@devobsessed/code-captain 0.0.6 → 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.
- package/README.md +36 -37
- package/bin/install.js +1166 -983
- package/claude-code/agents/code-captain.md +31 -22
- package/copilot/README.md +26 -16
- package/copilot/chatmodes/Code Captain.chatmode.md +41 -25
- package/copilot/prompts/create-adr.prompt.md +6 -4
- package/copilot/prompts/create-spec.prompt.md +62 -45
- package/copilot/prompts/explain-code.prompt.md +7 -23
- package/copilot/prompts/new-command.prompt.md +60 -21
- package/copilot/prompts/research.prompt.md +14 -30
- package/copilot/prompts/status.prompt.md +13 -2
- package/copilot/prompts/swab.prompt.md +1 -0
- package/cursor/README.md +77 -88
- package/cursor/cc.mdc +13 -42
- package/cursor/commands/create-adr.md +7 -13
- package/cursor/commands/create-spec.md +73 -64
- package/cursor/commands/edit-spec.md +2 -15
- package/cursor/commands/execute-task.md +7 -15
- package/cursor/commands/explain-code.md +16 -35
- package/cursor/commands/initialize.md +19 -18
- package/cursor/commands/new-command.md +173 -81
- package/cursor/commands/plan-product.md +7 -13
- package/cursor/commands/research.md +5 -27
- package/cursor/commands/status.md +34 -23
- package/cursor/commands/swab.md +63 -12
- package/manifest.json +110 -229
- package/package.json +13 -4
- package/cursor/cc.md +0 -183
- package/cursor/integrations/azure-devops/create-azure-work-items.md +0 -403
- package/cursor/integrations/azure-devops/sync-azure-work-items.md +0 -486
- package/cursor/integrations/github/create-github-issues.md +0 -765
- package/cursor/integrations/github/scripts/create-issues-batch.sh +0 -272
- package/cursor/integrations/github/sync-github-issues.md +0 -237
- package/cursor/integrations/github/sync.md +0 -305
- package/windsurf/README.md +0 -254
- package/windsurf/rules/cc.md +0 -5
- package/windsurf/workflows/create-adr.md +0 -331
- package/windsurf/workflows/create-spec.md +0 -280
- package/windsurf/workflows/edit-spec.md +0 -273
- package/windsurf/workflows/execute-task.md +0 -276
- package/windsurf/workflows/explain-code.md +0 -292
- package/windsurf/workflows/initialize.md +0 -298
- package/windsurf/workflows/new-command.md +0 -321
- package/windsurf/workflows/status.md +0 -213
|
@@ -13,22 +13,26 @@ Generate comprehensive feature specifications using a contract-first approach th
|
|
|
13
13
|
### Phase 1: Contract Establishment (No File Creation)
|
|
14
14
|
|
|
15
15
|
**Mission Statement:**
|
|
16
|
+
|
|
16
17
|
> 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
|
|
|
18
19
|
#### Step 1.1: Initial Context Scan
|
|
20
|
+
|
|
19
21
|
- Scan existing `.code-captain/specs/` for related specifications
|
|
20
22
|
- Analyze current codebase architecture and patterns using `codebase`
|
|
21
23
|
- Load project context files (`tech-stack.md`, `code-style.md`, `objective.md`)
|
|
22
24
|
- **Output:** Context summary (no files created yet)
|
|
23
25
|
|
|
24
26
|
#### Step 1.2: Gap Analysis & Silent Enumeration
|
|
27
|
+
|
|
25
28
|
**Internal Process (not shown to user):**
|
|
29
|
+
|
|
26
30
|
- Silently list every missing fact, constraint, or requirement
|
|
27
31
|
- Identify ambiguities in the initial description
|
|
28
32
|
- Note potential integration points and dependencies
|
|
29
33
|
- Catalog unknowns across these domains:
|
|
30
34
|
- Purpose & business value
|
|
31
|
-
- Target audience & user personas
|
|
35
|
+
- Target audience & user personas
|
|
32
36
|
- Technical constraints & requirements
|
|
33
37
|
- Success criteria & acceptance tests
|
|
34
38
|
- Scope boundaries (in/out of scope)
|
|
@@ -39,7 +43,9 @@ Generate comprehensive feature specifications using a contract-first approach th
|
|
|
39
43
|
- Risk tolerance & implementation approach
|
|
40
44
|
|
|
41
45
|
#### Step 1.3: Structured Clarification Loop
|
|
46
|
+
|
|
42
47
|
**Rules:**
|
|
48
|
+
|
|
43
49
|
- Ask ONE focused question at a time
|
|
44
50
|
- After each answer, re-scan codebase for new context if relevant
|
|
45
51
|
- Continue until reaching 95% confidence on deliverable
|
|
@@ -49,6 +55,7 @@ Generate comprehensive feature specifications using a contract-first approach th
|
|
|
49
55
|
- **Challenge ideas that don't make technical or business sense** - better to surface concerns early than build the wrong thing
|
|
50
56
|
|
|
51
57
|
**Critical Analysis Responsibility:**
|
|
58
|
+
|
|
52
59
|
- If requirements seem technically infeasible with current architecture, explain why and suggest alternatives
|
|
53
60
|
- If scope seems too large for a single feature, recommend breaking it down
|
|
54
61
|
- If user requests conflict with existing patterns found in codebase, point out the inconsistency
|
|
@@ -56,40 +63,45 @@ Generate comprehensive feature specifications using a contract-first approach th
|
|
|
56
63
|
- If performance/security/scalability concerns arise, surface them proactively
|
|
57
64
|
|
|
58
65
|
**Pushback Phrasing Examples:**
|
|
66
|
+
|
|
59
67
|
- "I see a potential issue with [requirement] because [technical reason]. Would [alternative approach] work better?"
|
|
60
68
|
- "Based on your existing codebase, [proposed approach] might conflict with [existing pattern]. How should we handle this?"
|
|
61
69
|
- "The scope you're describing sounds like it might be 3-4 separate features. Should we focus on [core piece] first?"
|
|
62
70
|
- "I'm concerned that [requirement] could create [specific problem]. Have you considered [alternative]?"
|
|
63
71
|
|
|
64
72
|
**Question Categories (examples):**
|
|
73
|
+
|
|
65
74
|
- "What specific user problem does this solve, and who experiences it?"
|
|
66
|
-
- "Should this integrate with [existing system found in codebase], or remain separate?"
|
|
75
|
+
- "Should this integrate with [existing system found in codebase], or remain separate?"
|
|
67
76
|
- "What does 'success' look like - how will we measure if this works?"
|
|
68
77
|
- "Are there performance requirements (response time, throughput, scale)?"
|
|
69
78
|
- "What UI/UX constraints exist - web only, mobile responsive, accessibility needs?"
|
|
70
79
|
- "What's your risk tolerance - prefer stable/proven approaches or cutting-edge solutions?"
|
|
71
80
|
|
|
72
81
|
**Transition to Contract:**
|
|
82
|
+
|
|
73
83
|
- When confidence is high, present contract without declaring it "final"
|
|
74
84
|
- Use phrases like "I think I have enough to create a solid contract" or "Based on our discussion, here's what I understand"
|
|
75
85
|
- Always leave room for more questions if needed
|
|
76
86
|
|
|
77
87
|
#### Step 1.4: Echo Check (Contract Proposal)
|
|
88
|
+
|
|
78
89
|
When confident, present a contract proposal with any concerns surfaced:
|
|
79
90
|
|
|
80
91
|
**Format:**
|
|
92
|
+
|
|
81
93
|
```
|
|
82
94
|
## Specification Contract
|
|
83
95
|
|
|
84
96
|
**Deliverable:** [One clear sentence describing what will be built]
|
|
85
97
|
|
|
86
|
-
**Must Include:** [Critical requirement that makes this valuable]
|
|
98
|
+
**Must Include:** [Critical requirement that makes this valuable]
|
|
87
99
|
|
|
88
100
|
**Hardest Constraint:** [Biggest technical/business limitation to navigate]
|
|
89
101
|
|
|
90
102
|
**Success Criteria:** [How we'll know it's working correctly]
|
|
91
103
|
|
|
92
|
-
**Scope Boundaries:**
|
|
104
|
+
**Scope Boundaries:**
|
|
93
105
|
- In Scope: [2-3 key features]
|
|
94
106
|
- Out of Scope: [2-3 things we won't build]
|
|
95
107
|
|
|
@@ -104,7 +116,7 @@ When confident, present a contract proposal with any concerns surfaced:
|
|
|
104
116
|
---
|
|
105
117
|
Options:
|
|
106
118
|
- Type 'yes' to lock this contract and create the spec package
|
|
107
|
-
- Type 'edit: [your changes]' to modify the contract
|
|
119
|
+
- Type 'edit: [your changes]' to modify the contract
|
|
108
120
|
- Type 'risks' to explore potential implementation risks in detail
|
|
109
121
|
- Type 'blueprint' to see the planned folder structure and documents
|
|
110
122
|
- Ask more questions if anything needs clarification
|
|
@@ -115,37 +127,20 @@ Options:
|
|
|
115
127
|
**Triggered only after user confirms contract with 'yes'**
|
|
116
128
|
|
|
117
129
|
#### Step 2.1: Determine Current Date
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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"
|
|
130
|
+
|
|
131
|
+
Get current date by running: `npx @devobsessed/code-captain date`
|
|
132
|
+
|
|
133
|
+
This returns the current date in `YYYY-MM-DD` format for folder naming:
|
|
134
|
+
`.code-captain/specs/[DATE]-[feature-name]/`
|
|
142
135
|
|
|
143
136
|
#### Step 2.2: Create Directory Structure
|
|
137
|
+
|
|
144
138
|
**Generated folder (using determined date):**
|
|
139
|
+
|
|
145
140
|
```
|
|
146
141
|
.code-captain/specs/[DATE]-{feature-name}/
|
|
147
142
|
├── spec.md # Main specification (from contract)
|
|
148
|
-
├── spec-lite.md # Condensed version for AI context
|
|
143
|
+
├── spec-lite.md # Condensed version for AI context
|
|
149
144
|
├── user-stories/ # Individual user story files
|
|
150
145
|
│ ├── README.md # Overview and progress tracking
|
|
151
146
|
│ ├── story-1-{name}.md # Individual user story with focused tasks
|
|
@@ -155,12 +150,13 @@ Options:
|
|
|
155
150
|
├── technical-spec.md # Architecture & implementation details
|
|
156
151
|
├── database-schema.md # Database changes (if needed)
|
|
157
152
|
├── api-spec.md # API documentation (if needed)
|
|
158
|
-
└── ui-wireframes.md # UI/UX specifications (if needed)
|
|
153
|
+
└── ui-wireframes.md # UI/UX specifications (if needed)
|
|
159
154
|
```
|
|
160
155
|
|
|
161
156
|
#### Step 2.3: Generate Core Documents
|
|
162
157
|
|
|
163
158
|
**spec.md** - Built directly from the locked contract:
|
|
159
|
+
|
|
164
160
|
```markdown
|
|
165
161
|
# [Feature Name] Specification
|
|
166
162
|
|
|
@@ -169,46 +165,51 @@ Options:
|
|
|
169
165
|
> Contract Locked: ✅
|
|
170
166
|
|
|
171
167
|
## Contract Summary
|
|
168
|
+
|
|
172
169
|
[Echo check content verbatim]
|
|
173
170
|
|
|
174
171
|
## Detailed Requirements
|
|
172
|
+
|
|
175
173
|
[Expanded from clarification responses]
|
|
176
174
|
|
|
177
175
|
## Implementation Approach
|
|
176
|
+
|
|
178
177
|
[Technical strategy based on codebase analysis]
|
|
179
178
|
```
|
|
180
179
|
|
|
181
180
|
**user-stories/ folder structure** - Individual user story files for better organization:
|
|
182
181
|
|
|
183
182
|
**user-stories/README.md** - Overview and progress tracking:
|
|
183
|
+
|
|
184
184
|
```markdown
|
|
185
185
|
# User Stories Overview
|
|
186
186
|
|
|
187
|
-
> **Specification:** [Feature Name]
|
|
188
|
-
> **Created:** [DATE]
|
|
189
|
-
> **Status:** Planning
|
|
187
|
+
> **Specification:** [Feature Name] > **Created:** [DATE] > **Status:** Planning
|
|
190
188
|
|
|
191
189
|
## Stories Summary
|
|
192
190
|
|
|
193
|
-
| Story | Title
|
|
194
|
-
|
|
195
|
-
| 1
|
|
196
|
-
| 2
|
|
197
|
-
| 3
|
|
191
|
+
| Story | Title | Status | Tasks | Progress |
|
|
192
|
+
| ----- | ------------- | ----------- | ----- | -------- |
|
|
193
|
+
| 1 | [Story title] | Not Started | 5 | 0/5 |
|
|
194
|
+
| 2 | [Story title] | Not Started | 4 | 0/4 |
|
|
195
|
+
| 3 | [Story title] | Not Started | 6 | 0/6 |
|
|
198
196
|
|
|
199
197
|
**Total Progress:** 0/15 tasks (0%)
|
|
200
198
|
|
|
201
199
|
## Story Dependencies
|
|
200
|
+
|
|
202
201
|
- Story 2 depends on Story 1 completion
|
|
203
202
|
- Story 3 can run parallel to Story 2
|
|
204
203
|
|
|
205
204
|
## Quick Links
|
|
205
|
+
|
|
206
206
|
- [Story 1: User Login](./story-1-user-login.md)
|
|
207
207
|
- [Story 2: Password Reset](./story-2-password-reset.md)
|
|
208
208
|
- [Story 3: Profile Management](./story-3-profile-management.md)
|
|
209
209
|
```
|
|
210
210
|
|
|
211
211
|
**user-stories/story-1-{name}.md** - Individual story files (max 5-7 tasks each):
|
|
212
|
+
|
|
212
213
|
```markdown
|
|
213
214
|
# Story 1: [Title from contract deliverable]
|
|
214
215
|
|
|
@@ -217,27 +218,32 @@ Options:
|
|
|
217
218
|
> **Dependencies:** None
|
|
218
219
|
|
|
219
220
|
## User Story
|
|
221
|
+
|
|
220
222
|
**As a** [user type from clarification]
|
|
221
223
|
**I want to** [action from contract]
|
|
222
224
|
**So that** [value from contract must-include]
|
|
223
225
|
|
|
224
226
|
## Acceptance Criteria
|
|
227
|
+
|
|
225
228
|
- [ ] Given [context], when [action], then [outcome]
|
|
226
229
|
- [ ] Given [context], when [action], then [outcome]
|
|
227
230
|
- [ ] Given [context], when [action], then [outcome]
|
|
228
231
|
|
|
229
232
|
## Implementation Tasks
|
|
233
|
+
|
|
230
234
|
- [ ] 1.1 Write tests for [specific component]
|
|
231
235
|
- [ ] 1.2 [Focused technical step]
|
|
232
|
-
- [ ] 1.3 [Focused technical step]
|
|
236
|
+
- [ ] 1.3 [Focused technical step]
|
|
233
237
|
- [ ] 1.4 [Focused technical step]
|
|
234
238
|
- [ ] 1.5 Verify acceptance criteria are met
|
|
235
239
|
- [ ] 1.6 Verify all tests pass
|
|
236
240
|
|
|
237
241
|
## Notes
|
|
242
|
+
|
|
238
243
|
[Any specific technical considerations, risks, or dependencies for this story]
|
|
239
244
|
|
|
240
245
|
## Definition of Done
|
|
246
|
+
|
|
241
247
|
- [ ] All tasks completed
|
|
242
248
|
- [ ] All acceptance criteria met
|
|
243
249
|
- [ ] Tests passing
|
|
@@ -261,6 +267,7 @@ Options:
|
|
|
261
267
|
**user-stories/ folder** - Organized individual story files with focused task groups:
|
|
262
268
|
|
|
263
269
|
**Structure Philosophy:**
|
|
270
|
+
|
|
264
271
|
- Each user story gets its own file for better organization
|
|
265
272
|
- Implementation tasks are kept small and focused (max 5-7 per story)
|
|
266
273
|
- Complex stories are broken into multiple smaller stories
|
|
@@ -269,6 +276,7 @@ Options:
|
|
|
269
276
|
- Each story follows TDD: test → implement → verify acceptance criteria
|
|
270
277
|
|
|
271
278
|
**Benefits of Folder Structure:**
|
|
279
|
+
|
|
272
280
|
- **Manageability**: Each file stays focused and readable
|
|
273
281
|
- **Navigation**: Easy to find and work on specific stories
|
|
274
282
|
- **Parallel Work**: Multiple developers can work on different stories
|
|
@@ -277,12 +285,14 @@ Options:
|
|
|
277
285
|
- **Traceability**: Every technical task traces to user value
|
|
278
286
|
|
|
279
287
|
**File Organization:**
|
|
288
|
+
|
|
280
289
|
- **README.md**: Overview, progress summary, dependencies
|
|
281
290
|
- **story-N-{name}.md**: Individual stories with focused tasks (5-7 tasks max)
|
|
282
291
|
- **Story Naming**: Clear, descriptive names for easy identification
|
|
283
292
|
- **Task Numbering**: N.1, N.2, N.3... within each story file
|
|
284
293
|
|
|
285
294
|
**Task Breakdown Strategy:**
|
|
295
|
+
|
|
286
296
|
- If a story would have >7 tasks, split into multiple stories
|
|
287
297
|
- Each story should deliver standalone user value
|
|
288
298
|
- Tasks within a story should be cohesive and related
|
|
@@ -292,12 +302,13 @@ Options:
|
|
|
292
302
|
#### Step 2.6: Final Package Review & User Validation
|
|
293
303
|
|
|
294
304
|
Present complete package with file references:
|
|
305
|
+
|
|
295
306
|
```
|
|
296
307
|
✅ Specification package created successfully!
|
|
297
308
|
|
|
298
309
|
📁 .code-captain/specs/[DATE]-feature-name/
|
|
299
310
|
├── 📋 spec.md - Main specification document
|
|
300
|
-
├── 📝 spec-lite.md - AI context summary
|
|
311
|
+
├── 📝 spec-lite.md - AI context summary
|
|
301
312
|
├── 👥 user-stories/ - Individual user story files
|
|
302
313
|
│ ├── 📊 README.md - Overview and progress tracking
|
|
303
314
|
│ ├── 📝 story-1-{name}.md - Focused story with 5-7 tasks
|
|
@@ -334,6 +345,7 @@ Once you're satisfied with the specification, I can help you start implementatio
|
|
|
334
345
|
## Tool Integration
|
|
335
346
|
|
|
336
347
|
**Primary tools:**
|
|
348
|
+
|
|
337
349
|
- `codebase` - Scanning existing architecture and patterns
|
|
338
350
|
- `search` - Finding related specifications and documentation
|
|
339
351
|
- `editFiles` - Creating specification documents
|
|
@@ -341,6 +353,7 @@ Once you're satisfied with the specification, I can help you start implementatio
|
|
|
341
353
|
- `fetch` - External research for best practices
|
|
342
354
|
|
|
343
355
|
**Documentation organization:**
|
|
356
|
+
|
|
344
357
|
- Specifications stored in `.code-captain/specs/[DATE]-{feature-name}/`
|
|
345
358
|
- User stories organized in individual files for better management
|
|
346
359
|
- Technical sub-specs created only when relevant
|
|
@@ -348,22 +361,26 @@ Once you're satisfied with the specification, I can help you start implementatio
|
|
|
348
361
|
## Key Improvements Over Original
|
|
349
362
|
|
|
350
363
|
### 1. Contract-First Approach
|
|
364
|
+
|
|
351
365
|
- **No presumptuous file creation** - Nothing gets built until contract is locked
|
|
352
366
|
- **Structured clarification** - One question at a time, building understanding
|
|
353
367
|
- **Echo check validation** - Clear contract summary before proceeding
|
|
354
368
|
|
|
355
|
-
### 2. Codebase-Aware Questioning
|
|
369
|
+
### 2. Codebase-Aware Questioning
|
|
370
|
+
|
|
356
371
|
- **Context scanning between questions** - Each answer triggers fresh codebase analysis
|
|
357
372
|
- **Integration-focused queries** - Questions shaped by what exists in the codebase
|
|
358
373
|
- **Architecture consistency** - Recommendations align with existing patterns
|
|
359
374
|
|
|
360
375
|
### 3. User Control & Transparency
|
|
376
|
+
|
|
361
377
|
- **Clear decision points** - User explicitly approves before file creation
|
|
362
|
-
- **Risk assessment option** - Can explore implementation risks before committing
|
|
378
|
+
- **Risk assessment option** - Can explore implementation risks before committing
|
|
363
379
|
- **Blueprint preview** - Can see planned structure before creation
|
|
364
380
|
- **Edit capability** - Can modify contract before locking
|
|
365
381
|
|
|
366
382
|
### 4. Efficient Clarification Process
|
|
383
|
+
|
|
367
384
|
- **Gap enumeration** - Systematically identifies all unknowns
|
|
368
385
|
- **95% confidence threshold** - Stops asking when ready to deliver
|
|
369
386
|
- **Token efficiency** - Focused questions, no verbose explanations during clarification
|
|
@@ -385,7 +402,7 @@ First question: You mentioned "real-time multiplayer chat with blockchain integr
|
|
|
385
402
|
|
|
386
403
|
Developer: I want messages to be permanently stored and verifiable, plus users should pay crypto to send messages to prevent spam
|
|
387
404
|
|
|
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.
|
|
405
|
+
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
406
|
|
|
390
407
|
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
408
|
|
|
@@ -427,4 +444,4 @@ Agent: ✅ Contract locked! Creating specification package...
|
|
|
427
444
|
[Creates files that account for the technical concerns and hybrid architecture discussed]
|
|
428
445
|
```
|
|
429
446
|
|
|
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.
|
|
447
|
+
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.
|
|
@@ -133,34 +133,16 @@ Files are named using the format: `[DATE]-[target-name].md` where DATE is YYYY-M
|
|
|
133
133
|
|
|
134
134
|
## Auto-Save Behavior
|
|
135
135
|
|
|
136
|
-
All explanations are automatically saved to `.code-captain/explanations/` using the format `[DATE]-[target-name].md`.
|
|
136
|
+
All explanations are automatically saved to `.code-captain/explanations/` using the format `[DATE]-[target-name].md`.
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
Get current date by running: `npx @devobsessed/code-captain date`
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
1. **CREATE** directory if not exists: `.code-captain/explanations/`
|
|
143
|
-
2. **CREATE** temporary file: `.code-captain/explanations/.date-check`
|
|
144
|
-
3. **READ** file creation timestamp from filesystem
|
|
145
|
-
4. **EXTRACT** date in YYYY-MM-DD format
|
|
146
|
-
5. **DELETE** temporary file
|
|
147
|
-
6. **STORE** date in variable for file naming
|
|
148
|
-
|
|
149
|
-
### Fallback Method: User Confirmation
|
|
150
|
-
|
|
151
|
-
If file system method fails:
|
|
152
|
-
|
|
153
|
-
1. **STATE**: "I need to confirm today's date for the explanation file"
|
|
154
|
-
2. **ASK**: "What is today's date? (YYYY-MM-DD format)"
|
|
155
|
-
3. **WAIT** for user response
|
|
156
|
-
4. **VALIDATE** format matches `^\d{4}-\d{2}-\d{2}$`
|
|
157
|
-
5. **STORE** date for file naming
|
|
158
|
-
|
|
159
|
-
**Example filename:** `.code-captain/explanations/2024-01-15-AuthenticationFlow.md`
|
|
140
|
+
**Example filename:** `.code-captain/explanations/2025-09-27-AuthenticationFlow.md`
|
|
160
141
|
|
|
161
142
|
## Integration Points
|
|
162
143
|
|
|
163
144
|
### With Other Commands
|
|
145
|
+
|
|
164
146
|
```
|
|
165
147
|
# Saved explanations can be referenced by other commands
|
|
166
148
|
/research authentication
|
|
@@ -240,6 +222,7 @@ All explanations use a consistent intermediate technical level that balances acc
|
|
|
240
222
|
## Tool Integration
|
|
241
223
|
|
|
242
224
|
**Primary tools:**
|
|
225
|
+
|
|
243
226
|
- `codebase` - Analyzing code structure and dependencies
|
|
244
227
|
- `search` - Finding related components and existing explanations
|
|
245
228
|
- `editFiles` - Creating explanation documents
|
|
@@ -247,6 +230,7 @@ All explanations use a consistent intermediate technical level that balances acc
|
|
|
247
230
|
- `usages` - Understanding how code is used throughout the system
|
|
248
231
|
|
|
249
232
|
**Documentation organization:**
|
|
233
|
+
|
|
250
234
|
- Explanations stored in `.code-captain/explanations/`
|
|
251
235
|
- Date-prefixed filenames for chronological organization
|
|
252
236
|
- Cross-references to related explanations and components
|
|
@@ -289,4 +273,4 @@ Track effectiveness through:
|
|
|
289
273
|
- Performance profiling integration
|
|
290
274
|
- Security vulnerability highlighting in explanations
|
|
291
275
|
- Code quality suggestions as part of explanations
|
|
292
|
-
- Integration with documentation generation tools
|
|
276
|
+
- Integration with documentation generation tools
|
|
@@ -33,7 +33,7 @@ A meta command that creates new Code Captain commands following established patt
|
|
|
33
33
|
**Interactive Specification Building:**
|
|
34
34
|
Ask clarifying questions to build complete command specification:
|
|
35
35
|
|
|
36
|
-
1. **Command Category**: "Is this a [
|
|
36
|
+
1. **Command Category**: "Is this a [Foundation/Analysis/Specification/Implementation/Quality/Meta] command?"
|
|
37
37
|
2. **Execution Style**: "Should this use contract style (extensive clarification rounds like create-spec) or direct execution (immediate action like swab)?"
|
|
38
38
|
3. **Usage Pattern**: "Does it take arguments, flags, or is it standalone?"
|
|
39
39
|
4. **AI Coordination**: "Does it need AI prompts for complex decision-making?"
|
|
@@ -88,20 +88,35 @@ mode: agent
|
|
|
88
88
|
- Clear step-by-step execution
|
|
89
89
|
- Progress feedback and completion confirmation
|
|
90
90
|
|
|
91
|
-
**
|
|
91
|
+
**Foundation Commands:**
|
|
92
|
+
- Project initialization steps
|
|
93
|
+
- Planning and product setup workflows
|
|
94
|
+
- Configuration and environment setup
|
|
95
|
+
|
|
96
|
+
**Analysis Commands:**
|
|
92
97
|
- Context scanning steps
|
|
93
|
-
-
|
|
94
|
-
-
|
|
98
|
+
- Research and analysis workflows
|
|
99
|
+
- Documentation review and assessment
|
|
100
|
+
|
|
101
|
+
**Specification Commands:**
|
|
102
|
+
- Specification creation and editing
|
|
103
|
+
- Structured documentation workflows
|
|
104
|
+
- Contract-based clarification processes
|
|
95
105
|
|
|
96
106
|
**Implementation Commands:**
|
|
97
107
|
- TDD workflows if applicable
|
|
98
108
|
- Code modification steps
|
|
99
|
-
-
|
|
109
|
+
- Task execution procedures
|
|
100
110
|
|
|
101
|
-
**
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
111
|
+
**Quality Commands:**
|
|
112
|
+
- Health and status reporting
|
|
113
|
+
- QA-oriented checks and validations
|
|
114
|
+
- Lightweight remediation workflows
|
|
115
|
+
|
|
116
|
+
**Meta Commands:**
|
|
117
|
+
- Command scaffolding and documentation updates
|
|
118
|
+
- Code understanding and explanation
|
|
119
|
+
- Process and tooling refinements
|
|
105
120
|
|
|
106
121
|
### Step 3: Documentation Integration
|
|
107
122
|
|
|
@@ -179,9 +194,12 @@ TEMPLATE STRUCTURE:
|
|
|
179
194
|
TEMPLATE ADAPTATION RULES:
|
|
180
195
|
- Contract Style commands: Include clarification phases, contract establishment, critical analysis, user agreement checkpoints
|
|
181
196
|
- Direct Execution commands: Include immediate action workflows, minimal interaction, clear progress feedback
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
197
|
+
- Foundation commands: Include project initialization, planning workflows, configuration setup
|
|
198
|
+
- Analysis commands: Include context scanning, research workflows, documentation assessment
|
|
199
|
+
- Specification commands: Include specification creation, structured documentation, contract-based processes
|
|
200
|
+
- Implementation commands: Include TDD workflows, code modification, task execution
|
|
201
|
+
- Quality commands: Include health and status reporting, QA-oriented checks and validations, lightweight remediation workflows
|
|
202
|
+
- Meta commands: Include command scaffolding and documentation updates, code understanding and explanation, process and tooling refinements
|
|
185
203
|
- All commands: Include clear examples, tool coordination, progress tracking
|
|
186
204
|
- CRITICAL: Be language and shell agnostic - use codebase, search instead of language-specific commands or hardcoded file extensions
|
|
187
205
|
|
|
@@ -228,29 +246,50 @@ echo "command-name" | grep -E '^[a-z][a-z0-9-]*[a-z0-9]$'
|
|
|
228
246
|
ls .github/prompts/ | grep "^command-name.prompt.md$"
|
|
229
247
|
```
|
|
230
248
|
|
|
249
|
+
### Command Categories
|
|
250
|
+
|
|
251
|
+
Commands are organized into logical categories:
|
|
252
|
+
|
|
253
|
+
1. **Foundation** (`initialize`, `plan-product`)
|
|
254
|
+
2. **Analysis** (`research`, `create-adr`)
|
|
255
|
+
3. **Specification** (`create-spec`, `edit-spec`)
|
|
256
|
+
4. **Implementation** (`execute-task`)
|
|
257
|
+
5. **Quality** (`status`, `swab`)
|
|
258
|
+
6. **Meta** (`new-command`, `explain-code`)
|
|
259
|
+
|
|
231
260
|
### Template Selection Logic
|
|
232
261
|
|
|
233
262
|
**Command Categories and Templates:**
|
|
234
263
|
|
|
235
|
-
1. **
|
|
264
|
+
1. **Foundation** (`initialize`, `plan-product`)
|
|
265
|
+
- Project initialization workflows
|
|
266
|
+
- Planning and setup processes
|
|
267
|
+
- Configuration and environment preparation
|
|
268
|
+
|
|
269
|
+
2. **Analysis** (`research`, `create-adr`)
|
|
236
270
|
- Context scanning workflows
|
|
237
271
|
- Documentation generation
|
|
238
|
-
-
|
|
272
|
+
- Research and assessment emphasis
|
|
239
273
|
|
|
240
|
-
|
|
274
|
+
3. **Specification** (`create-spec`, `edit-spec`)
|
|
241
275
|
- Interactive clarification phases
|
|
242
276
|
- Structured output formats
|
|
243
277
|
- Contract-based workflows
|
|
244
278
|
|
|
245
|
-
|
|
279
|
+
4. **Implementation** (`execute-task`)
|
|
246
280
|
- Code modification workflows
|
|
247
281
|
- TDD patterns
|
|
248
|
-
-
|
|
282
|
+
- Task execution steps
|
|
283
|
+
|
|
284
|
+
5. **Quality** (`status`, `swab`)
|
|
285
|
+
- Health and status reporting
|
|
286
|
+
- QA-oriented checks and validations
|
|
287
|
+
- Lightweight remediation workflows
|
|
249
288
|
|
|
250
|
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
289
|
+
6. **Meta** (`new-command`, `explain-code`)
|
|
290
|
+
- Command scaffolding and documentation updates
|
|
291
|
+
- Code understanding and explanation
|
|
292
|
+
- Process and tooling refinements
|
|
254
293
|
|
|
255
294
|
|
|
256
295
|
|
|
@@ -30,6 +30,7 @@ Conduct systematic research on a topic using structured phases that build upon e
|
|
|
30
30
|
4. Plan research phases and approach
|
|
31
31
|
|
|
32
32
|
**Research Structure:**
|
|
33
|
+
|
|
33
34
|
- Phase 1: Define scope and questions [in_progress]
|
|
34
35
|
- Phase 2: Initial discovery [pending]
|
|
35
36
|
- Phase 3: Deep dive analysis [pending]
|
|
@@ -87,7 +88,7 @@ Conduct systematic research on a topic using structured phases that build upon e
|
|
|
87
88
|
2. Create recommendations based on research
|
|
88
89
|
3. Identify next steps or areas requiring further investigation
|
|
89
90
|
4. Document sources and evidence for claims
|
|
90
|
-
5.
|
|
91
|
+
5. Get current date using: `npx @devobsessed/code-captain date`
|
|
91
92
|
6. Create research document in `.code-captain/research/` folder using the standardized format below
|
|
92
93
|
7. Present findings in appropriate format (summary document, recommendations)
|
|
93
94
|
|
|
@@ -121,40 +122,18 @@ Conduct systematic research on a topic using structured phases that build upon e
|
|
|
121
122
|
- **Further Research:** [What questions remain]
|
|
122
123
|
- **Decision Points:** [Key choices that need to be made]
|
|
123
124
|
|
|
124
|
-
## Date Determination
|
|
125
|
-
|
|
126
|
-
### Primary Method: File System Timestamp
|
|
127
|
-
|
|
128
|
-
1. **CREATE** directory if not exists: `.code-captain/research/`
|
|
129
|
-
2. **CREATE** temporary file: `.code-captain/research/.date-check`
|
|
130
|
-
3. **READ** file creation timestamp from filesystem
|
|
131
|
-
4. **EXTRACT** date in YYYY-MM-DD format
|
|
132
|
-
5. **DELETE** temporary file
|
|
133
|
-
6. **STORE** date in variable for folder naming
|
|
134
|
-
|
|
135
|
-
### Fallback Method: User Confirmation
|
|
136
|
-
|
|
137
|
-
If file system method fails:
|
|
138
|
-
|
|
139
|
-
1. **STATE**: "I need to confirm today's date for the research folder"
|
|
140
|
-
2. **ASK**: "What is today's date? (YYYY-MM-DD format)"
|
|
141
|
-
3. **WAIT** for user response
|
|
142
|
-
4. **VALIDATE** format matches `^\d{4}-\d{2}-\d{2}$`
|
|
143
|
-
- year: 2024-2030
|
|
144
|
-
- month: 01-12
|
|
145
|
-
- day: 01-31
|
|
146
|
-
5. **STORE** date for folder naming
|
|
125
|
+
## Date Determination
|
|
147
126
|
|
|
148
|
-
|
|
127
|
+
Get current date by running: `npx @devobsessed/code-captain date`
|
|
149
128
|
|
|
150
|
-
-
|
|
151
|
-
-
|
|
129
|
+
This returns the current date in `YYYY-MM-DD` format for folder naming:
|
|
130
|
+
`.code-captain/research/[DATE]-[topic-name]-research.md`
|
|
152
131
|
|
|
153
132
|
## Research Document Template
|
|
154
133
|
|
|
155
|
-
**First,
|
|
134
|
+
**First, get the current date using: `npx @devobsessed/code-captain date`**
|
|
156
135
|
|
|
157
|
-
Create a markdown file in `.code-captain/research/[DATE]-[topic-name]-research.md
|
|
136
|
+
Create a markdown file in `.code-captain/research/[DATE]-[topic-name]-research.md`.
|
|
158
137
|
|
|
159
138
|
**Example:** `.code-captain/research/2024-01-15-blockchain-supply-chain-research.md`
|
|
160
139
|
|
|
@@ -253,6 +232,7 @@ Use the following structure:
|
|
|
253
232
|
## Tool Integration
|
|
254
233
|
|
|
255
234
|
**Primary tools:**
|
|
235
|
+
|
|
256
236
|
- `fetch` - Web research and external information gathering
|
|
257
237
|
- `search` - Finding existing research and related documentation
|
|
258
238
|
- `editFiles` - Creating research documents and reports
|
|
@@ -260,6 +240,7 @@ Use the following structure:
|
|
|
260
240
|
- `codebase` - Understanding project context and existing knowledge
|
|
261
241
|
|
|
262
242
|
**Documentation organization:**
|
|
243
|
+
|
|
263
244
|
- Research documents stored in `.code-captain/research/`
|
|
264
245
|
- Date-prefixed filenames for chronological organization
|
|
265
246
|
- Cross-references to related project documentation
|
|
@@ -300,6 +281,7 @@ Use the following structure:
|
|
|
300
281
|
## Example Research Progression
|
|
301
282
|
|
|
302
283
|
**Initial Phase:**
|
|
284
|
+
|
|
303
285
|
```
|
|
304
286
|
- Research blockchain solutions for supply chain [in_progress]
|
|
305
287
|
- Analyze implementation approaches [pending]
|
|
@@ -309,6 +291,7 @@ Use the following structure:
|
|
|
309
291
|
```
|
|
310
292
|
|
|
311
293
|
**After Phase 2:**
|
|
294
|
+
|
|
312
295
|
```
|
|
313
296
|
- Research blockchain solutions for supply chain [completed]
|
|
314
297
|
- Analyze implementation approaches [in_progress]
|
|
@@ -319,6 +302,7 @@ Use the following structure:
|
|
|
319
302
|
```
|
|
320
303
|
|
|
321
304
|
**Final:**
|
|
305
|
+
|
|
322
306
|
```
|
|
323
307
|
- Research blockchain solutions for supply chain [completed]
|
|
324
308
|
- Analyze implementation approaches [completed]
|
|
@@ -326,4 +310,4 @@ Use the following structure:
|
|
|
326
310
|
- Determine date using file system method [completed]
|
|
327
311
|
- Create research document in .code-captain/research/ [completed]
|
|
328
312
|
- Create recommendation report [completed]
|
|
329
|
-
```
|
|
313
|
+
```
|