@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.
Files changed (34) hide show
  1. package/README.md +1 -10
  2. package/bin/install.js +178 -182
  3. package/claude-code/agents/code-captain.md +17 -20
  4. package/copilot/README.md +26 -16
  5. package/copilot/chatmodes/Code Captain.chatmode.md +11 -16
  6. package/copilot/prompts/create-spec.prompt.md +5 -8
  7. package/copilot/prompts/explain-code.prompt.md +5 -8
  8. package/copilot/prompts/new-command.prompt.md +60 -21
  9. package/copilot/prompts/research.prompt.md +5 -8
  10. package/copilot/prompts/status.prompt.md +13 -2
  11. package/copilot/prompts/swab.prompt.md +1 -0
  12. package/cursor/README.md +8 -23
  13. package/cursor/cc.md +2 -29
  14. package/cursor/cc.mdc +3 -10
  15. package/cursor/commands/create-adr.md +1 -1
  16. package/cursor/commands/create-spec.md +9 -12
  17. package/cursor/commands/explain-code.md +5 -8
  18. package/cursor/commands/initialize.md +1 -1
  19. package/cursor/commands/new-command.md +5 -4
  20. package/cursor/commands/research.md +6 -9
  21. package/cursor/commands/status.md +13 -2
  22. package/cursor/commands/swab.md +61 -2
  23. package/manifest.json +150 -166
  24. package/package.json +12 -2
  25. package/windsurf/workflows/explain-code.md +4 -8
  26. package/windsurf/workflows/plan-product.md +330 -0
  27. package/windsurf/workflows/research.md +240 -0
  28. package/windsurf/workflows/swab.md +212 -0
  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
