@devobsessed/code-captain 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +214 -0
  2. package/bin/install.js +1048 -0
  3. package/claude-code/README.md +276 -0
  4. package/claude-code/agents/code-captain.md +121 -0
  5. package/claude-code/agents/spec-generator.md +271 -0
  6. package/claude-code/agents/story-creator.md +309 -0
  7. package/claude-code/agents/tech-spec.md +440 -0
  8. package/claude-code/commands/cc-initialize.md +520 -0
  9. package/copilot/README.md +210 -0
  10. package/copilot/chatmodes/Code Captain.chatmode.md +60 -0
  11. package/copilot/docs/best-practices.md +74 -0
  12. package/copilot/prompts/create-adr.prompt.md +468 -0
  13. package/copilot/prompts/create-spec.prompt.md +430 -0
  14. package/copilot/prompts/edit-spec.prompt.md +396 -0
  15. package/copilot/prompts/execute-task.prompt.md +144 -0
  16. package/copilot/prompts/explain-code.prompt.md +292 -0
  17. package/copilot/prompts/initialize.prompt.md +65 -0
  18. package/copilot/prompts/new-command.prompt.md +310 -0
  19. package/copilot/prompts/plan-product.prompt.md +450 -0
  20. package/copilot/prompts/research.prompt.md +329 -0
  21. package/copilot/prompts/status.prompt.md +424 -0
  22. package/copilot/prompts/swab.prompt.md +217 -0
  23. package/cursor/README.md +224 -0
  24. package/cursor/cc.md +183 -0
  25. package/cursor/cc.mdc +69 -0
  26. package/cursor/commands/create-adr.md +504 -0
  27. package/cursor/commands/create-spec.md +430 -0
  28. package/cursor/commands/edit-spec.md +405 -0
  29. package/cursor/commands/execute-task.md +514 -0
  30. package/cursor/commands/explain-code.md +289 -0
  31. package/cursor/commands/initialize.md +397 -0
  32. package/cursor/commands/new-command.md +312 -0
  33. package/cursor/commands/plan-product.md +466 -0
  34. package/cursor/commands/research.md +317 -0
  35. package/cursor/commands/status.md +413 -0
  36. package/cursor/commands/swab.md +209 -0
  37. package/cursor/docs/best-practices.md +74 -0
  38. package/cursor/integrations/azure-devops/create-azure-work-items.md +403 -0
  39. package/cursor/integrations/azure-devops/sync-azure-work-items.md +486 -0
  40. package/cursor/integrations/github/create-github-issues.md +765 -0
  41. package/cursor/integrations/github/scripts/create-issues-batch.sh +272 -0
  42. package/cursor/integrations/github/sync-github-issues.md +237 -0
  43. package/cursor/integrations/github/sync.md +305 -0
  44. package/manifest.json +381 -0
  45. package/package.json +58 -0
  46. package/windsurf/README.md +254 -0
  47. package/windsurf/rules/cc.md +5 -0
  48. package/windsurf/workflows/create-adr.md +331 -0
  49. package/windsurf/workflows/create-spec.md +280 -0
  50. package/windsurf/workflows/edit-spec.md +273 -0
  51. package/windsurf/workflows/execute-task.md +276 -0
  52. package/windsurf/workflows/explain-code.md +292 -0
  53. package/windsurf/workflows/initialize.md +298 -0
  54. package/windsurf/workflows/new-command.md +321 -0
  55. package/windsurf/workflows/status.md +213 -0
