@devobsessed/code-captain 0.0.8 → 0.0.9

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 (37) hide show
  1. package/README.md +35 -27
  2. package/bin/install.js +1165 -978
  3. package/claude-code/agents/code-captain.md +15 -3
  4. package/copilot/chatmodes/Code Captain.chatmode.md +30 -9
  5. package/copilot/prompts/create-adr.prompt.md +6 -4
  6. package/copilot/prompts/create-spec.prompt.md +60 -40
  7. package/copilot/prompts/explain-code.prompt.md +7 -20
  8. package/copilot/prompts/research.prompt.md +14 -27
  9. package/cursor/README.md +72 -68
  10. package/cursor/cc.mdc +13 -35
  11. package/cursor/commands/create-adr.md +6 -12
  12. package/cursor/commands/create-spec.md +66 -54
  13. package/cursor/commands/edit-spec.md +2 -15
  14. package/cursor/commands/execute-task.md +7 -15
  15. package/cursor/commands/explain-code.md +16 -32
  16. package/cursor/commands/initialize.md +18 -17
  17. package/cursor/commands/new-command.md +168 -77
  18. package/cursor/commands/plan-product.md +7 -13
  19. package/cursor/commands/research.md +4 -23
  20. package/cursor/commands/status.md +28 -28
  21. package/cursor/commands/swab.md +4 -12
  22. package/manifest.json +104 -207
  23. package/package.json +2 -3
  24. package/cursor/cc.md +0 -156
  25. package/windsurf/README.md +0 -254
  26. package/windsurf/rules/cc.md +0 -5
  27. package/windsurf/workflows/create-adr.md +0 -331
  28. package/windsurf/workflows/create-spec.md +0 -280
  29. package/windsurf/workflows/edit-spec.md +0 -273
  30. package/windsurf/workflows/execute-task.md +0 -276
  31. package/windsurf/workflows/explain-code.md +0 -288
  32. package/windsurf/workflows/initialize.md +0 -298
  33. package/windsurf/workflows/new-command.md +0 -321
  34. package/windsurf/workflows/plan-product.md +0 -330
  35. package/windsurf/workflows/research.md +0 -240
  36. package/windsurf/workflows/status.md +0 -213
  37. package/windsurf/workflows/swab.md +0 -212
