plugins/specweave/skills/done/SKILL.md
Close increment with PM 3-gate validation (tasks, tests, docs). Use when all tasks complete and saying "close increment", "we're done", or "finish up".
npx skillsauth add anton-abyzov/specweave plugins/specweave/skills/doneInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Skill Memories: If .specweave/skill-memories/done.md exists, read and apply its learnings.
PM-Led Closure: Validate tasks, tests, and docs before closing.
AUTO-CLOSURE DEFAULT: After sw:do completes all tasks, sw:done runs automatically — no user confirmation needed. Quality gates (code-review, simplify, grill, judge-llm, PM validation) provide the safety net. If something is wrong, the user can re-open the increment.
For large multi-agent sessions (via sw:team-lead), running sw:done directly may cause context overflow due to loading 4+ skill definitions into an already-full context. Instead, sw:team-merge spawns sw:sw-closer subagents that run the full closure pipeline in isolated fresh contexts -- one per increment. The sw-closer agent definition is at plugins/specweave/agents/sw-closer.md.
If you are closing an increment from a normal (non-team) session, use sw:done directly as documented below.
sw:done <increment-id> [--auto]
Argument: Required increment ID (e.g., "001", "0001", "0042", "0153-feature-name"). Numeric portion extracted and zero-padded to 4 digits.
| Option | Description |
|--------|-------------|
| --auto | Legacy flag, now a no-op. Auto-closure is the default for all modes. All quality gates (code-review, simplify, grill, judge-llm, Gate 0, PM gates) always enforced. |
If closing a SpecWeave framework increment, show post-closure reminders: update CHANGELOG.md, CLAUDE.md, consider version bump, run npm test && npm run rebuild, check for breaking changes. Informational only, not blocking.
The CLI blocks closure if code-review-report.json is missing (when required). Do NOT skip this step.
jq -r '.codeReview.required // true' .specweave/config.json — if false, skip to Step 3MAX_ITER=$(jq -r '.codeReview.maxFixIterations // 3' .specweave/config.json 2>/dev/null)critical, high, medium (configurable via codeReview.blockingSeverities)Skill({ skill: "sw:code-reviewer", args: "--increment <id>" })
b. Verify report written: Bash({ command: "test -f .specweave/increments/<id>/reports/code-review-report.json && echo OK || echo MISSING" })
c. If report MISSING: write it manually from code-reviewer output using the Write tool
d. Read the report JSON: parse the summary object for severity counts
e. Evaluate blocking findings: Sum counts for critical + high + medium (or configured severities)
f. If no blocking findings → PASS, continue to Step 3
g. If blocking findings exist AND ITERATION < MAX_ITER:
rm -f .specweave/increments/<id>/reports/code-review-report.jsonCode review passed. Run simplify to clean up code before the grill examines it.
Skill({ skill: "simplify" }) — this is a built-in Claude Code skill, NOT a sw: skill/simplify spawns 3 parallel agents checking: duplication, readability, efficiencyThe CLI blocks closure if grill-report.json is missing. Do NOT skip this step.
jq -r '.grill.required // true' .specweave/config.json — if false, skip to Step 5Skill({ skill: "sw:grill" }) with incrementIdBash({ command: "test -f .specweave/increments/<id>/reports/grill-report.json && echo OK || echo MISSING" })A report file MUST be written regardless of outcome (even WAIVED if consent denied).
externalModels in config. If denied, write WAIVED report and continueSkill({ skill: "sw:judge-llm" }) with --last-commit (or --staged)Bash({ command: "test -f .specweave/increments/<id>/reports/judge-llm-report.json && echo OK || echo MISSING" })ready_for_review -> Proceedactive -> Check all tasks done, transition to ready_for_review firstcompleted -> Already closed, warn userbacklog / paused / abandoned -> BLOCK with errorNo confirmation needed: Proceed directly to closure. Quality gates (code-review, simplify, grill, judge-llm, Gate 0, PM gates) are the safety net — NOT user confirmation prompts. NEVER stop to ask "should I close this?" — just close it. If a gate fails, the increment stays open automatically. If the user disagrees with closure, they can re-open.
.specweave/increments/0001-*/spec.md, plan.md, tasks.md, tests.mdMANDATORY, cannot be bypassed. Runs BEFORE PM validation.
ACStatusManager.syncACStatus(incrementId) -- prevents race conditions with background hooksDesyncDetector.validateOrThrow(incrementId) -- blocks if metadata.json/spec.md inconsistentIncrementCompletionValidator.validateCompletion(incrementId)Rubric Quality Contract: If rubric.md exists in the increment directory, rubric evaluation runs automatically via the completion-validator. The validator reads rubric.md, evaluates all criteria against gate reports (grill-report.json, code-review-report.json, judge-llm-report.json), and blocks closure if any [blocking] criterion has status FAIL or PENDING. Advisory failures are reported as warnings. If rubric.md does not exist, the existing hardcoded gates run unchanged (backward compatible). Review any blocking rubric failures before retrying closure.
Gate 0 validates:
- [x] **AC-...)**Status**: [x] completed)If validation fails -> increment stays in-progress, command exits.
PM validation report goes in: .specweave/increments/####-name/reports/PM-VALIDATION-REPORT.md
Gate 1 - Tasks Completed: All P1 done, P2 done or deferred with reason, P3 done/deferred/backlogged, no blocked tasks, ACs met.
Gate 2a - E2E Tests (AUTOMATED, BLOCKING): Detect playwright/cypress configs (including repositories/*/*-e2e). If found, run them. E2E failure blocks closure. No E2E detected -> skip.
Gate 2 - Tests Passing: All suites passing, coverage >80% critical paths, no unexplained skips, tests align with ACs.
Gate 3 - Documentation Updated: CLAUDE.md, README.md, CHANGELOG.md updated as needed. Inline docs complete. No stale references.
All gates pass:
mkdir -p .specweave/state && touch .specweave/state/.sw-done-in-progressBash({ command: "specweave complete <id> --yes" }) — the CLI re-verifies quality gate reports (code-review-report.json, grill-report.json, judge-llm-report.json) exist. It also triggers LifecycleHookDispatcher.onIncrementDone() for living docs sync, GitHub Project sync, and issue closure.rm -f .specweave/state/.sw-done-in-progressCRITICAL: Do NOT directly edit metadata.json to set status. Always use the specweave complete CLI command — it is the single completion path that triggers all post-closure hooks.
Any gate fails:
Check push strategy:
PUSH_STRATEGY=$(jq -r '.cicd.pushStrategy // "direct"' .specweave/config.json 2>/dev/null)
If pr-based:
sw:pr skill: Skill({ skill: "sw:pr", args: "<increment-id>" })prRefs with state: "open"If direct: Skip this step entirely (existing behavior unchanged).
The specweave complete call in Step 10 triggers LifecycleHookDispatcher.onIncrementDone() which automatically handles:
sync_living_docs flag): Updates feature specs and user story filessync_to_github_project flag): Pushes spec to GitHub Projectclose_github_issue flag): Closes GitHub/JIRA/ADO issues via SyncCoordinatorAfter the CLI completes, display the sync result summary:
| Hook | Result |
|--------------------------|---------------------------|
| Living docs sync | OK / FAILED: {reason} |
| GitHub Project sync | OK / SKIPPED |
| Issue closure | OK / SKIPPED |
If any operation failed, display: "Run sw:progress-sync to retry failed sync operations."
Supplemental closure (not handled by hooks — run manually if applicable):
A) Close external-origin issue (E-suffix increments only): Parse metadata.external_ref (format: github#owner/repo#number). Check sync.settings.canUpdateStatus permission. Close via gh issue close -R.
B) Close ALL per-user-story GitHub issues: If the hook-based closure missed any, search by title pattern:
sync.github.owner and sync.github.repo from config.jsongh issue list -R {owner}/{repo} --search "[{feature_id}][{us_id}]" --state open --json numbergh issue close {number} -R {owner}/{repo} -c "Completed as part of increment {increment_id}"Execute: Skill({ skill: "sw:sync-docs" }) with the increment ID. Do NOT just mention it -- actually invoke it. This serves as a verification pass to confirm living docs are up to date after closure.
After living docs sync, update cross-references and bidirectional links so existing docs reference the newly created feature specs. Do NOT skip this step:
.specweave/docs/internal/specs/{project}/FS-XXX/FEATURE.md and us-*.md)[DRAFT] → [COMPLETE] on doc sections matching completed ACsVerify that .specweave/docs/internal/specs/{project}/FS-XXX/ contains FEATURE.md and us-*.md files. If missing, re-run Step 12.
Runs ONLY if closure succeeded. Invoke: sw:qa ${incrementId}
Evaluates 7 dimensions: Clarity, Testability, Completeness, Feasibility, Maintainability, Edge Cases, Risk Assessment.
Report saved to: .specweave/increments/####/reports/qa-post-closure.md
Quality assessment runs AFTER closure (not blocking delivery). Critical issues trigger follow-up increment creation.
If scope creep detected, offer options:
Transfer tasks creates new increment with dependencies on current one.
tools
Generate AI videos from text prompts or images. Supports Google Veo 3.1 and Pollinations.ai (free). Use when generating video, creating animations, text-to-video, AI video, video generation, make clip, animate.
tools
Validate increment with rule-based checks and AI quality assessment. Use when saying "validate", "check quality", or "verify increment".
tools
Create and manage umbrella workspaces for multi-repo projects. Activate when the user wants to: create umbrella, umbrella init, wrap in umbrella, create workspace, setup multi-repo, migrate repos to umbrella, umbrella create, new workspace, restructure into umbrella, "wrap this repo", "create umbrella for these repos", "setup workspace with repos", "move repos into umbrella". Do NOT activate for: add a repo to existing umbrella (use sw:get), add a feature, add an increment, clone a repo (use sw:get).
tools
--- description: Merge completed parallel agent work and trigger GitHub sync per increment. Activates for: team merge, merge agents, combine work, team finish. --- # Team Merge **Verify all teammates completed, run quality gates, close increments, and trigger sync.** ## Usage ```bash sw:team-merge sw:team-merge --dry-run # Preview merge plan sw:team-merge --skip-sync # Merge without GitHub/JIRA sync ``` ## What This Skill Does 1. **Verify all teammates completed** -- bl