@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.
Files changed (44) hide show
  1. package/README.md +36 -37
  2. package/bin/install.js +1166 -983
  3. package/claude-code/agents/code-captain.md +31 -22
  4. package/copilot/README.md +26 -16
  5. package/copilot/chatmodes/Code Captain.chatmode.md +41 -25
  6. package/copilot/prompts/create-adr.prompt.md +6 -4
  7. package/copilot/prompts/create-spec.prompt.md +62 -45
  8. package/copilot/prompts/explain-code.prompt.md +7 -23
  9. package/copilot/prompts/new-command.prompt.md +60 -21
  10. package/copilot/prompts/research.prompt.md +14 -30
  11. package/copilot/prompts/status.prompt.md +13 -2
  12. package/copilot/prompts/swab.prompt.md +1 -0
  13. package/cursor/README.md +77 -88
  14. package/cursor/cc.mdc +13 -42
  15. package/cursor/commands/create-adr.md +7 -13
  16. package/cursor/commands/create-spec.md +73 -64
  17. package/cursor/commands/edit-spec.md +2 -15
  18. package/cursor/commands/execute-task.md +7 -15
  19. package/cursor/commands/explain-code.md +16 -35
  20. package/cursor/commands/initialize.md +19 -18
  21. package/cursor/commands/new-command.md +173 -81
  22. package/cursor/commands/plan-product.md +7 -13
  23. package/cursor/commands/research.md +5 -27
  24. package/cursor/commands/status.md +34 -23
  25. package/cursor/commands/swab.md +63 -12
  26. package/manifest.json +110 -229
  27. package/package.json +13 -4
  28. package/cursor/cc.md +0 -183
  29. package/cursor/integrations/azure-devops/create-azure-work-items.md +0 -403
  30. package/cursor/integrations/azure-devops/sync-azure-work-items.md +0 -486
  31. package/cursor/integrations/github/create-github-issues.md +0 -765
  32. package/cursor/integrations/github/scripts/create-issues-batch.sh +0 -272
  33. package/cursor/integrations/github/sync-github-issues.md +0 -237
  34. package/cursor/integrations/github/sync.md +0 -305
  35. package/windsurf/README.md +0 -254
  36. package/windsurf/rules/cc.md +0 -5
  37. package/windsurf/workflows/create-adr.md +0 -331
  38. package/windsurf/workflows/create-spec.md +0 -280
  39. package/windsurf/workflows/edit-spec.md +0 -273
  40. package/windsurf/workflows/execute-task.md +0 -276
  41. package/windsurf/workflows/explain-code.md +0 -292
  42. package/windsurf/workflows/initialize.md +0 -298
  43. package/windsurf/workflows/new-command.md +0 -321
  44. package/windsurf/workflows/status.md +0 -213