@@ -1,273 +0,0 @@
1
- ---
2
- description: Modify existing feature specifications using contract-first approach with safe change management
3
- ---
4
-
5
- # Edit Spec Workflow
6
-
7
- ## Overview
8
- Modify existing feature specifications using a contract-first approach that ensures complete alignment between developer and AI before updating any supporting files. Prevents assumptions by establishing a clear "modification contract" through structured clarification rounds.
9
-
10
- ## Usage Examples
11
- - "user-authentication" "add social login options"
12
- - "2024-01-15-payment-gateway" "change from Stripe to PayPal"
13
- - "latest" "remove the mobile app requirement"
14
-
15
- ## Command Process
16
-
17
- ### Phase 1: Specification Loading & Change Contract (No File Modifications)
18
-
19
- **Mission Statement:**
20
- > Help modify existing specifications safely and precisely. Deliver updated spec package only after both parties agree on the modification contract. **Challenge changes that could break existing functionality or create technical debt - better to surface concerns early than implement problematic modifications.**
21
-
22
- #### Step 1.1: Specification Discovery & Loading
23
-
24
- **Locate Target Specification:**
25
- 1. Use `find_by_name` to scan `.code-captain/specs/` directory for all existing specifications
26
- 2. If spec-identifier provided:
27
- - Search for exact folder name match: `[DATE]-{spec-identifier}`
28
- - Search for partial name match in folder names
29
- - Search for identifier in spec.md titles/content using `view_file`
30
- 3. If spec-identifier is "latest":
31
- - Find most recent folder by date prefix using `list_dir`
32
- 4. If no spec-identifier provided:
33
- - List all available specifications for user selection
34
- 5. If multiple matches found:
35
- - Present options for user disambiguation
36
-
37
- **Load Current State:**
38
- 1. Use `view_file` to read primary specification file (`spec.md`)
39
- 2. Use `view_file` to read user stories overview (`user-stories/README.md`)
40
- 3. Use `view_file` to read all individual story files in `user-stories/` directory
41
- 4. Use `view_file` to read all sub-specifications in `sub-specs/` directory
42
- 5. Use `codebase_search` to scan for any implementation progress related to this spec
43
- 6. **Output:** Current specification summary with story status (no modifications yet)
44
-
45
- #### Step 1.2: Impact Analysis & Change Assessment
46
-
47
- **Internal Process (not shown to user):**
48
- - Analyze proposed changes against current specification
49
- - Identify affected individual story files and task groups
50
- - Note potential ripple effects on:
51
- - Existing implementation (if any)
52
- - Specific user story files in user-stories/ folder
53
- - Story dependencies and sequencing
54
- - Technical architecture
55
- - Acceptance criteria within affected stories
56
- - Project timelines and story priorities
57
- - Catalog modification domains:
58
- - Scope changes (adding/removing/splitting stories)
59
- - Technical approach modifications
60
- - Individual story adjustments or combinations
61
- - Task group reorganization (keeping 5-7 tasks max)
62
- - Performance/security requirement changes
63
- - Integration point modifications
64
- - Success criteria updates within stories
65
-
66
- #### Step 1.3: Change Clarification Loop
67
-
68
- **Rules:**
69
- - Ask ONE focused question at a time about the proposed changes
70
- - After each answer, re-analyze the existing spec and codebase using `codebase_search`
71
- - Continue until reaching 95% confidence on modification impact
72
- - Each question should target the highest-impact unknown or risk
73
- - **Never declare "final question"** - let the conversation flow naturally
74
- - **Challenge changes that could break existing functionality or create technical debt**
75
-
76
- **Critical Analysis Responsibility:**
77
- - If proposed changes conflict with existing implementation, explain impact and suggest migration strategies
78
- - If scope changes affect other dependent specifications, identify and discuss dependencies
79
- - If modifications introduce technical complexity, assess if benefits justify the cost
80
- - If changes affect user stories that may already be in progress, surface timeline implications
81
- - If proposed changes contradict original business value, question the modification rationale
82
-
83
- **Risk Assessment Categories:**
84
- - **Breaking Changes**: Will this break existing functionality?
85
- - **Implementation Impact**: How much existing work needs to be modified/discarded?
86
- - **Architecture Consistency**: Do changes align with existing patterns?
87
- - **Scope Creep**: Are we expanding beyond the original contract boundaries?
88
- - **Business Value**: Do changes improve or compromise original user value?
89
-
90
- **Question Categories:**
91
- - "This change would affect [existing user story]. Should we modify that story or create a new one?"
92
- - "I see this conflicts with [existing implementation]. Should we plan a migration strategy?"
93
- - "This modification increases complexity in [area]. Is the added value worth the technical cost?"
94
- - "The original spec was focused on [goal]. How does this change serve that same goal?"
95
- - "This would require changes to [dependent system]. Have you considered the downstream impact?"
96
-
97
- #### Step 1.4: Modification Contract Proposal
98
-
99
- When confident about changes, present a modification contract:
100
-
101
- ```
102
- ## Modification Contract
103
-
104
- **Target Specification:** [Specification name and date]
105
-
106
- **Proposed Changes:** [Clear description of what will be modified]
107
-
108
- **Change Type:** [Addition/Removal/Modification/Refactor]
109
-
110
- **Impact Assessment:**
111
- - **Story Files Affected:** [Specific story-N-{name}.md files needing changes]
112
- - **New Stories Required:** [Additional story files to create]
113
- - **Stories to Remove/Combine:** [Story files becoming obsolete]
114
- - **Technical Components Affected:** [Code/architecture areas needing updates]
115
- - **Implementation Status:** [Existing work affected across stories]
116
-
117
- **Migration Strategy:** [Handle existing implementation, preserve work, rollback plan]
118
-
119
- **Updated Success Criteria:** [How success metrics change]
120
-
121
- **Revised Scope:** Still/Now/Removed/Out of scope [summarized changes]
122
-
123
- **⚠️ Risks & Concerns:**
124
- - [Specific technical or business risks from the changes]
125
- - [Potential complications or dependencies]
126
-
127
- **💡 Recommendations:**
128
- - [Suggestions for safer implementation approaches]
129
- - [Ways to minimize disruption to existing work]
130
-
131
- **Effort Estimate:** [How much additional/changed work is involved]
132
-
133
- ---
134
- Options:
135
- - Type 'yes' to lock this modification contract and update the specification
136
- - Type 'edit: [your changes]' to modify the contract
137
- - Type 'compare' to see a detailed before/after comparison
138
- - Type 'risks' to explore implementation risks in detail
139
- - Type 'rollback' to understand how to undo these changes later
140
- - Ask more questions if anything needs clarification
141
- ```
142
-
143
- ### Phase 2: Specification Update (Post-Agreement Only)
144
-
145
- **Triggered only after user confirms modification contract with 'yes'**
146
-
147
- #### Step 2.1: Create Backup & Change Documentation
148
-
149
- **Backup Process:**
150
- 1. Use `run_command` to get current timestamp:
151
- ```bash
152
- date +%Y%m%d-%H%M%S
153
- ```
154
- 2. Use `write_to_file` to create backup folder structure
155
- 3. Use `view_file` to read all current files and copy to backup location
156
- 4. Use `write_to_file` to create change log entry in `CHANGELOG.md`
157
-
158
- **Change Log Format:**
159
- ```markdown
160
- # Specification Change Log
161
-
162
- ## [Date] - [Change Type]
163
- **Modified by:** [User] | **Contract:** [Brief summary]
164
-
165
- ### Changes: [List changes] | ### Files: [List files] | ### Backup: `backups/[timestamp]/`
166
- ```
167
-
168
- #### Step 2.2: Update Core Specification Files
169
-
170
- **spec.md Updates:**
171
- - Use `view_file` to read current content
172
- - Use `write_to_file` to update with:
173
- - Modified contract summary to reflect new agreement
174
- - Updated detailed requirements based on clarification
175
- - Revised implementation approach if changed
176
- - Change log reference
177
- - Updated status if appropriate
178
-
179
- **user-stories/ folder Updates:**
180
- - **README.md**: Update progress tracking table and story dependencies
181
- - **Individual story files**: Modify affected story-N-{name}.md files
182
- - **Story additions**: Create new story files with focused task groups (5-7 tasks max)
183
- - **Story combinations**: Merge related stories if they become too granular
184
- - **Story removals**: Archive or delete story files no longer needed
185
- - **Task reorganization**: Ensure task groups within stories remain manageable
186
- - **Status updates**: Mark completed tasks that might need rework across all stories
187
-
188
- #### Step 2.3: Update Technical Sub-Specifications
189
-
190
- **Selective Updates:**
191
- - Only update sub-specs affected by the changes using `view_file` and `write_to_file`
192
- - Create new sub-specs if new technical areas introduced
193
- - Archive sub-specs no longer relevant
194
- - Update cross-references between documents
195
-
196
- #### Step 2.4: Story-Based Task Reconciliation
197
-
198
- **Task Status Assessment Across Stories:**
199
- - Review each story file for task status and relevance
200
- - Identify completed tasks within stories that remain valid
201
- - Flag tasks requiring rework due to changes
202
- - Add new tasks while maintaining 5-7 task limit per story
203
- - Split stories if task count would exceed 7 tasks
204
- - Combine stories if task counts become too small
205
- - Reorder stories if dependencies changed
206
-
207
- **Story-Level Task Annotations:**
208
- ```markdown
209
- # In story-1-user-auth.md:
210
- - [x] 1.1 Write tests for user authentication ✅ (Still valid)
211
- - [ ] 1.2 Implement OAuth provider ⚠️ (Needs modification)
212
- - [ ] 1.3 Create social login UI 🆕 (New task from scope change)
213
- - [~~] 1.4 Implement mobile-specific auth ❌ (Moved to new story-4-mobile-auth.md)
214
- ```
215
-
216
- **Story Management:**
217
- - **Split large stories**: If modifications would create >7 tasks, create additional story files
218
- - **Archive obsolete stories**: Move removed stories to archived/ subfolder with timestamp
219
- - **Update story dependencies**: Modify README.md to reflect new story relationships
220
- - **Maintain story cohesion**: Ensure each story delivers standalone user value
221
-
222
- #### Step 2.5: Final Update Review & Validation
223
-
224
- Present updated package:
225
- ```
226
- ✅ Specification successfully updated!
227
-
228
- 📁 .code-captain/specs/[DATE]-feature-name/
229
- ├── 📋 spec.md - ⭐ Updated specification
230
- ├── 👥 user-stories/ - ⭐ Updated story organization
231
- │ ├── 📊 README.md - ⭐ Updated progress tracking
232
- │ └── 📝 story-N-{name}.md - ⭐ Modified stories (5-7 tasks each)
233
- ├── 📂 sub-specs/ - ⭐ Updated technical specifications
234
- ├── 💾 backups/[timestamp]/ - Original files preserved
235
- └── 📝 CHANGELOG.md - ⭐ Change documentation
236
-
237
- **Changes:** [X] stories modified, [Y] added, [Z] archived | **Tasks:** [N] total (max 5-7 per story)
238
-
239
- Please review: Does this accurately reflect the agreed modifications? Should any stories be split/combined?
240
-
241
- Original version backed up. Can help with rollback if needed.
242
- ```
243
-
244
- #### Step 2.6: Create Memory of Specification Changes (Optional)
245
- After successful spec update, ask Cascade:
246
- "Please create a memory of these specification changes: [brief summary of modifications and their impact on the feature]"
247
-
248
- ## Key Features
249
-
250
- **Safe Modification:** Backup creation, change tracking, rollback capability, impact assessment
251
-
252
- **Precise Control:** Focused clarification, risk assessment, migration strategy, selective updates
253
-
254
- **Implementation Continuity:** Task status preservation, clear rework annotation, timeline impact analysis
255
-
256
- **Change Documentation:** Detailed logs, comparison capability, rationale capture, rollback instructions
257
-
258
- ## Windsurf Tools Used
259
-
260
- - `find_by_name`: Locate existing specifications and story files
261
- - `list_dir`: Explore specification directories and folder structures
262
- - `view_file`: Read current specification content and story files
263
- - `write_to_file`: Update specification documents and create backups
264
- - `codebase_search`: Analyze implementation progress and conflicts
265
- - `run_command`: Get timestamps for backup folder naming
266
-
267
- ## Windsurf Features Used
268
-
269
- - **Memories**: After completion, optionally create memory of specification changes and their rationale
270
-
271
- ---
272
-
273
- *📝 Safe evolution keeps specifications valuable. Change with intention, preserve with care.*
@@ -1,276 +0,0 @@
1
- ---
2
- description: Execute specific tasks systematically following Test-Driven Development workflow with comprehensive testing
3
- ---
4
-
5
- # Execute Task Workflow
6
-
7
- ## Overview
8
- Execute specific tasks and sub-tasks systematically following a Test-Driven Development (TDD) workflow. Reads task specifications from `.code-captain/specs/` directories and implements features with comprehensive testing, following established code standards and best practices.
9
-
10
- ## CRITICAL REQUIREMENT: 100% Test Pass Rate
11
-
12
- **⚠️ ZERO TOLERANCE FOR FAILING TESTS ⚠️**
13
-
14
- This workflow enforces strict test validation:
15
- - **NO story can be marked "COMPLETED" with ANY failing tests**
16
- - **100% test pass rate is MANDATORY before completion**
17
- - **"Edge case" or "minor" test failures are NOT acceptable**
18
- - **Implementation is considered incomplete until all tests pass**
19
-
20
- If tests fail, the story remains "IN PROGRESS" until all failures are resolved.
21
-
22
- ## Command Process
23
-
24
- ### Step 1: Task Discovery & Selection
25
-
26
- **Scan for available specifications:**
27
-
28
- - Use `find_by_name` to search `.code-captain/specs/` for dated specification folders
29
- - Use `view_file` to load user stories from `user-stories/` folders in each spec
30
- - Use `view_file` to read `user-stories/README.md` for story overview and progress
31
- - Use `view_file` to parse individual `story-N-{name}.md` files for available tasks
32
- - Present available stories and tasks organized by specification
33
-
34
- **Story selection process:**
35
-
36
- 1. **If multiple specs exist**: Present selection menu with spec dates and story summaries
37
- 2. **If single spec exists**: Show available stories and their tasks within that specification
38
- 3. **If story/task specified**: Validate story exists and select specific task for execution
39
- 4. **If no specs exist**: Guide user to run create-spec workflow first
40
-
41
- **Selection format:**
42
- ```
43
- Available specifications:
44
- ├── 2024-01-15-user-auth/ (3 stories, 12 total tasks)
45
- │ ├── Story 1: User Registration (5 tasks) - Not Started
46
- │ ├── Story 2: User Login (4 tasks) - Not Started
47
- │ └── Story 3: Password Reset (3 tasks) - Not Started
48
- └── 2024-01-20-payment-system/ (2 stories, 8 total tasks)
49
- ├── Story 1: Payment Processing (5 tasks) - In Progress (2/5)
50
- └── Story 2: Refund Management (3 tasks) - Not Started
51
- ```
52
-
53
- ### Step 2: Context Gathering & Analysis
54
-
55
- **Load specification context:**
56
-
57
- - Use `view_file` to read primary spec document: `spec.md`
58
- - Use `view_file` to load user stories overview: `user-stories/README.md`
59
- - Use `view_file` to read selected story file: `user-stories/story-N-{name}.md`
60
- - Use `view_file` to review technical specifications: `sub-specs/technical-spec.md`
61
- - Parse task breakdown from individual story file
62
-
63
- **Analyze current codebase:**
64
-
65
- Use `codebase_search` to understand:
66
- - Current architecture and patterns
67
- - Related existing functionality
68
- - Integration points for new features
69
- - Testing frameworks and conventions
70
-
71
- **Load project standards:**
72
- - Code style guide: `.code-captain/docs/code-style.md`
73
- - Technology stack: `.code-captain/docs/tech-stack.md`
74
- - Best practices: `.code-captain/docs/best-practices.md`
75
-
76
- ### Step 3: Story & Task Analysis
77
-
78
- **Parse selected story structure:**
79
-
80
- - Use `view_file` to load complete story file: `user-stories/story-N-{name}.md`
81
- - Extract user story, acceptance criteria, and implementation tasks
82
- - Analyze task dependencies and execution order within the story
83
- - Understand test requirements (first task typically writes tests)
84
- - Plan implementation approach based on story's task breakdown
85
-
86
- **Validate TDD approach within story:**
87
-
88
- - **First task**: Should write tests for the story functionality
89
- - **Middle tasks**: Implement functionality to pass tests (max 5-7 tasks total)
90
- - **Final task**: Verify all tests pass and acceptance criteria are met
91
- - **Integration considerations**: Update adjacent/related tests as needed
92
-
93
- **Story structure:** User story → Acceptance criteria → Implementation tasks (max 5-7 tasks, first task writes tests, final task verifies 100% pass rate)
94
-
95
- ### Step 4: Pre-Implementation Preparation
96
-
97
- **Validate testing setup:**
98
- - Use `codebase_search` to confirm testing framework is configured
99
- - Use `find_by_name` to verify test directories and naming conventions
100
- - Use `view_file` to check existing test patterns and utilities
101
- - Use `run_command` to ensure test runner is functional
102
-
103
- ### Step 5: Story Task Execution (TDD Workflow)
104
-
105
- **Execute story tasks in sequential order:**
106
-
107
- #### Task 1: Write Tests (Test-First Approach)
108
-
109
- **Actions:**
110
- - Write comprehensive test cases for the entire feature using `write_to_file`
111
- - Include unit tests, integration tests, and edge cases
112
- - Cover happy path, error conditions, and boundary cases
113
- - Ensure tests fail appropriately (red phase)
114
-
115
- **Test categories to include:**
116
- - **Unit tests**: Individual function/method testing
117
- - **Integration tests**: Component interaction testing
118
- - **Edge cases**: Boundary conditions and error scenarios
119
- - **Acceptance tests**: User story validation
120
-
121
- #### Tasks 2-N: Implementation (Green Phase)
122
-
123
- **For each implementation task within the story:**
124
-
125
- 1. **Focus on specific functionality**: Implement only what's needed for current task
126
- 2. **Make tests pass**: Write minimal code to satisfy failing tests using `replace_file_content`
127
- 3. **Update related tests**: Modify adjacent tests if behavior changes
128
- 4. **Maintain compatibility**: Ensure no regressions in existing functionality
129
- 5. **Refactor when green**: Improve code quality while tests remain passing
130
-
131
- **Implementation approach:**
132
- - Start with simplest implementation that passes tests
133
- - Add complexity incrementally as required by test cases
134
- - Keep tests passing at each step using `run_command` to verify
135
- - Refactor for clarity and maintainability
136
-
137
- #### Final Task: Test & Acceptance Verification
138
-
139
- **CRITICAL: 100% Test Pass Rate Required**
140
-
141
- **Mandatory Actions (ALL must succeed before story completion):**
142
-
143
- 1. **Run complete test suite for this story** using `run_command`
144
- 2. **Achieve 100% pass rate for ALL tests** - NO EXCEPTIONS
145
- 3. **Verify no regressions in existing test suites**
146
- 4. **Validate all acceptance criteria are met for the user story**
147
- 5. **Confirm story delivers the specified user value**
148
-
149
- **⚠️ STORY CANNOT BE MARKED COMPLETE WITH ANY FAILING TESTS ⚠️**
150
-
151
- If ANY tests fail:
152
- - **STOP IMMEDIATELY** - Do not mark story as complete
153
- - Debug and fix each failing test
154
- - Re-run test suite until 100% pass rate achieved
155
- - Only then proceed to mark story as complete
156
-
157
- ### Step 6: Story-Specific Test Validation
158
-
159
- **Run targeted test validation:**
160
-
161
- Use `run_command` to verify:
162
- - All tests written in first task are passing
163
- - New functionality works as specified in user story
164
- - All acceptance criteria are satisfied
165
- - No regressions introduced to existing features
166
- - Performance requirements are met (if specified)
167
-
168
- **Test execution strategy:**
169
- - **First**: Run only tests for current story/feature
170
- - **Then**: Run related test suites to check for regressions
171
- - **Finally**: Consider full test suite if significant changes made
172
- - **Acceptance**: Validate user story acceptance criteria are met
173
-
174
- **Failure handling:**
175
-
176
- **ZERO TOLERANCE FOR FAILING TESTS:**
177
- - **If ANY tests fail**: Story CANNOT be marked complete
178
- - **Required action**: Debug and fix ALL failing tests before proceeding
179
- - **No exceptions**: "Edge case" or "minor" failing tests are NOT acceptable
180
- - **If performance issues**: Optimize implementation until all tests pass
181
- - **If regressions found**: Fix regressions - story completion is blocked until resolved
182
-
183
- **Failure Resolution Process:**
184
- 1. Identify root cause of each failing test
185
- 2. Fix implementation to make test pass using `replace_file_content`
186
- 3. Re-run ALL tests using `run_command` to ensure 100% pass rate
187
- 4. Repeat until NO tests fail
188
- 5. Only then mark story as complete
189
-
190
- ### Step 7: Story Completion & Status Updates
191
-
192
- **Update story file status:**
193
-
194
- Use `replace_file_content` to mark completed tasks in story file:
195
- - Change status from "Not Started" to "Completed ✅"
196
- - Mark all tasks as [x] with ✅
197
- - Mark all acceptance criteria as [x] with ✅
198
- - Update Definition of Done with **ALL tests passing (100% pass rate)** ✅ **MANDATORY**
199
- - Add note: "Story CANNOT be marked complete without 100% test pass rate"
200
-
201
- **Update stories overview:**
202
-
203
- Use `replace_file_content` to update progress tracking in `user-stories/README.md`:
204
-
205
- ```markdown
206
- | Story | Title | Status | Tasks | Progress |
207
- |-------|-------|--------|-------|----------|
208
- | 1 | User Authentication | Completed ✅ | 5 | 5/5 ✅ |
209
- | 2 | Password Reset | Not Started | 4 | 0/4 |
210
- | 3 | Profile Management | Not Started | 6 | 0/6 |
211
-
212
- **Total Progress:** 5/15 tasks (33%)
213
- ```
214
-
215
- **Document completion:**
216
- - Update spec status if all stories in the specification are complete
217
- - Note any deviations from original plan in story notes
218
- - Document lessons learned or improvements made
219
- - Identify any follow-up tasks or technical debt
220
-
221
- **Present completion summary:**
222
-
223
- **If ALL tests pass (100%):** "Story completed successfully: [Story name] - Tasks: X/X ✅ - Tests: X/X (100%) ✅ - Next stories available"
224
-
225
- **If ANY tests fail:** "Story INCOMPLETE - Tests failing: [Story name] - Tests: X/Y (Z%) ❌ COMPLETION BLOCKED - Must fix all failing tests before completion"
226
-
227
- ### Step 8: Create Memory of Completed Story (Optional)
228
- After successful story completion, ask Cascade:
229
- "Please create a memory of this completed story: [story name and key implementation approach, noting 100% test pass achievement]"
230
-
231
- ## Integration with Code Captain Ecosystem
232
-
233
- **Specification dependency:**
234
- - Requires existing spec created by create-spec workflow
235
- - Uses story breakdown from `user-stories/` folder in spec directories
236
- - Loads individual story files: `user-stories/story-N-{name}.md`
237
- - Tracks progress in `user-stories/README.md`
238
- - Follows technical approach from `sub-specs/technical-spec.md`
239
-
240
- **Code style compliance:**
241
- - Adheres to patterns in `.code-captain/docs/code-style.md`
242
- - Uses technology stack from `.code-captain/docs/tech-stack.md`
243
- - Follows best practices from `.code-captain/docs/best-practices.md`
244
-
245
- ## Quality Standards
246
-
247
- **TDD:** Tests before implementation, **100% pass rate MANDATORY**, ZERO TOLERANCE for failures, comprehensive coverage, regression testing, failed tests = incomplete implementation.
248
-
249
- **Code quality:** Follow project patterns, maintain compatibility, proper error handling, appropriate logging.
250
-
251
- ## Error Handling & Best Practices
252
-
253
- **Common failures:** No specs (→ create-spec), test framework issues (→ setup guidance), implementation conflicts (→ resolution strategies), performance issues (→ optimization)
254
-
255
- **Blocking issues:** Document as `⚠️ Blocking issue: [DESCRIPTION]` in story notes. Try alternatives, research solutions, break down tasks. Max 3 attempts before escalating.
256
-
257
- **TDD adherence:** Start with failing tests, minimal code to pass, refactor when green. **MANDATORY: 100% test pass rate before completion. NO EXCEPTIONS.**
258
-
259
- **Development:** Sequential tasks, verify each step with `run_command`, test early, validate incrementally, update status immediately, document decisions.
260
-
261
- ## Windsurf Tools Used
262
-
263
- - `find_by_name`: Locate specifications, story files, and test directories
264
- - `view_file`: Read specification documents, story files, and existing code
265
- - `write_to_file`: Create test files and new implementation files
266
- - `replace_file_content`: Update existing code and story status files
267
- - `codebase_search`: Understand current architecture and patterns
268
- - `run_command`: Execute tests, verify functionality, and run build processes
269
-
270
- ## Windsurf Features Used
271
-
272
- - **Memories**: After completion, optionally create memory of completed story and implementation approach
273
-
274
- ---
275
-
276
- *🧪 Tests first, code second, success always. No compromises on quality.*