@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,403 @@
|
|
|
1
|
+
# Create Azure DevOps Work Items Command (cc: create-azure-work-items)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Automatically create Azure DevOps work items from existing user stories and tasks, establishing parent-child relationships through hierarchical work item types and updating source documents with work item IDs for traceability.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cc: create-azure-work-items [spec-folder-path]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Examples:**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cc: create-azure-work-items .code-captain/specs/2024-12-28-user-profile-dashboard/
|
|
17
|
+
cc: create-azure-work-items # Auto-detect latest spec folder
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Command Process
|
|
21
|
+
|
|
22
|
+
### Step 1: Context Discovery & Validation
|
|
23
|
+
|
|
24
|
+
**Auto-detect spec folder (if no path provided):**
|
|
25
|
+
|
|
26
|
+
- Search `.code-captain/specs/` for most recent dated folder
|
|
27
|
+
- Validate folder contains required files: `user-stories.md` and `tasks.md`
|
|
28
|
+
- Confirm Azure DevOps project context is available
|
|
29
|
+
|
|
30
|
+
**Validate required files exist:**
|
|
31
|
+
|
|
32
|
+
- `user-stories.md` - Source for User Story work items
|
|
33
|
+
- `tasks.md` - Source for Task and Sub-task work items
|
|
34
|
+
- Optional: `spec.md` for additional context
|
|
35
|
+
|
|
36
|
+
**Azure DevOps project detection:**
|
|
37
|
+
|
|
38
|
+
- Check if 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
|
+
|
|
42
|
+
### Step 2: Create Todo Tracking
|
|
43
|
+
|
|
44
|
+
**Use `todo_write` to track the work item creation process:**
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"todos": [
|
|
49
|
+
{
|
|
50
|
+
"id": "azure-workitems-parse",
|
|
51
|
+
"content": "Parse user stories and tasks from spec documents",
|
|
52
|
+
"status": "in_progress"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "azure-workitems-create-stories",
|
|
56
|
+
"content": "Create User Story work items from user stories",
|
|
57
|
+
"status": "pending"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "azure-workitems-create-tasks",
|
|
61
|
+
"content": "Create Task work items linked to User Stories",
|
|
62
|
+
"status": "pending"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "azure-workitems-update-docs",
|
|
66
|
+
"content": "Update user-stories.md and tasks.md with work item IDs",
|
|
67
|
+
"status": "pending"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "azure-workitems-verify",
|
|
71
|
+
"content": "Verify all work items created and documents updated",
|
|
72
|
+
"status": "pending"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 3: Parse Spec Documents
|
|
79
|
+
|
|
80
|
+
**Read and parse user-stories.md:**
|
|
81
|
+
|
|
82
|
+
- Extract each user story with its structure:
|
|
83
|
+
- Title
|
|
84
|
+
- "As a/I want to/So that" format
|
|
85
|
+
- Acceptance criteria list
|
|
86
|
+
- Definition of done checklist
|
|
87
|
+
|
|
88
|
+
**Read and parse tasks.md:**
|
|
89
|
+
|
|
90
|
+
- Extract main tasks and their subtasks
|
|
91
|
+
- Identify task hierarchy (1.0, 1.1, 1.2, etc.)
|
|
92
|
+
- Preserve task descriptions and checkboxes
|
|
93
|
+
|
|
94
|
+
**Create mapping structure:**
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
{
|
|
98
|
+
userStories: [
|
|
99
|
+
{
|
|
100
|
+
title: "Story Title",
|
|
101
|
+
description: "As a user...",
|
|
102
|
+
acceptanceCriteria: ["Given...", "When...", "Then..."],
|
|
103
|
+
definitionOfDone: ["Testable requirement 1", "..."],
|
|
104
|
+
originalLineRange: [25, 45]
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
tasks: [
|
|
108
|
+
{
|
|
109
|
+
title: "Main Task Title",
|
|
110
|
+
subtasks: [
|
|
111
|
+
{ title: "Subtask 1", description: "...", originalLineRange: [10, 12] },
|
|
112
|
+
{ title: "Subtask 2", description: "...", originalLineRange: [13, 15] }
|
|
113
|
+
],
|
|
114
|
+
originalLineRange: [8, 20]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Step 4: Create User Story Work Items
|
|
121
|
+
|
|
122
|
+
**For each user story:**
|
|
123
|
+
|
|
124
|
+
**Work item title format:**
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
{Story Title}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Work item fields:**
|
|
131
|
+
|
|
132
|
+
- **Work Item Type:** User Story
|
|
133
|
+
- **Title:** Story title
|
|
134
|
+
- **Description:** Full user story with acceptance criteria
|
|
135
|
+
- **State:** New
|
|
136
|
+
- **Area Path:** Current project area
|
|
137
|
+
- **Iteration Path:** Current iteration
|
|
138
|
+
- **Tags:** user-story, code-captain
|
|
139
|
+
|
|
140
|
+
**Description template:**
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
## User Story
|
|
144
|
+
|
|
145
|
+
{User Story Description - "As a ... I want to ... So that ..."}
|
|
146
|
+
|
|
147
|
+
## Acceptance Criteria
|
|
148
|
+
|
|
149
|
+
{Acceptance Criteria formatted as checklist}
|
|
150
|
+
|
|
151
|
+
- [ ] Given [context], when [action], then [outcome]
|
|
152
|
+
- [ ] Given [context], when [action], then [outcome]
|
|
153
|
+
|
|
154
|
+
## Definition of Done
|
|
155
|
+
|
|
156
|
+
{Definition of Done formatted as checklist}
|
|
157
|
+
|
|
158
|
+
- [ ] [Testable requirement]
|
|
159
|
+
- [ ] [Testable requirement]
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
_Generated from spec: {spec-folder-name}_
|
|
164
|
+
_Source: user-stories.md_
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Create work items using Azure DevOps REST API:**
|
|
168
|
+
|
|
169
|
+
- Use Azure DevOps REST API to create User Story work items
|
|
170
|
+
- Store returned work item IDs with user story mapping
|
|
171
|
+
|
|
172
|
+
### Step 5: Create Task Work Items
|
|
173
|
+
|
|
174
|
+
**For each main task:**
|
|
175
|
+
|
|
176
|
+
**Main task work item:**
|
|
177
|
+
|
|
178
|
+
- **Work Item Type:** Task
|
|
179
|
+
- **Title:** Main task title
|
|
180
|
+
- **Parent Link:** Link to related User Story (if applicable)
|
|
181
|
+
- **Description:** Task overview with subtask list
|
|
182
|
+
- **State:** New
|
|
183
|
+
- **Tags:** task, code-captain
|
|
184
|
+
|
|
185
|
+
**For each subtask:**
|
|
186
|
+
|
|
187
|
+
**Subtask work item:**
|
|
188
|
+
|
|
189
|
+
- **Work Item Type:** Task
|
|
190
|
+
- **Title:** Subtask title
|
|
191
|
+
- **Parent Link:** Link to main task
|
|
192
|
+
- **Description:** Subtask details
|
|
193
|
+
- **State:** New
|
|
194
|
+
- **Tags:** subtask, code-captain
|
|
195
|
+
|
|
196
|
+
**Description template for main tasks:**
|
|
197
|
+
|
|
198
|
+
```markdown
|
|
199
|
+
## Task Overview
|
|
200
|
+
|
|
201
|
+
{Main Task Description}
|
|
202
|
+
|
|
203
|
+
## Sub-Tasks
|
|
204
|
+
|
|
205
|
+
This task includes the following sub-tasks:
|
|
206
|
+
|
|
207
|
+
{List of subtask work items with links - populated after creation}
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
_Generated from spec: {spec-folder-name}_
|
|
212
|
+
_Source: tasks.md_
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Description template for subtasks:**
|
|
216
|
+
|
|
217
|
+
```markdown
|
|
218
|
+
## Subtask Details
|
|
219
|
+
|
|
220
|
+
{Subtask Description}
|
|
221
|
+
|
|
222
|
+
## Parent Task
|
|
223
|
+
|
|
224
|
+
This subtask belongs to: {parent-task-work-item-link}
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
_Generated from spec: {spec-folder-name}_
|
|
229
|
+
_Source: tasks.md_
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Step 6: Update Source Documents with Work Item IDs
|
|
233
|
+
|
|
234
|
+
**Update user-stories.md:**
|
|
235
|
+
|
|
236
|
+
For each user story, add work item ID reference:
|
|
237
|
+
|
|
238
|
+
```markdown
|
|
239
|
+
## Story 1: User Profile Creation [#123]
|
|
240
|
+
|
|
241
|
+
**As a** new user
|
|
242
|
+
**I want to** create a profile with basic information
|
|
243
|
+
**So that** I can personalize my experience
|
|
244
|
+
|
|
245
|
+
### Work Item: [123](https://dev.azure.com/org/project/_workitems/edit/123)
|
|
246
|
+
|
|
247
|
+
### Acceptance Criteria
|
|
248
|
+
|
|
249
|
+
...
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Update tasks.md:**
|
|
253
|
+
|
|
254
|
+
For each task and subtask, add work item ID references:
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
## Tasks
|
|
258
|
+
|
|
259
|
+
- [ ] 1. User Authentication System [#124]
|
|
260
|
+
|
|
261
|
+
- [ ] 1.1 Write tests for authentication middleware [#125]
|
|
262
|
+
- [ ] 1.2 Implement JWT token generation [#126]
|
|
263
|
+
- [ ] 1.3 Create password hashing utilities [#127]
|
|
264
|
+
|
|
265
|
+
### Task Work Items:
|
|
266
|
+
|
|
267
|
+
- Main Task: [124](https://dev.azure.com/org/project/_workitems/edit/124)
|
|
268
|
+
- Subtasks: [125](https://dev.azure.com/org/project/_workitems/edit/125), [126](https://dev.azure.com/org/project/_workitems/edit/126), [127](https://dev.azure.com/org/project/_workitems/edit/127)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Step 7: Create Work Item Relationship Mapping
|
|
272
|
+
|
|
273
|
+
**Generate mapping document:**
|
|
274
|
+
|
|
275
|
+
Create `.code-captain/specs/{spec-folder}/azure-workitems-mapping.md`:
|
|
276
|
+
|
|
277
|
+
```markdown
|
|
278
|
+
# Azure DevOps Work Items Mapping
|
|
279
|
+
|
|
280
|
+
> Generated: {current-date}
|
|
281
|
+
> Spec: {spec-folder-name}
|
|
282
|
+
> Organization: {org-name}
|
|
283
|
+
> Project: {project-name}
|
|
284
|
+
|
|
285
|
+
## User Story Work Items
|
|
286
|
+
|
|
287
|
+
| Story Title | Work Item # | Azure DevOps Link |
|
|
288
|
+
| ------------- | ----------- | ------------------------------------------------------------- |
|
|
289
|
+
| Story 1 Title | 123 | [Link](https://dev.azure.com/org/project/_workitems/edit/123) |
|
|
290
|
+
| Story 2 Title | 124 | [Link](https://dev.azure.com/org/project/_workitems/edit/124) |
|
|
291
|
+
|
|
292
|
+
## Task Work Items
|
|
293
|
+
|
|
294
|
+
| Task Title | Main Work Item | Sub Work Items |
|
|
295
|
+
| ------------ | -------------- | ------------------------ |
|
|
296
|
+
| Task 1 Title | [125](link) | [126](link), [127](link) |
|
|
297
|
+
| Task 2 Title | [128](link) | [129](link), [130](link) |
|
|
298
|
+
|
|
299
|
+
## Summary
|
|
300
|
+
|
|
301
|
+
- **Total Work Items Created:** {count}
|
|
302
|
+
- **User Stories:** {count}
|
|
303
|
+
- **Main Tasks:** {count}
|
|
304
|
+
- **Subtasks:** {count}
|
|
305
|
+
|
|
306
|
+
## Source Files Updated
|
|
307
|
+
|
|
308
|
+
- ✅ user-stories.md - Added work item references
|
|
309
|
+
- ✅ tasks.md - Added work item references and links
|
|
310
|
+
- ✅ azure-workitems-mapping.md - Created mapping document
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Step 8: Verification & Summary
|
|
314
|
+
|
|
315
|
+
**Verify all work items created:**
|
|
316
|
+
|
|
317
|
+
- Check each returned work item ID is valid
|
|
318
|
+
- Verify Azure DevOps links are accessible
|
|
319
|
+
- Confirm parent-child relationships established
|
|
320
|
+
|
|
321
|
+
**Present completion summary:**
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
✅ Azure DevOps Work Items Creation Complete
|
|
325
|
+
|
|
326
|
+
📊 Summary:
|
|
327
|
+
- User Stories: {count} work items created
|
|
328
|
+
- Main Tasks: {count} work items created
|
|
329
|
+
- Subtasks: {count} work items created
|
|
330
|
+
- Total: {total-count} work items
|
|
331
|
+
|
|
332
|
+
📁 Updated Files:
|
|
333
|
+
- user-stories.md - Added work item references
|
|
334
|
+
- tasks.md - Added work item references and task links
|
|
335
|
+
- azure-workitems-mapping.md - Created mapping document
|
|
336
|
+
|
|
337
|
+
🔗 Organization: {org-name}
|
|
338
|
+
📋 Project: {project-name}
|
|
339
|
+
📋 All work items available at: https://dev.azure.com/{org}/{project}/_workitems
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## Configuration Requirements
|
|
343
|
+
|
|
344
|
+
**Azure DevOps Access:**
|
|
345
|
+
|
|
346
|
+
- Personal Access Token (PAT) with Work Items (read, write) permissions
|
|
347
|
+
- Organization and project access
|
|
348
|
+
- Environment variable: `AZURE_DEVOPS_PAT`
|
|
349
|
+
|
|
350
|
+
**Project Configuration:**
|
|
351
|
+
|
|
352
|
+
- Extract organization and project from git remote URL
|
|
353
|
+
- Support both SSH and HTTPS Azure DevOps remotes
|
|
354
|
+
- Validate access to target project
|
|
355
|
+
|
|
356
|
+
## Error Handling & Edge Cases
|
|
357
|
+
|
|
358
|
+
**Missing configuration:**
|
|
359
|
+
|
|
360
|
+
- If PAT not configured: Provide setup instructions
|
|
361
|
+
- If not an Azure DevOps repository: Error with guidance
|
|
362
|
+
- If project access denied: Clear permission error message
|
|
363
|
+
|
|
364
|
+
**API limitations:**
|
|
365
|
+
|
|
366
|
+
- Handle rate limiting with appropriate delays
|
|
367
|
+
- Retry failed work item creation attempts
|
|
368
|
+
- Validate work item field requirements
|
|
369
|
+
|
|
370
|
+
**Document parsing errors:**
|
|
371
|
+
|
|
372
|
+
- Handle malformed user story structures gracefully
|
|
373
|
+
- Skip invalid task hierarchies with warnings
|
|
374
|
+
- Continue processing valid entries when possible
|
|
375
|
+
|
|
376
|
+
## Integration with Existing Commands
|
|
377
|
+
|
|
378
|
+
**Works with create-spec:**
|
|
379
|
+
|
|
380
|
+
- Automatically detects create-spec output format
|
|
381
|
+
- Reads user-stories.md and tasks.md generated by create-spec
|
|
382
|
+
- Maintains consistency with spec folder structure
|
|
383
|
+
|
|
384
|
+
**Azure DevOps specific features:**
|
|
385
|
+
|
|
386
|
+
- Utilizes Azure DevOps work item hierarchy (User Story > Task)
|
|
387
|
+
- Creates proper parent-child relationships
|
|
388
|
+
- Applies Azure DevOps specific tags and fields
|
|
389
|
+
- Integrates with Azure DevOps iterations and areas
|
|
390
|
+
|
|
391
|
+
## Usage Notes
|
|
392
|
+
|
|
393
|
+
**Prerequisites:**
|
|
394
|
+
|
|
395
|
+
- Existing spec folder with user-stories.md and tasks.md
|
|
396
|
+
- Azure DevOps project with appropriate permissions
|
|
397
|
+
- Azure DevOps PAT configured in environment
|
|
398
|
+
|
|
399
|
+
**Best practices:**
|
|
400
|
+
|
|
401
|
+
- Run after completing spec creation and review
|
|
402
|
+
- Ensure spec documents are finalized before creating work items
|
|
403
|
+
- Use consistent area and iteration paths for better organization
|