Skip to content

Commit eace261

Browse files
committed
feat: integrate cleanup phase into implementation workflow
- Add handoff from implement.md to cleanup command - Add cleanup phase (N+1) to tasks-template.md - Update phase dependencies to include cleanup as final gate - Update incremental delivery strategy to include cleanup step - Suggest running cleanup after implementation completes
1 parent 232f7c2 commit eace261

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

templates/commands/implement.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ description: Execute the implementation plan by processing and executing all tas
33
scripts:
44
sh: scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks
55
ps: scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
6+
handoffs:
7+
- label: Run cleanup phase
8+
agent: speckit.cleanup
9+
prompt: Review implementation changes, fix small issues, and identify tech debt
610
---
711

812
## User Input
@@ -134,5 +138,6 @@ You **MUST** consider the user input before proceeding (if not empty).
134138
- Validate that tests pass and coverage meets requirements
135139
- Confirm the implementation follows the technical plan
136140
- Report final status with summary of completed work
141+
- **Suggest next step**: Recommend running `/speckit.cleanup` to review changes and identify tech debt
137142
138143
Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/speckit.tasks` first to regenerate the task list.

templates/tasks-template.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,30 @@ Examples of foundational tasks (adjust based on your project):
159159

160160
---
161161

162+
## Phase N+1: Cleanup & Tech Debt Review
163+
164+
**Purpose**: Final quality gate - review all changes, identify tech debt, and ensure code hygiene
165+
166+
**Executed by**: `/speckit.cleanup` command (run after `/speckit.implement` completes)
167+
168+
The cleanup phase handles issues by severity:
169+
170+
| Severity | Examples | Action |
171+
|----------|----------|--------|
172+
| **Small** | Debug statements, unused imports, dead code | Fix immediately (Scout Rule) |
173+
| **Medium** | Missing error handling, code duplication (2-3x) | Create follow-up tasks in tasks.md |
174+
| **Large** | Architectural issues, security vulnerabilities | Generate tech-debt-report.md with options |
175+
176+
### Output Artifacts
177+
178+
All outputs stay within the spec workflow (`/specs/[###-feature-name]/`):
179+
180+
- **Direct fixes**: Small issues fixed and committed
181+
- **Tech Debt Tasks**: Appended to tasks.md for medium issues
182+
- **tech-debt-report.md**: Analysis with options for large issues
183+
184+
---
185+
162186
## Dependencies & Execution Order
163187

164188
### Phase Dependencies
@@ -168,7 +192,8 @@ Examples of foundational tasks (adjust based on your project):
168192
- **User Stories (Phase 3+)**: All depend on Foundational phase completion
169193
- User stories can then proceed in parallel (if staffed)
170194
- Or sequentially in priority order (P1 → P2 → P3)
171-
- **Polish (Final Phase)**: Depends on all desired user stories being complete
195+
- **Polish (Phase N)**: Depends on all desired user stories being complete
196+
- **Cleanup (Phase N+1)**: Depends on Polish completion - FINAL quality gate before delivery
172197

173198
### User Story Dependencies
174199

@@ -225,7 +250,9 @@ Task: "Create [Entity2] model in src/models/[entity2].py"
225250
2. Add User Story 1 → Test independently → Deploy/Demo (MVP!)
226251
3. Add User Story 2 → Test independently → Deploy/Demo
227252
4. Add User Story 3 → Test independently → Deploy/Demo
228-
5. Each story adds value without breaking previous stories
253+
5. Complete Polish → Cross-cutting improvements applied
254+
6. Complete Cleanup → Tech debt reviewed, small fixes applied, follow-ups created
255+
7. Each story adds value without breaking previous stories
229256

230257
### Parallel Team Strategy
231258

0 commit comments

Comments
 (0)