@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,405 @@
1
+ # Enhanced Edit Spec Command (cc: edit-spec)
2
+
3
+ ## Overview
4
+
5
+ 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.
6
+
7
+ ## Usage
8
+
9
+ ```bash
10
+ cc: edit-spec [spec-identifier] "proposed changes description"
11
+ ```
12
+
13
+ **Examples:**
14
+ ```bash
15
+ cc: edit-spec "user-authentication" "add social login options"
16
+ cc: edit-spec "2024-01-15-payment-gateway" "change from Stripe to PayPal"
17
+ cc: edit-spec "latest" "remove the mobile app requirement"
18
+ ```
19
+
20
+ ## Command Process
21
+
22
+ ### Phase 1: Specification Loading & Change Contract (No File Modifications)
23
+
24
+ **Mission Statement:**
25
+ > 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.**
26
+
27
+ #### Step 1.1: Specification Discovery & Loading
28
+
29
+ **Locate Target Specification:**
30
+ 1. **SCAN** `.code-captain/specs/` directory for all existing specifications
31
+ 2. **IF** spec-identifier provided:
32
+ - **SEARCH** for exact folder name match: `[DATE]-{spec-identifier}`
33
+ - **SEARCH** for partial name match in folder names
34
+ - **SEARCH** for identifier in spec.md titles/content
35
+ 3. **IF** spec-identifier is "latest":
36
+ - **FIND** most recent folder by date prefix
37
+ 4. **IF** no spec-identifier provided:
38
+ - **LIST** all available specifications for user selection
39
+ 5. **IF** multiple matches found:
40
+ - **PRESENT** options for user disambiguation
41
+
42
+ **Load Current State:**
43
+ 1. **READ** primary specification file (`spec.md`)
44
+ 2. **READ** user stories overview (`user-stories/README.md`)
45
+ 3. **READ** all individual story files in `user-stories/` directory
46
+ 4. **READ** all sub-specifications in `sub-specs/` directory
47
+ 5. **SCAN** codebase for any implementation progress related to this spec
48
+ 6. **OUTPUT:** Current specification summary with story status (no modifications yet)
49
+
50
+ #### Step 1.2: Impact Analysis & Change Assessment
51
+
52
+ **Internal Process (not shown to user):**
53
+ - Analyze proposed changes against current specification
54
+ - Identify affected individual story files and task groups
55
+ - Note potential ripple effects on:
56
+ - Existing implementation (if any)
57
+ - Specific user story files in user-stories/ folder
58
+ - Story dependencies and sequencing
59
+ - Technical architecture
60
+ - Acceptance criteria within affected stories
61
+ - Project timelines and story priorities
62
+ - Catalog modification domains:
63
+ - Scope changes (adding/removing/splitting stories)
64
+ - Technical approach modifications
65
+ - Individual story adjustments or combinations
66
+ - Task group reorganization (keeping 5-7 tasks max)
67
+ - Performance/security requirement changes
68
+ - Integration point modifications
69
+ - Success criteria updates within stories
70
+
71
+ #### Step 1.3: Change Clarification Loop
72
+
73
+ **Rules:**
74
+ - Ask ONE focused question at a time about the proposed changes
75
+ - After each answer, re-analyze the existing spec and codebase for new context
76
+ - Continue until reaching 95% confidence on modification impact
77
+ - Each question should target the highest-impact unknown or risk
78
+ - **Never declare "final question"** - let the conversation flow naturally
79
+ - **Challenge changes that could break existing functionality or create technical debt**
80
+
81
+ **Critical Analysis Responsibility:**
82
+ - If proposed changes conflict with existing implementation, explain impact and suggest migration strategies
83
+ - If scope changes affect other dependent specifications, identify and discuss dependencies
84
+ - If modifications introduce technical complexity, assess if benefits justify the cost
85
+ - If changes affect user stories that may already be in progress, surface timeline implications
86
+ - If proposed changes contradict original business value, question the modification rationale
87
+
88
+ **Risk Assessment Categories:**
89
+ - **Breaking Changes**: Will this break existing functionality?
90
+ - **Implementation Impact**: How much existing work needs to be modified/discarded?
91
+ - **Architecture Consistency**: Do changes align with existing patterns?
92
+ - **Scope Creep**: Are we expanding beyond the original contract boundaries?
93
+ - **Business Value**: Do changes improve or compromise original user value?
94
+
95
+ **Question Categories (examples):**
96
+ - "This change would affect [existing user story]. Should we modify that story or create a new one?"
97
+ - "I see this conflicts with [existing implementation]. Should we plan a migration strategy?"
98
+ - "This modification increases complexity in [area]. Is the added value worth the technical cost?"
99
+ - "The original spec was focused on [goal]. How does this change serve that same goal?"
100
+ - "This would require changes to [dependent system]. Have you considered the downstream impact?"
101
+
102
+ #### Step 1.4: Modification Contract Proposal
103
+
104
+ When confident about changes, present a modification contract:
105
+
106
+ **Format:**
107
+ ```
108
+ ## Modification Contract
109
+
110
+ **Target Specification:** [Specification name and date]
111
+
112
+ **Proposed Changes:** [Clear description of what will be modified]
113
+
114
+ **Change Type:** [Addition/Removal/Modification/Refactor]
115
+
116
+ **Impact Assessment:**
117
+ - **Story Files Affected:** [List of specific story-N-{name}.md files that need changes]
118
+ - **New Stories Required:** [Any additional story files to be created]
119
+ - **Stories to Remove/Combine:** [Any story files that become obsolete]
120
+ - **Task Groups Affected:** [Which task groups within stories need modification]
121
+ - **Technical Components Affected:** [Code/architecture areas needing updates]
122
+ - **Implementation Status:** [How much existing work across stories is affected]
123
+
124
+ **Migration Strategy:**
125
+ - [How to handle existing implementation]
126
+ - [Steps to preserve completed work]
127
+ - [Rollback plan if needed]
128
+
129
+ **Updated Success Criteria:** [How success metrics change]
130
+
131
+ **Revised Scope Boundaries:**
132
+ - **Still In Scope:** [What remains from original]
133
+ - **Now In Scope:** [What gets added]
134
+ - **Removed From Scope:** [What gets removed]
135
+ - **Still Out of Scope:** [Unchanged exclusions]
136
+
137
+ **⚠️ Risks & Concerns:**
138
+ - [Specific technical or business risks from the changes]
139
+ - [Potential complications or dependencies]
140
+
141
+ **💡 Recommendations:**
142
+ - [Suggestions for safer implementation approaches]
143
+ - [Ways to minimize disruption to existing work]
144
+
145
+ **Effort Estimate:** [How much additional/changed work is involved]
146
+
147
+ ---
148
+ Options:
149
+ - Type 'yes' to lock this modification contract and update the specification
150
+ - Type 'edit: [your changes]' to modify the contract
151
+ - Type 'compare' to see a detailed before/after comparison
152
+ - Type 'risks' to explore implementation risks in detail
153
+ - Type 'rollback' to understand how to undo these changes later
154
+ - Ask more questions if anything needs clarification
155
+ ```
156
+
157
+ ### Phase 2: Specification Update (Post-Agreement Only)
158
+
159
+ **Triggered only after user confirms modification contract with 'yes'**
160
+
161
+ #### Step 2.1: Initialize Modification Tracking
162
+ ```bash
163
+ # Use todo_write to track modification process
164
+ 1. Backup original specification files and user-stories folder
165
+ 2. Update core specification document
166
+ 3. Modify affected individual story files in user-stories/
167
+ 4. Update user-stories/README.md with new progress tracking
168
+ 5. Create/remove/combine story files as needed
169
+ 6. Update technical sub-specifications
170
+ 7. Adjust task groups within stories (maintain 5-7 tasks max)
171
+ 8. Create change log entry
172
+ 9. Present updated package for validation
173
+ ```
174
+
175
+ #### Step 2.2: Create Backup & Change Documentation
176
+
177
+ **Backup Process:**
178
+ 1. **CREATE** backup folder: `.code-captain/specs/[spec-folder]/backups/`
179
+ 2. **COPY** all current files to `backups/[timestamp]/`
180
+ 3. **CREATE** change log entry in `CHANGELOG.md` within spec folder
181
+
182
+ **Change Log Format:**
183
+ ```markdown
184
+ # Specification Change Log
185
+
186
+ ## [Date] - [Change Type]
187
+ **Modified by:** [User identifier or "Manual edit"]
188
+ **Modification Contract:** [Brief summary]
189
+
190
+ ### Changes Made:
191
+ - [Specific change 1]
192
+ - [Specific change 2]
193
+
194
+ ### Files Updated:
195
+ - spec.md - [what changed]
196
+ - user-stories/README.md - [progress tracking updates]
197
+ - user-stories/story-N-{name}.md - [specific story changes]
198
+ - sub-specs/[file] - [what changed]
199
+
200
+ ### Backup Location:
201
+ `backups/[timestamp]/`
202
+
203
+ ---
204
+ ```
205
+
206
+ #### Step 2.3: Update Core Specification Files
207
+
208
+ **spec.md Updates:**
209
+ - Modify contract summary to reflect new agreement
210
+ - Update detailed requirements based on clarification
211
+ - Revise implementation approach if changed
212
+ - Add change log reference
213
+ - Update status if appropriate
214
+
215
+ **user-stories/ folder Updates:**
216
+ - **README.md**: Update progress tracking table and story dependencies
217
+ - **Individual story files**: Modify affected story-N-{name}.md files
218
+ - **Story additions**: Create new story files with focused task groups (5-7 tasks max)
219
+ - **Story combinations**: Merge related stories if they become too granular
220
+ - **Story removals**: Archive or delete story files no longer needed
221
+ - **Task reorganization**: Ensure task groups within stories remain manageable
222
+ - **Status updates**: Mark completed tasks that might need rework across all stories
223
+
224
+ #### Step 2.4: Update Technical Sub-Specifications
225
+
226
+ **Selective Updates:**
227
+ - Only update sub-specs affected by the changes
228
+ - Create new sub-specs if new technical areas introduced
229
+ - Archive sub-specs no longer relevant
230
+ - Update cross-references between documents
231
+
232
+ #### Step 2.5: Story-Based Task Reconciliation
233
+
234
+ **Task Status Assessment Across Stories:**
235
+ - **Review each story file** for task status and relevance
236
+ - **Identify completed tasks** within stories that remain valid
237
+ - **Flag tasks requiring rework** due to changes
238
+ - **Add new tasks** while maintaining 5-7 task limit per story
239
+ - **Split stories** if task count would exceed 7 tasks
240
+ - **Combine stories** if task counts become too small
241
+ - **Reorder stories** if dependencies changed
242
+
243
+ **Story-Level Task Annotations:**
244
+ ```markdown
245
+ # In story-1-user-auth.md:
246
+ - [x] 1.1 Write tests for user authentication ✅ (Still valid)
247
+ - [ ] 1.2 Implement OAuth provider ⚠️ (Needs modification)
248
+ - [ ] 1.3 Create social login UI 🆕 (New task from scope change)
249
+ - [~~] 1.4 Implement mobile-specific auth ❌ (Moved to new story-4-mobile-auth.md)
250
+
251
+ # New story-4-mobile-auth.md created if mobile auth becomes separate feature
252
+ ```
253
+
254
+ **Story Management:**
255
+ - **Split large stories**: If modifications would create >7 tasks, create additional story files
256
+ - **Archive obsolete stories**: Move removed stories to archived/ subfolder with timestamp
257
+ - **Update story dependencies**: Modify README.md to reflect new story relationships
258
+ - **Maintain story cohesion**: Ensure each story delivers standalone user value
259
+
260
+ #### Step 2.6: Final Update Review & Validation
261
+
262
+ Present updated package with change summary:
263
+ ```
264
+ ✅ Specification successfully updated!
265
+
266
+ 📁 .code-captain/specs/[DATE]-feature-name/
267
+ ├── 📋 spec.md - ⭐ Updated specification
268
+ ├── 📝 spec-lite.md - ⭐ Updated AI context summary
269
+ ├── 👥 user-stories/ - ⭐ Updated story organization
270
+ │ ├── 📊 README.md - ⭐ Updated progress tracking and dependencies
271
+ │ ├── 📝 story-1-{name}.md - ⭐ Modified stories (5-7 tasks each)
272
+ │ ├── 📝 story-2-{name}.md - 🆕 New stories or combinations
273
+ │ ├── 📂 archived/ - 🗃️ Obsolete stories (if any)
274
+ │ └── 📝 story-N-{name}.md - ⭐ Focused task groups
275
+ ├── 📂 sub-specs/
276
+ │ ├── 🔧 technical-spec.md - ⭐ Updated if affected
277
+ │ └── [other sub-specs...]
278
+ ├── 💾 backups/[timestamp]/ - Original files and stories preserved
279
+ └── 📝 CHANGELOG.md - ⭐ Change documentation
280
+
281
+ ## Summary of Changes:
282
+ - **Stories Modified:** [X] existing story files updated
283
+ - **Stories Added:** [Y] new story files created
284
+ - **Stories Removed/Archived:** [Z] story files no longer needed
285
+ - **Task Groups Affected:** [N] task groups reorganized
286
+ - **Modified Components:** [List of changed technical components]
287
+
288
+ ## Impact on Implementation:
289
+ - **Stories Still Valid:** [X] out of [Y] stories remain unchanged
290
+ - **Stories Requiring Rework:** [N] stories need modification
291
+ - **New Stories Added:** [N] new stories created (with focused task groups)
292
+ - **Stories Archived:** [N] stories no longer needed
293
+ - **Total Tasks:** [N] tasks across all stories (max 5-7 per story)
294
+
295
+ Please review the updated specification:
296
+ - Does this accurately reflect the agreed modifications?
297
+ - Are the user stories appropriately organized (5-7 tasks per story)?
298
+ - Should any stories be further split or combined?
299
+ - Are story dependencies correctly updated in the README?
300
+ - Should any additional changes be made?
301
+
302
+ The updated user-stories folder structure provides:
303
+ - **Focused development**: Work on one story at a time
304
+ - **Better organization**: Each story file is manageable and self-contained
305
+ - **Team collaboration**: Different stories can be assigned to different developers
306
+ - **Clear progress tracking**: README overview shows status across all stories
307
+ - **Flexible workflow**: Stories can be completed independently where possible
308
+
309
+ The original version is safely backed up in the backups folder. If you need to rollback any changes, I can help restore from backup.
310
+ ```
311
+
312
+ ## Key Features
313
+
314
+ ### 1. Safe Modification Process
315
+ - **Backup creation** before any changes
316
+ - **Change tracking** with detailed logs
317
+ - **Rollback capability** to restore previous versions
318
+ - **Impact assessment** before making changes
319
+
320
+ ### 2. Precise Change Control
321
+ - **Focused clarification** about specific modifications
322
+ - **Risk assessment** for breaking changes
323
+ - **Migration strategy** for existing implementation
324
+ - **Selective updates** only to affected components
325
+
326
+ ### 3. Implementation Continuity
327
+ - **Task status preservation** for completed work
328
+ - **Clear annotation** of what needs rework
329
+ - **Priority reassessment** based on changes
330
+ - **Timeline impact** analysis
331
+
332
+ ### 4. Change Documentation
333
+ - **Detailed change logs** for audit trail
334
+ - **Before/after comparison** capability
335
+ - **Modification rationale** capture
336
+ - **Rollback instructions** for safety
337
+
338
+ ## Example Usage Flow
339
+
340
+ ```
341
+ Developer: cc: edit-spec "user-auth" "add biometric authentication"
342
+
343
+ Agent: I found your user authentication specification from 2024-01-15. Let me load the current state...
344
+
345
+ [Loads spec.md, tasks.md, and sub-specs]
346
+
347
+ Current specification includes email/password auth with OAuth social login. I see there are 8 user stories, with 3 already implemented in your codebase.
348
+
349
+ 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.
350
+
351
+ 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?
352
+
353
+ Developer: WebAuthn for browser-based
354
+
355
+ 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.
356
+
357
+ 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)?
358
+
359
+ Developer: Optional enhancement for supported browsers
360
+
361
+ Agent: [Continues with more questions about UX, fallback behavior, etc.]
362
+
363
+ ## Modification Contract
364
+
365
+ **Target Specification:** User Authentication System (2024-01-15)
366
+
367
+ **Proposed Changes:** Add WebAuthn biometric authentication as optional enhancement
368
+
369
+ **Change Type:** Addition (with graceful degradation)
370
+
371
+ **Impact Assessment:**
372
+ - **User Stories Affected:** Story 2 (Login flow) needs biometric option
373
+ - **Technical Components Affected:** Frontend auth component, browser capability detection
374
+ - **Implementation Status:** 3/8 stories completed, none affected by this change
375
+
376
+ **Migration Strategy:**
377
+ - Existing auth flows remain unchanged
378
+ - Add biometric as progressive enhancement
379
+ - No breaking changes to current implementation
380
+
381
+ **Updated Success Criteria:** Users can log in with biometrics on supported browsers, fallback to existing methods
382
+
383
+ **⚠️ Risks & Concerns:**
384
+ - Browser support varies (Chrome 67+, Firefox 60+, Safari 14+)
385
+ - Requires HTTPS in production
386
+ - UX complexity for unsupported browsers
387
+
388
+ **💡 Recommendations:**
389
+ - Feature detection before offering biometric option
390
+ - Clear messaging when biometric unavailable
391
+ - Analytics to track adoption rates
392
+
393
+ **Effort Estimate:** ~2-3 additional days (1 story addition, modest technical complexity)
394
+
395
+ ---
396
+ Options: [yes/edit/compare/risks/rollback]
397
+
398
+ Developer: yes
399
+
400
+ Agent: ✅ Modification contract locked! Updating specification...
401
+
402
+ [Updates files, creates backups, documents changes]
403
+ ```
404
+
405
+ 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.