@@ -1,486 +0,0 @@
1
- # Sync Azure DevOps Work Items Command (cc: sync-azure-work-items)
2
-
3
- ## Overview
4
-
5
- Retrieve and synchronize with current Azure DevOps work items, providing organized reports and optionally updating local spec documents with current work item statuses and progress.
6
-
7
- ## Usage
8
-
9
- ```bash
10
- cc: sync-azure-work-items [options]
11
- ```
12
-
13
- **Examples:**
14
-
15
- ```bash
16
- cc: sync-azure-work-items # Full sync with default options
17
- cc: sync-azure-work-items --state active # Only active work items
18
- cc: sync-azure-work-items --type user-story # Only user story work items
19
- cc: sync-azure-work-items --update-docs # Sync status back to local docs
20
- cc: sync-azure-work-items --spec-folder .code-captain/specs/2024-12-28-feature/
21
- ```
22
-
23
- **Options:**
24
-
25
- - `--state [active|closed|all]` - Filter by work item state (default: active)
26
- - `--type [user-story|task|bug|all]` - Filter by work item type (default: all)
27
- - `--update-docs` - Update local spec documents with current work item status
28
- - `--spec-folder [path]` - Target specific spec folder for document updates
29
- - `--format [summary|detailed|json]` - Output format (default: summary)
30
- - `--iteration [current|all]` - Filter by iteration (default: current)
31
-
32
- ## Command Process
33
-
34
- ### Step 1: Azure DevOps Project Context & Validation
35
-
36
- **Azure DevOps project detection:**
37
-
38
- - Verify current directory is a git repository with Azure DevOps remote
39
- - Extract organization and project from remote origin
40
- - Validate Azure DevOps access permissions and PAT configuration
41
- - Confirm project has work items enabled
42
-
43
- **Spec folder detection (if --update-docs used):**
44
-
45
- - Auto-detect latest spec folder if --spec-folder not provided
46
- - Validate spec folder contains `user-stories.md`, `tasks.md`, or `azure-workitems-mapping.md`
47
- - Check for existing work item references in documents
48
-
49
- ### Step 2: Create Todo Tracking
50
-
51
- **Use `todo_write` to track the sync process:**
52
-
53
- ```json
54
- {
55
- "todos": [
56
- {
57
- "id": "azure-sync-fetch",
58
- "content": "Fetch current Azure DevOps work items with filters applied",
59
- "status": "in_progress"
60
- },
61
- {
62
- "id": "azure-sync-organize",
63
- "content": "Organize work items by type and categorize by spec relationship",
64
- "status": "pending"
65
- },
66
- {
67
- "id": "azure-sync-report",
68
- "content": "Generate organized work item report and summary",
69
- "status": "pending"
70
- },
71
- {
72
- "id": "azure-sync-update-docs",
73
- "content": "Update local spec documents with current status (if requested)",
74
- "status": "pending"
75
- },
76
- {
77
- "id": "azure-sync-summary",
78
- "content": "Provide sync summary and actionable insights",
79
- "status": "pending"
80
- }
81
- ]
82
- }
83
- ```
84
-
85
- ### Step 3: Fetch Azure DevOps Work Items
86
-
87
- **Use Azure DevOps REST API to retrieve work items:**
88
-
89
- - Query work items using WIQL (Work Item Query Language)
90
- - Fetch work item details, relationships, and fields
91
- - Handle pagination for projects with many work items
92
- - Sort by state change date, creation date, or priority
93
-
94
- **WIQL Query Construction:**
95
-
96
- ```sql
97
- SELECT [System.Id], [System.Title], [System.State], [System.WorkItemType],
98
- [System.AssignedTo], [System.CreatedDate], [System.ChangedDate]
99
- FROM WorkItems
100
- WHERE [System.TeamProject] = '{project-name}'
101
- AND [System.State] IN ({state-filter})
102
- AND [System.WorkItemType] IN ({type-filter})
103
- AND [System.Tags] CONTAINS 'code-captain'
104
- ORDER BY [System.ChangedDate] DESC
105
- ```
106
-
107
- **Work item categorization:**
108
-
109
- - **User Story Work Items**: WorkItemType = "User Story"
110
- - **Task Work Items**: WorkItemType = "Task"
111
- - **Bug Work Items**: WorkItemType = "Bug"
112
- - **Feature Work Items**: WorkItemType = "Feature"
113
- - **Code Captain Items**: Tags contain "code-captain"
114
-
115
- ### Step 4: Organize and Analyze Work Items
116
-
117
- **Create work item organization structure:**
118
-
119
- ```javascript
120
- {
121
- summary: {
122
- total: number,
123
- active: number,
124
- closed: number,
125
- byType: {
126
- userStories: number,
127
- tasks: number,
128
- bugs: number,
129
- features: number
130
- },
131
- byState: {
132
- new: number,
133
- active: number,
134
- resolved: number,
135
- closed: number
136
- }
137
- },
138
- userStories: [
139
- {
140
- id: 123,
141
- title: "User Profile Creation",
142
- state: "Active",
143
- assignee: "user@company.com",
144
- tags: ["user-story", "code-captain"],
145
- created: "2024-12-28",
146
- changed: "2024-12-29",
147
- url: "https://dev.azure.com/org/project/_workitems/edit/123",
148
- linkedSpec: ".code-captain/specs/2024-12-28-feature/",
149
- areaPath: "ProjectName\\FeatureName",
150
- iterationPath: "ProjectName\\Sprint 1",
151
- progressInfo: {
152
- totalCriteria: 5,
153
- completedCriteria: 2
154
- }
155
- }
156
- ],
157
- tasks: [
158
- {
159
- id: 124,
160
- title: "User Authentication System",
161
- state: "Active",
162
- parent: 123,
163
- childTasks: [125, 126, 127],
164
- completedChildTasks: 1,
165
- totalChildTasks: 3,
166
- remainingWork: 16,
167
- completedWork: 8
168
- }
169
- ],
170
- bugs: [
171
- {
172
- id: 128,
173
- title: "Login form validation error",
174
- state: "New",
175
- severity: "2 - High",
176
- priority: 2
177
- }
178
- ],
179
- orphanedWorkItems: [], // Work items without clear spec relationship
180
- staleWorkItems: [] // Work items not updated in X days
181
- }
182
- ```
183
-
184
- **Analyze work item relationships:**
185
-
186
- - Identify parent-child relationships between User Stories and Tasks
187
- - Match work items to local spec documents using work item mapping
188
- - Detect orphaned work items not linked to any spec
189
- - Identify stale work items (not updated in configurable timeframe)
190
- - Calculate progress metrics based on work item states and remaining work
191
-
192
- ### Step 5: Generate Work Item Reports
193
-
194
- **Summary Report Format:**
195
-
196
- ```markdown
197
- # Azure DevOps Work Items Sync Report
198
-
199
- > Generated: {current-date}
200
- > Organization: {org-name}
201
- > Project: {project-name}
202
- > Filters Applied: {filter-summary}
203
-
204
- ## 📊 Work Item Summary
205
-
206
- | Type | Active | Closed | Total |
207
- | ------------ | ------ | ------ | ------ |
208
- | User Stories | 3 | 2 | 5 |
209
- | Tasks | 12 | 18 | 30 |
210
- | Bugs | 2 | 5 | 7 |
211
- | Features | 1 | 0 | 1 |
212
- | **Total** | **18** | **25** | **43** |
213
-
214
- ## 🎯 User Stories
215
-
216
- ### Active User Stories
217
-
218
- - [123](link) **User Profile Creation**
219
- - State: Active | Assignee: user@company.com | Updated: 2 days ago
220
- - Progress: 2/5 acceptance criteria completed
221
- - Iteration: Sprint 1 | Area: ProjectName\FeatureName
222
- - Linked to: `.code-captain/specs/2024-12-28-user-profile/`
223
-
224
- ### Recently Closed User Stories
225
-
226
- - [121](link) **User Registration**
227
- - State: Closed | Completed: 1 day ago
228
- - All acceptance criteria completed ✅
229
-
230
- ## 🔧 Tasks & Subtasks
231
-
232
- ### Active Tasks
233
-
234
- - [124](link) **User Authentication System** (2/3 child tasks complete)
235
- - Remaining Work: 16 hours | Completed: 8 hours
236
- - [125](link) ✅ Write tests for authentication (closed)
237
- - [126](link) 🔄 Implement JWT token generation (active)
238
- - [127](link) ⏳ Create password hashing utilities (new)
239
-
240
- ### Blocked Tasks
241
-
242
- - [128](link) **Database Migration** - Waiting for infrastructure approval
243
- - Blocked Reason: External dependency
244
-
245
- ## 🐛 Bugs & Issues
246
-
247
- ### Active Bugs
248
-
249
- - [129](link) **Login form validation error** (Severity: High, Priority: 2)
250
- - Assignee: dev@company.com | Created: 3 days ago
251
- - Area: ProjectName\Authentication
252
-
253
- ## ⚠️ Work Items Requiring Attention
254
-
255
- ### Stale Work Items (No updates > 7 days)
256
-
257
- - [119](link) **API Documentation** - Last updated 10 days ago
258
- - [115](link) **Error Handling** - Last updated 14 days ago
259
-
260
- ### Orphaned Work Items (No spec relationship)
261
-
262
- - [130](link) **Bug: Login form styling** - Not linked to any spec
263
-
264
- ### High Priority Items
265
-
266
- - [131](link) **Critical: Data loss on logout** (Priority 1, Severity 1)
267
-
268
- ## 📈 Sprint Progress
269
-
270
- ### Current Iteration: Sprint 1
271
-
272
- - **Planned Work:** 80 hours
273
- - **Completed Work:** 32 hours (40%)
274
- - **Remaining Work:** 48 hours
275
- - **Burndown Status:** On track
276
-
277
- ### Velocity Metrics
278
-
279
- - **Average Completion Rate:** 1.2 work items per day
280
- - **Story Points Completed:** 13/21 (62%)
281
- - **Estimated Completion:** 5 days remaining
282
-
283
- ## 🔄 Sync Status
284
-
285
- - **Last Sync:** {timestamp}
286
- - **Work Items Fetched:** {count}
287
- - **Spec Documents:** {updated-count} updated
288
- - **New Work Items Since Last Sync:** {new-count}
289
- - **Closed Work Items Since Last Sync:** {closed-count}
290
- ```
291
-
292
- ### Step 6: Update Local Spec Documents (Optional)
293
-
294
- **If --update-docs flag provided:**
295
-
296
- **Update user-stories.md:**
297
-
298
- Add state indicators and progress tracking:
299
-
300
- ```markdown
301
- ## Story 1: User Profile Creation [#123] 🔄
302
-
303
- **State:** Active | **Assignee:** user@company.com | **Updated:** 2 days ago
304
- **Iteration:** Sprint 1 | **Area:** ProjectName\FeatureName
305
-
306
- **As a** new user
307
- **I want to** create a profile with basic information
308
- **So that** I can personalize my experience
309
-
310
- ### Work Item: [123](https://dev.azure.com/org/project/_workitems/edit/123)
311
-
312
- ### Acceptance Criteria (2/5 completed)
313
-
314
- - [x] Given a new user, when they access profile creation, then form is displayed
315
- - [x] Given valid profile data, when submitted, then profile is created
316
- - [ ] Given invalid email, when submitted, then validation error shown
317
- - [ ] Given profile creation, when successful, then welcome email sent
318
- - [ ] Given profile creation, when successful, then user redirected to dashboard
319
-
320
- ### Progress: 40% complete (2/5 criteria)
321
-
322
- ### Remaining Work: 12 hours | Completed: 8 hours
323
- ```
324
-
325
- **Update tasks.md:**
326
-
327
- Add state and progress indicators:
328
-
329
- ```markdown
330
- ## Tasks
331
-
332
- - [x] 1. User Authentication System [#124] 🔄 (2/3 child tasks complete)
333
-
334
- - [x] 1.1 Write tests for authentication middleware [#125] ✅
335
- - [ ] 1.2 Implement JWT token generation [#126] 🔄 (6h remaining)
336
- - [ ] 1.3 Create password hashing utilities [#127] ⏳ (8h estimated)
337
-
338
- ### Task Progress:
339
-
340
- - Main Task: [124](https://dev.azure.com/org/project/_workitems/edit/124) - 67% complete
341
- - Overall Progress: 2/3 child tasks completed
342
- - Remaining Work: 14 hours total
343
- - Estimated Completion: Based on current velocity
344
- ```
345
-
346
- ### Step 7: Generate Actionable Insights
347
-
348
- **Identify actionable items:**
349
-
350
- ```markdown
351
- ## 🎯 Recommended Actions
352
-
353
- ### Immediate Actions Needed
354
-
355
- 1. **Review Stale Work Items** - 2 work items haven't been updated in >7 days
356
- 2. **Assign Orphaned Work Items** - 1 work item needs spec relationship established
357
- 3. **Address High Priority Bugs** - 1 critical bug needs immediate attention
358
-
359
- ### Sprint Health Check
360
-
361
- - **User Stories:** 60% completion rate (3/5 closed)
362
- - **Tasks:** Making good progress, 67% of active tasks on track
363
- - **Velocity:** Average 1.2 work items closed per day over last 7 days
364
- - **Burndown:** Currently on track for sprint completion
365
-
366
- ### Capacity Planning
367
-
368
- - **Team Capacity:** 40 hours/week total
369
- - **Current Workload:** 48 hours remaining work
370
- - **Recommendation:** Sprint completion achievable with current pace
371
-
372
- ### Risk Indicators
373
-
374
- - **Blocked Items:** 1 task waiting for external dependency
375
- - **Overdue Items:** 0 work items past due date
376
- - **Unassigned Critical Work:** 0 high-priority items unassigned
377
- ```
378
-
379
- ### Step 8: Save Sync Results
380
-
381
- **Create sync report document:**
382
-
383
- Save to `.code-captain/reports/azure-sync-{date}-{time}.md`
384
-
385
- **Update sync metadata:**
386
-
387
- Create or update `.code-captain/azure-sync-status.json`:
388
-
389
- ```json
390
- {
391
- "lastSync": "2024-12-29T10:30:00Z",
392
- "organization": "orgname",
393
- "project": "projectname",
394
- "totalWorkItems": 43,
395
- "activeWorkItems": 18,
396
- "filters": {
397
- "state": "all",
398
- "type": "all",
399
- "iteration": "current"
400
- },
401
- "syncDuration": "2.8s",
402
- "workItemsUpdated": 8,
403
- "newWorkItemsSinceLastSync": 2,
404
- "closedWorkItemsSinceLastSync": 3,
405
- "sprintMetrics": {
406
- "currentIteration": "Sprint 1",
407
- "plannedWork": 80,
408
- "completedWork": 32,
409
- "remainingWork": 48,
410
- "velocityPerDay": 1.2
411
- }
412
- }
413
- ```
414
-
415
- ## Configuration Requirements
416
-
417
- **Azure DevOps Access:**
418
-
419
- - Personal Access Token (PAT) with Work Items (read) permissions
420
- - Organization and project access
421
- - Environment variable: `AZURE_DEVOPS_PAT`
422
-
423
- **Project Configuration:**
424
-
425
- - Extract organization and project from git remote URL
426
- - Support both SSH and HTTPS Azure DevOps remotes
427
- - Validate access to target project
428
-
429
- ## Error Handling & Edge Cases
430
-
431
- **Azure DevOps API Issues:**
432
-
433
- - Handle rate limiting with appropriate backoff
434
- - Provide clear error messages for authentication failures
435
- - Continue with partial results if some API calls fail
436
- - Cache results to minimize API calls
437
-
438
- **Missing Local Documents:**
439
-
440
- - If no spec folders found: Generate report without local sync
441
- - If mapping file missing: Create new mapping from current state
442
- - If spec documents missing: Note in report but continue sync
443
-
444
- **Large Projects:**
445
-
446
- - Handle pagination for projects with hundreds of work items
447
- - Implement filtering to avoid overwhelming output
448
- - Provide progress indicators for long-running syncs
449
- - Option to limit results to current iteration only
450
-
451
- ## Integration with Existing Commands
452
-
453
- **Works with create-azure-work-items:**
454
-
455
- - Reads and validates work item mapping files created by create-azure-work-items
456
- - Updates progress on work items created from specs
457
- - Maintains consistency with Code Captain work item tagging
458
-
459
- **Azure DevOps specific features:**
460
-
461
- - Utilizes Azure DevOps iterations and area paths
462
- - Tracks remaining work and capacity metrics
463
- - Integrates with Azure DevOps sprint planning
464
- - Provides burndown and velocity analytics
465
-
466
- ## Usage Notes
467
-
468
- **Prerequisites:**
469
-
470
- - Azure DevOps project with existing work items
471
- - Azure DevOps PAT configured in environment
472
- - Optional: Existing spec folders with work item mappings
473
-
474
- **Best practices:**
475
-
476
- - Run regularly (daily) during active sprints
477
- - Use iteration filtering to focus on current sprint work
478
- - Review actionable insights for daily standups
479
- - Update docs regularly to maintain traceability
480
-
481
- **Performance considerations:**
482
-
483
- - Large projects may require filtering to avoid API limits
484
- - Use caching for frequently accessed work item data
485
- - Consider pagination limits for projects with >200 work items
486
- - Respect Azure DevOps API rate limits