@devobsessed/code-captain 0.0.6 → 0.0.8
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 +1 -10
- package/bin/install.js +178 -182
- package/claude-code/agents/code-captain.md +17 -20
- package/copilot/README.md +26 -16
- package/copilot/chatmodes/Code Captain.chatmode.md +11 -16
- package/copilot/prompts/create-spec.prompt.md +5 -8
- package/copilot/prompts/explain-code.prompt.md +5 -8
- package/copilot/prompts/new-command.prompt.md +60 -21
- package/copilot/prompts/research.prompt.md +5 -8
- package/copilot/prompts/status.prompt.md +13 -2
- package/copilot/prompts/swab.prompt.md +1 -0
- package/cursor/README.md +8 -23
- package/cursor/cc.md +2 -29
- package/cursor/cc.mdc +3 -10
- package/cursor/commands/create-adr.md +1 -1
- package/cursor/commands/create-spec.md +9 -12
- package/cursor/commands/explain-code.md +5 -8
- package/cursor/commands/initialize.md +1 -1
- package/cursor/commands/new-command.md +5 -4
- package/cursor/commands/research.md +6 -9
- package/cursor/commands/status.md +13 -2
- package/cursor/commands/swab.md +61 -2
- package/manifest.json +150 -166
- package/package.json +12 -2
- package/windsurf/workflows/explain-code.md +4 -8
- package/windsurf/workflows/plan-product.md +330 -0
- package/windsurf/workflows/research.md +240 -0
- package/windsurf/workflows/swab.md +212 -0
- 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
|
@@ -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
|