@@ -1,305 +0,0 @@
1
- # Enhanced GitHub Sync Command (cc: sync)
2
-
3
- ## Overview
4
-
5
- Advanced bidirectional synchronization between Code Captain local specs and GitHub issues using partitioned cache for optimal performance. This replaces the basic `sync-github-issues` with comprehensive sync capabilities.
6
-
7
- ## Usage
8
-
9
- ```bash
10
- cc: sync [--full] [--my-work-only] [--spec spec-name]
11
- ```
12
-
13
- **Examples:**
14
-
15
- ```bash
16
- cc: sync # Default incremental sync
17
- cc: sync --full # Full refresh (slower)
18
- cc: sync --my-work-only # Sync only my assigned tasks (fastest)
19
- cc: sync --spec user-dashboard # Sync specific spec only
20
- ```
21
-
22
- ## Command Process
23
-
24
- ### Step 1: Sync Preparation
25
-
26
- **Validate GitHub access and repository:**
27
- - Verify GitHub CLI authentication
28
- - Check repository permissions
29
- - Confirm issue access
30
-
31
- ### Step 2: Determine Sync Strategy
32
-
33
- **Incremental Sync (Default):**
34
- - Only fetch issues updated since last sync
35
- - Update local spec documents as needed
36
-
37
- **Full Sync:**
38
- - Fetch all issues with essential fields
39
- - Update all relevant spec documents
40
- - Comprehensive but slower
41
-
42
- **My Work Only:**
43
- - Only sync issues assigned to current user
44
- - Fastest option for personal workflow
45
-
46
- **Spec-Specific:**
47
- - Sync only issues related to specific spec/milestone
48
- - Efficient for focused work
49
-
50
- ### Step 3: GitHub Data Retrieval
51
-
52
- **Authentication & Rate Limit Check:**
53
-
54
- Check GitHub CLI authentication and rate limits (Code Captain will use platform-appropriate commands based on your shell from `state.json`):
55
- - Verify GitHub CLI authentication status
56
- - Check API rate limit remaining
57
-
58
- **Incremental Sync Query:**
59
-
60
- Get last sync timestamp and fetch updated issues (Code Captain will use platform-appropriate commands based on your shell from `state.json`):
61
- - Read last sync timestamp from `.code-captain/state/index.json`
62
- - Use `gh issue list` to fetch issues updated since last sync
63
- - Include fields: number, title, state, assignees, labels, milestone, updatedAt
64
-
65
- **Full Sync Query:**
66
-
67
- Fetch all issues with comprehensive data:
68
- ```
69
- gh issue list --json number,title,state,assignees,labels,milestone,createdAt,updatedAt --state all --limit 1000
70
- ```
71
-
72
- **My Assignments Query:**
73
-
74
- Fetch issues assigned to current user:
75
- ```
76
- gh issue list --json number,title,state,labels,milestone,updatedAt --assignee @me --state all
77
- ```
78
-
79
- ### Step 4: Data Transformation & Partitioning
80
-
81
- **Transform GitHub Issues to Code Captain Format:**
82
-
83
- ```typescript
84
- interface GitHubIssue {
85
- number: number;
86
- title: string;
87
- state: 'OPEN' | 'CLOSED';
88
- assignees: Array<{login: string, name?: string}>;
89
- labels: Array<{name: string, color: string}>;
90
- milestone?: {title: string};
91
- createdAt: string;
92
- updatedAt: string;
93
- }
94
-
95
- interface CodeCaptainTask {
96
- platform_id: string;
97
- task_id: string;
98
- title: string;
99
- status: 'open' | 'in_progress' | 'completed' | 'blocked';
100
- assignee: string | null;
101
- priority: 'urgent' | 'high' | 'medium' | 'low';
102
- spec_folder: string;
103
- created_date: string;
104
- last_modified: string;
105
- }
106
- ```
107
-
108
- **Priority Extraction from Labels:**
109
- ```typescript
110
- function extractPriority(labels: Array<{name: string}>): string {
111
- const labelNames = labels.map(l => l.name.toLowerCase());
112
-
113
- if (labelNames.some(name => ['urgent', 'critical', 'p0'].includes(name))) {
114
- return 'urgent';
115
- }
116
- if (labelNames.some(name => ['high-priority', 'high', 'p1'].includes(name))) {
117
- return 'high';
118
- }
119
- if (labelNames.some(name => ['low-priority', 'low', 'p3'].includes(name))) {
120
- return 'low';
121
- }
122
- return 'medium'; // Default
123
- }
124
- ```
125
-
126
- **Status Mapping:**
127
- ```typescript
128
- function mapGitHubState(state: string, assignees: Array<any>): string {
129
- if (state === 'CLOSED') return 'completed';
130
- if (state === 'OPEN' && assignees.length > 0) return 'in_progress';
131
- if (state === 'OPEN' && assignees.length === 0) return 'open';
132
- return 'open';
133
- }
134
- ```
135
-
136
- ### Step 5: Update Cache Partitions
137
-
138
- **Update index.json:**
139
- ```json
140
- {
141
- "last_sync": "2024-01-15T14:30:00Z",
142
- "sync_status": "current",
143
- "platform": "github",
144
- "repository": "company/main-app",
145
- "gh_cli_version": "2.40.1",
146
-
147
- "summary": {
148
- "total_issues": 89,
149
- "open_issues": 34,
150
- "my_assigned": 3,
151
- "available_tasks": 12,
152
- "high_priority_open": 5
153
- },
154
-
155
- "my_active_work": [
156
- {
157
- "issue_number": 124,
158
- "title": "Create dashboard route and controller",
159
- "spec": "user-dashboard",
160
- "task_id": "1.2",
161
- "priority": "high"
162
- }
163
- ],
164
-
165
- "attention_needed": [
166
- "5 high-priority issues unassigned",
167
- "user-dashboard spec has 2 blocked tasks"
168
- ],
169
-
170
- "specs_status": {
171
- "user-dashboard": {"total": 5, "completed": 2, "in_progress": 2, "available": 1},
172
- "payment-system": {"total": 8, "completed": 1, "in_progress": 3, "available": 4}
173
- }
174
- }
175
- ```
176
-
177
- **Update local specification documents:**
178
- - Update issue status in relevant spec files
179
- - Sync assignee information
180
- - Update completion status
181
- - Maintain traceability between specs and GitHub issues
182
-
183
- ### Step 6: Conflict Detection & Resolution
184
-
185
- **Detect sync conflicts:**
186
- ```json
187
- {
188
- "conflicts": [
189
- {
190
- "type": "assignment_conflict",
191
- "issue_number": 124,
192
- "local_assignee": "alice-dev",
193
- "github_assignee": "bob-dev",
194
- "detected_at": "2024-01-15T14:30:00Z",
195
- "resolution": "pending"
196
- },
197
- {
198
- "type": "status_conflict",
199
- "issue_number": 125,
200
- "local_status": "completed",
201
- "github_status": "OPEN",
202
- "detected_at": "2024-01-15T14:25:00Z",
203
- "resolution": "accept_github"
204
- }
205
- ]
206
- }
207
- ```
208
-
209
- **Handle conflicts:**
210
- - Assignment conflicts: GitHub wins (most recent assignment)
211
- - Status conflicts: GitHub wins (authoritative state)
212
- - Title/description conflicts: GitHub wins
213
- - Log all conflicts for review
214
-
215
- ### Step 7: Update Local Spec Files
216
-
217
- **Update spec files with latest GitHub state:**
218
- - Update task status indicators
219
- - Update assignee information
220
- - Update issue links
221
- - Preserve original spec content structure
222
-
223
- ### Step 8: Generate Sync Report
224
-
225
- **Create sync summary:**
226
- ```markdown
227
- ✅ GitHub Sync Complete
228
-
229
- 📊 Summary:
230
- - Sync Type: Incremental
231
- - Issues Updated: 15
232
- - Cache Files Updated: 3
233
- - Conflicts Detected: 2 (auto-resolved)
234
-
235
- 📁 Updated Files:
236
- - Local specification documents updated with issue status
237
- - GitHub issue mappings synchronized
238
-
239
- ⚠️ Conflicts Resolved:
240
- - Issue #124: Assignment updated (alice-dev → bob-dev)
241
- - Issue #125: Status updated (completed → open)
242
-
243
- 🕐 Last Sync: 2024-01-15T14:30:00Z
244
- 🔄 Next Recommended Sync: 2024-01-15T15:30:00Z
245
- ```
246
-
247
- ## Tool Integration
248
-
249
- **GitHub CLI Commands:**
250
- - `gh issue list` for fetching issues
251
- - `gh auth status` for authentication check
252
- - `gh api rate_limit` for rate limit monitoring
253
-
254
- **Code Captain Tools:**
255
- - `todo_write` for progress tracking
256
- - `read_file` for cache file management
257
- - `write` for cache updates
258
- - `MultiEdit` for spec file updates
259
- - `grep_search` for finding issue references
260
-
261
- ## Error Handling
262
-
263
- **GitHub API Issues:**
264
- - Handle authentication failures gracefully
265
- - Implement rate limit backoff
266
- - Provide partial sync on API errors
267
-
268
- **Cache Corruption:**
269
- - Validate cache file integrity
270
- - Rebuild corrupted partitions
271
- - Maintain backup of previous state
272
-
273
- **Network Issues:**
274
- - Graceful degradation when offline
275
- - Resume interrupted syncs
276
- - Clear error messaging
277
-
278
- ## Performance Optimizations
279
-
280
- **Incremental Updates:**
281
- - Only sync changed issues
282
- - Update affected cache partitions only
283
- - Parallel cache file updates
284
-
285
- **Memory Management:**
286
- - Stream large issue lists
287
- - Partition data by concern
288
- - Lazy load cache files
289
-
290
- **API Efficiency:**
291
- - Batch GitHub API calls
292
- - Use appropriate pagination
293
- - Cache expensive queries
294
-
295
- ## Integration with Existing Commands
296
-
297
- **Enhances create-github-issues:**
298
- - Automatically sync after issue creation
299
- - Update cache with new issue mappings
300
- - Maintain bidirectional traceability
301
-
302
- **Works with existing workflows:**
303
- - Maintains compatibility with current spec formats
304
- - Preserves existing GitHub integration
305
- - Extends functionality without breaking changes
@@ -1,254 +0,0 @@
1
- # Code Captain for Windsurf
2
-
3
- > **Codeium's AI-powered development environment with custom workflow integration**
4
-
5
- Windsurf provides advanced AI capabilities with custom workflow integration, built-in context management, and intelligent code coordination.
6
-
7
- ## 🚀 Installation
8
-
9
- ### Automatic Installation (Recommended)
10
-
11
- ```bash
12
- npx @devobsessed/code-captain
13
- ```
14
-
15
- The installer will detect Windsurf and install to:
16
- - `.windsurf/` - Custom workflows and rules
17
- - `.code-captain/` - Complete workflow system
18
-
19
- ### Manual Installation
20
-
21
- ```bash
22
- # Clone or download the windsurf/ directory contents to .windsurf/
23
- cp -r windsurf/ .windsurf/
24
- cp -r .code-captain/ .
25
- ```
26
-
27
- ## 🎯 Workflow Integration
28
-
29
- Code Captain in Windsurf uses custom workflow files that integrate with Windsurf's AI system:
30
-
31
- ### Available Workflows
32
- Located in `.windsurf/workflows/`:
33
-
34
- - **`initialize.md`** - Project setup and analysis
35
- - **`create-spec.md`** - Feature specification creation
36
- - **`create-adr.md`** - Architecture Decision Records
37
- - **`execute-task.md`** - Test-driven development
38
- - **`explain-code.md`** - Code explanation with diagrams
39
- - **`status.md`** - Project status analysis
40
- - **`edit-spec.md`** - Specification modification
41
- - **`new-command.md`** - Custom command creation
42
-
43
- ### Workflow Rules
44
- Located in `.windsurf/rules/`:
45
-
46
- - **`cc.md`** - Core Code Captain rules and guidelines
47
-
48
- ## 🛠️ Available Workflows
49
-
50
- ### 📋 Project Setup & Analysis
51
- - **Initialize Project** - Comprehensive project analysis and documentation setup
52
- - **Product Planning** - Strategic product planning with roadmap generation
53
- - **Technical Research** - Systematic 4-phase research methodology
54
- - **Custom Commands** - Create domain-specific workflow extensions
55
-
56
- ### 📝 Requirements & Planning
57
- - **Feature Specifications** - Detailed specs with technical implementation details
58
- - **Architecture Decisions** - ADRs with systematic research and alternatives analysis
59
- - **Code Explanations** - Visual diagrams with comprehensive technical analysis
60
- - **Specification Editing** - Contract-first approach to specification modifications
61
-
62
- ### ⚙️ Implementation
63
- - **Test-Driven Development** - Systematic TDD workflow with progress tracking
64
- - **Project Status** - Comprehensive status analysis with actionable recommendations
65
- - **Code Cleanup** - Incremental improvements following the Boy Scout Rule
66
-
67
- ## 🔄 Workflow Examples
68
-
69
- ### Project Initialization
70
-
71
- 1. **Open Windsurf** and navigate to your project
72
- 2. **Reference the initialize workflow**: `.windsurf/workflows/initialize.md`
73
- 3. **Follow the systematic process** for project analysis
74
- 4. **Review generated documentation** in `.code-captain/docs/`
75
-
76
- ### Feature Development
77
-
78
- 1. **Research Phase**
79
- - Use `.windsurf/workflows/create-adr.md` for architectural decisions
80
- - Reference research methodology from workflows
81
-
82
- 2. **Specification Phase**
83
- - Follow `.windsurf/workflows/create-spec.md`
84
- - Generate comprehensive feature specifications
85
-
86
- 3. **Implementation Phase**
87
- - Use `.windsurf/workflows/execute-task.md`
88
- - Follow TDD methodology with progress tracking
89
-
90
- 4. **Status Monitoring**
91
- - Reference `.windsurf/workflows/status.md`
92
- - Get comprehensive project health analysis
93
-
94
- ### Code Understanding
95
-
96
- 1. **Code Explanation**
97
- - Use `.windsurf/workflows/explain-code.md`
98
- - Generate visual diagrams and technical analysis
99
-
100
- 2. **Incremental Improvements**
101
- - Follow best practices from `.windsurf/rules/cc.md`
102
- - Apply small, focused improvements
103
-
104
- ## 📁 File Organization
105
-
106
- Windsurf integration creates this structure:
107
-
108
- ```
109
- .windsurf/
110
- ├── workflows/
111
- │ ├── initialize.md
112
- │ ├── create-spec.md
113
- │ ├── create-adr.md
114
- │ ├── execute-task.md
115
- │ ├── explain-code.md
116
- │ ├── status.md
117
- │ ├── edit-spec.md
118
- │ └── new-command.md
119
- └── rules/
120
- └── cc.md
121
-
122
- .code-captain/
123
- ├── commands/ # Reference documentation
124
- ├── docs/ # Generated documentation
125
- ├── research/ # Technical research reports
126
- ├── decision-records/ # Architecture Decision Records
127
- ├── specs/ # Feature specifications
128
- │ └── YYYY-MM-DD-feature/
129
- │ ├── spec.md
130
- │ ├── user-stories/
131
- │ └── tasks.md
132
- └── cc.md # Complete reference guide
133
- ```
134
-
135
- ## 🎯 Windsurf-Specific Features
136
-
137
- ### Custom Workflow Integration
138
- - **Workflow-based execution** aligned with Windsurf's AI coordination
139
- - **Context-aware processing** using Windsurf's advanced context management
140
- - **Intelligent file organization** with automatic workspace awareness
141
-
142
- ### Advanced AI Coordination
143
- - **Multi-step workflow execution** with AI guidance
144
- - **Context preservation** across workflow phases
145
- - **Intelligent tool selection** based on workflow requirements
146
-
147
- ### Built-in Best Practices
148
- - **Critical thinking guidelines** from `windsurf/rules/cc.md`
149
- - **Systematic approaches** to complex development tasks
150
- - **Quality-focused workflows** with verification steps
151
-
152
- ## 🚀 Advanced Usage
153
-
154
- ### Custom Workflow Creation
155
-
156
- Create new workflows in `.windsurf/workflows/`:
157
-
158
- ```markdown
159
- # Custom Workflow
160
-
161
- ## Overview
162
- [Describe workflow purpose and capabilities]
163
-
164
- ## Process
165
- [Detail step-by-step workflow execution]
166
-
167
- ## Tool Integration
168
- [Specify Windsurf tool coordination]
169
-
170
- ## Output Organization
171
- [Define file structure and locations]
172
- ```
173
-
174
- ### Rule Customization
175
-
176
- Enhance `.windsurf/rules/cc.md` with team-specific guidelines:
177
-
178
- ```markdown
179
- ## Team-Specific Rules
180
-
181
- ### Code Standards
182
- [Define team coding standards]
183
-
184
- ### Review Process
185
- [Specify review requirements]
186
-
187
- ### Documentation Standards
188
- [Define documentation expectations]
189
- ```
190
-
191
- ### Workflow Chaining
192
-
193
- Chain workflows for complex development processes:
194
-
195
- 1. **Initialize** → **Research** → **Create ADR**
196
- 2. **Create Spec** → **Execute Task** → **Status Check**
197
- 3. **Explain Code** → **Swab** → **Status Update**
198
-
199
- ## 🔧 Configuration
200
-
201
- ### Windsurf Settings
202
- Configure Windsurf to optimize Code Captain integration:
203
-
204
- - **Enable advanced context management**
205
- - **Configure AI coordination preferences**
206
- - **Set up workspace awareness**
207
-
208
- ### Project-Specific Rules
209
- Customize `.windsurf/rules/cc.md` for your project:
210
-
211
- - **Domain-specific guidelines**
212
- - **Technology-specific patterns**
213
- - **Team collaboration standards**
214
-
215
- ## 📊 Workflow Reference
216
-
217
- | Workflow | Purpose | Output Location |
218
- |----------|---------|-----------------|
219
- | `initialize` | Project analysis & setup | `.code-captain/docs/` |
220
- | `create-spec` | Feature specification | `.code-captain/specs/` |
221
- | `execute-task` | TDD implementation | Source code + tests |
222
- | `create-adr` | Architecture decisions | `.code-captain/decision-records/` |
223
- | `status` | Project health analysis | Terminal output |
224
-
225
- ## 🛠️ Troubleshooting
226
-
227
- ### Workflows Not Executing Properly
228
- **Problem**: Windsurf doesn't follow workflow steps correctly
229
- **Solution**: Ensure workflow files are in `.windsurf/workflows/` and reference them explicitly
230
-
231
- ### Context Issues
232
- **Problem**: AI loses context during workflow execution
233
- **Solution**: Break complex workflows into smaller steps and verify context preservation
234
-
235
- ### File Organization Problems
236
- **Problem**: Generated files appear in wrong locations
237
- **Solution**: Check `.code-captain/` folder structure and verify workflow output specifications
238
-
239
- ## 🤝 Contributing
240
-
241
- Windsurf-specific contributions:
242
-
243
- 1. **Workflow Enhancement** - Improve AI coordination and workflow efficiency
244
- 2. **Rule Development** - Add domain-specific rules and guidelines
245
- 3. **Documentation** - Create Windsurf-specific examples and patterns
246
- 4. **Integration** - Enhance Windsurf AI coordination capabilities
247
-
248
- ---
249
-
250
- **Ready to supercharge your Windsurf development?**
251
-
252
- 1. **Install:** `npx @devobsessed/code-captain`
253
- 2. **Reference:** `.windsurf/workflows/initialize.md`
254
- 3. **Begin:** Project initialization workflow
@@ -1,5 +0,0 @@
1
- ---
2
- trigger: always_on
3
- ---
4
-
5
- some content