Spec-Kit Implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Constitution Loading (REQUIRED)
Before ANY action, load and internalize the project constitution:
Read constitution:
cat .specify/memory/constitution.md 2>/dev/null || echo "NO_CONSTITUTION"
If file doesn't exist:
ERROR: Project constitution not found at .specify/memory/constitution.md
STOP - Cannot proceed without constitution.
Run /speckit-00-constitution first to define project principles.
Parse all principles, constraints, and governance rules.
Extract Enforcement Rules:
Validation commitment: Before writing ANY file, validate against each principle.
Hard Gate Declaration: State explicitly:
╭─────────────────────────────────────────────────────╮
│ CONSTITUTION ENFORCEMENT GATE ACTIVE │
├─────────────────────────────────────────────────────┤
│ Extracted: X enforcement rules │
│ Mode: STRICT - violations HALT implementation │
│ Checked: Before EVERY file write │
╰─────────────────────────────────────────────────────╯
Prerequisites Check
Run prerequisites check (choose based on platform):
Unix/macOS/Linux:
.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks
Windows (PowerShell):
pwsh .specify/scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
Parse JSON for FEATURE_DIR and AVAILABLE_DOCS.
If error or missing tasks.md:
ERROR: tasks.md not found in feature directory.
Run /speckit-05-tasks first to create the task list.
Comprehensive Pre-Implementation Validation
BEFORE any implementation, perform complete validation sweep:
1. Artifact Completeness Check
Verify all required artifacts exist and are complete:
| Artifact |
Required |
Check |
| constitution.md |
YES |
Has principles section |
| spec.md |
YES |
Has Requirements + Success Criteria |
| plan.md |
YES |
Has Technical Context defined |
| tasks.md |
YES |
Has at least one task |
| research.md |
NO |
Warn if missing |
| data-model.md |
NO |
Warn if missing |
| checklists/*.md |
YES |
At least one checklist |
2. Cross-Artifact Consistency Check
Validate relationships between artifacts:
Spec → Tasks Traceability:
- Every FR-XXX requirement should have corresponding task(s)
- Every user story should have a task phase
- Report: "Coverage: X/Y requirements have tasks (Z%)"
Plan → Tasks Alignment:
- Tech stack in plan matches task file paths (e.g., Python → .py files)
- Project structure matches task paths
- WARN if mismatch: "Plan says Python but tasks create .js files"
Constitution → Plan Compliance:
- Re-verify no constitution violations in plan
- Extract MUST/MUST NOT rules and validate
3. Implementation Readiness Score
╭─────────────────────────────────────────────────────╮
│ IMPLEMENTATION READINESS │
├─────────────────────────────────────────────────────┤
│ Artifacts: X/Y complete [✓/✗] │
│ Spec Coverage: X% requirements → tasks [✓/✗] │
│ Plan Alignment: [Aligned/X mismatches] [✓/✗] │
│ Constitution: [Compliant/X violations] [✓/✗] │
│ Checklists: X/Y at 100% [✓/✗] │
│ Dependencies: [Valid/Circular detected] [✓/✗] │
├─────────────────────────────────────────────────────┤
│ OVERALL READINESS: [READY/BLOCKED] │
│ Blocking Issues: [None/List issues] │
╰─────────────────────────────────────────────────────╯
If BLOCKED: List all blocking issues and required actions
If READY: Proceed to Checklist Gating
Checklist Gating (CRITICAL)
Before implementation begins, check checklists status.
Use this approach (do NOT write custom bash for counting):
- Read each checklist file in
FEATURE_DIR/checklists/ using the Read tool
- Count manually by scanning the content:
- Incomplete: lines starting with
- [ ]
- Complete: lines starting with
- [x] or - [X]
- Build status table from the counts
Example output:
| Checklist |
Total |
Completed |
Incomplete |
Status |
| ux.md |
12 |
12 |
0 |
PASS |
| test.md |
8 |
5 |
3 |
FAIL |
Decision logic:
Execution Flow
1. Load Implementation Context
- REQUIRED: Read
tasks.md for complete task list and execution plan
- REQUIRED: Read
plan.md for tech stack, architecture, and file structure
- IF EXISTS: Read
data-model.md for entities and relationships
- IF EXISTS: Read
contracts/ for API specifications
- IF EXISTS: Read
research.md for technical decisions
- IF EXISTS: Read
quickstart.md for integration scenarios
2. Tessl Initialization (Optional but Recommended)
Initialize Tessl and install tiles for the planned tech stack BEFORE any implementation begins.
Why Tessl: AI agents often drift, misuse APIs, or fall back on outdated patterns when working with libraries. Tessl provides 10,000+ "tiles" of agent-optimized documentation that keeps implementation aligned with current best practices and prevents spinning on obscure library usage.
Check if Tessl is available:
command -v tessl >/dev/null 2>&1 && echo "TESSL_AVAILABLE" || echo "TESSL_NOT_FOUND"
If Tessl is NOT available, display a gentle recommendation:
╭──────────────────────────────────────────────────────────────────╮
│ Tessl not detected │
│ │
│ Tessl helps AI agents write better code by providing accurate, │
│ up-to-date documentation for libraries and frameworks. │
│ │
│ Without Tessl, I may: │
│ • Use outdated API patterns │
│ • Miss library-specific conventions │
│ • Spin on obscure library features │
│ │
│ Learn more: https://tessl.io │
│ Quick install: npm install -g tessl │
╰──────────────────────────────────────────────────────────────────╯
Then proceed without Tessl.
If Tessl IS available, initialize and install tiles from plan.md:
a. Initialize Tessl:
tessl init --agent claude-code
b. Extract technologies from plan.md Technical Context section:
- Language/Version (e.g., Python, Node.js, TypeScript)
- Primary Dependencies (e.g., Click, Express, React)
- Storage (e.g., SQLite, PostgreSQL, MongoDB)
- Testing (e.g., pytest, Jest, Vitest)
- Any other frameworks/libraries mentioned
c. For each technology, search for available tiles and install:
# Search for tile
tessl search <technology>
# If tile found, install it
tessl install tessl/<tile-name>
Example for Python + Click + SQLite + pytest stack:
tessl search python # → install tessl/python if found
tessl search click # → install tessl/click if found
tessl search sqlite # → install tessl/sqlite3 if found
tessl search pytest # → install tessl/pytest if found
d. Report installed tiles:
Tessl initialized with tiles:
✓ tessl/python
✓ tessl/click
✓ tessl/sqlite3
✓ tessl/pytest
✗ tessl/somelib (not found in registry)
Library documentation now available via MCP.
Using Tessl during implementation (IMPORTANT):
After tiles are installed, actively use the Tessl MCP tool to get library documentation when implementing features:
mcp__tessl__get_library_docs(library="click", topic="commands")
mcp__tessl__get_library_docs(library="sqlite3", topic="connections")
mcp__tessl__get_library_docs(library="pytest", topic="fixtures")
When to query Tessl:
- Before using any API from an installed tile's library
- When unsure about correct patterns or conventions
- When implementing non-trivial features with the library
- When encountering errors related to library usage
Query pattern:
- Be specific with the
topic parameter (e.g., "decorators", "async", "error handling")
- Query once per distinct feature/pattern, cache mentally for the session
- If no useful result, proceed with best knowledge
Skip if: User passes --no-tessl flag.
3. Project Setup Verification
Create/verify ignore files based on actual project setup:
Detection & Creation Logic:
- Check if git repo:
git rev-parse --git-dir 2>/dev/null -> create/verify .gitignore
- Check if Dockerfile exists or Docker in plan.md -> create/verify
.dockerignore
- Check if .eslintrc* exists -> create/verify
.eslintignore
- Check if eslint.config.* exists -> ensure config's
ignores entries cover required patterns
- Check if .prettierrc* exists -> create/verify
.prettierignore
- Check if .npmrc or package.json exists -> create/verify
.npmignore (if publishing)
- Check if terraform files (*.tf) exist -> create/verify
.terraformignore
- Check if helm charts present -> create/verify
.helmignore
Common Patterns by Technology (from plan.md tech stack):
- Node.js/JavaScript/TypeScript:
node_modules/, dist/, build/, *.log, .env*
- Python:
__pycache__/, *.pyc, .venv/, venv/, dist/, *.egg-info/
- Java:
target/, *.class, *.jar, .gradle/, build/
- C#/.NET:
bin/, obj/, *.user, *.suo, packages/
- Go:
*.exe, *.test, vendor/, *.out
- Rust:
target/, debug/, release/, *.rs.bk
- Universal:
.DS_Store, Thumbs.db, *.tmp, *.swp, .vscode/, .idea/
4. Parse tasks.md
Extract:
- Task phases: Setup, Tests, Core, Integration, Polish
- Task dependencies: Sequential vs parallel execution rules
- Task details: ID, description, file paths, parallel markers [P]
- Execution flow: Order and dependency requirements
5. Execute Implementation
Phase-by-phase execution:
- Complete each phase before moving to the next
- Respect dependencies: Run sequential tasks in order
- Parallel tasks [P] can run together (different files, no dependencies)
- Follow TDD approach: Execute test tasks before implementation tasks
- Validation checkpoints: Verify each phase completion before proceeding
5.1 Phase 1: Setup
Execute Setup phase tasks:
- Initialize project structure
- Create configuration files (package.json, pyproject.toml, etc.)
- Install dependencies (
npm install, pip install, etc.)
Note: Tessl was already initialized in step 2 with tiles for the planned tech stack.
5.2 Remaining Phases
Continue with remaining phases:
- Phase 2: Foundational - blocking prerequisites
- Phase 3+: User Stories - in priority order (P1, P2, P3...)
- Final Phase: Polish - cross-cutting concerns
Implementation execution rules:
- Tests before code: If tests requested, write them first and verify they fail
- Core development: Implement models, services, CLI commands, endpoints
- Integration work: Database connections, middleware, logging, external services
- Polish and validation: Unit tests, performance optimization, documentation
6. Output Validation (REQUIRED)
Before writing ANY file:
- Review output against EACH constitutional principle
- If ANY violation detected:
- STOP immediately
- State: "CONSTITUTION VIOLATION: [Principle Name]"
- Explain: What specifically violates the principle
- Suggest: Compliant alternative approach
- DO NOT proceed with "best effort" or workarounds
- If compliant, proceed with file write
7. Progress Tracking
- Report progress after each completed task
- Halt execution if any non-parallel task fails
- For parallel tasks [P], continue with successful tasks, report failed ones
- Provide clear error messages with context for debugging
- Suggest next steps if implementation cannot proceed
- IMPORTANT: For completed tasks, mark the task as [X] in the tasks file
8. Completion Validation
- Verify all required tasks are completed
- Check that implemented features match the original specification
- Validate that tests pass and coverage meets requirements
- Confirm the implementation follows the technical plan
- Report final status with summary of completed work
Error Handling
| Condition |
Detection |
Response |
| Tasks file missing |
File not found |
STOP with "Run /speckit-05-tasks first" |
| Plan file missing |
File not found |
STOP with "Run /speckit-03-plan first" |
| Constitution violation |
Principle check fails |
STOP, explain violation, suggest alternative |
| Checklist incomplete |
User says "no" |
STOP gracefully with instructions |
| Task fails |
Non-zero exit or error |
Report error, halt sequential tasks |
Next Steps
After implementation:
- Required: Run tests to verify functionality
- Required: Commit and push changes
- Optional: Run
/speckit-05-taskstoissues to create GitHub Issues
- Exports remaining tasks to GitHub for project tracking
- Useful for team collaboration and sprint planning
- Creates issues with labels, assignments, and cross-references
Suggest to user:
Implementation complete! Next steps:
- Run tests to verify functionality
- Commit and push changes
- /speckit-05-taskstoissues - (Optional) Export remaining tasks to GitHub Issues
1---2name: speckit-07-implement3description: Speckit 07 Implement4---5
6# Spec-Kit Implement
7
8Execute the implementation plan by processing and executing all tasks defined in tasks.md.
9
10## User Input
11
12```text
13$ARGUMENTS
14```
15
16You **MUST** consider the user input before proceeding (if not empty).
17
18## Constitution Loading (REQUIRED)
19
20Before ANY action, load and internalize the project constitution:
21
221. Read constitution:
23 ```bash
24 cat .specify/memory/constitution.md 2>/dev/null || echo "NO_CONSTITUTION"
25 ```
26
272. If file doesn't exist:
28 ```
29 ERROR: Project constitution not found at .specify/memory/constitution.md
30
31 STOP - Cannot proceed without constitution.
32 Run /speckit-00-constitution first to define project principles.
33 ```
34
353. Parse all principles, constraints, and governance rules.
36
374. **Extract Enforcement Rules**:
38 - Find all lines containing "MUST", "MUST NOT", "SHALL", "SHALL NOT", "REQUIRED", "NON-NEGOTIABLE"
39 - Build enforcement checklist:
40 ```
41 CONSTITUTION ENFORCEMENT RULES:
42 [MUST] ...
43 [MUST NOT] ...
44 [REQUIRED] ...
45 ```
46 - These rules will be checked BEFORE EVERY FILE WRITE
47
485. **Validation commitment:** Before writing ANY file, validate against each principle.
49
506. **Hard Gate Declaration**: State explicitly:
51 ```
52 ╭─────────────────────────────────────────────────────╮
53 │ CONSTITUTION ENFORCEMENT GATE ACTIVE │
54 ├─────────────────────────────────────────────────────┤
55 │ Extracted: X enforcement rules │
56 │ Mode: STRICT - violations HALT implementation │
57 │ Checked: Before EVERY file write │
58 ╰─────────────────────────────────────────────────────╯
59 ```
60
61## Prerequisites Check
62
631. Run prerequisites check (choose based on platform):
64
65 **Unix/macOS/Linux:**
66 ```bash
67 .specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks
68 ```
69
70 **Windows (PowerShell):**
71 ```powershell
72 pwsh .specify/scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
73 ```
74
752. Parse JSON for `FEATURE_DIR` and `AVAILABLE_DOCS`.
76
773. If error or missing `tasks.md`:
78 ```
79 ERROR: tasks.md not found in feature directory.
80 Run /speckit-05-tasks first to create the task list.
81 ```
82
83## Comprehensive Pre-Implementation Validation
84
85**BEFORE any implementation, perform complete validation sweep:**
86
87### 1. Artifact Completeness Check
88
89Verify all required artifacts exist and are complete:
90
91| Artifact | Required | Check |
92|----------|----------|-------|
93| constitution.md | YES | Has principles section |
94| spec.md | YES | Has Requirements + Success Criteria |
95| plan.md | YES | Has Technical Context defined |
96| tasks.md | YES | Has at least one task |
97| research.md | NO | Warn if missing |
98| data-model.md | NO | Warn if missing |
99| checklists/*.md | YES | At least one checklist |
100
101### 2. Cross-Artifact Consistency Check
102
103Validate relationships between artifacts:
104
1051. **Spec → Tasks Traceability**:
106 - Every FR-XXX requirement should have corresponding task(s)
107 - Every user story should have a task phase
108 - Report: "Coverage: X/Y requirements have tasks (Z%)"
109
1102. **Plan → Tasks Alignment**:
111 - Tech stack in plan matches task file paths (e.g., Python → .py files)
112 - Project structure matches task paths
113 - WARN if mismatch: "Plan says Python but tasks create .js files"
114
1153. **Constitution → Plan Compliance**:
116 - Re-verify no constitution violations in plan
117 - Extract MUST/MUST NOT rules and validate
118
119### 3. Implementation Readiness Score
120
121```
122╭─────────────────────────────────────────────────────╮
123│ IMPLEMENTATION READINESS │
124├─────────────────────────────────────────────────────┤
125│ Artifacts: X/Y complete [✓/✗] │
126│ Spec Coverage: X% requirements → tasks [✓/✗] │
127│ Plan Alignment: [Aligned/X mismatches] [✓/✗] │
128│ Constitution: [Compliant/X violations] [✓/✗] │
129│ Checklists: X/Y at 100% [✓/✗] │
130│ Dependencies: [Valid/Circular detected] [✓/✗] │
131├─────────────────────────────────────────────────────┤
132│ OVERALL READINESS: [READY/BLOCKED] │
133│ Blocking Issues: [None/List issues] │
134╰─────────────────────────────────────────────────────╯
135```
136
137**If BLOCKED**: List all blocking issues and required actions
138**If READY**: Proceed to Checklist Gating
139
140## Checklist Gating (CRITICAL)
141
142**Before implementation begins**, check checklists status.
143
144**Use this approach** (do NOT write custom bash for counting):
145
1461. **Read each checklist file** in `FEATURE_DIR/checklists/` using the Read tool
1472. **Count manually** by scanning the content:
148 - Incomplete: lines starting with `- [ ]`
149 - Complete: lines starting with `- [x]` or `- [X]`
1503. **Build status table** from the counts
151
152Example output:
153
154| Checklist | Total | Completed | Incomplete | Status |
155|-----------|-------|-----------|------------|--------|
156| ux.md | 12 | 12 | 0 | PASS |
157| test.md | 8 | 5 | 3 | FAIL |
158
159**Decision logic:**
160- **PASS**: All checklists have 0 incomplete items → proceed automatically
161- **FAIL**: Any checklist has incomplete items → ask user:
162 ```
163 Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)
164 ```
165 - If "no"/"wait"/"stop": halt execution
166 - If "yes"/"proceed"/"continue": proceed to next step
167
168## Execution Flow
169
170### 1. Load Implementation Context
171
172- **REQUIRED**: Read `tasks.md` for complete task list and execution plan
173- **REQUIRED**: Read `plan.md` for tech stack, architecture, and file structure
174- **IF EXISTS**: Read `data-model.md` for entities and relationships
175- **IF EXISTS**: Read `contracts/` for API specifications
176- **IF EXISTS**: Read `research.md` for technical decisions
177- **IF EXISTS**: Read `quickstart.md` for integration scenarios
178
179### 2. Tessl Initialization (Optional but Recommended)
180
181Initialize Tessl and install tiles for the planned tech stack BEFORE any implementation begins.
182
183**Why Tessl:** AI agents often drift, misuse APIs, or fall back on outdated patterns when working with libraries. Tessl provides 10,000+ "tiles" of agent-optimized documentation that keeps implementation aligned with current best practices and prevents spinning on obscure library usage.
184
1851. **Check if Tessl is available:**
186 ```bash
187 command -v tessl >/dev/null 2>&1 && echo "TESSL_AVAILABLE" || echo "TESSL_NOT_FOUND"
188 ```
189
1902. **If Tessl is NOT available**, display a gentle recommendation:
191 ```
192 ╭──────────────────────────────────────────────────────────────────╮
193 │ Tessl not detected │
194 │ │
195 │ Tessl helps AI agents write better code by providing accurate, │
196 │ up-to-date documentation for libraries and frameworks. │
197 │ │
198 │ Without Tessl, I may: │
199 │ • Use outdated API patterns │
200 │ • Miss library-specific conventions │
201 │ • Spin on obscure library features │
202 │ │
203 │ Learn more: https://tessl.io │
204 │ Quick install: npm install -g tessl │
205 ╰──────────────────────────────────────────────────────────────────╯
206 ```
207 Then proceed without Tessl.
208
2093. **If Tessl IS available**, initialize and install tiles from plan.md:
210
211 a. Initialize Tessl:
212 ```bash
213 tessl init --agent claude-code
214 ```
215
216 b. Extract technologies from plan.md **Technical Context** section:
217 - Language/Version (e.g., Python, Node.js, TypeScript)
218 - Primary Dependencies (e.g., Click, Express, React)
219 - Storage (e.g., SQLite, PostgreSQL, MongoDB)
220 - Testing (e.g., pytest, Jest, Vitest)
221 - Any other frameworks/libraries mentioned
222
223 c. For each technology, search for available tiles and install:
224 ```bash
225 # Search for tile
226 tessl search <technology>
227
228 # If tile found, install it
229 tessl install tessl/<tile-name>
230 ```
231
232 Example for Python + Click + SQLite + pytest stack:
233 ```bash
234 tessl search python # → install tessl/python if found
235 tessl search click # → install tessl/click if found
236 tessl search sqlite # → install tessl/sqlite3 if found
237 tessl search pytest # → install tessl/pytest if found
238 ```
239
240 d. Report installed tiles:
241 ```
242 Tessl initialized with tiles:
243 ✓ tessl/python
244 ✓ tessl/click
245 ✓ tessl/sqlite3
246 ✓ tessl/pytest
247 ✗ tessl/somelib (not found in registry)
248
249 Library documentation now available via MCP.
250 ```
251
2524. **Using Tessl during implementation (IMPORTANT):**
253
254 After tiles are installed, **actively use the Tessl MCP tool** to get library documentation when implementing features:
255
256 ```
257 mcp__tessl__get_library_docs(library="click", topic="commands")
258 mcp__tessl__get_library_docs(library="sqlite3", topic="connections")
259 mcp__tessl__get_library_docs(library="pytest", topic="fixtures")
260 ```
261
262 **When to query Tessl:**
263 - Before using any API from an installed tile's library
264 - When unsure about correct patterns or conventions
265 - When implementing non-trivial features with the library
266 - When encountering errors related to library usage
267
268 **Query pattern:**
269 - Be specific with the `topic` parameter (e.g., "decorators", "async", "error handling")
270 - Query once per distinct feature/pattern, cache mentally for the session
271 - If no useful result, proceed with best knowledge
272
273**Skip if:** User passes `--no-tessl` flag.
274
275### 3. Project Setup Verification
276
277**Create/verify ignore files based on actual project setup:**
278
279**Detection & Creation Logic**:
280- Check if git repo: `git rev-parse --git-dir 2>/dev/null` -> create/verify `.gitignore`
281- Check if Dockerfile exists or Docker in plan.md -> create/verify `.dockerignore`
282- Check if .eslintrc* exists -> create/verify `.eslintignore`
283- Check if eslint.config.* exists -> ensure config's `ignores` entries cover required patterns
284- Check if .prettierrc* exists -> create/verify `.prettierignore`
285- Check if .npmrc or package.json exists -> create/verify `.npmignore` (if publishing)
286- Check if terraform files (*.tf) exist -> create/verify `.terraformignore`
287- Check if helm charts present -> create/verify `.helmignore`
288
289**Common Patterns by Technology** (from plan.md tech stack):
290- **Node.js/JavaScript/TypeScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
291- **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`, `*.egg-info/`
292- **Java**: `target/`, `*.class`, `*.jar`, `.gradle/`, `build/`
293- **C#/.NET**: `bin/`, `obj/`, `*.user`, `*.suo`, `packages/`
294- **Go**: `*.exe`, `*.test`, `vendor/`, `*.out`
295- **Rust**: `target/`, `debug/`, `release/`, `*.rs.bk`
296- **Universal**: `.DS_Store`, `Thumbs.db`, `*.tmp`, `*.swp`, `.vscode/`, `.idea/`
297
298### 4. Parse tasks.md
299
300Extract:
301- Task phases: Setup, Tests, Core, Integration, Polish
302- Task dependencies: Sequential vs parallel execution rules
303- Task details: ID, description, file paths, parallel markers [P]
304- Execution flow: Order and dependency requirements
305
306### 5. Execute Implementation
307
308**Phase-by-phase execution**:
309- Complete each phase before moving to the next
310- Respect dependencies: Run sequential tasks in order
311- Parallel tasks [P] can run together (different files, no dependencies)
312- Follow TDD approach: Execute test tasks before implementation tasks
313- Validation checkpoints: Verify each phase completion before proceeding
314
315#### 5.1 Phase 1: Setup
316
317Execute Setup phase tasks:
318- Initialize project structure
319- Create configuration files (package.json, pyproject.toml, etc.)
320- Install dependencies (`npm install`, `pip install`, etc.)
321
322**Note:** Tessl was already initialized in step 2 with tiles for the planned tech stack.
323
324#### 5.2 Remaining Phases
325
326Continue with remaining phases:
327- **Phase 2: Foundational** - blocking prerequisites
328- **Phase 3+: User Stories** - in priority order (P1, P2, P3...)
329- **Final Phase: Polish** - cross-cutting concerns
330
331**Implementation execution rules**:
332- Tests before code: If tests requested, write them first and verify they fail
333- Core development: Implement models, services, CLI commands, endpoints
334- Integration work: Database connections, middleware, logging, external services
335- Polish and validation: Unit tests, performance optimization, documentation
336
337### 6. Output Validation (REQUIRED)
338
339Before writing ANY file:
340
3411. Review output against EACH constitutional principle
3422. If ANY violation detected:
343 - STOP immediately
344 - State: "CONSTITUTION VIOLATION: [Principle Name]"
345 - Explain: What specifically violates the principle
346 - Suggest: Compliant alternative approach
347 - DO NOT proceed with "best effort" or workarounds
3483. If compliant, proceed with file write
349
350### 7. Progress Tracking
351
352- Report progress after each completed task
353- Halt execution if any non-parallel task fails
354- For parallel tasks [P], continue with successful tasks, report failed ones
355- Provide clear error messages with context for debugging
356- Suggest next steps if implementation cannot proceed
357- **IMPORTANT**: For completed tasks, mark the task as [X] in the tasks file
358
359### 8. Completion Validation
360
361- Verify all required tasks are completed
362- Check that implemented features match the original specification
363- Validate that tests pass and coverage meets requirements
364- Confirm the implementation follows the technical plan
365- Report final status with summary of completed work
366
367## Error Handling
368
369| Condition | Detection | Response |
370|-----------|-----------|----------|
371| Tasks file missing | File not found | STOP with "Run /speckit-05-tasks first" |
372| Plan file missing | File not found | STOP with "Run /speckit-03-plan first" |
373| Constitution violation | Principle check fails | STOP, explain violation, suggest alternative |
374| Checklist incomplete | User says "no" | STOP gracefully with instructions |
375| Task fails | Non-zero exit or error | Report error, halt sequential tasks |
376
377## Next Steps
378
379After implementation:
380
3811. **Required**: Run tests to verify functionality
3822. **Required**: Commit and push changes
3833. **Optional**: Run `/speckit-05-taskstoissues` to create GitHub Issues
384 - Exports remaining tasks to GitHub for project tracking
385 - Useful for team collaboration and sprint planning
386 - Creates issues with labels, assignments, and cross-references
387
388Suggest to user:
389```
390Implementation complete! Next steps:
391- Run tests to verify functionality
392- Commit and push changes
393- /speckit-05-taskstoissues - (Optional) Export remaining tasks to GitHub Issues
394```