phase-enforcement
Evidence-based phase completion enforcement for /dev:feature. Use when orchestrating 8-phase feature development to ensure artifacts exist before phase completion, validation criteria are addressed, outer loops are enforced, and show-your-work requirements are met.
What this skill does
# Phase Completion Enforcement
**Version:** 1.0.0
**Purpose:** Mechanical enforcement of phase completion requirements for /dev:feature
**Status:** Production Ready
## Overview
This skill provides **mechanical enforcement** (not just prompt-based instructions) for the 8-phase feature development workflow. It prevents:
1. **Claiming completion without proof** - Artifacts must exist
2. **Skipping documentation** - Required files per phase
3. **Ignoring validation criteria** - Phase 1 criteria must map to Phase 7 results
4. **Bypassing retry logic** - Outer loop enforced with state tracking
5. **Shipping without tests** - Phase 6 requires test files
6. **Faking completion when blocked** - Graceful degradation with honest status
7. **Hiding actual results** - Show-your-work requirement
8. **Missing automated checks** - Checkpoint verification at boundaries
## Enforcement Components
### 1. Phase Completion Validator
**Script:** `scripts/phase-completion-validator.js`
**How it works:**
- Runs as PreToolUse hook on TaskUpdate
- Detects phase from task subject (e.g., "Phase 3: Planning")
- Checks required artifacts exist for that phase
- Blocks completion if artifacts missing or empty
**Required Artifacts per Phase:**
| Phase | Required Artifacts | Custom Checks |
|-------|-------------------|---------------|
| 1 | requirements.md, validation-criteria.md, iteration-config.json | Config has required fields |
| 3 | architecture.md | Plan reviews exist |
| 4 | implementation-log.md | Git changes detected |
| 5 | reviews/code-review/consolidated.md | Has PASS/FAIL verdict |
| 6 | tests/test-plan.md | Test files created |
| 7 | validation/result.md | Has PASS/FAIL status + evidence |
| 8 | report.md | Phase 7 PASSED |
**Usage in orchestrator:**
```markdown
Before marking any phase complete:
1. Run checkpoint verification:
```bash
${PLUGIN_PATH}/scripts/checkpoint-verifier.sh phase{N} ${SESSION_PATH}
```
2. If check passes, mark task complete:
```
TaskUpdate(taskId: X, status: "completed")
```
3. If check fails, DO NOT mark complete. Fix missing artifacts first.
```
---
### 2. Outer Loop Enforcer
**Script:** `scripts/outer-loop-enforcer.js`
**How it works:**
- Tracks iteration state in session-meta.json
- Blocks Phase 8 unless Phase 7 PASSED
- Detects regression (score getting worse)
- Handles escalation when max iterations reached
**Commands:**
```bash
# Start new iteration (call before Phase 3)
node outer-loop-enforcer.js start-iteration ${SESSION_PATH}
# Record Phase 7 result
node outer-loop-enforcer.js record-result ${SESSION_PATH} PASS "All checks passed" 95
# Check if Phase 8 can proceed
node outer-loop-enforcer.js check-can-complete ${SESSION_PATH}
# Get current status
node outer-loop-enforcer.js get-status ${SESSION_PATH}
```
**Session state tracking:**
```json
{
"outerLoop": {
"currentIteration": 2,
"maxIterations": 3,
"mode": "limited",
"phase7Results": [
{"iteration": 1, "status": "FAIL", "reason": "Button color mismatch", "score": 78},
{"iteration": 2, "status": "PASS", "reason": "All checks passed", "score": 94}
]
}
}
```
**Usage in orchestrator:**
```markdown
OUTER LOOP: Before starting Phase 3
1. Start iteration:
```bash
node ${PLUGIN_PATH}/scripts/outer-loop-enforcer.js start-iteration ${SESSION_PATH}
```
2. Check exit code:
- 0: Proceed with iteration
- 2: Max iterations reached, escalate to user
OUTER LOOP: After Phase 7 completes
1. Record result:
```bash
node ${PLUGIN_PATH}/scripts/outer-loop-enforcer.js record-result ${SESSION_PATH} <PASS|FAIL> "reason" [score]
```
2. If PASS: Proceed to Phase 8
3. If FAIL: Loop back to Phase 3 (start-iteration will be called again)
OUTER LOOP: Before Phase 8
1. Verify Phase 7 passed:
```bash
node ${PLUGIN_PATH}/scripts/outer-loop-enforcer.js check-can-complete ${SESSION_PATH}
```
2. If exit code 1: BLOCKED - cannot proceed to Phase 8
```
---
### 3. Validation Criteria Enforcer
**Script:** `scripts/validation-criteria-enforcer.js`
**How it works:**
- Parses validation-criteria.md from Phase 1
- Parses validation/result.md from Phase 7
- Matches criteria to results using fuzzy matching
- Blocks if >20% criteria unaddressed
**Usage in orchestrator:**
```markdown
PHASE 7: After creating result.md
1. Run criteria enforcer:
```bash
node ${PLUGIN_PATH}/scripts/validation-criteria-enforcer.js ${SESSION_PATH}
```
2. Review generated report:
${SESSION_PATH}/validation/criteria-mapping.md
3. If unaddressed criteria found:
- Update result.md to address them
- Or document why they couldn't be tested
```
**Output format:**
```markdown
# Validation Criteria Mapping Report
## Summary
- Total Criteria: 5
- Matched: 4
- Unmatched: 1
- Coverage: 80%
## Criteria Mapping
| Line | Criterion | Result | Evidence |
|------|-----------|--------|----------|
| 12 | "Navigate to test URL" | PASS | screenshot-before.png |
| 13 | "Fill email field" | PASS | action-log.md line 5 |
| 14 | "Click login button" | PASS | action-log.md line 8 |
| 15 | "Redirect to dashboard" | PASS | screenshot-after.png |
## โ ๏ธ Unaddressed Criteria
- Line 16: "Show error for invalid password"
```
---
### 4. Checkpoint Verifier
**Script:** `scripts/checkpoint-verifier.sh`
**How it works:**
- Bash script for fast automated checks
- Runs at phase boundaries
- Verifies files exist and have content
- Checks git state for implementation phase
**Usage:**
```bash
# Before completing Phase 4
./checkpoint-verifier.sh phase4 ${SESSION_PATH}
# Before completing Phase 7
./checkpoint-verifier.sh phase7 ${SESSION_PATH}
```
**Example output:**
```
๐ Checkpoint Verification: phase4
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Session: ai-docs/sessions/dev-feature-login-20260204-143022
โ
Implementation Log: implementation-log.md (1234 bytes)
โ
Code Changes: 8 files with changes
โ
Implementation Log: Has structured progress
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Checkpoint passed
```
---
## Integration with /dev:feature
### Phase Transition Protocol
**MANDATORY: Before marking ANY phase as completed:**
```markdown
<phase_completion_protocol>
**Step 1: Run Checkpoint Verification**
```bash
${PLUGIN_PATH}/scripts/checkpoint-verifier.sh phase{N} ${SESSION_PATH}
```
If exit code != 0: STOP. Fix missing artifacts first.
**Step 2: Show Evidence Summary**
Display 3-5 lines of actual results:
```
## Phase {N} Evidence
- Artifact: ${SESSION_PATH}/{artifact}.md (exists, 1234 bytes)
- Key result: {actual output from phase}
- Evidence: {file paths to screenshots, logs, etc.}
```
**Step 3: Map to Original Criteria** (for Phase 7)
```
From validation-criteria.md:
- [x] Criterion 1 โ Verified (evidence file)
- [x] Criterion 2 โ Verified (screenshot)
- [ ] Criterion 3 โ Skipped (reason documented)
```
**Step 4: Mark Task Complete**
Only if Steps 1-3 pass:
```
TaskUpdate(taskId: X, status: "completed")
```
</phase_completion_protocol>
```
### Show-Your-Work Requirement
**Anti-pattern (BLOCKED):**
```markdown
I'll run the tests now.
[Task tool call to run tests]
Tests passed! Moving to next phase.
```
**Required pattern:**
```markdown
Running tests:
$ bun test
โ auth.test.ts (5 tests)
โ should authenticate valid user (12ms)
โ should reject invalid password (8ms)
โ should expire session after timeout (15ms)
โ should refresh token correctly (10ms)
โ should logout user (5ms)
โ payment.test.ts (3 tests)
โ should process valid payment (20ms)
โ should reject invalid card (12ms)
โ should handle timeout (FAILED)
Error: Expected timeout after 30s, got success
Results: 7 passed, 1 failed
The payment timeout test failure needs investigation before Phase 6 can complete.
```
---
## Graceful Degradation
### Three Completion Statuses
**COMPLETE**: All validation criteria passed
- All artifacts created
- All tests pass
- Full validation executed
**PARTIAL**Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.