@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.
- package/README.md +214 -0
- package/bin/install.js +1048 -0
- package/claude-code/README.md +276 -0
- package/claude-code/agents/code-captain.md +121 -0
- package/claude-code/agents/spec-generator.md +271 -0
- package/claude-code/agents/story-creator.md +309 -0
- package/claude-code/agents/tech-spec.md +440 -0
- package/claude-code/commands/cc-initialize.md +520 -0
- package/copilot/README.md +210 -0
- package/copilot/chatmodes/Code Captain.chatmode.md +60 -0
- package/copilot/docs/best-practices.md +74 -0
- package/copilot/prompts/create-adr.prompt.md +468 -0
- package/copilot/prompts/create-spec.prompt.md +430 -0
- package/copilot/prompts/edit-spec.prompt.md +396 -0
- package/copilot/prompts/execute-task.prompt.md +144 -0
- package/copilot/prompts/explain-code.prompt.md +292 -0
- package/copilot/prompts/initialize.prompt.md +65 -0
- package/copilot/prompts/new-command.prompt.md +310 -0
- package/copilot/prompts/plan-product.prompt.md +450 -0
- package/copilot/prompts/research.prompt.md +329 -0
- package/copilot/prompts/status.prompt.md +424 -0
- package/copilot/prompts/swab.prompt.md +217 -0
- package/cursor/README.md +224 -0
- package/cursor/cc.md +183 -0
- package/cursor/cc.mdc +69 -0
- package/cursor/commands/create-adr.md +504 -0
- package/cursor/commands/create-spec.md +430 -0
- package/cursor/commands/edit-spec.md +405 -0
- package/cursor/commands/execute-task.md +514 -0
- package/cursor/commands/explain-code.md +289 -0
- package/cursor/commands/initialize.md +397 -0
- package/cursor/commands/new-command.md +312 -0
- package/cursor/commands/plan-product.md +466 -0
- package/cursor/commands/research.md +317 -0
- package/cursor/commands/status.md +413 -0
- package/cursor/commands/swab.md +209 -0
- package/cursor/docs/best-practices.md +74 -0
- package/cursor/integrations/azure-devops/create-azure-work-items.md +403 -0
- package/cursor/integrations/azure-devops/sync-azure-work-items.md +486 -0
- package/cursor/integrations/github/create-github-issues.md +765 -0
- package/cursor/integrations/github/scripts/create-issues-batch.sh +272 -0
- package/cursor/integrations/github/sync-github-issues.md +237 -0
- package/cursor/integrations/github/sync.md +305 -0
- package/manifest.json +381 -0
- package/package.json +58 -0
- package/windsurf/README.md +254 -0
- package/windsurf/rules/cc.md +5 -0
- package/windsurf/workflows/create-adr.md +331 -0
- package/windsurf/workflows/create-spec.md +280 -0
- package/windsurf/workflows/edit-spec.md +273 -0
- package/windsurf/workflows/execute-task.md +276 -0
- package/windsurf/workflows/explain-code.md +292 -0
- package/windsurf/workflows/initialize.md +298 -0
- package/windsurf/workflows/new-command.md +321 -0
- package/windsurf/workflows/status.md +213 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
mode: agent
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Explain Code Command
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Provide comprehensive, AI-powered explanations of code segments, functions, classes, or entire files. This command combines natural language explanations with visual diagrams to help developers understand complex code quickly and thoroughly.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
### Target (Required)
|
|
14
|
+
|
|
15
|
+
- `[function-name]` - Specific function to explain
|
|
16
|
+
- `[class-name]` - Entire class explanation
|
|
17
|
+
- `[file-path]` - Explain entire file
|
|
18
|
+
- `[line-range]` - Explain specific lines (e.g., "125-150")
|
|
19
|
+
- `current-selection` - Explain currently selected code in IDE
|
|
20
|
+
|
|
21
|
+
The command automatically:
|
|
22
|
+
|
|
23
|
+
- Includes visual diagrams (flowcharts, sequence diagrams, class diagrams)
|
|
24
|
+
- Uses intermediate complexity level (technical but accessible)
|
|
25
|
+
- Provides full context (includes dependencies and related components)
|
|
26
|
+
- Saves explanations to `.code-captain/explanations/` for future reference
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
# Explain a specific function
|
|
32
|
+
/explain-code calculateUserDiscount
|
|
33
|
+
|
|
34
|
+
# Explain a class
|
|
35
|
+
/explain-code PaymentProcessor
|
|
36
|
+
|
|
37
|
+
# Explain entire file
|
|
38
|
+
/explain-code src/auth/AuthService.js
|
|
39
|
+
|
|
40
|
+
# Explain specific line range
|
|
41
|
+
/explain-code "src/utils/helpers.js:45-78"
|
|
42
|
+
|
|
43
|
+
# Explain currently selected code in IDE
|
|
44
|
+
/explain-code current-selection
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Output Structure
|
|
48
|
+
|
|
49
|
+
All explanations are displayed in chat and automatically saved to `.code-captain/explanations/`
|
|
50
|
+
|
|
51
|
+
### Chat Display
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
📋 Function Overview
|
|
55
|
+
├── Purpose: What this code does
|
|
56
|
+
├── Parameters: Input expectations
|
|
57
|
+
├── Return Value: What it outputs
|
|
58
|
+
├── Key Logic: Step-by-step breakdown
|
|
59
|
+
└── Usage Examples: How to call it
|
|
60
|
+
|
|
61
|
+
🔄 Execution Flow
|
|
62
|
+
├── [Flowchart diagram showing decision paths]
|
|
63
|
+
├── Decision points and branches
|
|
64
|
+
├── Error handling paths
|
|
65
|
+
└── Performance characteristics
|
|
66
|
+
|
|
67
|
+
🏗️ Architecture Context
|
|
68
|
+
├── Where this fits in the system
|
|
69
|
+
├── Dependencies and related components
|
|
70
|
+
├── Design patterns used
|
|
71
|
+
└── Integration points
|
|
72
|
+
|
|
73
|
+
⚡ Technical Details
|
|
74
|
+
├── Time complexity
|
|
75
|
+
├── Memory usage
|
|
76
|
+
├── Potential issues
|
|
77
|
+
└── Optimization opportunities
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Saved Format
|
|
81
|
+
|
|
82
|
+
````markdown
|
|
83
|
+
# Code Explanation: [Target Name]
|
|
84
|
+
|
|
85
|
+
_Generated on [DATE]_
|
|
86
|
+
|
|
87
|
+
## Overview
|
|
88
|
+
|
|
89
|
+
[Natural language summary]
|
|
90
|
+
|
|
91
|
+
## Execution Flow
|
|
92
|
+
|
|
93
|
+
```mermaid
|
|
94
|
+
[Generated diagram]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Detailed Breakdown
|
|
98
|
+
|
|
99
|
+
[Step-by-step explanation]
|
|
100
|
+
|
|
101
|
+
## Architecture Context
|
|
102
|
+
|
|
103
|
+
[How it fits in the system]
|
|
104
|
+
|
|
105
|
+
## Usage Examples
|
|
106
|
+
|
|
107
|
+
[Code examples]
|
|
108
|
+
|
|
109
|
+
## Related Components
|
|
110
|
+
|
|
111
|
+
[Links to other explanations]
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
_Generated by Code Captain on [timestamp]_
|
|
116
|
+
_Last updated: [timestamp]_
|
|
117
|
+
````
|
|
118
|
+
|
|
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
|
+
## Auto-Save Behavior
|
|
135
|
+
|
|
136
|
+
All explanations are automatically saved to `.code-captain/explanations/` using the format `[DATE]-[target-name].md`. The system uses the same date determination process as the research command to ensure consistent timestamps.
|
|
137
|
+
|
|
138
|
+
## Date Determination Process
|
|
139
|
+
|
|
140
|
+
### Primary Method: File System Timestamp
|
|
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`
|
|
160
|
+
|
|
161
|
+
## Integration Points
|
|
162
|
+
|
|
163
|
+
### With Other Commands
|
|
164
|
+
```
|
|
165
|
+
# Saved explanations can be referenced by other commands
|
|
166
|
+
/research authentication
|
|
167
|
+
/create-spec payment-processing
|
|
168
|
+
/execute-task "optimize the user search"
|
|
169
|
+
|
|
170
|
+
# AI can access saved explanations from .code-captain/explanations/
|
|
171
|
+
# to provide better context for other commands
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### With IDE Integration
|
|
175
|
+
|
|
176
|
+
- Hover over function calls to see saved explanations
|
|
177
|
+
- Right-click context menu: "Explain with Code Captain"
|
|
178
|
+
- Inline explanation widgets for complex code blocks
|
|
179
|
+
|
|
180
|
+
## Management Commands
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
# List all saved explanations
|
|
184
|
+
/list-explanations
|
|
185
|
+
|
|
186
|
+
# Search explanations
|
|
187
|
+
/search-explanations "authentication"
|
|
188
|
+
|
|
189
|
+
# Show explanation history
|
|
190
|
+
/explanation-history calculateDiscount
|
|
191
|
+
|
|
192
|
+
# Update outdated explanations when code changes
|
|
193
|
+
/refresh-explanations --check-code-changes
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Diagram Types Generated
|
|
197
|
+
|
|
198
|
+
### Flowcharts
|
|
199
|
+
|
|
200
|
+
- Control flow through functions
|
|
201
|
+
- Decision trees for complex logic
|
|
202
|
+
- Error handling paths
|
|
203
|
+
|
|
204
|
+
### Sequence Diagrams
|
|
205
|
+
|
|
206
|
+
- Function call sequences
|
|
207
|
+
- API interaction flows
|
|
208
|
+
- Database transaction flows
|
|
209
|
+
|
|
210
|
+
### Class Diagrams
|
|
211
|
+
|
|
212
|
+
- Object relationships
|
|
213
|
+
- Inheritance hierarchies
|
|
214
|
+
- Dependency structures
|
|
215
|
+
|
|
216
|
+
### Architecture Diagrams
|
|
217
|
+
|
|
218
|
+
- Component interactions
|
|
219
|
+
- Data flow through system
|
|
220
|
+
- Service communication patterns
|
|
221
|
+
|
|
222
|
+
## Output Characteristics
|
|
223
|
+
|
|
224
|
+
All explanations use a consistent intermediate technical level that balances accessibility with depth:
|
|
225
|
+
|
|
226
|
+
- **Technical but accessible**: Explains how the code works with some optimization details
|
|
227
|
+
- **Full context**: Always includes related functions, dependencies, and architectural context
|
|
228
|
+
- **Visual diagrams**: Every explanation includes appropriate flowcharts, sequence diagrams, or class diagrams
|
|
229
|
+
- **Comprehensive coverage**: Shows how the code fits in the entire system
|
|
230
|
+
|
|
231
|
+
## AI Processing Workflow
|
|
232
|
+
|
|
233
|
+
1. **Code Analysis**: Parse syntax, identify patterns, measure complexity
|
|
234
|
+
2. **Context Gathering**: Understand surrounding code and dependencies
|
|
235
|
+
3. **Explanation Generation**: Create intermediate-level natural language description
|
|
236
|
+
4. **Diagram Creation**: Generate appropriate visual representations (flowcharts, sequence, class diagrams)
|
|
237
|
+
5. **Formatting**: Structure output for both chat display and markdown file
|
|
238
|
+
6. **Auto-Save**: Save explanation to `.code-captain/explanations/` with date-prefixed filename `[DATE]-[target-name].md`
|
|
239
|
+
|
|
240
|
+
## Tool Integration
|
|
241
|
+
|
|
242
|
+
**Primary tools:**
|
|
243
|
+
- `codebase` - Analyzing code structure and dependencies
|
|
244
|
+
- `search` - Finding related components and existing explanations
|
|
245
|
+
- `editFiles` - Creating explanation documents
|
|
246
|
+
- `runCommands` - Date determination and directory creation
|
|
247
|
+
- `usages` - Understanding how code is used throughout the system
|
|
248
|
+
|
|
249
|
+
**Documentation organization:**
|
|
250
|
+
- Explanations stored in `.code-captain/explanations/`
|
|
251
|
+
- Date-prefixed filenames for chronological organization
|
|
252
|
+
- Cross-references to related explanations and components
|
|
253
|
+
|
|
254
|
+
## Error Handling
|
|
255
|
+
|
|
256
|
+
### Common Issues
|
|
257
|
+
|
|
258
|
+
- **Code not found**: "Could not locate [target]. Please check the path/name."
|
|
259
|
+
- **Too complex**: "This code is very complex. Consider breaking into smaller explanations."
|
|
260
|
+
- **Limited context**: "Some context may be missing. Ensure related files are accessible."
|
|
261
|
+
|
|
262
|
+
### Fallback Behaviors
|
|
263
|
+
|
|
264
|
+
- If diagrams fail to generate, provide text-based flow description
|
|
265
|
+
- If target is ambiguous, offer multiple options to choose from
|
|
266
|
+
- If code is too large, suggest breaking into smaller segments
|
|
267
|
+
|
|
268
|
+
## Success Metrics
|
|
269
|
+
|
|
270
|
+
Track effectiveness through:
|
|
271
|
+
|
|
272
|
+
- Explanation clarity ratings from users
|
|
273
|
+
- Frequency of re-explanations for same code
|
|
274
|
+
- Time saved in code reviews and onboarding
|
|
275
|
+
- Reduction in "what does this do?" questions during development
|
|
276
|
+
|
|
277
|
+
## Future Enhancements
|
|
278
|
+
|
|
279
|
+
### Planned Features
|
|
280
|
+
|
|
281
|
+
- Interactive explanations with expandable sections
|
|
282
|
+
- Voice-generated explanations for accessibility
|
|
283
|
+
- Integration with code review tools
|
|
284
|
+
- Automatic explanation updates when code changes
|
|
285
|
+
- Explanation versioning and history tracking
|
|
286
|
+
|
|
287
|
+
### Advanced Capabilities
|
|
288
|
+
|
|
289
|
+
- Performance profiling integration
|
|
290
|
+
- Security vulnerability highlighting in explanations
|
|
291
|
+
- Code quality suggestions as part of explanations
|
|
292
|
+
- Integration with documentation generation tools
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
mode: agent
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Initialize Command
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Analyze and set up technical foundation for either greenfield (new) or brownfield (existing) projects. This command intelligently detects project type, scans the codebase, and generates foundational documentation including technology stack analysis, code style guide, and architectural overview.
|
|
10
|
+
|
|
11
|
+
## Command Process
|
|
12
|
+
|
|
13
|
+
### Step 1: Project Type Detection
|
|
14
|
+
|
|
15
|
+
**Scan for existing code:**
|
|
16
|
+
- Check for common files indicating existing project (package.json, pom.xml, etc.)
|
|
17
|
+
- Detect programming languages and frameworks
|
|
18
|
+
- Identify project structure patterns
|
|
19
|
+
- Determine if greenfield (new) or brownfield (existing) project
|
|
20
|
+
|
|
21
|
+
### Step 2: Project Analysis
|
|
22
|
+
|
|
23
|
+
**For Brownfield Projects:**
|
|
24
|
+
- Scan codebase for technology stack inventory
|
|
25
|
+
- Analyze code patterns and conventions
|
|
26
|
+
- Infer project purpose and goals
|
|
27
|
+
- Generate comprehensive documentation
|
|
28
|
+
|
|
29
|
+
**For Greenfield Projects:**
|
|
30
|
+
- Guide through strategic project setup questions
|
|
31
|
+
- Recommend technology stack based on requirements
|
|
32
|
+
- Create project foundation structure
|
|
33
|
+
|
|
34
|
+
### Step 3: Documentation Generation
|
|
35
|
+
|
|
36
|
+
Generate foundational documents in `.code-captain/docs/`:
|
|
37
|
+
|
|
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
|
|
42
|
+
|
|
43
|
+
### Step 4: Next Steps Recommendation
|
|
44
|
+
|
|
45
|
+
Provide clear guidance on next steps, typically:
|
|
46
|
+
1. **`/plan-product`** - For product strategy and vision planning
|
|
47
|
+
2. **`/create-spec`** - For specific feature development
|
|
48
|
+
3. **`/research`** - For technology investigation needs
|
|
49
|
+
|
|
50
|
+
## Tool Integration
|
|
51
|
+
|
|
52
|
+
**Primary tools:**
|
|
53
|
+
- `codebase` - Analyzing codebase patterns and structure
|
|
54
|
+
- `search` - Finding specific patterns and technologies
|
|
55
|
+
- `editFiles` - Creating foundational documentation
|
|
56
|
+
- `runCommands` - Detecting build tools and dependencies
|
|
57
|
+
- `githubRepo` - Understanding repository context and history
|
|
58
|
+
- `findTestFiles` - Locating test files and patterns
|
|
59
|
+
- `problems` - Identifying code issues
|
|
60
|
+
|
|
61
|
+
**Documentation organization:**
|
|
62
|
+
- Progress documented in `.code-captain/initialization-progress.md`
|
|
63
|
+
- Results organized in `.code-captain/docs/` folder
|
|
64
|
+
|
|
65
|
+
This command provides comprehensive project analysis and setup using GitHub Copilot's native capabilities.
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
---
|
|
2
|
+
mode: agent
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# New Command Creator
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
A meta command that creates new Code Captain commands following established patterns and conventions. This command generates properly structured command files, updates documentation, and ensures consistency across the Code Captain ecosystem.
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
# Create optimization command
|
|
15
|
+
/new-command "optimize" "Performance optimization for slow code sections"
|
|
16
|
+
|
|
17
|
+
# Create deployment command
|
|
18
|
+
/new-command "deploy" "Deploy applications to various cloud platforms"
|
|
19
|
+
|
|
20
|
+
# Create test generation command
|
|
21
|
+
/new-command "test-gen" "Generate comprehensive test suites from existing code"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Command Process
|
|
25
|
+
|
|
26
|
+
### Step 1: Command Specification Gathering
|
|
27
|
+
|
|
28
|
+
**Initial Input Processing:**
|
|
29
|
+
- Parse command name (validate format: lowercase, hyphens allowed)
|
|
30
|
+
- Extract brief description from user input
|
|
31
|
+
- Validate command name doesn't conflict with existing commands
|
|
32
|
+
|
|
33
|
+
**Interactive Specification Building:**
|
|
34
|
+
Ask clarifying questions to build complete command specification:
|
|
35
|
+
|
|
36
|
+
1. **Command Category**: "Is this a [Setup/Analysis/Implementation/Integration] command?"
|
|
37
|
+
2. **Execution Style**: "Should this use contract style (extensive clarification rounds like create-spec) or direct execution (immediate action like swab)?"
|
|
38
|
+
3. **Usage Pattern**: "Does it take arguments, flags, or is it standalone?"
|
|
39
|
+
4. **AI Coordination**: "Does it need AI prompts for complex decision-making?"
|
|
40
|
+
5. **Output Location**: "Where should outputs be stored? (.code-captain/[folder])"
|
|
41
|
+
6. **Tool Integration**: "Which GitHub Copilot tools will it use? (codebase, search, etc.)"
|
|
42
|
+
7. **Workflow Steps**: "What are the main phases/steps the command follows?"
|
|
43
|
+
|
|
44
|
+
### Step 2: Command Structure Generation
|
|
45
|
+
|
|
46
|
+
**Generate Standard Prompt File Structure:**
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
---
|
|
50
|
+
mode: agent
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
# [Command Name] Command
|
|
54
|
+
|
|
55
|
+
## Overview
|
|
56
|
+
[Generated from description and clarifying questions]
|
|
57
|
+
|
|
58
|
+
## Command Process
|
|
59
|
+
|
|
60
|
+
### Step 1: [Phase Name]
|
|
61
|
+
[Generated workflow steps]
|
|
62
|
+
|
|
63
|
+
### Step 2: [Phase Name]
|
|
64
|
+
[Generated workflow steps]
|
|
65
|
+
|
|
66
|
+
## Tool Integration
|
|
67
|
+
[Generated based on command type]
|
|
68
|
+
|
|
69
|
+
## AI Implementation Prompt
|
|
70
|
+
[Generated if AI coordination needed]
|
|
71
|
+
|
|
72
|
+
## Integration Notes
|
|
73
|
+
[Generated integration details]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Template Sections Based on Command Type and Execution Style:**
|
|
77
|
+
|
|
78
|
+
**Contract Style Commands** (like `/create-spec`, `/create-adr`):
|
|
79
|
+
- Phase 1: Contract Establishment (No File Creation)
|
|
80
|
+
- Interactive clarification rounds with structured questions
|
|
81
|
+
- Critical analysis and assumption challenging
|
|
82
|
+
- Echo check/contract proposal phase
|
|
83
|
+
- Explicit user agreement before proceeding
|
|
84
|
+
|
|
85
|
+
**Direct Execution Commands** (like `/swab`, `/execute-task`):
|
|
86
|
+
- Immediate action workflows
|
|
87
|
+
- Minimal clarification if needed
|
|
88
|
+
- Clear step-by-step execution
|
|
89
|
+
- Progress feedback and completion confirmation
|
|
90
|
+
|
|
91
|
+
**Setup/Analysis Commands:**
|
|
92
|
+
- Context scanning steps
|
|
93
|
+
- File generation workflows
|
|
94
|
+
- Progress tracking workflows
|
|
95
|
+
|
|
96
|
+
**Implementation Commands:**
|
|
97
|
+
- TDD workflows if applicable
|
|
98
|
+
- Code modification steps
|
|
99
|
+
- Verification procedures
|
|
100
|
+
|
|
101
|
+
**Integration Commands:**
|
|
102
|
+
- Platform-specific API interactions
|
|
103
|
+
- Sync and conflict resolution
|
|
104
|
+
- Error handling patterns
|
|
105
|
+
|
|
106
|
+
### Step 3: Documentation Integration
|
|
107
|
+
|
|
108
|
+
**Provide guidance for documentation updates:**
|
|
109
|
+
|
|
110
|
+
1. **Command Documentation:**
|
|
111
|
+
- Generate complete prompt file structure
|
|
112
|
+
- Include usage examples and integration notes
|
|
113
|
+
- Provide clear implementation guidelines
|
|
114
|
+
|
|
115
|
+
2. **Integration Recommendations:**
|
|
116
|
+
- Suggest where command fits in existing workflow
|
|
117
|
+
- Identify related commands and dependencies
|
|
118
|
+
- Recommend documentation updates if needed
|
|
119
|
+
|
|
120
|
+
### Step 4: Validation and Integration
|
|
121
|
+
|
|
122
|
+
**Verify Command Integration:**
|
|
123
|
+
- Check command file syntax and structure
|
|
124
|
+
- Validate documentation updates
|
|
125
|
+
- Ensure no conflicts with existing commands
|
|
126
|
+
- Run basic structure validation
|
|
127
|
+
|
|
128
|
+
**Present Summary:**
|
|
129
|
+
```
|
|
130
|
+
✅ New command prompt created successfully!
|
|
131
|
+
|
|
132
|
+
📁 Generated Content:
|
|
133
|
+
- .github/prompts/[command-name].prompt.md
|
|
134
|
+
- Complete prompt file structure with frontmatter
|
|
135
|
+
- Usage examples and documentation
|
|
136
|
+
- Integration guidelines and recommendations
|
|
137
|
+
|
|
138
|
+
🚀 Command Ready:
|
|
139
|
+
Usage: /[command-name] [args]
|
|
140
|
+
Implementation: Follow generated prompt structure
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Core Rules
|
|
144
|
+
|
|
145
|
+
1. **Consistent Structure** - All generated commands follow established patterns
|
|
146
|
+
2. **Clear Documentation** - Each section has purpose and implementation details
|
|
147
|
+
3. **Integration Guidance** - Provides recommendations for documentation and workflow integration
|
|
148
|
+
4. **Validation Required** - Check for conflicts and proper structure
|
|
149
|
+
5. **Template Flexibility** - Adapt template based on command type and requirements
|
|
150
|
+
6. **Language & Shell Agnostic** - Commands should work across different programming languages and shell environments, using Code Captain's existing tools rather than making assumptions about tech stack
|
|
151
|
+
|
|
152
|
+
## AI Implementation Prompt
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
You are creating a new Code Captain command following established patterns.
|
|
156
|
+
|
|
157
|
+
MISSION: Generate a complete, well-structured command file and update documentation.
|
|
158
|
+
|
|
159
|
+
COMMAND SPECIFICATION:
|
|
160
|
+
- Name: {command_name}
|
|
161
|
+
- Description: {description}
|
|
162
|
+
- Category: {category}
|
|
163
|
+
- Execution Style: {contract_style_or_direct_execution}
|
|
164
|
+
- Usage Pattern: {usage_pattern}
|
|
165
|
+
- AI Coordination: {needs_ai_prompts}
|
|
166
|
+
- Output Location: {output_location}
|
|
167
|
+
- Tool Integration: {copilot_tools}
|
|
168
|
+
- Workflow Steps: {workflow_phases}
|
|
169
|
+
|
|
170
|
+
TEMPLATE STRUCTURE:
|
|
171
|
+
1. Frontmatter: mode: agent
|
|
172
|
+
2. Title: # [Command Name] Command
|
|
173
|
+
3. Overview: Purpose and capabilities
|
|
174
|
+
4. Command Process: Detailed step-by-step workflow
|
|
175
|
+
5. Tool Integration: GitHub Copilot tool coordination
|
|
176
|
+
6. AI Implementation Prompt: (if AI coordination needed)
|
|
177
|
+
7. Integration Notes: Platform coordination
|
|
178
|
+
|
|
179
|
+
TEMPLATE ADAPTATION RULES:
|
|
180
|
+
- Contract Style commands: Include clarification phases, contract establishment, critical analysis, user agreement checkpoints
|
|
181
|
+
- Direct Execution commands: Include immediate action workflows, minimal interaction, clear progress feedback
|
|
182
|
+
- Setup/Analysis commands: Include context scanning, file generation, progress tracking
|
|
183
|
+
- Implementation commands: Include TDD workflows, code modification, verification
|
|
184
|
+
- Integration commands: Include API interactions, sync, error handling
|
|
185
|
+
- All commands: Include clear examples, tool coordination, progress tracking
|
|
186
|
+
- CRITICAL: Be language and shell agnostic - use codebase, search instead of language-specific commands or hardcoded file extensions
|
|
187
|
+
|
|
188
|
+
DOCUMENTATION GUIDANCE:
|
|
189
|
+
Provide recommendations for integrating the new command:
|
|
190
|
+
- Suggest workflow placement and related commands
|
|
191
|
+
- Include usage examples and best practices
|
|
192
|
+
- Recommend documentation structure and content
|
|
193
|
+
|
|
194
|
+
OUTPUT REQUIREMENTS:
|
|
195
|
+
1. Generate complete .prompt.md file with frontmatter following the template
|
|
196
|
+
2. Provide integration recommendations and workflow guidance
|
|
197
|
+
3. Include clear usage examples and implementation notes
|
|
198
|
+
4. Ensure consistency with existing command patterns
|
|
199
|
+
5. Validate no conflicts with existing commands
|
|
200
|
+
|
|
201
|
+
QUALITY CHECKS:
|
|
202
|
+
- Command name follows naming conventions (lowercase, hyphens)
|
|
203
|
+
- Usage examples are clear and practical
|
|
204
|
+
- Workflow steps are actionable and specific
|
|
205
|
+
- Integration points are clearly documented
|
|
206
|
+
- All sections serve a clear purpose
|
|
207
|
+
- No hardcoded language assumptions or shell-specific commands
|
|
208
|
+
- Uses Code Captain's existing tools (codebase, search) rather than system-specific commands
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Implementation Details
|
|
212
|
+
|
|
213
|
+
### Command Name Validation
|
|
214
|
+
|
|
215
|
+
**Validation Rules:**
|
|
216
|
+
- Lowercase letters, numbers, hyphens only
|
|
217
|
+
- No spaces or special characters
|
|
218
|
+
- Maximum 20 characters
|
|
219
|
+
- Cannot start with number or hyphen
|
|
220
|
+
- Must not conflict with existing commands
|
|
221
|
+
|
|
222
|
+
**Validation Process:**
|
|
223
|
+
```bash
|
|
224
|
+
# Check format
|
|
225
|
+
echo "command-name" | grep -E '^[a-z][a-z0-9-]*[a-z0-9]$'
|
|
226
|
+
|
|
227
|
+
# Check conflicts
|
|
228
|
+
ls .github/prompts/ | grep "^command-name.prompt.md$"
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Template Selection Logic
|
|
232
|
+
|
|
233
|
+
**Command Categories and Templates:**
|
|
234
|
+
|
|
235
|
+
1. **Setup/Analysis** (`initialize`, `research`, `explain-code`)
|
|
236
|
+
- Context scanning workflows
|
|
237
|
+
- Documentation generation
|
|
238
|
+
- Progress tracking emphasis
|
|
239
|
+
|
|
240
|
+
2. **Planning/Specification** (`create-spec`, `create-adr`, `plan-product`)
|
|
241
|
+
- Interactive clarification phases
|
|
242
|
+
- Structured output formats
|
|
243
|
+
- Contract-based workflows
|
|
244
|
+
|
|
245
|
+
3. **Implementation** (`execute-task`, `swab`)
|
|
246
|
+
- Code modification workflows
|
|
247
|
+
- TDD patterns
|
|
248
|
+
- Verification steps
|
|
249
|
+
|
|
250
|
+
4. **Integration** (`sync`, `create-github-issues`)
|
|
251
|
+
- Platform API interactions
|
|
252
|
+
- Sync and conflict handling
|
|
253
|
+
- Status reporting
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
### Error Handling
|
|
258
|
+
|
|
259
|
+
**Common Issues:**
|
|
260
|
+
- **Duplicate command name**: Check existing prompts, suggest alternatives
|
|
261
|
+
- **Invalid command name format**: Provide format guidance and examples
|
|
262
|
+
- **Documentation integration conflicts**: Use safe merge strategies, manual review if needed
|
|
263
|
+
- **Template generation errors**: Validate inputs, provide clear error messages
|
|
264
|
+
|
|
265
|
+
**Error Messages:**
|
|
266
|
+
```
|
|
267
|
+
❌ Command creation failed: [specific reason]
|
|
268
|
+
|
|
269
|
+
Suggestions:
|
|
270
|
+
- Check command name format (lowercase, hyphens only)
|
|
271
|
+
- Ensure name doesn't conflict with existing commands
|
|
272
|
+
- Verify all required inputs are provided
|
|
273
|
+
|
|
274
|
+
Try: /new-command "valid-name" "clear description"
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Tool Integration
|
|
278
|
+
|
|
279
|
+
**Primary tools:**
|
|
280
|
+
- `codebase` - Analyzing existing prompt patterns and structure
|
|
281
|
+
- `search` - Finding existing prompts to check for conflicts
|
|
282
|
+
- `editFiles` - Creating new prompt files and updating documentation
|
|
283
|
+
- `runCommands` - Command name validation and directory operations
|
|
284
|
+
|
|
285
|
+
**Documentation organization:**
|
|
286
|
+
- Prompt files stored in `.github/prompts/`
|
|
287
|
+
- Integration guidance for documentation updates
|
|
288
|
+
- Validation and conflict checking before creation
|
|
289
|
+
|
|
290
|
+
## Integration Notes
|
|
291
|
+
|
|
292
|
+
This command integrates with Code Captain by:
|
|
293
|
+
|
|
294
|
+
1. **Following Established Patterns** - Uses same structure as existing prompts
|
|
295
|
+
2. **Maintaining Consistency** - Ensures all new prompts match style and format
|
|
296
|
+
3. **Documentation Guidance** - Provides clear recommendations for integration and usage
|
|
297
|
+
4. **Extensibility** - Makes it easy to add new capabilities to Code Captain
|
|
298
|
+
5. **Quality Assurance** - Validates structure and prevents conflicts
|
|
299
|
+
|
|
300
|
+
## Future Enhancements
|
|
301
|
+
|
|
302
|
+
Potential improvements (not in initial version):
|
|
303
|
+
|
|
304
|
+
- **Template Library**: Multiple prompt templates for different use cases
|
|
305
|
+
- **Interactive Wizard**: Step-by-step prompt creation with guidance
|
|
306
|
+
- **Integration Testing**: Automated testing of generated prompts
|
|
307
|
+
- **Version Control**: Track prompt changes and updates
|
|
308
|
+
- **Command Dependencies**: Handle prompts that depend on other prompts
|
|
309
|
+
|
|
310
|
+
But for now: Focus on core functionality - create well-structured prompts that integrate seamlessly with the existing Code Captain ecosystem.
|