@devobsessed/code-captain 0.2.0 → 0.2.1
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/bin/install.js +40 -10
- package/copilot/agents/Code Captain.agent.md +16 -18
- package/copilot/copilot-instructions.md +64 -0
- package/copilot/prompts/create-adr.prompt.md +18 -106
- package/copilot/prompts/create-spec.prompt.md +26 -113
- package/copilot/prompts/edit-spec.prompt.md +11 -180
- package/copilot/prompts/execute-task.prompt.md +7 -22
- package/copilot/prompts/explain-code.prompt.md +14 -139
- package/copilot/prompts/initialize.prompt.md +9 -12
- package/copilot/prompts/new-command.prompt.md +25 -213
- package/copilot/prompts/plan-product.prompt.md +15 -306
- package/copilot/prompts/research.prompt.md +12 -139
- package/copilot/prompts/status.prompt.md +37 -365
- package/copilot/prompts/swab.prompt.md +9 -135
- package/manifest.json +92 -84
- package/package.json +1 -1
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
agent:
|
|
2
|
+
agent: agent
|
|
3
|
+
description: "Modify existing feature specifications with change tracking"
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
# Edit Spec
|
|
6
|
+
# You are executing the Edit Spec command.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
You MUST follow these instructions exactly. Do NOT describe this process — execute it.
|
|
8
9
|
|
|
9
|
-
Modify existing feature
|
|
10
|
-
|
|
11
|
-
## Command Process
|
|
10
|
+
Your mission: Modify an existing feature specification safely and precisely using a contract-first approach. Establish complete alignment on the modifications before updating any files.
|
|
12
11
|
|
|
13
12
|
### Phase 1: Specification Loading & Change Contract (No File Modifications)
|
|
14
13
|
|
|
15
|
-
**Mission Statement:**
|
|
16
|
-
> Your goal is to help me modify an existing specification safely and precisely. You will deliver the updated spec package only after we both agree on the modification contract. **Important: Challenge changes that could break existing functionality or create technical debt - it's better to surface concerns early than implement problematic modifications.**
|
|
17
|
-
|
|
18
14
|
#### Step 1.1: Specification Discovery & Loading
|
|
19
15
|
|
|
20
16
|
**Locate Target Specification:**
|
|
@@ -83,13 +79,6 @@ Modify existing feature specifications using a contract-first approach that ensu
|
|
|
83
79
|
- **Scope Creep**: Are we expanding beyond the original contract boundaries?
|
|
84
80
|
- **Business Value**: Do changes improve or compromise original user value?
|
|
85
81
|
|
|
86
|
-
**Question Categories (examples):**
|
|
87
|
-
- "This change would affect [existing user story]. Should we modify that story or create a new one?"
|
|
88
|
-
- "I see this conflicts with [existing implementation]. Should we plan a migration strategy?"
|
|
89
|
-
- "This modification increases complexity in [area]. Is the added value worth the technical cost?"
|
|
90
|
-
- "The original spec was focused on [goal]. How does this change serve that same goal?"
|
|
91
|
-
- "This would require changes to [dependent system]. Have you considered the downstream impact?"
|
|
92
|
-
|
|
93
82
|
#### Step 1.4: Modification Contract Proposal
|
|
94
83
|
|
|
95
84
|
When confident about changes, present a modification contract:
|
|
@@ -109,7 +98,7 @@ When confident about changes, present a modification contract:
|
|
|
109
98
|
- **New Stories Required:** [Any additional story files to be created]
|
|
110
99
|
- **Stories to Remove/Combine:** [Any story files that become obsolete]
|
|
111
100
|
- **Task Groups Affected:** [Which task groups within stories need modification]
|
|
112
|
-
- **Technical Components Affected:** [Code/architecture areas needing updates]
|
|
101
|
+
- **Technical Components Affected:** [Code/architecture areas needing updates]
|
|
113
102
|
- **Implementation Status:** [How much existing work across stories is affected]
|
|
114
103
|
|
|
115
104
|
**Migration Strategy:**
|
|
@@ -125,11 +114,11 @@ When confident about changes, present a modification contract:
|
|
|
125
114
|
- **Removed From Scope:** [What gets removed]
|
|
126
115
|
- **Still Out of Scope:** [Unchanged exclusions]
|
|
127
116
|
|
|
128
|
-
|
|
117
|
+
**Risks & Concerns:**
|
|
129
118
|
- [Specific technical or business risks from the changes]
|
|
130
119
|
- [Potential complications or dependencies]
|
|
131
120
|
|
|
132
|
-
|
|
121
|
+
**Recommendations:**
|
|
133
122
|
- [Suggestions for safer implementation approaches]
|
|
134
123
|
- [Ways to minimize disruption to existing work]
|
|
135
124
|
|
|
@@ -217,74 +206,11 @@ Options:
|
|
|
217
206
|
- **Combine stories** if task counts become too small
|
|
218
207
|
- **Reorder stories** if dependencies changed
|
|
219
208
|
|
|
220
|
-
**Story-Level Task Annotations:**
|
|
221
|
-
```markdown
|
|
222
|
-
# In story-1-user-auth.md:
|
|
223
|
-
- [x] 1.1 Write tests for user authentication ✅ (Still valid)
|
|
224
|
-
- [ ] 1.2 Implement OAuth provider ⚠️ (Needs modification)
|
|
225
|
-
- [ ] 1.3 Create social login UI 🆕 (New task from scope change)
|
|
226
|
-
- [~~] 1.4 Implement mobile-specific auth ❌ (Moved to new story-4-mobile-auth.md)
|
|
227
|
-
|
|
228
|
-
# New story-4-mobile-auth.md created if mobile auth becomes separate feature
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**Story Management:**
|
|
232
|
-
- **Split large stories**: If modifications would create >7 tasks, create additional story files
|
|
233
|
-
- **Archive obsolete stories**: Move removed stories to archived/ subfolder with timestamp
|
|
234
|
-
- **Update story dependencies**: Modify README.md to reflect new story relationships
|
|
235
|
-
- **Maintain story cohesion**: Ensure each story delivers standalone user value
|
|
236
|
-
|
|
237
209
|
#### Step 2.5: Final Update Review & Validation
|
|
238
210
|
|
|
239
|
-
Present updated package with change summary
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
📁 .code-captain/specs/[DATE]-feature-name/
|
|
244
|
-
├── 📋 spec.md - ⭐ Updated specification
|
|
245
|
-
├── 📝 spec-lite.md - ⭐ Updated AI context summary
|
|
246
|
-
├── 👥 user-stories/ - ⭐ Updated story organization
|
|
247
|
-
│ ├── 📊 README.md - ⭐ Updated progress tracking and dependencies
|
|
248
|
-
│ ├── 📝 story-1-{name}.md - ⭐ Modified stories (5-7 tasks each)
|
|
249
|
-
│ ├── 📝 story-2-{name}.md - 🆕 New stories or combinations
|
|
250
|
-
│ ├── 📂 archived/ - 🗃️ Obsolete stories (if any)
|
|
251
|
-
│ └── 📝 story-N-{name}.md - ⭐ Focused task groups
|
|
252
|
-
├── 📂 sub-specs/
|
|
253
|
-
│ ├── 🔧 technical-spec.md - ⭐ Updated if affected
|
|
254
|
-
│ └── [other sub-specs...]
|
|
255
|
-
├── 💾 backups/[timestamp]/ - Original files and stories preserved
|
|
256
|
-
└── 📝 CHANGELOG.md - ⭐ Change documentation
|
|
257
|
-
|
|
258
|
-
## Summary of Changes:
|
|
259
|
-
- **Stories Modified:** [X] existing story files updated
|
|
260
|
-
- **Stories Added:** [Y] new story files created
|
|
261
|
-
- **Stories Removed/Archived:** [Z] story files no longer needed
|
|
262
|
-
- **Task Groups Affected:** [N] task groups reorganized
|
|
263
|
-
- **Modified Components:** [List of changed technical components]
|
|
264
|
-
|
|
265
|
-
## Impact on Implementation:
|
|
266
|
-
- **Stories Still Valid:** [X] out of [Y] stories remain unchanged
|
|
267
|
-
- **Stories Requiring Rework:** [N] stories need modification
|
|
268
|
-
- **New Stories Added:** [N] new stories created (with focused task groups)
|
|
269
|
-
- **Stories Archived:** [N] stories no longer needed
|
|
270
|
-
- **Total Tasks:** [N] tasks across all stories (max 5-7 per story)
|
|
271
|
-
|
|
272
|
-
Please review the updated specification:
|
|
273
|
-
- Does this accurately reflect the agreed modifications?
|
|
274
|
-
- Are the user stories appropriately organized (5-7 tasks per story)?
|
|
275
|
-
- Should any stories be further split or combined?
|
|
276
|
-
- Are story dependencies correctly updated in the README?
|
|
277
|
-
- Should any additional changes be made?
|
|
278
|
-
|
|
279
|
-
The updated user-stories folder structure provides:
|
|
280
|
-
- **Focused development**: Work on one story at a time
|
|
281
|
-
- **Better organization**: Each story file is manageable and self-contained
|
|
282
|
-
- **Team collaboration**: Different stories can be assigned to different developers
|
|
283
|
-
- **Clear progress tracking**: README overview shows status across all stories
|
|
284
|
-
- **Flexible workflow**: Stories can be completed independently where possible
|
|
285
|
-
|
|
286
|
-
The original version is safely backed up in the backups folder. If you need to rollback any changes, I can help restore from backup.
|
|
287
|
-
```
|
|
211
|
+
Present updated package with change summary showing files modified, stories added/removed/archived, task groups reorganized, and total task count.
|
|
212
|
+
|
|
213
|
+
The original version is safely backed up in the backups folder. If the user needs to rollback any changes, offer to help restore from backup.
|
|
288
214
|
|
|
289
215
|
## Tool Integration
|
|
290
216
|
|
|
@@ -299,98 +225,3 @@ The original version is safely backed up in the backups folder. If you need to r
|
|
|
299
225
|
- Backup system for safe modification tracking
|
|
300
226
|
- Change logs for audit trail and rollback capability
|
|
301
227
|
- User stories organized in individual files for better management
|
|
302
|
-
|
|
303
|
-
## Key Features
|
|
304
|
-
|
|
305
|
-
### 1. Safe Modification Process
|
|
306
|
-
- **Backup creation** before any changes
|
|
307
|
-
- **Change tracking** with detailed logs
|
|
308
|
-
- **Rollback capability** to restore previous versions
|
|
309
|
-
- **Impact assessment** before making changes
|
|
310
|
-
|
|
311
|
-
### 2. Precise Change Control
|
|
312
|
-
- **Focused clarification** about specific modifications
|
|
313
|
-
- **Risk assessment** for breaking changes
|
|
314
|
-
- **Migration strategy** for existing implementation
|
|
315
|
-
- **Selective updates** only to affected components
|
|
316
|
-
|
|
317
|
-
### 3. Implementation Continuity
|
|
318
|
-
- **Task status preservation** for completed work
|
|
319
|
-
- **Clear annotation** of what needs rework
|
|
320
|
-
- **Priority reassessment** based on changes
|
|
321
|
-
- **Timeline impact** analysis
|
|
322
|
-
|
|
323
|
-
### 4. Change Documentation
|
|
324
|
-
- **Detailed change logs** for audit trail
|
|
325
|
-
- **Before/after comparison** capability
|
|
326
|
-
- **Modification rationale** capture
|
|
327
|
-
- **Rollback instructions** for safety
|
|
328
|
-
|
|
329
|
-
## Example Usage Flow
|
|
330
|
-
|
|
331
|
-
```
|
|
332
|
-
Developer: /edit-spec "user-auth" "add biometric authentication"
|
|
333
|
-
|
|
334
|
-
Agent: I found your user authentication specification from 2024-01-15. Let me load the current state...
|
|
335
|
-
|
|
336
|
-
[Loads spec.md, tasks.md, and sub-specs]
|
|
337
|
-
|
|
338
|
-
Current specification includes email/password auth with OAuth social login. I see there are 8 user stories, with 3 already implemented in your codebase.
|
|
339
|
-
|
|
340
|
-
I have a concern about adding biometric authentication: your current implementation is web-focused, but biometric auth typically requires native mobile or desktop apps. I see no mobile components in your existing specification.
|
|
341
|
-
|
|
342
|
-
First question: Are you planning to add mobile app development to this specification, or do you want to use WebAuthn for browser-based biometric authentication?
|
|
343
|
-
|
|
344
|
-
Developer: WebAuthn for browser-based
|
|
345
|
-
|
|
346
|
-
Agent: That makes more sense with your existing web architecture. However, WebAuthn requires HTTPS and has limited browser support. I see your current implementation supports users who may be on older browsers.
|
|
347
|
-
|
|
348
|
-
Should we make biometric authentication an optional enhancement for supported browsers, or do you want to require it for all users (which might break compatibility)?
|
|
349
|
-
|
|
350
|
-
Developer: Optional enhancement for supported browsers
|
|
351
|
-
|
|
352
|
-
Agent: [Continues with more questions about UX, fallback behavior, etc.]
|
|
353
|
-
|
|
354
|
-
## Modification Contract
|
|
355
|
-
|
|
356
|
-
**Target Specification:** User Authentication System (2024-01-15)
|
|
357
|
-
|
|
358
|
-
**Proposed Changes:** Add WebAuthn biometric authentication as optional enhancement
|
|
359
|
-
|
|
360
|
-
**Change Type:** Addition (with graceful degradation)
|
|
361
|
-
|
|
362
|
-
**Impact Assessment:**
|
|
363
|
-
- **User Stories Affected:** Story 2 (Login flow) needs biometric option
|
|
364
|
-
- **Technical Components Affected:** Frontend auth component, browser capability detection
|
|
365
|
-
- **Implementation Status:** 3/8 stories completed, none affected by this change
|
|
366
|
-
|
|
367
|
-
**Migration Strategy:**
|
|
368
|
-
- Existing auth flows remain unchanged
|
|
369
|
-
- Add biometric as progressive enhancement
|
|
370
|
-
- No breaking changes to current implementation
|
|
371
|
-
|
|
372
|
-
**Updated Success Criteria:** Users can log in with biometrics on supported browsers, fallback to existing methods
|
|
373
|
-
|
|
374
|
-
**⚠️ Risks & Concerns:**
|
|
375
|
-
- Browser support varies (Chrome 67+, Firefox 60+, Safari 14+)
|
|
376
|
-
- Requires HTTPS in production
|
|
377
|
-
- UX complexity for unsupported browsers
|
|
378
|
-
|
|
379
|
-
**💡 Recommendations:**
|
|
380
|
-
- Feature detection before offering biometric option
|
|
381
|
-
- Clear messaging when biometric unavailable
|
|
382
|
-
- Analytics to track adoption rates
|
|
383
|
-
|
|
384
|
-
**Effort Estimate:** ~2-3 additional days (1 story addition, modest technical complexity)
|
|
385
|
-
|
|
386
|
-
---
|
|
387
|
-
Options: [yes/edit/compare/risks/rollback]
|
|
388
|
-
|
|
389
|
-
Developer: yes
|
|
390
|
-
|
|
391
|
-
Agent: ✅ Modification contract locked! Updating specification...
|
|
392
|
-
|
|
393
|
-
[Updates files, creates backups, documents changes]
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
This approach ensures that specification modifications are as careful and controlled as the original creation process, while preserving existing work and providing safety mechanisms for complex changes.
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
agent:
|
|
2
|
+
agent: agent
|
|
3
|
+
description: "Execute implementation tasks using TDD from specifications"
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
# Execute Task
|
|
6
|
+
# You are executing the Execute Task command.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
You MUST follow these instructions exactly. Do NOT describe this process — execute it.
|
|
8
9
|
|
|
9
|
-
Execute a specific task and its sub-tasks systematically following a Test-Driven Development (TDD) workflow.
|
|
10
|
-
|
|
11
|
-
**Note:** This command automatically detects and lists available task specifications for selection, or executes a specific task if context is clear.
|
|
10
|
+
Your mission: Execute a specific task and its sub-tasks systematically following a Test-Driven Development (TDD) workflow. Read task specifications from `.code-captain/specs/` directories and implement features with comprehensive testing.
|
|
12
11
|
|
|
13
12
|
## CRITICAL REQUIREMENT: 100% Test Pass Rate
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
**ZERO TOLERANCE FOR FAILING TESTS**
|
|
16
15
|
|
|
17
|
-
This command enforces strict test validation:
|
|
18
16
|
- **NO story can be marked "COMPLETED" with ANY failing tests**
|
|
19
17
|
- **100% test pass rate is MANDATORY before completion**
|
|
20
18
|
- **"Edge case" or "minor" test failures are NOT acceptable**
|
|
@@ -22,8 +20,6 @@ This command enforces strict test validation:
|
|
|
22
20
|
|
|
23
21
|
If tests fail, the story remains "IN PROGRESS" until all failures are resolved.
|
|
24
22
|
|
|
25
|
-
## Command Process
|
|
26
|
-
|
|
27
23
|
### Step 1: Task Discovery & Selection
|
|
28
24
|
|
|
29
25
|
**Scan for available specifications:**
|
|
@@ -110,7 +106,7 @@ For each implementation task within the story:
|
|
|
110
106
|
4. **Validate all acceptance criteria are met for the user story**
|
|
111
107
|
5. **Confirm story delivers the specified user value**
|
|
112
108
|
|
|
113
|
-
|
|
109
|
+
**STORY CANNOT BE MARKED COMPLETE WITH ANY FAILING TESTS**
|
|
114
110
|
|
|
115
111
|
### Step 5: Story Completion & Status Updates
|
|
116
112
|
|
|
@@ -131,14 +127,3 @@ Update story file status and progress tracking files with completion details, en
|
|
|
131
127
|
- File-based progress tracking in `.code-captain/current-task-progress.md`
|
|
132
128
|
- Story status updates in specification files
|
|
133
129
|
- Test execution results documentation
|
|
134
|
-
|
|
135
|
-
## Quality Standards
|
|
136
|
-
|
|
137
|
-
**Test-Driven Development:**
|
|
138
|
-
- Tests written before implementation
|
|
139
|
-
- **100% test pass rate MANDATORY before task completion**
|
|
140
|
-
- **ZERO TOLERANCE for failing tests - no story completion with any failures**
|
|
141
|
-
- Comprehensive coverage including edge cases
|
|
142
|
-
- Regression testing for existing functionality
|
|
143
|
-
|
|
144
|
-
This command ensures systematic, test-driven implementation with proper documentation and progress tracking using file-based systems compatible with GitHub Copilot.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
agent:
|
|
2
|
+
agent: agent
|
|
3
|
+
description: "Generate comprehensive code explanations with diagrams"
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
# Explain Code
|
|
6
|
+
# You are executing the Explain Code command.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
You MUST follow these instructions exactly. Do NOT describe this process — execute it.
|
|
8
9
|
|
|
9
|
-
Provide comprehensive,
|
|
10
|
+
Your mission: Provide a comprehensive, visual explanation of the specified code target. Combine natural language explanations with Mermaid diagrams to help the developer understand the code quickly and thoroughly.
|
|
10
11
|
|
|
11
12
|
## Parameters
|
|
12
13
|
|
|
@@ -46,31 +47,31 @@ The command automatically:
|
|
|
46
47
|
|
|
47
48
|
## Output Structure
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
Display in chat and automatically save to `.code-captain/explanations/`.
|
|
50
51
|
|
|
51
52
|
### Chat Display
|
|
52
53
|
|
|
53
54
|
```
|
|
54
|
-
|
|
55
|
+
Function Overview
|
|
55
56
|
├── Purpose: What this code does
|
|
56
57
|
├── Parameters: Input expectations
|
|
57
58
|
├── Return Value: What it outputs
|
|
58
59
|
├── Key Logic: Step-by-step breakdown
|
|
59
60
|
└── Usage Examples: How to call it
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
Execution Flow
|
|
62
63
|
├── [Flowchart diagram showing decision paths]
|
|
63
64
|
├── Decision points and branches
|
|
64
65
|
├── Error handling paths
|
|
65
66
|
└── Performance characteristics
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
Architecture Context
|
|
68
69
|
├── Where this fits in the system
|
|
69
70
|
├── Dependencies and related components
|
|
70
71
|
├── Design patterns used
|
|
71
72
|
└── Integration points
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
Technical Details
|
|
74
75
|
├── Time complexity
|
|
75
76
|
├── Memory usage
|
|
76
77
|
├── Potential issues
|
|
@@ -79,6 +80,8 @@ All explanations are displayed in chat and automatically saved to `.code-captain
|
|
|
79
80
|
|
|
80
81
|
### Saved Format
|
|
81
82
|
|
|
83
|
+
Save as `.code-captain/explanations/[DATE]-[target-name].md`:
|
|
84
|
+
|
|
82
85
|
````markdown
|
|
83
86
|
# Code Explanation: [Target Name]
|
|
84
87
|
|
|
@@ -116,99 +119,11 @@ _Generated by Code Captain on [timestamp]_
|
|
|
116
119
|
_Last updated: [timestamp]_
|
|
117
120
|
````
|
|
118
121
|
|
|
119
|
-
## File Organization
|
|
120
|
-
|
|
121
|
-
Saved explanations are stored with date prefixes for chronological organization:
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
.code-captain/
|
|
125
|
-
└── explanations/
|
|
126
|
-
├── 2024-01-15-AuthenticationFlow.md
|
|
127
|
-
├── 2024-01-16-PaymentProcessor.md
|
|
128
|
-
├── 2024-01-16-UserService.md
|
|
129
|
-
└── 2024-01-17-SearchAlgorithm.md
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Files are named using the format: `[DATE]-[target-name].md` where DATE is YYYY-MM-DD format.
|
|
133
|
-
|
|
134
122
|
## Auto-Save Behavior
|
|
135
123
|
|
|
136
|
-
All explanations are automatically saved to `.code-captain/explanations/` using the format `[DATE]-[target-name].md`.
|
|
137
|
-
|
|
138
124
|
Get current date by running: `npx @devobsessed/code-captain date`
|
|
139
125
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
## Integration Points
|
|
143
|
-
|
|
144
|
-
### With Other Commands
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
# Saved explanations can be referenced by other commands
|
|
148
|
-
/research authentication
|
|
149
|
-
/create-spec payment-processing
|
|
150
|
-
/execute-task "optimize the user search"
|
|
151
|
-
|
|
152
|
-
# AI can access saved explanations from .code-captain/explanations/
|
|
153
|
-
# to provide better context for other commands
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### With IDE Integration
|
|
157
|
-
|
|
158
|
-
- Hover over function calls to see saved explanations
|
|
159
|
-
- Right-click context menu: "Explain with Code Captain"
|
|
160
|
-
- Inline explanation widgets for complex code blocks
|
|
161
|
-
|
|
162
|
-
## Management Commands
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
# List all saved explanations
|
|
166
|
-
/list-explanations
|
|
167
|
-
|
|
168
|
-
# Search explanations
|
|
169
|
-
/search-explanations "authentication"
|
|
170
|
-
|
|
171
|
-
# Show explanation history
|
|
172
|
-
/explanation-history calculateDiscount
|
|
173
|
-
|
|
174
|
-
# Update outdated explanations when code changes
|
|
175
|
-
/refresh-explanations --check-code-changes
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## Diagram Types Generated
|
|
179
|
-
|
|
180
|
-
### Flowcharts
|
|
181
|
-
|
|
182
|
-
- Control flow through functions
|
|
183
|
-
- Decision trees for complex logic
|
|
184
|
-
- Error handling paths
|
|
185
|
-
|
|
186
|
-
### Sequence Diagrams
|
|
187
|
-
|
|
188
|
-
- Function call sequences
|
|
189
|
-
- API interaction flows
|
|
190
|
-
- Database transaction flows
|
|
191
|
-
|
|
192
|
-
### Class Diagrams
|
|
193
|
-
|
|
194
|
-
- Object relationships
|
|
195
|
-
- Inheritance hierarchies
|
|
196
|
-
- Dependency structures
|
|
197
|
-
|
|
198
|
-
### Architecture Diagrams
|
|
199
|
-
|
|
200
|
-
- Component interactions
|
|
201
|
-
- Data flow through system
|
|
202
|
-
- Service communication patterns
|
|
203
|
-
|
|
204
|
-
## Output Characteristics
|
|
205
|
-
|
|
206
|
-
All explanations use a consistent intermediate technical level that balances accessibility with depth:
|
|
207
|
-
|
|
208
|
-
- **Technical but accessible**: Explains how the code works with some optimization details
|
|
209
|
-
- **Full context**: Always includes related functions, dependencies, and architectural context
|
|
210
|
-
- **Visual diagrams**: Every explanation includes appropriate flowcharts, sequence diagrams, or class diagrams
|
|
211
|
-
- **Comprehensive coverage**: Shows how the code fits in the entire system
|
|
126
|
+
Save all explanations automatically to `.code-captain/explanations/` using the format `[DATE]-[target-name].md`.
|
|
212
127
|
|
|
213
128
|
## AI Processing Workflow
|
|
214
129
|
|
|
@@ -217,7 +132,7 @@ All explanations use a consistent intermediate technical level that balances acc
|
|
|
217
132
|
3. **Explanation Generation**: Create intermediate-level natural language description
|
|
218
133
|
4. **Diagram Creation**: Generate appropriate visual representations (flowcharts, sequence, class diagrams)
|
|
219
134
|
5. **Formatting**: Structure output for both chat display and markdown file
|
|
220
|
-
6. **Auto-Save**: Save explanation to `.code-captain/explanations/` with date-prefixed filename
|
|
135
|
+
6. **Auto-Save**: Save explanation to `.code-captain/explanations/` with date-prefixed filename
|
|
221
136
|
|
|
222
137
|
## Tool Integration
|
|
223
138
|
|
|
@@ -234,43 +149,3 @@ All explanations use a consistent intermediate technical level that balances acc
|
|
|
234
149
|
- Explanations stored in `.code-captain/explanations/`
|
|
235
150
|
- Date-prefixed filenames for chronological organization
|
|
236
151
|
- Cross-references to related explanations and components
|
|
237
|
-
|
|
238
|
-
## Error Handling
|
|
239
|
-
|
|
240
|
-
### Common Issues
|
|
241
|
-
|
|
242
|
-
- **Code not found**: "Could not locate [target]. Please check the path/name."
|
|
243
|
-
- **Too complex**: "This code is very complex. Consider breaking into smaller explanations."
|
|
244
|
-
- **Limited context**: "Some context may be missing. Ensure related files are accessible."
|
|
245
|
-
|
|
246
|
-
### Fallback Behaviors
|
|
247
|
-
|
|
248
|
-
- If diagrams fail to generate, provide text-based flow description
|
|
249
|
-
- If target is ambiguous, offer multiple options to choose from
|
|
250
|
-
- If code is too large, suggest breaking into smaller segments
|
|
251
|
-
|
|
252
|
-
## Success Metrics
|
|
253
|
-
|
|
254
|
-
Track effectiveness through:
|
|
255
|
-
|
|
256
|
-
- Explanation clarity ratings from users
|
|
257
|
-
- Frequency of re-explanations for same code
|
|
258
|
-
- Time saved in code reviews and onboarding
|
|
259
|
-
- Reduction in "what does this do?" questions during development
|
|
260
|
-
|
|
261
|
-
## Future Enhancements
|
|
262
|
-
|
|
263
|
-
### Planned Features
|
|
264
|
-
|
|
265
|
-
- Interactive explanations with expandable sections
|
|
266
|
-
- Voice-generated explanations for accessibility
|
|
267
|
-
- Integration with code review tools
|
|
268
|
-
- Automatic explanation updates when code changes
|
|
269
|
-
- Explanation versioning and history tracking
|
|
270
|
-
|
|
271
|
-
### Advanced Capabilities
|
|
272
|
-
|
|
273
|
-
- Performance profiling integration
|
|
274
|
-
- Security vulnerability highlighting in explanations
|
|
275
|
-
- Code quality suggestions as part of explanations
|
|
276
|
-
- Integration with documentation generation tools
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
agent:
|
|
2
|
+
agent: agent
|
|
3
|
+
description: "Analyze and set up project foundation with documentation"
|
|
3
4
|
---
|
|
4
5
|
|
|
5
|
-
# Initialize
|
|
6
|
+
# You are executing the Initialize command.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
You MUST follow these instructions exactly. Do NOT describe this process — execute it.
|
|
8
9
|
|
|
9
|
-
Analyze and set up technical foundation
|
|
10
|
-
|
|
11
|
-
## Command Process
|
|
10
|
+
Your mission: Analyze the current project and set up the technical foundation. Detect whether this is a greenfield (new) or brownfield (existing) project, scan the codebase, and generate foundational documentation.
|
|
12
11
|
|
|
13
12
|
### Step 1: Project Type Detection
|
|
14
13
|
|
|
@@ -35,10 +34,10 @@ Analyze and set up technical foundation for either greenfield (new) or brownfiel
|
|
|
35
34
|
|
|
36
35
|
Generate foundational documents in `.code-captain/docs/`:
|
|
37
36
|
|
|
38
|
-
**tech-stack.md** - Complete technology inventory and analysis
|
|
39
|
-
**code-style.md** - Observed patterns and coding conventions
|
|
40
|
-
**objective.md** - Inferred or defined project purpose and goals
|
|
41
|
-
**architecture.md** - System architecture overview and decisions
|
|
37
|
+
- **tech-stack.md** - Complete technology inventory and analysis
|
|
38
|
+
- **code-style.md** - Observed patterns and coding conventions
|
|
39
|
+
- **objective.md** - Inferred or defined project purpose and goals
|
|
40
|
+
- **architecture.md** - System architecture overview and decisions
|
|
42
41
|
|
|
43
42
|
### Step 4: Next Steps Recommendation
|
|
44
43
|
|
|
@@ -61,5 +60,3 @@ Provide clear guidance on next steps, typically:
|
|
|
61
60
|
**Documentation organization:**
|
|
62
61
|
- Progress documented in `.code-captain/initialization-progress.md`
|
|
63
62
|
- Results organized in `.code-captain/docs/` folder
|
|
64
|
-
|
|
65
|
-
This command provides comprehensive project analysis and setup using GitHub Copilot's native capabilities.
|