Purpose
Persistent Completion Loop is a PRD-driven persistence loop that keeps working on a task until ALL user stories have passes: true and are reviewer-verified. It wraps parallel execution with session persistence, automatic retry on failure, structured story tracking, and mandatory verification before completion.
When to Use
- Task requires guaranteed completion with verification (not just "do your best")
- User says "don't stop", "must complete", "finish this", or "keep going until done"
- Work may span multiple iterations and needs persistence across retries
- Task benefits from structured PRD-driven execution with reviewer sign-off
Do Not Use When
- User wants a full autonomous pipeline from idea to code -- use autonomous delivery instead
- User wants to explore or plan before committing -- use the plan skill instead
- User wants a quick one-shot fix -- delegate directly to an executor agent
- User wants manual control over completion -- use parallel execution directly
Why This Exists
Complex tasks often fail silently: partial implementations get declared "done", tests get skipped, edge cases get forgotten. This skill prevents this by:
- Structuring work into discrete user stories with testable acceptance criteria
- Iterating story-by-story until each one passes
- Tracking progress and learnings across iterations
- Requiring fresh reviewer verification against specific acceptance criteria before completion
Inputs
- A task description
- Optional: an existing PRD file; if none exists, a scaffold is auto-generated and must be refined with task-specific stories and acceptance criteria
PRD Mode
A scaffold PRD file is auto-generated when the loop starts if none exists.
Startup gate: Always initialize and validate the PRD at startup.
Reviewer selection: The completion reviewer validates the stories, and the reviewer cannot be the same writer lane/agent that implemented the code.
Execution Policy
- Fire independent agent calls simultaneously -- never wait sequentially for independent work
- Use background execution for long operations (installs, builds, test suites)
- Always pass the
model or tier parameter explicitly when delegating to agents
- Deliver the full implementation: no scope reduction, no partial completion, no deleting tests to make them pass
- Default-safe behaviors apply. Review before committing/pushing.
Workflow
PRD Setup (first iteration only):
a. Check for an existing PRD file.
b. If none exists, auto-generate a scaffold.
c. CRITICAL: Refine the scaffold. Replace generic criteria with task-specific criteria:
- Break the original task into right-sized user stories
- Write concrete, verifiable acceptance criteria for each story
- Order stories by priority (foundational work first, dependent work later)
- Write the refined PRD back
Pick next story: Select the highest-priority story with passes: false. This is your current focus.
Implement the current story:
- Delegate to specialist agents at appropriate tiers.
- Run long operations in background.
Verify the current story's acceptance criteria:
a. For EACH acceptance criterion in the story, verify it is met with fresh evidence
b. Run relevant checks (test, build, lint, typecheck) and read the output
c. If any criterion is NOT met, continue working -- do NOT mark the story as complete
Mark story complete:
a. When ALL acceptance criteria are verified, set passes: true for this story
b. Record progress (what was implemented, files changed, learnings)
Check PRD completion:
a. Are ALL stories marked passes: true?
b. If NOT all complete, loop back to Step 2
c. If ALL complete, proceed to Step 7 (reviewer verification)
Reviewer verification (tiered, against acceptance criteria):
- The reviewer MUST be a different agent than the implementer.
- The reviewer verifies against the SPECIFIC acceptance criteria from prd.json
- On APPROVAL: immediately proceed to Step 7.5.
7.5 Mandatory Cleanup Pass (runs after Step 7 approval, unless configured otherwise):
- Run the code cleanup skill on files changed during the current session only.
- Keep the scope bounded to the changed-file set.
7.6 Regression Re-verification:
- After the cleanup pass, re-run all relevant tests, build, and lint checks.
- If regression fails, fix it, then rerun until it passes.
On approval: Report completion and clean up all intermediate state files.
On rejection: Fix the issues raised, re-verify, then loop back.
Output
- All PRD user stories completed (
passes: true) and reviewer-verified against their specific acceptance criteria
- Cleanup pass applied to session-changed files, with post-cleanup regression checks passing
- A completion report; intermediate state files removed
Failure Modes
- Stop and report when a fundamental blocker requires user input (missing credentials, unclear requirements, external service down)
- Stop when the user says "stop", "cancel", or "abort"
- If the reviewer rejects verification, fix the issues and re-verify (do not stop)
- If the same issue recurs across 3+ iterations, report it as a potential fundamental problem
Verification
1---2name: persistent-completion-loop3description: Use when a task must run to verified completion rather than best effort -- the user says "don't stop", "must complete", "finish this", or "keep going until done", or the work spans multiple iterations and needs reviewer sign-off before being called done.4---56## Purpose78Persistent Completion Loop is a PRD-driven persistence loop that keeps working on a task until ALL user stories have passes: true and are reviewer-verified. It wraps parallel execution with session persistence, automatic retry on failure, structured story tracking, and mandatory verification before completion.910## When to Use1112- Task requires guaranteed completion with verification (not just "do your best")13- User says "don't stop", "must complete", "finish this", or "keep going until done"14- Work may span multiple iterations and needs persistence across retries15- Task benefits from structured PRD-driven execution with reviewer sign-off1617## Do Not Use When1819- User wants a full autonomous pipeline from idea to code -- use autonomous delivery instead20- User wants to explore or plan before committing -- use the plan skill instead21- User wants a quick one-shot fix -- delegate directly to an executor agent22- User wants manual control over completion -- use parallel execution directly2324## Why This Exists2526Complex tasks often fail silently: partial implementations get declared "done", tests get skipped, edge cases get forgotten. This skill prevents this by:271. Structuring work into discrete user stories with testable acceptance criteria282. Iterating story-by-story until each one passes293. Tracking progress and learnings across iterations304. Requiring fresh reviewer verification against specific acceptance criteria before completion3132## Inputs3334- A task description35- Optional: an existing PRD file; if none exists, a scaffold is auto-generated and must be refined with task-specific stories and acceptance criteria3637## PRD Mode3839A scaffold PRD file is auto-generated when the loop starts if none exists.4041**Startup gate:** Always initialize and validate the PRD at startup.4243**Reviewer selection:** The completion reviewer validates the stories, and **the reviewer cannot be the same writer lane/agent that implemented the code**.4445## Execution Policy4647- Fire independent agent calls simultaneously -- never wait sequentially for independent work48- Use background execution for long operations (installs, builds, test suites)49- Always pass the `model` or `tier` parameter explicitly when delegating to agents50- Deliver the full implementation: no scope reduction, no partial completion, no deleting tests to make them pass51- Default-safe behaviors apply. Review before committing/pushing.5253## Workflow54551. **PRD Setup** (first iteration only):56 a. Check for an existing PRD file.57 b. If none exists, auto-generate a scaffold.58 c. **CRITICAL: Refine the scaffold.** Replace generic criteria with task-specific criteria:59 - Break the original task into right-sized user stories60 - Write concrete, verifiable acceptance criteria for each story61 - Order stories by priority (foundational work first, dependent work later)62 - Write the refined PRD back63642. **Pick next story**: Select the highest-priority story with `passes: false`. This is your current focus.65663. **Implement the current story**:67 - Delegate to specialist agents at appropriate tiers.68 - Run long operations in background.69704. **Verify the current story's acceptance criteria**:71 a. For EACH acceptance criterion in the story, verify it is met with fresh evidence72 b. Run relevant checks (test, build, lint, typecheck) and read the output73 c. If any criterion is NOT met, continue working -- do NOT mark the story as complete74755. **Mark story complete**:76 a. When ALL acceptance criteria are verified, set `passes: true` for this story77 b. Record progress (what was implemented, files changed, learnings)78796. **Check PRD completion**:80 a. Are ALL stories marked `passes: true`?81 b. If NOT all complete, loop back to Step 282 c. If ALL complete, proceed to Step 7 (reviewer verification)83847. **Reviewer verification** (tiered, against acceptance criteria):85 - The reviewer MUST be a different agent than the implementer.86 - The reviewer verifies against the SPECIFIC acceptance criteria from prd.json87 - **On APPROVAL: immediately proceed to Step 7.5.**8889 7.5 **Mandatory Cleanup Pass** (runs after Step 7 approval, unless configured otherwise):90 - Run the code cleanup skill on files changed during the current session only.91 - Keep the scope bounded to the changed-file set.9293 7.6 **Regression Re-verification**:94 - After the cleanup pass, re-run all relevant tests, build, and lint checks.95 - If regression fails, fix it, then rerun until it passes.96978. **On approval**: Report completion and clean up all intermediate state files.98999. **On rejection**: Fix the issues raised, re-verify, then loop back.100101## Output102103- All PRD user stories completed (`passes: true`) and reviewer-verified against their specific acceptance criteria104- Cleanup pass applied to session-changed files, with post-cleanup regression checks passing105- A completion report; intermediate state files removed106107## Failure Modes108109- Stop and report when a fundamental blocker requires user input (missing credentials, unclear requirements, external service down)110- Stop when the user says "stop", "cancel", or "abort"111- If the reviewer rejects verification, fix the issues and re-verify (do not stop)112- If the same issue recurs across 3+ iterations, report it as a potential fundamental problem113114## Verification115116- [ ] All PRD stories have `passes: true`117- [ ] PRD acceptance criteria are task-specific118- [ ] All requirements from the original task are met (no scope reduction)119- [ ] Zero pending TODO items120- [ ] Fresh test run output shows all tests pass121- [ ] Fresh build output shows success122- [ ] Reviewer (different from implementer) verification passed against specific acceptance criteria123- [ ] Cleanup pass completed on changed files124- [ ] Post-cleanup regression tests pass