Smart increment transition - auto-close current if ready, intelligently suggest next work (backlog or new feature)
Transitions to the next increment by validating completion, requesting user confirmation, and suggesting subsequent work.
/plugin marketplace add anton-abyzov/specweave/plugin install sw@specweaveSmart Workflow: Seamlessly transition from current work to next, with automatic closure validation.
You are helping the user complete their current increment and move to the next one with intelligent suggestions.
CRITICAL: This command requires EXPLICIT USER CONFIRMATION before closing any increment! This prevents the auto-completion bug where increments were marked "completed" without user approval.
/sw:next
No arguments needed - the command intelligently handles the transition.
The /sw:next command is your workflow continuation command. It:
ready_for_reviewcompleted if user confirms# Check for in-progress increments
find .specweave/increments -type f -name "spec.md" -exec grep -l "status: in-progress" {} \;
Scenarios:
๐ฅ CRITICAL: Run PM validation like /done command
Invoke PM validation for the in-progress increment:
Check tasks.md:
Example check:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GATE 1: Tasks Completion
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Checking tasks.md for increment 0001...
Priority P1 (Critical): 12 tasks
โ
12/12 completed (100%)
Priority P2 (Important): 18 tasks
โ
16/18 completed (89%)
โ ๏ธ 2 deferred (documented reasons)
Priority P3 (Nice-to-have): 12 tasks
โ
8/12 completed (67%)
๐ 4 moved to backlog
Status: โ
PASS
Run test suite:
Example check:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GATE 2: Tests Passing
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running test suite...
Unit Tests: โ
47/47 passing (Coverage: 89%)
Integration Tests: โ
15/15 passing
E2E Tests: โ
8/8 passing
Status: โ
PASS
Check documentation:
Example check:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GATE 3: Documentation Updated
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Checking documentation updates...
CLAUDE.md: โ
Updated with new features
README.md: โ
Examples added
CHANGELOG.md: โ
v0.1.7 entry created
Inline Docs: โ
All functions documented
Status: โ
PASS
Based on PM validation results:
CRITICAL: NEVER auto-close! Always ask for user confirmation to prevent the auto-completion bug.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PM VALIDATION: โ
READY TO CLOSE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Gate 1: Tasks (100% P1, 89% P2)
โ
Gate 2: Tests (70/70 passing, 89% coverage)
โ
Gate 3: Docs (all current)
Increment 0001-user-authentication is ready for closure!
๐ Status: ready_for_review (awaiting your approval)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๏ธ CONFIRMATION REQUIRED
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This will permanently mark the increment as COMPLETED.
Please confirm: Do you want to close this increment?
A. Yes, close it - I've reviewed the work and it's complete
B. No, keep it open - I need to review or make changes first
๐ฅ CRITICAL: Use the AskUserQuestion tool to get explicit confirmation:
AskUserQuestion({
questions: [{
header: "Close increment?",
question: "All PM gates passed. Ready to permanently close this increment?",
options: [
{ label: "Yes, close it", description: "Mark as completed (irreversible)" },
{ label: "No, keep open", description: "Stay at ready_for_review status" }
],
multiSelect: false
}]
})
Only if user confirms "Yes":
๐ฏ Closing increment with your approval...
โ Updated status: ready_for_review โ completed
โ Set completion date: 2025-10-28
โ Set approvedAt timestamp
โ Generated completion report
โ Freed WIP slot (1/2 โ 0/2)
๐ Increment 0001 closed successfully!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ POST-CLOSURE QUALITY ASSESSMENT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running quality assessment to validate implementation...
/sw:qa 0001
Overall Score: 87/100 (GOOD) โ
Dimension Scores:
Clarity: 92/100 โโ
Testability: 85/100 โ
Completeness: 90/100 โโ
Feasibility: 88/100 โโ
Maintainability: 85/100 โ
Edge Cases: 78/100 โ
Risk Assessment: 75/100 โ
Quality Gate Decision: โ
PASS
๐ Quality report saved:
.specweave/increments/0001-user-authentication/reports/qa-post-closure.md
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Proceeding to suggest next work...
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PM VALIDATION: โ NOT READY TO CLOSE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Gate 1: Tasks - 2 P1 tasks incomplete
โ
Gate 2: Tests - All passing
โ Gate 3: Docs - CLAUDE.md and README.md outdated
Increment 0001-user-authentication is NOT ready to close.
Options:
A. Complete remaining work (recommended)
โ Finish T005 (password hashing) - 2h
โ Finish T008 (JWT validation) - 3h
โ Update CLAUDE.md - 30m
โ Update README.md - 1h
โ Estimated: 6-7 hours
B. Force close and defer incomplete tasks
โ Move T005, T008 to next increment (0002)
โ Close 0001 as "completed with deferrals"
โ Document deferral reasons
C. Stay on current increment
โ Continue working on 0001
โ Run `/specweave do 0001` to resume
What would you like to do? [A/B/C]
๐ฅ CRITICAL: NEVER auto-close with incomplete work! Always give user control.
๐ฏ MANDATORY: After successful closure, automatically run quality assessment to validate implementation quality.
Why This Step Matters:
Implementation:
Invoke QA command automatically:
/sw:qa ${incrementId}
Quality assessment evaluates:
Generate quality report:
.specweave/increments/####/reports/qa-post-closure.mdDisplay results:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ POST-CLOSURE QUALITY ASSESSMENT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Overall Score: 87/100 (GOOD) โ
Dimension Scores:
Clarity: 92/100 โโ
Testability: 85/100 โ
Completeness: 90/100 โโ
Feasibility: 88/100 โโ
Maintainability: 85/100 โ
Edge Cases: 78/100 โ
Risk Assessment: 75/100 โ
Quality Gate Decision: โ
PASS
๐ Full report: .specweave/increments/####/reports/qa-post-closure.md
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Quality Gate Decisions:
| Decision | Criteria | Action |
|---|---|---|
| โ PASS | Score โฅ80, No critical risks | Proceed to next work |
| ๐ก CONCERNS | Score 60-79, High risks present | Log concerns, suggest improvements |
| ๐ด FAIL | Score <60, Critical risks present | Create follow-up increment for fixes |
If Quality Gate FAILS:
๐ด QUALITY GATE: FAIL (Score: 58/100)
Critical Issues Found:
โข CRITICAL RISK: Password storage implementation (9.0/10)
โข HIGH RISK: Rate limiting not specified (6.0/10)
โข Testability: 45/100 (below threshold)
Recommendation: Create follow-up increment 0002-security-fixes
Options:
A. Create follow-up increment now (recommended)
B. Log as technical debt (track in backlog)
C. Continue to next feature (not recommended)
What would you like to do? [A/B/C]
If Quality Gate CONCERNS:
๐ก QUALITY GATE: CONCERNS (Score: 72/100)
Issues to address:
โข Edge cases coverage: 65/100 (should be 80+)
โข 2 high-priority risks identified
โข Recommendations: 5 improvements suggested
๐ Review report: .specweave/increments/####/reports/qa-post-closure.md
These can be addressed in future iterations.
Proceeding to next work...
IMPORTANT: Quality assessment runs AFTER closure to:
Intelligent suggestions based on project state:
Check for planned increments in backlog:
ls .specweave/increments/_backlog/*.md
# or
find .specweave/increments -name "spec.md" -exec grep -l "status: planned" {} \;
Present options based on findings:
Option A: Backlog items found โ
๐ฏ Next Work Suggestions
Found 2 planned increments in backlog:
1. 0002-payment-processing (P1)
โ Stripe integration, payment flow
โ Estimated: 2 weeks
โ Dependencies: 0001 (โ
complete)
2. 0003-notification-system (P2)
โ Email + SMS notifications
โ Estimated: 1 week
โ Dependencies: None
Recommendation: Start 0002-payment-processing (P1, ready to go)
Actions:
A. Start 0002 now โ Run `/specweave do 0002`
B. Start 0003 instead โ Run `/specweave do 0003`
C. Create new increment โ Run `/specweave inc "feature name"`
What would you like to do? [A/B/C]
Option B: No backlog, but in-progress work exists โ ๏ธ
๐ฏ Next Work Suggestions
Current WIP: 1/2 increments active
Active: 0002-payment-processing (50% complete)
Recommendation: Continue 0002-payment-processing
Next Action: Run `/specweave do 0002` to resume
๐ก Tip: Run `/progress 0002` to see current status
Option C: Clean slate, no planned work โจ
๐ฏ Next Work Suggestions
No planned increments found.
Current WIP: 0/2 (both slots available)
Time to plan your next feature!
Options:
A. Create new increment โ Run `/specweave inc "feature description"`
Example: /specweave inc "Admin dashboard"
B. Check existing ideas โ Look in .specweave/increments/_backlog/
If you have ideas saved, promote them with /sw:increment
C. Review roadmap โ See .specweave/docs/internal/strategy/roadmap.md
๐ก Tip: Start with the most valuable feature for users!
User:
/sw:next
Output:
๐ Checking current increment...
Active: 0001-user-authentication
๐ PM Validation:
โ
Gate 1: All P1 tasks complete (12/12)
โ
Gate 2: All tests passing (70/70, 89% coverage)
โ
Gate 3: Documentation updated
โ
All gates passed! Transitioning to ready_for_review...
๐ Status: ready_for_review (awaiting your approval)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๏ธ CONFIRMATION REQUIRED
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This will permanently mark increment 0001 as COMPLETED.
Please confirm: Do you want to close this increment?
๐ฅ Claude uses AskUserQuestion tool here to get explicit confirmation
User confirms: "Yes, close it"
Output (after confirmation):
๐ฏ Closing increment with your approval...
โ Status: ready_for_review โ completed
โ Set approvedAt: 2025-10-28
โ Completion report generated
โ WIP freed (1/2 โ 0/2)
๐ Increment 0001 closed successfully!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ POST-CLOSURE QUALITY ASSESSMENT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running quality assessment...
Overall Score: 87/100 (GOOD) โ
Quality Gate Decision: โ
PASS
๐ Report: .specweave/increments/0001-user-authentication/reports/qa-post-closure.md
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ Next Work Suggestions
Found 1 planned increment:
0002-payment-processing (P1)
โ Stripe integration, payment flow
โ Estimated: 2 weeks
โ Dependencies: 0001 (โ
complete)
Recommendation: Start 0002-payment-processing
Next Action: Run `/specweave do 0002` to begin
๐ก Tip: Review spec first with `cat .specweave/increments/0002-payment-processing/spec.md`
User:
/sw:next
Output:
๐ Checking current increment...
Active: 0001-user-authentication
๐ PM Validation:
โ Gate 1: 2 P1 tasks incomplete (10/12)
โ
Gate 2: All tests passing
โ Gate 3: README.md not updated
Increment 0001 is NOT ready to close.
Blockers:
โข T010: Add rate limiting (P1) - 2 hours
โข T012: Add password reset (P1) - 3 hours
โข README.md update - 1 hour
Options:
A. Complete remaining work (recommended) โ 6 hours
B. Force close and defer T010, T012 to 0002
C. Stay on 0001 and continue working
What would you like to do? [A/B/C] _
User types "A":
โ
Good choice! Let's finish 0001 properly.
Next Action: Run `/specweave do 0001` to resume at T010
๐ก Tip: `/specweave progress` shows your current status anytime
User:
/sw:next
Output:
๐ Checking current increment...
No active increments found.
Recent work:
โ
0001-user-authentication (closed 2 days ago)
โ
0002-payment-processing (closed 1 week ago)
Current WIP: 0/2 (both slots available)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ Next Work Suggestions
No planned increments found. Time to plan new work!
Options:
1. Create new increment:
โ Run `/specweave inc "feature description"`
โ Example: /specweave inc "Admin dashboard"
2. Check backlog for ideas:
โ Look in .specweave/increments/_backlog/
โ Promote with `/specweave inc "feature name"`
3. Review roadmap:
โ See .specweave/docs/internal/strategy/roadmap.md
๐ก Tip: Focus on the most valuable feature for users!
User:
/sw:next
Output:
๐ Checking current increment...
โ ๏ธ Warning: Multiple increments in-progress (2/2 at WIP limit)
Active increments:
1. 0002-payment-processing (50% complete)
โ Last activity: 2 hours ago
โ Next task: T008
2. 0003-notification-system (25% complete)
โ Last activity: 1 day ago
โ Next task: T004
Recommendation: Focus on completing one before starting new work.
Which increment should we focus on closing?
A. Close 0002-payment-processing
B. Close 0003-notification-system
C. Cancel (continue working as-is)
Your choice? [A/B/C] _
| Command | Purpose | When to Use |
|---|---|---|
/sw:increment "feature" | Create NEW increment with specific feature | Starting fresh work |
/sw:do | Execute tasks in increment | Implementing planned work |
/sw:progress | Check status (no action) | Quick status check |
/sw:done | Explicitly close increment | Manual closure with validation |
/sw:qa | Quality assessment only | Standalone QA check |
/sw:next โญ | Smart transition (close + QA + suggest next) | Natural workflow continuation |
Why /sw:next is special:
/sw:done then /sw:qa then /sw:increment sequence/sw:next when you feel done - It validates completion and suggests next steps/specweave progress for status - /next is for transitions/inc - Create new increment (PM-led planning)/specweave do - Execute tasks (auto-resumes)/specweave progress - Check status/done - Manual closure with PM validation/list-increments - View all incrementsAuto-close uses sensible defaults:
๐ก Remember: /next is your "I'm done, what's next?" command. It handles the transition intelligently so you can stay in flow!