@@ -0,0 +1,396 @@
1
+ ---
2
+ mode: agent
3
+ ---
4
+
5
+ # Edit Spec Command
6
+
7
+ ## Overview
8
+
9
+ Modify existing feature specifications using a contract-first approach that ensures complete alignment between developer and AI before updating any supporting files. This command prevents assumptions by establishing a clear "modification contract" through structured clarification rounds.
10
+
11
+ ## Command Process
12
+
13
+ ### Phase 1: Specification Loading & Change Contract (No File Modifications)
14
+
15
+ **Mission Statement:**
16
+ > Your goal is to help me modify an existing specification safely and precisely. You will deliver the updated spec package only after we both agree on the modification contract. **Important: Challenge changes that could break existing functionality or create technical debt - it's better to surface concerns early than implement problematic modifications.**
17
+
18
+ #### Step 1.1: Specification Discovery & Loading
19
+
20
+ **Locate Target Specification:**
21
+ 1. **SCAN** `.code-captain/specs/` directory for all existing specifications
22
+ 2. **IF** spec-identifier provided:
23
+ - **SEARCH** for exact folder name match: `[DATE]-{spec-identifier}`
24
+ - **SEARCH** for partial name match in folder names
25
+ - **SEARCH** for identifier in spec.md titles/content
26
+ 3. **IF** spec-identifier is "latest":
27
+ - **FIND** most recent folder by date prefix
28
+ 4. **IF** no spec-identifier provided:
29
+ - **LIST** all available specifications for user selection
30
+ 5. **IF** multiple matches found:
31
+ - **PRESENT** options for user disambiguation
32
+
33
+ **Load Current State:**
34
+ 1. **READ** primary specification file (`spec.md`)
35
+ 2. **READ** user stories overview (`user-stories/README.md`)
36
+ 3. **READ** all individual story files in `user-stories/` directory
37
+ 4. **READ** all sub-specifications in `sub-specs/` directory
38
+ 5. **SCAN** codebase for any implementation progress related to this spec
39
+ 6. **OUTPUT:** Current specification summary with story status (no modifications yet)
40
+
41
+ #### Step 1.2: Impact Analysis & Change Assessment
42
+
43
+ **Internal Process (not shown to user):**
44
+ - Analyze proposed changes against current specification
45
+ - Identify affected individual story files and task groups
46
+ - Note potential ripple effects on:
47
+ - Existing implementation (if any)
48
+ - Specific user story files in user-stories/ folder
49
+ - Story dependencies and sequencing
50
+ - Technical architecture
51
+ - Acceptance criteria within affected stories
52
+ - Project timelines and story priorities
53
+ - Catalog modification domains:
54
+ - Scope changes (adding/removing/splitting stories)
55
+ - Technical approach modifications
56
+ - Individual story adjustments or combinations
57
+ - Task group reorganization (keeping 5-7 tasks max)
58
+ - Performance/security requirement changes
59
+ - Integration point modifications
60
+ - Success criteria updates within stories
61
+
62
+ #### Step 1.3: Change Clarification Loop
63
+
64
+ **Rules:**
65
+ - Ask ONE focused question at a time about the proposed changes
66
+ - After each answer, re-analyze the existing spec and codebase for new context
67
+ - Continue until reaching 95% confidence on modification impact
68
+ - Each question should target the highest-impact unknown or risk
69
+ - **Never declare "final question"** - let the conversation flow naturally
70
+ - **Challenge changes that could break existing functionality or create technical debt**
71
+
72
+ **Critical Analysis Responsibility:**
73
+ - If proposed changes conflict with existing implementation, explain impact and suggest migration strategies
74
+ - If scope changes affect other dependent specifications, identify and discuss dependencies
75
+ - If modifications introduce technical complexity, assess if benefits justify the cost
76
+ - If changes affect user stories that may already be in progress, surface timeline implications
77
+ - If proposed changes contradict original business value, question the modification rationale
78
+
79
+ **Risk Assessment Categories:**
80
+ - **Breaking Changes**: Will this break existing functionality?
81
+ - **Implementation Impact**: How much existing work needs to be modified/discarded?
82
+ - **Architecture Consistency**: Do changes align with existing patterns?
83
+ - **Scope Creep**: Are we expanding beyond the original contract boundaries?
84
+ - **Business Value**: Do changes improve or compromise original user value?
85
+
86
+ **Question Categories (examples):**
87
+ - "This change would affect [existing user story]. Should we modify that story or create a new one?"
88
+ - "I see this conflicts with [existing implementation]. Should we plan a migration strategy?"
89
+ - "This modification increases complexity in [area]. Is the added value worth the technical cost?"
90
+ - "The original spec was focused on [goal]. How does this change serve that same goal?"
91
+ - "This would require changes to [dependent system]. Have you considered the downstream impact?"
92
+
93
+ #### Step 1.4: Modification Contract Proposal
94
+
95
+ When confident about changes, present a modification contract:
96
+
97
+ **Format:**
98
+ ```
99
+ ## Modification Contract
100
+
101
+ **Target Specification:** [Specification name and date]
102
+
103
+ **Proposed Changes:** [Clear description of what will be modified]
104
+
105
+ **Change Type:** [Addition/Removal/Modification/Refactor]
106
+
107
+ **Impact Assessment:**
108
+ - **Story Files Affected:** [List of specific story-N-{name}.md files that need changes]
109
+ - **New Stories Required:** [Any additional story files to be created]
110
+ - **Stories to Remove/Combine:** [Any story files that become obsolete]
111
+ - **Task Groups Affected:** [Which task groups within stories need modification]
112
+ - **Technical Components Affected:** [Code/architecture areas needing updates]
113
+ - **Implementation Status:** [How much existing work across stories is affected]
114
+
115
+ **Migration Strategy:**
116
+ - [How to handle existing implementation]
117
+ - [Steps to preserve completed work]
118
+ - [Rollback plan if needed]
119
+
120
+ **Updated Success Criteria:** [How success metrics change]
121
+
122
+ **Revised Scope Boundaries:**
123
+ - **Still In Scope:** [What remains from original]
124
+ - **Now In Scope:** [What gets added]
125
+ - **Removed From Scope:** [What gets removed]
126
+ - **Still Out of Scope:** [Unchanged exclusions]
127
+
128
+ **⚠️ Risks & Concerns:**
129
+ - [Specific technical or business risks from the changes]
130
+ - [Potential complications or dependencies]
131
+
132
+ **💡 Recommendations:**
133
+ - [Suggestions for safer implementation approaches]
134
+ - [Ways to minimize disruption to existing work]
135
+
136
+ **Effort Estimate:** [How much additional/changed work is involved]
137
+
138
+ ---
139
+ Options:
140
+ - Type 'yes' to lock this modification contract and update the specification
141
+ - Type 'edit: [your changes]' to modify the contract
142
+ - Type 'compare' to see a detailed before/after comparison
143
+ - Type 'risks' to explore implementation risks in detail
144
+ - Type 'rollback' to understand how to undo these changes later
145
+ - Ask more questions if anything needs clarification
146
+ ```
147
+
148
+ ### Phase 2: Specification Update (Post-Agreement Only)
149
+
150
+ **Triggered only after user confirms modification contract with 'yes'**
151
+
152
+ #### Step 2.1: Create Backup & Change Documentation
153
+
154
+ **Backup Process:**
155
+ 1. **CREATE** backup folder: `.code-captain/specs/[spec-folder]/backups/`
156
+ 2. **COPY** all current files to `backups/[timestamp]/`
157
+ 3. **CREATE** change log entry in `CHANGELOG.md` within spec folder
158
+
159
+ **Change Log Format:**
160
+ ```markdown
161
+ # Specification Change Log
162
+
163
+ ## [Date] - [Change Type]
164
+ **Modified by:** [User identifier or "Manual edit"]
165
+ **Modification Contract:** [Brief summary]
166
+
167
+ ### Changes Made:
168
+ - [Specific change 1]
169
+ - [Specific change 2]
170
+
171
+ ### Files Updated:
172
+ - spec.md - [what changed]
173
+ - user-stories/README.md - [progress tracking updates]
174
+ - user-stories/story-N-{name}.md - [specific story changes]
175
+ - sub-specs/[file] - [what changed]
176
+
177
+ ### Backup Location:
178
+ `backups/[timestamp]/`
179
+
180
+ ---
181
+ ```
182
+
183
+ #### Step 2.2: Update Core Specification Files
184
+
185
+ **spec.md Updates:**
186
+ - Modify contract summary to reflect new agreement
187
+ - Update detailed requirements based on clarification
188
+ - Revise implementation approach if changed
189
+ - Add change log reference
190
+ - Update status if appropriate
191
+
192
+ **user-stories/ folder Updates:**
193
+ - **README.md**: Update progress tracking table and story dependencies
194
+ - **Individual story files**: Modify affected story-N-{name}.md files
195
+ - **Story additions**: Create new story files with focused task groups (5-7 tasks max)
196
+ - **Story combinations**: Merge related stories if they become too granular
197
+ - **Story removals**: Archive or delete story files no longer needed
198
+ - **Task reorganization**: Ensure task groups within stories remain manageable
199
+ - **Status updates**: Mark completed tasks that might need rework across all stories
200
+
201
+ #### Step 2.3: Update Technical Sub-Specifications
202
+
203
+ **Selective Updates:**
204
+ - Only update sub-specs affected by the changes
205
+ - Create new sub-specs if new technical areas introduced
206
+ - Archive sub-specs no longer relevant
207
+ - Update cross-references between documents
208
+
209
+ #### Step 2.4: Story-Based Task Reconciliation
210
+
211
+ **Task Status Assessment Across Stories:**
212
+ - **Review each story file** for task status and relevance
213
+ - **Identify completed tasks** within stories that remain valid
214
+ - **Flag tasks requiring rework** due to changes
215
+ - **Add new tasks** while maintaining 5-7 task limit per story
216
+ - **Split stories** if task count would exceed 7 tasks
217
+ - **Combine stories** if task counts become too small
218
+ - **Reorder stories** if dependencies changed
219
+
220
+ **Story-Level Task Annotations:**
221
+ ```markdown
222
+ # In story-1-user-auth.md:
223
+ - [x] 1.1 Write tests for user authentication ✅ (Still valid)
224
+ - [ ] 1.2 Implement OAuth provider ⚠️ (Needs modification)
225
+ - [ ] 1.3 Create social login UI 🆕 (New task from scope change)
226
+ - [~~] 1.4 Implement mobile-specific auth ❌ (Moved to new story-4-mobile-auth.md)
227
+
228
+ # New story-4-mobile-auth.md created if mobile auth becomes separate feature
229
+ ```
230
+
231
+ **Story Management:**
232
+ - **Split large stories**: If modifications would create >7 tasks, create additional story files
233
+ - **Archive obsolete stories**: Move removed stories to archived/ subfolder with timestamp
234
+ - **Update story dependencies**: Modify README.md to reflect new story relationships
235
+ - **Maintain story cohesion**: Ensure each story delivers standalone user value
236
+
237
+ #### Step 2.5: Final Update Review & Validation
238
+
239
+ Present updated package with change summary:
240
+ ```
241
+ ✅ Specification successfully updated!
242
+
243
+ 📁 .code-captain/specs/[DATE]-feature-name/
244
+ ├── 📋 spec.md - ⭐ Updated specification
245
+ ├── 📝 spec-lite.md - ⭐ Updated AI context summary
246
+ ├── 👥 user-stories/ - ⭐ Updated story organization
247
+ │ ├── 📊 README.md - ⭐ Updated progress tracking and dependencies
248
+ │ ├── 📝 story-1-{name}.md - ⭐ Modified stories (5-7 tasks each)
249
+ │ ├── 📝 story-2-{name}.md - 🆕 New stories or combinations
250
+ │ ├── 📂 archived/ - 🗃️ Obsolete stories (if any)
251
+ │ └── 📝 story-N-{name}.md - ⭐ Focused task groups
252
+ ├── 📂 sub-specs/
253
+ │ ├── 🔧 technical-spec.md - ⭐ Updated if affected
254
+ │ └── [other sub-specs...]
255
+ ├── 💾 backups/[timestamp]/ - Original files and stories preserved
256
+ └── 📝 CHANGELOG.md - ⭐ Change documentation
257
+
258
+ ## Summary of Changes:
259
+ - **Stories Modified:** [X] existing story files updated
260
+ - **Stories Added:** [Y] new story files created
261
+ - **Stories Removed/Archived:** [Z] story files no longer needed
262
+ - **Task Groups Affected:** [N] task groups reorganized
263
+ - **Modified Components:** [List of changed technical components]
264
+
265
+ ## Impact on Implementation:
266
+ - **Stories Still Valid:** [X] out of [Y] stories remain unchanged
267
+ - **Stories Requiring Rework:** [N] stories need modification
268
+ - **New Stories Added:** [N] new stories created (with focused task groups)
269
+ - **Stories Archived:** [N] stories no longer needed
270
+ - **Total Tasks:** [N] tasks across all stories (max 5-7 per story)
271
+
272
+ Please review the updated specification:
273
+ - Does this accurately reflect the agreed modifications?
274
+ - Are the user stories appropriately organized (5-7 tasks per story)?
275
+ - Should any stories be further split or combined?
276
+ - Are story dependencies correctly updated in the README?
277
+ - Should any additional changes be made?
278
+
279
+ The updated user-stories folder structure provides:
280
+ - **Focused development**: Work on one story at a time
281
+ - **Better organization**: Each story file is manageable and self-contained
282
+ - **Team collaboration**: Different stories can be assigned to different developers
283
+ - **Clear progress tracking**: README overview shows status across all stories
284
+ - **Flexible workflow**: Stories can be completed independently where possible
285
+
286
+ The original version is safely backed up in the backups folder. If you need to rollback any changes, I can help restore from backup.
287
+ ```
288
+
289
+ ## Tool Integration
290
+
291
+ **Primary tools:**
292
+ - `codebase` - Analyzing existing architecture and implementation progress
293
+ - `search` - Finding existing specifications and related documentation
294
+ - `editFiles` - Updating specification documents and story files
295
+ - `runCommands` - Creating backups and directory operations
296
+
297
+ **Documentation organization:**
298
+ - Specifications stored in `.code-captain/specs/[DATE]-{feature-name}/`
299
+ - Backup system for safe modification tracking
300
+ - Change logs for audit trail and rollback capability
301
+ - User stories organized in individual files for better management
302
+
303
+ ## Key Features
304
+
305
+ ### 1. Safe Modification Process
306
+ - **Backup creation** before any changes
307
+ - **Change tracking** with detailed logs
308
+ - **Rollback capability** to restore previous versions
309
+ - **Impact assessment** before making changes
310
+
311
+ ### 2. Precise Change Control
312
+ - **Focused clarification** about specific modifications
313
+ - **Risk assessment** for breaking changes
314
+ - **Migration strategy** for existing implementation
315
+ - **Selective updates** only to affected components
316
+
317
+ ### 3. Implementation Continuity
318
+ - **Task status preservation** for completed work
319
+ - **Clear annotation** of what needs rework
320
+ - **Priority reassessment** based on changes
321
+ - **Timeline impact** analysis
322
+
323
+ ### 4. Change Documentation
324
+ - **Detailed change logs** for audit trail
325
+ - **Before/after comparison** capability
326
+ - **Modification rationale** capture
327
+ - **Rollback instructions** for safety
328
+
329
+ ## Example Usage Flow
330
+
331
+ ```
332
+ Developer: /edit-spec "user-auth" "add biometric authentication"
333
+
334
+ Agent: I found your user authentication specification from 2024-01-15. Let me load the current state...
335
+
336
+ [Loads spec.md, tasks.md, and sub-specs]
337
+
338
+ Current specification includes email/password auth with OAuth social login. I see there are 8 user stories, with 3 already implemented in your codebase.
339
+
340
+ I have a concern about adding biometric authentication: your current implementation is web-focused, but biometric auth typically requires native mobile or desktop apps. I see no mobile components in your existing specification.
341
+
342
+ First question: Are you planning to add mobile app development to this specification, or do you want to use WebAuthn for browser-based biometric authentication?
343
+
344
+ Developer: WebAuthn for browser-based
345
+
346
+ Agent: That makes more sense with your existing web architecture. However, WebAuthn requires HTTPS and has limited browser support. I see your current implementation supports users who may be on older browsers.
347
+
348
+ Should we make biometric authentication an optional enhancement for supported browsers, or do you want to require it for all users (which might break compatibility)?
349
+
350
+ Developer: Optional enhancement for supported browsers
351
+
352
+ Agent: [Continues with more questions about UX, fallback behavior, etc.]
353
+
354
+ ## Modification Contract
355
+
356
+ **Target Specification:** User Authentication System (2024-01-15)
357
+
358
+ **Proposed Changes:** Add WebAuthn biometric authentication as optional enhancement
359
+
360
+ **Change Type:** Addition (with graceful degradation)
361
+
362
+ **Impact Assessment:**
363
+ - **User Stories Affected:** Story 2 (Login flow) needs biometric option
364
+ - **Technical Components Affected:** Frontend auth component, browser capability detection
365
+ - **Implementation Status:** 3/8 stories completed, none affected by this change
366
+
367
+ **Migration Strategy:**
368
+ - Existing auth flows remain unchanged
369
+ - Add biometric as progressive enhancement
370
+ - No breaking changes to current implementation
371
+
372
+ **Updated Success Criteria:** Users can log in with biometrics on supported browsers, fallback to existing methods
373
+
374
+ **⚠️ Risks & Concerns:**
375
+ - Browser support varies (Chrome 67+, Firefox 60+, Safari 14+)
376
+ - Requires HTTPS in production
377
+ - UX complexity for unsupported browsers
378
+
379
+ **💡 Recommendations:**
380
+ - Feature detection before offering biometric option
381
+ - Clear messaging when biometric unavailable
382
+ - Analytics to track adoption rates
383
+
384
+ **Effort Estimate:** ~2-3 additional days (1 story addition, modest technical complexity)
385
+
386
+ ---
387
+ Options: [yes/edit/compare/risks/rollback]
388
+
389
+ Developer: yes
390
+
391
+ Agent: ✅ Modification contract locked! Updating specification...
392
+
393
+ [Updates files, creates backups, documents changes]
394
+ ```
395
+
396
+ This approach ensures that specification modifications are as careful and controlled as the original creation process, while preserving existing work and providing safety mechanisms for complex changes.
@@ -0,0 +1,144 @@
1
+ ---
2
+ mode: agent
3
+ ---
4
+
5
+ # Execute Task Command
6
+
7
+ ## Overview
8
+
9
+ Execute a specific task and its sub-tasks systematically following a Test-Driven Development (TDD) workflow. This command reads task specifications from `.code-captain/specs/` directories and implements features with comprehensive testing, following established code standards and best practices.
10
+
11
+ **Note:** This command automatically detects and lists available task specifications for selection, or executes a specific task if context is clear.
12
+
13
+ ## CRITICAL REQUIREMENT: 100% Test Pass Rate
14
+
15
+ **⚠️ ZERO TOLERANCE FOR FAILING TESTS ⚠️**
16
+
17
+ This command enforces strict test validation:
18
+ - **NO story can be marked "COMPLETED" with ANY failing tests**
19
+ - **100% test pass rate is MANDATORY before completion**
20
+ - **"Edge case" or "minor" test failures are NOT acceptable**
21
+ - **Implementation is considered incomplete until all tests pass**
22
+
23
+ If tests fail, the story remains "IN PROGRESS" until all failures are resolved.
24
+
25
+ ## Command Process
26
+
27
+ ### Step 1: Task Discovery & Selection
28
+
29
+ **Scan for available specifications:**
30
+
31
+ - Search `.code-captain/specs/` for dated specification folders
32
+ - Load user stories from `user-stories/` folders in each spec
33
+ - Read `user-stories/README.md` for story overview and progress
34
+ - Parse individual `story-N-{name}.md` files for available tasks
35
+ - Present available stories and tasks organized by specification
36
+
37
+ **Create execution progress tracking:**
38
+
39
+ Create `.code-captain/current-task-progress.md` to track the execution process:
40
+
41
+ ```markdown
42
+ # Task Execution Progress
43
+
44
+ ## Current Task: [Task Name]
45
+ - Status: In Progress
46
+ - Started: [Date/Time]
47
+
48
+ ## Progress Steps:
49
+ - [x] Task discovery and selection
50
+ - [ ] Context gathering from specs and codebase
51
+ - [ ] Subtask execution in TDD order
52
+ - [ ] Test verification (100% pass rate required)
53
+ - [ ] Task completion and status update
54
+
55
+ ## Current Step: Task Discovery
56
+ ```
57
+
58
+ ### Step 2: Context Gathering & Analysis
59
+
60
+ **Load specification context:**
61
+
62
+ - Read primary spec document: `spec.md`
63
+ - Load user stories overview: `user-stories/README.md`
64
+ - Read selected story file: `user-stories/story-N-{name}.md`
65
+ - Review technical specifications: `sub-specs/technical-spec.md`
66
+ - Parse task breakdown from individual story file
67
+
68
+ **Analyze current codebase:**
69
+
70
+ Use `codebase` and `search` to understand:
71
+
72
+ - Current architecture and patterns
73
+ - Related existing functionality
74
+ - Integration points for new features
75
+ - Testing frameworks and conventions
76
+
77
+ ### Step 3: Story & Task Analysis
78
+
79
+ Parse selected story structure and validate TDD approach within story using file-based progress tracking instead of todo_write.
80
+
81
+ ### Step 4: Story Task Execution (TDD Workflow)
82
+
83
+ Execute story tasks in sequential order with file-based tracking:
84
+
85
+ #### Task 1: Write Tests (Test-First Approach)
86
+
87
+ **Actions:**
88
+ - Write comprehensive test cases for the entire feature
89
+ - Include unit tests, integration tests, and edge cases
90
+ - Cover happy path, error conditions, and boundary cases
91
+ - Ensure tests fail appropriately (red phase)
92
+
93
+ #### Tasks 2-N: Implementation (Green Phase)
94
+
95
+ For each implementation task within the story:
96
+ 1. **Focus on specific functionality**: Implement only what's needed for current task
97
+ 2. **Make tests pass**: Write minimal code to satisfy failing tests
98
+ 3. **Update related tests**: Modify adjacent tests if behavior changes
99
+ 4. **Maintain compatibility**: Ensure no regressions in existing functionality
100
+ 5. **Refactor when green**: Improve code quality while tests remain passing
101
+
102
+ #### Final Task: Test & Acceptance Verification
103
+
104
+ **CRITICAL: 100% Test Pass Rate Required**
105
+
106
+ **Mandatory Actions (ALL must succeed before story completion):**
107
+ 1. **Run complete test suite for this story**
108
+ 2. **Achieve 100% pass rate for ALL tests** - NO EXCEPTIONS
109
+ 3. **Verify no regressions in existing test suites**
110
+ 4. **Validate all acceptance criteria are met for the user story**
111
+ 5. **Confirm story delivers the specified user value**
112
+
113
+ **⚠️ STORY CANNOT BE MARKED COMPLETE WITH ANY FAILING TESTS ⚠️**
114
+
115
+ ### Step 5: Story Completion & Status Updates
116
+
117
+ Update story file status and progress tracking files with completion details, ensuring all tests pass before marking complete.
118
+
119
+ ## Tool Integration
120
+
121
+ **Primary tools:**
122
+ - `codebase` - Understanding existing architecture and patterns
123
+ - `search` - Finding related code and patterns
124
+ - `editFiles` - Implementing code changes
125
+ - `runCommands` - Executing build processes
126
+ - `runTests` - Running test suites
127
+ - `findTestFiles` - Locating test files
128
+ - `testFailure` - Analyzing test failures
129
+
130
+ **Progress tracking:**
131
+ - File-based progress tracking in `.code-captain/current-task-progress.md`
132
+ - Story status updates in specification files
133
+ - Test execution results documentation
134
+
135
+ ## Quality Standards
136
+
137
+ **Test-Driven Development:**
138
+ - Tests written before implementation
139
+ - **100% test pass rate MANDATORY before task completion**
140
+ - **ZERO TOLERANCE for failing tests - no story completion with any failures**
141
+ - Comprehensive coverage including edge cases
142
+ - Regression testing for existing functionality
143
+
144
+ This command ensures systematic, test-driven implementation with proper documentation and progress tracking using file-based systems compatible with GitHub Copilot.