@chris1807/claude-kit 2.1.9 → 2.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chris1807/claude-kit",
3
- "version": "2.1.9",
3
+ "version": "2.1.10",
4
4
  "description": "Claude Code starter kit for Azure DevOps teams — agents, hooks, MCP servers, slash commands, and end-to-end work item → PR → release → deploy workflow automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,219 @@
1
+ Sweep an Azure DevOps backlog for Dev Ready user stories without child tasks and propose a per-story task breakdown with hour estimates. Usage: `/plan-backlog [project]`
2
+
3
+ This command walks the **backlog** of a chosen Azure DevOps project (work items not assigned to any sprint), finds user stories that are **Dev Ready**, **have Story Points**, and **have no child tasks yet**, and — story by story — proposes a tailored Task breakdown with hour estimates for the user to approve before any work items are created.
4
+
5
+ Treat `$ARGUMENTS` as an optional project name (e.g. `/plan-backlog CSI Development`). If provided, skip the project prompt in Step 1.
6
+
7
+ ## Step 1: Choose the Azure DevOps Project
8
+
9
+ ### Detect the default project
10
+
11
+ Before prompting, attempt to detect the default Azure DevOps project from CLAUDE.md, in this order:
12
+
13
+ 1. **Project CLAUDE.md** — read `<current-repo>/CLAUDE.md`. Look for an explicit `project: <name>` declaration, a "Work items live in **<Project Name>**" sentence, or a `## Pipeline Configuration` table with project references.
14
+ 2. **Parent CLAUDE.md** — read `<parent-dir>/CLAUDE.md` (e.g. `~/Projects/CLAUDE.md`). Look for the same patterns. The CSI parent CLAUDE.md, for example, declares: "Work items for both **COMPASS** and **CSI Pay** live in the **CSI Development** Azure DevOps project."
15
+
16
+ If a default is found, present it pre-selected:
17
+
18
+ ```
19
+ Which Azure DevOps project should I sweep?
20
+
21
+ Default: {detected project} ← press enter to accept
22
+
23
+ Or specify a different project name, or "list" to see all projects.
24
+ ```
25
+
26
+ If the user types `list`, call `mcp__azure-devops__core_list_projects` and present the names, then re-prompt. **Wait for the user's response.** Validate the chosen project name exists (call `core_list_projects` if uncertain).
27
+
28
+ ## Step 2: Query the Backlog
29
+
30
+ Run a WIQL query via `mcp__azure-devops__wit_query_by_wiql` to find candidate stories. "Backlog" means items at the **root iteration path** (not assigned to any sprint).
31
+
32
+ ```sql
33
+ SELECT [System.Id], [System.Title], [System.State],
34
+ [System.WorkItemType], [System.IterationPath],
35
+ [Microsoft.VSTS.Scheduling.StoryPoints], [System.Tags]
36
+ FROM WorkItems
37
+ WHERE [System.TeamProject] = '{project}'
38
+ AND [System.WorkItemType] IN ('User Story', 'Bug')
39
+ AND [System.State] = 'Dev Ready'
40
+ AND [Microsoft.VSTS.Scheduling.StoryPoints] > 0
41
+ AND [System.IterationPath] = '{project}'
42
+ ORDER BY [Microsoft.VSTS.Common.StackRank] ASC
43
+ ```
44
+
45
+ > The `[System.IterationPath] = '{project}'` clause restricts results to the **root** iteration — items not yet placed in a sprint. If a project uses a different convention (e.g. an explicit "Backlog" iteration), ask the user to confirm before proceeding.
46
+
47
+ If the query returns zero items, report:
48
+
49
+ ```
50
+ No Dev Ready stories with Story Points were found on the backlog of {project}.
51
+ Nothing to plan.
52
+ ```
53
+
54
+ and stop.
55
+
56
+ ## Step 3: Filter Out Stories That Already Have Child Tasks
57
+
58
+ For each candidate from Step 2, fetch the work item with `mcp__azure-devops__wit_get_work_item` expanding `relations`. If the item has any `System.LinkTypes.Hierarchy-Forward` relation pointing at a `Task`, mark it as **already broken down** and skip it.
59
+
60
+ Present a one-line summary of what was skipped:
61
+
62
+ ```
63
+ Skipped {n} stories that already have child tasks:
64
+ - AB#{id}: {title} ({k} existing tasks)
65
+ - ...
66
+ ```
67
+
68
+ If after filtering there are zero stories left, report "All Dev Ready backlog stories already have tasks — nothing to plan." and stop.
69
+
70
+ ## Step 4: Present the Working List
71
+
72
+ Show the remaining stories the user is about to walk through:
73
+
74
+ ```
75
+ Found {n} Dev Ready stories with Story Points and no child tasks on the {project} backlog:
76
+
77
+ | # | ID | Title | Points |
78
+ |----|----------|------------------------------------------|--------|
79
+ | 1 | AB#4521 | COM - Admin can export payments to CSV | 5 |
80
+ | 2 | AB#4523 | COM - Add bulk approval workflow | 8 |
81
+ | 3 | AB#4530 | COM - Dashboard trend graphs | 3 |
82
+ | .. | ... | ... | ... |
83
+
84
+ I'll walk through each one. For each story you'll see a proposed task list
85
+ with hours; you can approve, edit, or skip per story.
86
+
87
+ Continue? (yes / cancel)
88
+ ```
89
+
90
+ **Wait for the user.** If `cancel`, stop with no changes.
91
+
92
+ ## Step 5: Per-Story Task Breakdown (loop)
93
+
94
+ For each remaining story, in order:
95
+
96
+ ### 5a. Re-read the story in full
97
+
98
+ Fetch the work item again (Description and Acceptance Criteria fields) if not already cached. You need the AC text to tailor the task list.
99
+
100
+ ### 5b. Map Story Points → total hour budget
101
+
102
+ Use this rough mapping (calibrated to ~6 productive hours per day):
103
+
104
+ | Points | Hour budget | Notes |
105
+ |--------|-------------|-------|
106
+ | 1 | 4 hrs | trivial change |
107
+ | 2 | 8 hrs | small, one-layer change |
108
+ | 3 | 14 hrs | one feature slice, modest tests |
109
+ | 5 | 24 hrs | cross-layer or new component |
110
+ | 8 | 40 hrs | multi-area, real unknowns |
111
+ | 13 | 64 hrs | large feature — should probably be split |
112
+ | 21 | 100 hrs | very large — almost certainly split |
113
+
114
+ If the points value isn't on the Fibonacci scale, round to the nearest entry above.
115
+
116
+ ### 5c. Tailor the task list (hybrid template)
117
+
118
+ Start from this template, then **add, remove, or rename** tasks based on what the AC actually describes:
119
+
120
+ | Default task | When to include |
121
+ |------------------------|----------------------------------------------------------|
122
+ | Design / Spike | AC has open questions or the implementation isn't obvious |
123
+ | Backend implementation | AC mentions API, service, job, persistence, or data flow |
124
+ | Frontend implementation| AC mentions UI, screen, form, button, or workflow |
125
+ | Database / migration | AC requires schema changes or data backfill |
126
+ | Automated tests | Always include unless the story is purely a config tweak |
127
+ | Code review revisions | Always include |
128
+ | UAT support | Always include unless explicitly out of scope |
129
+
130
+ Distribute the hour budget across the chosen tasks. Reasonable defaults:
131
+
132
+ - Code review revisions: ~10% of budget (min 1 hr)
133
+ - UAT support: ~10% of budget (min 1 hr)
134
+ - Automated tests: ~15–25% of budget
135
+ - Design / Spike (if present): ~10–20% of budget
136
+ - Remaining hours split across implementation tasks based on the AC
137
+
138
+ Round each task to a whole hour. Final total should equal the budget (give or take 1 hr from rounding).
139
+
140
+ ### 5d. Show the proposal
141
+
142
+ ```
143
+ ─────────────────────────────────────────────────────────────
144
+ AB#{id}: {title} ({points} pts → {budget} hrs total)
145
+ ─────────────────────────────────────────────────────────────
146
+
147
+ Proposed child tasks:
148
+
149
+ | # | Task title | Hours |
150
+ |---|-----------------------------------------------|-------|
151
+ | 1 | {Prefix} - Design: clarify export field set | 3 |
152
+ | 2 | {Prefix} - Backend: CSV export endpoint | 8 |
153
+ | 3 | {Prefix} - Frontend: export button + download | 6 |
154
+ | 4 | {Prefix} - Tests: export endpoint + UI | 4 |
155
+ | 5 | {Prefix} - Code review revisions | 2 |
156
+ | 6 | {Prefix} - UAT support | 1 |
157
+ | | **Total** | **24**|
158
+
159
+ Approve? (yes / edit / skip / cancel-all)
160
+ ```
161
+
162
+ Task titles use the same product prefix as the parent (e.g. `COM`, `PAY`, `CDA`) — extract it from the parent's title. Use the format `{Prefix} - {what the task does}`.
163
+
164
+ **Wait for the user.**
165
+
166
+ - `yes` → proceed to 5e (create the tasks)
167
+ - `edit` → ask which row to change (title or hours), revise, re-show the table, ask again
168
+ - `skip` → skip this story, move to the next; record it as skipped
169
+ - `cancel-all` → stop the entire loop with no further changes. Report what was already created.
170
+
171
+ ### 5e. Create the child tasks
172
+
173
+ For each approved task, call `mcp__azure-devops__wit_create_work_item` with:
174
+
175
+ - **project**: the chosen project
176
+ - **workItemType**: `Task`
177
+ - **title**: the task title (with prefix)
178
+ - **fields**:
179
+ - `Microsoft.VSTS.Scheduling.OriginalEstimate` — the hour estimate (as a number)
180
+ - `Microsoft.VSTS.Scheduling.RemainingWork` — the same hour estimate
181
+ - `System.IterationPath` — copy from the parent (which is the root)
182
+ - `System.AreaPath` — copy from the parent
183
+
184
+ Then link the new task as a child of the parent with `mcp__azure-devops__wit_add_child_work_items` (or fall back to `wit_work_items_link` with link type `System.LinkTypes.Hierarchy-Forward` from parent → task).
185
+
186
+ If any create or link call fails, report the failure for that task, stop creating tasks for this story, and ask the user whether to continue with the next story or abort the loop.
187
+
188
+ ### 5f. Confirm per-story result
189
+
190
+ ```
191
+ ✓ AB#{id}: created {k} child tasks ({budget} hrs total)
192
+ ```
193
+
194
+ Then move to the next story.
195
+
196
+ ## Step 6: Final Summary
197
+
198
+ Once the loop ends (all stories handled, or user said `cancel-all`):
199
+
200
+ ```
201
+ ## Backlog Planning Complete — {project}
202
+
203
+ Stories planned: {n_planned}
204
+ ✓ Tasks created: {n_tasks_total} ({hours_total} hrs)
205
+ Stories skipped: {n_skipped}
206
+ - already had tasks: {n_existing}
207
+ - user skipped: {n_user_skipped}
208
+
209
+ Planned stories:
210
+ - AB#4521: 6 tasks, 24 hrs
211
+ - AB#4530: 4 tasks, 14 hrs
212
+ - ...
213
+
214
+ Next steps:
215
+ /quote AB#{id} — re-estimate any story whose budget felt off
216
+ /implement AB#{id} — start working on a planned story
217
+ ```
218
+
219
+ Do not assign tasks, change parent state, or add tags unless the user explicitly asks — those are downstream decisions.
@@ -211,6 +211,7 @@ All deployment and release operations are available as slash commands:
211
211
  | `/promote` | `/promote staging production` | Promote all code between environments |
212
212
  | `/rollback` | `/rollback AB#1234 production` | Revert commits on an environment |
213
213
  | `/status` | `/status release 24` | Check release, pipeline, or work item status |
214
+ | `/plan-backlog` | `/plan-backlog [project]` | Sweep backlog for Dev Ready stories with points and no tasks → propose child tasks with hours |
214
215
  | `/cleanup-branches` | `/cleanup-branches` | Delete merged branches |
215
216
 
216
217
  The CD pipeline is only triggered manually when pushing directly to an environment branch. For feature/work branches, the pipeline triggers on PR merge.