@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,430 @@
1
+ ---
2
+ mode: agent
3
+ ---
4
+
5
+ # Create Spec Command
6
+
7
+ ## Overview
8
+
9
+ Generate comprehensive feature specifications using a contract-first approach that ensures complete alignment between developer and AI before creating any supporting files. This command eliminates presumptuous file creation by establishing a clear "contract" through structured clarification rounds.
10
+
11
+ ## Command Process
12
+
13
+ ### Phase 1: Contract Establishment (No File Creation)
14
+
15
+ **Mission Statement:**
16
+ > Your goal is to turn my rough feature idea into a very clear work specification. You will deliver the complete spec package only after we both agree on the requirements contract. **Important: Challenge ideas that don't make technical or business sense - it's better to surface concerns early than build the wrong thing.**
17
+
18
+ #### Step 1.1: Initial Context Scan
19
+ - Scan existing `.code-captain/specs/` for related specifications
20
+ - Analyze current codebase architecture and patterns using `codebase`
21
+ - Load project context files (`tech-stack.md`, `code-style.md`, `objective.md`)
22
+ - **Output:** Context summary (no files created yet)
23
+
24
+ #### Step 1.2: Gap Analysis & Silent Enumeration
25
+ **Internal Process (not shown to user):**
26
+ - Silently list every missing fact, constraint, or requirement
27
+ - Identify ambiguities in the initial description
28
+ - Note potential integration points and dependencies
29
+ - Catalog unknowns across these domains:
30
+ - Purpose & business value
31
+ - Target audience & user personas
32
+ - Technical constraints & requirements
33
+ - Success criteria & acceptance tests
34
+ - Scope boundaries (in/out of scope)
35
+ - UI/UX requirements & design constraints
36
+ - Performance & scalability needs
37
+ - Security & compliance requirements
38
+ - Integration points with existing systems
39
+ - Risk tolerance & implementation approach
40
+
41
+ #### Step 1.3: Structured Clarification Loop
42
+ **Rules:**
43
+ - Ask ONE focused question at a time
44
+ - After each answer, re-scan codebase for new context if relevant
45
+ - Continue until reaching 95% confidence on deliverable
46
+ - Each question should target the highest-impact unknown
47
+ - **Never declare "final question"** - let the conversation flow naturally
48
+ - Let the user signal when they're ready to lock the contract
49
+ - **Challenge ideas that don't make technical or business sense** - better to surface concerns early than build the wrong thing
50
+
51
+ **Critical Analysis Responsibility:**
52
+ - If requirements seem technically infeasible with current architecture, explain why and suggest alternatives
53
+ - If scope seems too large for a single feature, recommend breaking it down
54
+ - If user requests conflict with existing patterns found in codebase, point out the inconsistency
55
+ - If business logic doesn't align with stated user value, ask clarifying questions
56
+ - If performance/security/scalability concerns arise, surface them proactively
57
+
58
+ **Pushback Phrasing Examples:**
59
+ - "I see a potential issue with [requirement] because [technical reason]. Would [alternative approach] work better?"
60
+ - "Based on your existing codebase, [proposed approach] might conflict with [existing pattern]. How should we handle this?"
61
+ - "The scope you're describing sounds like it might be 3-4 separate features. Should we focus on [core piece] first?"
62
+ - "I'm concerned that [requirement] could create [specific problem]. Have you considered [alternative]?"
63
+
64
+ **Question Categories (examples):**
65
+ - "What specific user problem does this solve, and who experiences it?"
66
+ - "Should this integrate with [existing system found in codebase], or remain separate?"
67
+ - "What does 'success' look like - how will we measure if this works?"
68
+ - "Are there performance requirements (response time, throughput, scale)?"
69
+ - "What UI/UX constraints exist - web only, mobile responsive, accessibility needs?"
70
+ - "What's your risk tolerance - prefer stable/proven approaches or cutting-edge solutions?"
71
+
72
+ **Transition to Contract:**
73
+ - When confidence is high, present contract without declaring it "final"
74
+ - Use phrases like "I think I have enough to create a solid contract" or "Based on our discussion, here's what I understand"
75
+ - Always leave room for more questions if needed
76
+
77
+ #### Step 1.4: Echo Check (Contract Proposal)
78
+ When confident, present a contract proposal with any concerns surfaced:
79
+
80
+ **Format:**
81
+ ```
82
+ ## Specification Contract
83
+
84
+ **Deliverable:** [One clear sentence describing what will be built]
85
+
86
+ **Must Include:** [Critical requirement that makes this valuable]
87
+
88
+ **Hardest Constraint:** [Biggest technical/business limitation to navigate]
89
+
90
+ **Success Criteria:** [How we'll know it's working correctly]
91
+
92
+ **Scope Boundaries:**
93
+ - In Scope: [2-3 key features]
94
+ - Out of Scope: [2-3 things we won't build]
95
+
96
+ **⚠️ Technical Concerns (if any):**
97
+ - [Specific concern about feasibility, performance, or architecture]
98
+ - [Suggested alternative or mitigation approach]
99
+
100
+ **💡 Recommendations:**
101
+ - [Suggestions for improving the approach based on codebase analysis]
102
+ - [Ways to reduce risk or complexity]
103
+
104
+ ---
105
+ Options:
106
+ - Type 'yes' to lock this contract and create the spec package
107
+ - Type 'edit: [your changes]' to modify the contract
108
+ - Type 'risks' to explore potential implementation risks in detail
109
+ - Type 'blueprint' to see the planned folder structure and documents
110
+ - Ask more questions if anything needs clarification
111
+ ```
112
+
113
+ ### Phase 2: Spec Package Creation (Post-Agreement Only)
114
+
115
+ **Triggered only after user confirms contract with 'yes'**
116
+
117
+ #### Step 2.1: Determine Current Date
118
+ **Objective:** Get current date for folder naming and document timestamps
119
+
120
+ **Date Determination Process:**
121
+
122
+ 1. **CREATE** directory if not exists: `.code-captain/specs/`
123
+ 2. **CREATE** temporary file: `.code-captain/specs/.date-check`
124
+ 3. **READ** file creation timestamp from filesystem
125
+ 4. **EXTRACT** date in YYYY-MM-DD format
126
+ 5. **DELETE** temporary file
127
+ 6. **STORE** date in variable for folder naming
128
+
129
+ **Fallback Method:** If file system method fails:
130
+ 1. **STATE**: "I need to confirm today's date for the specification folder"
131
+ 2. **ASK**: "What is today's date? (YYYY-MM-DD format)"
132
+ 3. **WAIT** for user response
133
+ 4. **VALIDATE** format matches `^\d{4}-\d{2}-\d{2}$`
134
+ - year: 2024-2030
135
+ - month: 01-12
136
+ - day: 01-31
137
+ 5. **STORE** date for folder naming
138
+
139
+ **Error Handling:**
140
+ - **IF** date_invalid: USE fallback_method
141
+ - **IF** both_methods_fail: ERROR "Unable to determine current date"
142
+
143
+ #### Step 2.2: Create Directory Structure
144
+ **Generated folder (using determined date):**
145
+ ```
146
+ .code-captain/specs/[DATE]-{feature-name}/
147
+ ├── spec.md # Main specification (from contract)
148
+ ├── spec-lite.md # Condensed version for AI context
149
+ ├── user-stories/ # Individual user story files
150
+ │ ├── README.md # Overview and progress tracking
151
+ │ ├── story-1-{name}.md # Individual user story with focused tasks
152
+ │ ├── story-2-{name}.md # Each story kept small and manageable
153
+ │ └── story-N-{name}.md # Max 5-7 implementation tasks per story
154
+ └── sub-specs/ # Technical deep-dives
155
+ ├── technical-spec.md # Architecture & implementation details
156
+ ├── database-schema.md # Database changes (if needed)
157
+ ├── api-spec.md # API documentation (if needed)
158
+ └── ui-wireframes.md # UI/UX specifications (if needed)
159
+ ```
160
+
161
+ #### Step 2.3: Generate Core Documents
162
+
163
+ **spec.md** - Built directly from the locked contract:
164
+ ```markdown
165
+ # [Feature Name] Specification
166
+
167
+ > Created: [DATE from Step 2.1 determination process]
168
+ > Status: Planning
169
+ > Contract Locked: ✅
170
+
171
+ ## Contract Summary
172
+ [Echo check content verbatim]
173
+
174
+ ## Detailed Requirements
175
+ [Expanded from clarification responses]
176
+
177
+ ## Implementation Approach
178
+ [Technical strategy based on codebase analysis]
179
+ ```
180
+
181
+ **user-stories/ folder structure** - Individual user story files for better organization:
182
+
183
+ **user-stories/README.md** - Overview and progress tracking:
184
+ ```markdown
185
+ # User Stories Overview
186
+
187
+ > **Specification:** [Feature Name]
188
+ > **Created:** [DATE]
189
+ > **Status:** Planning
190
+
191
+ ## Stories Summary
192
+
193
+ | Story | Title | Status | Tasks | Progress |
194
+ |-------|-------|--------|-------|----------|
195
+ | 1 | [Story title] | Not Started | 5 | 0/5 |
196
+ | 2 | [Story title] | Not Started | 4 | 0/4 |
197
+ | 3 | [Story title] | Not Started | 6 | 0/6 |
198
+
199
+ **Total Progress:** 0/15 tasks (0%)
200
+
201
+ ## Story Dependencies
202
+ - Story 2 depends on Story 1 completion
203
+ - Story 3 can run parallel to Story 2
204
+
205
+ ## Quick Links
206
+ - [Story 1: User Login](./story-1-user-login.md)
207
+ - [Story 2: Password Reset](./story-2-password-reset.md)
208
+ - [Story 3: Profile Management](./story-3-profile-management.md)
209
+ ```
210
+
211
+ **user-stories/story-1-{name}.md** - Individual story files (max 5-7 tasks each):
212
+ ```markdown
213
+ # Story 1: [Title from contract deliverable]
214
+
215
+ > **Status:** Not Started
216
+ > **Priority:** High
217
+ > **Dependencies:** None
218
+
219
+ ## User Story
220
+ **As a** [user type from clarification]
221
+ **I want to** [action from contract]
222
+ **So that** [value from contract must-include]
223
+
224
+ ## Acceptance Criteria
225
+ - [ ] Given [context], when [action], then [outcome]
226
+ - [ ] Given [context], when [action], then [outcome]
227
+ - [ ] Given [context], when [action], then [outcome]
228
+
229
+ ## Implementation Tasks
230
+ - [ ] 1.1 Write tests for [specific component]
231
+ - [ ] 1.2 [Focused technical step]
232
+ - [ ] 1.3 [Focused technical step]
233
+ - [ ] 1.4 [Focused technical step]
234
+ - [ ] 1.5 Verify acceptance criteria are met
235
+ - [ ] 1.6 Verify all tests pass
236
+
237
+ ## Notes
238
+ [Any specific technical considerations, risks, or dependencies for this story]
239
+
240
+ ## Definition of Done
241
+ - [ ] All tasks completed
242
+ - [ ] All acceptance criteria met
243
+ - [ ] Tests passing
244
+ - [ ] Code reviewed
245
+ - [ ] Documentation updated
246
+ ```
247
+
248
+ #### Step 2.4: Generate Technical Sub-Specs
249
+
250
+ **Only create relevant sub-specs based on contract requirements:**
251
+
252
+ - **technical-spec.md**: Always created - architecture, patterns, dependencies
253
+ - **database-schema.md**: Only if database changes needed (determined during clarification)
254
+ - **api-spec.md**: Only if new API endpoints required
255
+ - **ui-wireframes.md**: Only if UI/UX requirements were discussed
256
+
257
+ **Cross-reference integration**: Each sub-spec references relevant user stories from the user-stories/ folder to maintain traceability between technical details and user value.
258
+
259
+ #### Step 2.5: Create User Stories Folder Structure
260
+
261
+ **user-stories/ folder** - Organized individual story files with focused task groups:
262
+
263
+ **Structure Philosophy:**
264
+ - Each user story gets its own file for better organization
265
+ - Implementation tasks are kept small and focused (max 5-7 per story)
266
+ - Complex stories are broken into multiple smaller stories
267
+ - README.md provides overview and progress tracking
268
+ - Acceptance criteria become verification checkpoints
269
+ - Each story follows TDD: test → implement → verify acceptance criteria
270
+
271
+ **Benefits of Folder Structure:**
272
+ - **Manageability**: Each file stays focused and readable
273
+ - **Navigation**: Easy to find and work on specific stories
274
+ - **Parallel Work**: Multiple developers can work on different stories
275
+ - **Version Control**: Smaller, focused diffs when stories change
276
+ - **Progress Tracking**: Clear visibility of completion status
277
+ - **Traceability**: Every technical task traces to user value
278
+
279
+ **File Organization:**
280
+ - **README.md**: Overview, progress summary, dependencies
281
+ - **story-N-{name}.md**: Individual stories with focused tasks (5-7 tasks max)
282
+ - **Story Naming**: Clear, descriptive names for easy identification
283
+ - **Task Numbering**: N.1, N.2, N.3... within each story file
284
+
285
+ **Task Breakdown Strategy:**
286
+ - If a story would have >7 tasks, split into multiple stories
287
+ - Each story should deliver standalone user value
288
+ - Tasks within a story should be cohesive and related
289
+ - Always start with tests (N.1 Write tests...)
290
+ - Always end with verification (N.X Verify acceptance criteria met)
291
+
292
+ #### Step 2.6: Final Package Review & User Validation
293
+
294
+ Present complete package with file references:
295
+ ```
296
+ ✅ Specification package created successfully!
297
+
298
+ 📁 .code-captain/specs/[DATE]-feature-name/
299
+ ├── 📋 spec.md - Main specification document
300
+ ├── 📝 spec-lite.md - AI context summary
301
+ ├── 👥 user-stories/ - Individual user story files
302
+ │ ├── 📊 README.md - Overview and progress tracking
303
+ │ ├── 📝 story-1-{name}.md - Focused story with 5-7 tasks
304
+ │ ├── 📝 story-2-{name}.md - Manageable task groups
305
+ │ └── 📝 story-N-{name}.md - Easy navigation and parallel work
306
+ └── 📂 sub-specs/
307
+ ├── 🔧 technical-spec.md - Technical requirements
308
+ [Additional specs as created]
309
+
310
+ **Stories Created:** [N] user stories with focused task groups (max 5-7 tasks each)
311
+ **Total Tasks:** [X] implementation tasks across all stories
312
+ **Organization:** Each story is self-contained for better workflow management
313
+
314
+ Please take a moment to review the specification documents. The spec captures everything we discussed, including:
315
+ - [Brief summary of key features/requirements]
316
+ - [Notable technical approach or constraint]
317
+ - [Implementation approach or user story highlights]
318
+
319
+ Please read through the files and let me know:
320
+ - Does this accurately capture your vision?
321
+ - Are there any missing requirements or incorrect assumptions?
322
+ - Are the user stories appropriately sized (5-7 tasks each)?
323
+ - Should any stories be split further or combined?
324
+
325
+ The user-stories folder structure allows you to:
326
+ - Work on one story at a time for focused development
327
+ - Track progress easily with the README overview
328
+ - Assign different stories to different team members
329
+ - Keep task lists manageable and actionable
330
+
331
+ Once you're satisfied with the specification, I can help you start implementation with the first story, or we can make any needed adjustments.
332
+ ```
333
+
334
+ ## Tool Integration
335
+
336
+ **Primary tools:**
337
+ - `codebase` - Scanning existing architecture and patterns
338
+ - `search` - Finding related specifications and documentation
339
+ - `editFiles` - Creating specification documents
340
+ - `runCommands` - Date determination and directory creation
341
+ - `fetch` - External research for best practices
342
+
343
+ **Documentation organization:**
344
+ - Specifications stored in `.code-captain/specs/[DATE]-{feature-name}/`
345
+ - User stories organized in individual files for better management
346
+ - Technical sub-specs created only when relevant
347
+
348
+ ## Key Improvements Over Original
349
+
350
+ ### 1. Contract-First Approach
351
+ - **No presumptuous file creation** - Nothing gets built until contract is locked
352
+ - **Structured clarification** - One question at a time, building understanding
353
+ - **Echo check validation** - Clear contract summary before proceeding
354
+
355
+ ### 2. Codebase-Aware Questioning
356
+ - **Context scanning between questions** - Each answer triggers fresh codebase analysis
357
+ - **Integration-focused queries** - Questions shaped by what exists in the codebase
358
+ - **Architecture consistency** - Recommendations align with existing patterns
359
+
360
+ ### 3. User Control & Transparency
361
+ - **Clear decision points** - User explicitly approves before file creation
362
+ - **Risk assessment option** - Can explore implementation risks before committing
363
+ - **Blueprint preview** - Can see planned structure before creation
364
+ - **Edit capability** - Can modify contract before locking
365
+
366
+ ### 4. Efficient Clarification Process
367
+ - **Gap enumeration** - Systematically identifies all unknowns
368
+ - **95% confidence threshold** - Stops asking when ready to deliver
369
+ - **Token efficiency** - Focused questions, no verbose explanations during clarification
370
+
371
+ ## Example Usage Flow
372
+
373
+ ```
374
+ Developer: /create-spec "real-time multiplayer chat with blockchain integration"
375
+
376
+ Agent: I'm ready to help you create a comprehensive specification.
377
+
378
+ Let me first scan your codebase to understand the current architecture...
379
+
380
+ [Scans existing code, finds a simple React app with basic authentication]
381
+
382
+ I found your existing React application with basic user authentication, but I'm seeing some potential concerns with your request.
383
+
384
+ First question: You mentioned "real-time multiplayer chat with blockchain integration" - I see technical challenges with this combination. Real-time chat typically requires sub-100ms latency, but blockchain transactions can take seconds or minutes to confirm. What specific problem are you trying to solve with blockchain in a chat context?
385
+
386
+ Developer: I want messages to be permanently stored and verifiable, plus users should pay crypto to send messages to prevent spam
387
+
388
+ Agent: I understand the anti-spam goal, but I'm concerned about the user experience. If users have to wait 30+ seconds for transaction confirmation before each message appears, that breaks the "real-time" chat experience.
389
+
390
+ Would a hybrid approach work better - immediate message delivery with blockchain settlement in the background? Or are you thinking of a different model where users pre-purchase message credits?
391
+
392
+ Developer: Oh, that's a good point. Let's do the hybrid approach with background settlement
393
+
394
+ Agent: [Continues with more informed questions about the hybrid architecture...]
395
+
396
+ ## Specification Contract
397
+
398
+ **Deliverable:** Hybrid real-time chat with immediate message delivery and background blockchain verification for anti-spam
399
+
400
+ **Must Include:** Sub-second message delivery while maintaining blockchain verification for spam prevention
401
+
402
+ **Hardest Constraint:** Balancing real-time UX with blockchain settlement delays and gas cost management
403
+
404
+ **⚠️ Technical Concerns:**
405
+ - Gas costs could make casual chat expensive ($1-5 per message during network congestion)
406
+ - Background settlement failures need graceful handling and user notification
407
+ - Wallet integration adds authentication complexity to existing simple auth system
408
+
409
+ **💡 Recommendations:**
410
+ - Consider Layer 2 solution (Polygon) to reduce gas costs to $0.01-0.10 per message
411
+ - Implement message batching to settle multiple messages in single transaction
412
+ - Add fallback mode for when blockchain settlement fails
413
+
414
+ **Success Criteria:** Messages appear instantly, spam is prevented via crypto payments, blockchain verification happens within 5 minutes
415
+
416
+ **Scope Boundaries:**
417
+ - In Scope: Real-time chat, wallet integration, background blockchain settlement
418
+ - Out of Scope: Advanced chat features (file sharing, voice), custom token creation
419
+
420
+ ---
421
+ Options: [yes/edit/risks/blueprint]
422
+
423
+ Developer: yes
424
+
425
+ Agent: ✅ Contract locked! Creating specification package...
426
+
427
+ [Creates files that account for the technical concerns and hybrid architecture discussed]
428
+ ```
429
+
430
+ This approach ensures that every specification is built on solid understanding rather than assumptions, while respecting the developer's time and maintaining control over the process.