@chris1807/claude-kit 2.2.1 → 2.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chris1807/claude-kit",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
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": {
@@ -38,7 +38,7 @@ Wait for confirmation.
38
38
 
39
39
  ## Step 4: Assign and Tag
40
40
 
41
- Use `wit_update_work_items_batch` to:
41
+ Use `wit_work_item_write` (action `update_batch`) to:
42
42
  1. Set the Iteration Path to `{project}\Release #{N}` on each new work item
43
43
  2. Append `release-{N}` to each work item's tags
44
44
 
@@ -123,7 +123,7 @@ Cherry-picking:
123
123
  - **targetRefName**: `refs/heads/<target-environment-branch>`
124
124
  - **title**: `Cherry-pick AB#1234, AB#1235 → {Environment}`
125
125
  - **description**: List all work items with IDs and titles, and — under a `Scripts to run` heading — any deployment scripts found in Step 1b, so whoever merges sees them without opening the work items
126
- 3. Link all work items to the PR via `wit_link_work_item_to_pull_request`
126
+ 3. Link all work items to the PR via `wit_work_item_link_write` (action `link_to_pull_request`)
127
127
 
128
128
  ## Step 6: Pick Who Verifies Each Group (before the merge)
129
129
 
@@ -16,7 +16,7 @@ All work items live in the **CSI Development** Azure DevOps project (see CLAUDE.
16
16
 
17
17
  ## Step 1: Find Orphaned Tasks
18
18
 
19
- Use the Azure DevOps MCP `wit_query_by_wiql` with a hierarchy link query. The Source is the parent, the Target is the child Task:
19
+ Use the Azure DevOps MCP `wit_query` (action `wiql`) with a hierarchy link query. The Source is the parent, the Target is the child Task:
20
20
 
21
21
  ```sql
22
22
  SELECT [System.Id]
@@ -31,11 +31,11 @@ MODE (MustContain)
31
31
 
32
32
  If a **scope** was given, add the matching constraint to the `[Target]` clause (e.g. `AND [Target].[System.AreaPath] UNDER 'CSI Development\\Compass'`, or `AND [Target].[System.Title] CONTAINS 'PAY'`).
33
33
 
34
- > **Note on state names:** Process templates vary. Some projects close tasks to `Done` instead of `Closed`, or use `Resolved`. If the query returns nothing or errors on an unknown state, first confirm the valid states for the Task type via `wit_get_work_item_type`, then adjust the `NOT IN` list and the close target in Step 3 accordingly.
34
+ > **Note on state names:** Process templates vary. Some projects close tasks to `Done` instead of `Closed`, or use `Resolved`. If the query returns nothing or errors on an unknown state, first confirm the valid states for the Task type via `wit_work_item` (action `get_type`), then adjust the `NOT IN` list and the close target in Step 3 accordingly.
35
35
 
36
36
  If the link query is unsupported or returns no usable pairs, fall back to: query all open Tasks in scope with a flat WIQL, fetch each task's parent via `relations`, and keep only those whose parent state is in the three target states.
37
37
 
38
- Fetch the matched tasks (and their parents) in a batch via `wit_get_work_items_batch_by_ids` to get titles, states, assignees, and parent context.
38
+ Fetch the matched tasks (and their parents) in a batch via `wit_work_item` (action `get_batch`) to get titles, states, assignees, and parent context.
39
39
 
40
40
  ## Step 2: Present the Candidates
41
41
 
@@ -59,11 +59,11 @@ Otherwise, wait for explicit confirmation before proceeding. Never close tasks w
59
59
 
60
60
  ## Step 3: Close the Tasks
61
61
 
62
- For each confirmed task, use `wit_update_work_items_batch`:
62
+ For each confirmed task, use `wit_work_item_write` (action `update_batch`):
63
63
  - **path**: `/fields/System.State`
64
64
  - **value**: `Closed` (or the project's terminal Task state confirmed in Step 1)
65
65
 
66
- Then add a comment on each via `wit_add_work_item_comment` so the auto-close is traceable:
66
+ Then add a comment on each via `wit_work_item_comment_write` (action `add`) so the auto-close is traceable:
67
67
 
68
68
  > Auto-closed by `/close-orphan-tasks` — parent AB#{parentId} is in state "{parentState}".
69
69
 
@@ -38,13 +38,13 @@ Create a new iteration in Azure DevOps via `work_create_iterations`:
38
38
 
39
39
  ## Step 4: Assign Work Items to the Release
40
40
 
41
- Use `wit_update_work_items_batch` to set the Iteration Path on each work item to the new release iteration:
41
+ Use `wit_work_item_write` (action `update_batch`) to set the Iteration Path on each work item to the new release iteration:
42
42
  - **path**: `/fields/System.IterationPath`
43
43
  - **value**: `{project}\Release #{N}`
44
44
 
45
45
  ## Step 5: Tag Work Items
46
46
 
47
- Use `wit_update_work_items_batch` to add a release tag to each work item:
47
+ Use `wit_work_item_write` (action `update_batch`) to add a release tag to each work item:
48
48
  - **path**: `/fields/System.Tags`
49
49
  - **value**: append `release-{N}` to existing tags
50
50
 
@@ -404,7 +404,7 @@ This applies to **User Story**. It does **not** apply to Bug or Hot Fix: neither
404
404
 
405
405
  ### Call the create API
406
406
 
407
- Call `mcp__azure-devops__wit_create_work_item` with:
407
+ Call `mcp__azure-devops__wit_work_item_write` (action `create`) with:
408
408
 
409
409
  - **project**: the chosen project
410
410
  - **workItemType**: `Feature`, `Bug`, `User Story`, or `Hot Fix` (two words, exact casing)
@@ -431,7 +431,7 @@ If the `Open Questions` section is non-empty, append it as a clearly-labeled HTM
431
431
 
432
432
  ### Move to Dev Ready (pointed items only)
433
433
 
434
- If story points were agreed in Step 4, set `System.State` to `Dev Ready` via `mcp__azure-devops__wit_update_work_item` **after** the item is created (a separate call — new items start in `New`, and some process templates reject a non-initial state in the create call). If the state transition is rejected, report the error and leave the state as-is — don't silently retry through intermediate states. Items created without points stay in `New`.
434
+ If story points were agreed in Step 4, set `System.State` to `Dev Ready` via `mcp__azure-devops__wit_work_item_write` (action `update`) **after** the item is created (a separate call — new items start in `New`, and some process templates reject a non-initial state in the create call). If the state transition is rejected, report the error and leave the state as-is — don't silently retry through intermediate states. Items created without points stay in `New`.
435
435
 
436
436
  **Features are never moved.** A Feature stays in `New` and advances only as its child stories are verified and closed — the same rule `/implement` follows.
437
437
 
@@ -462,7 +462,7 @@ On `yes`:
462
462
  ```
463
463
 
464
464
  **Wait for the user.** Revise and re-present until approved. Do not create anything before approval.
465
- 5. On approval, create each story with `mcp__azure-devops__wit_create_work_item` in the same project, setting:
465
+ 5. On approval, create each story with `mcp__azure-devops__wit_work_item_write` (action `create`) in the same project, setting:
466
466
  - `System.Description` and `Microsoft.VSTS.Common.AcceptanceCriteria` — rendered to HTML per the Step 8 rules
467
467
  - `Custom.Order` — the wave number
468
468
  - `Microsoft.VSTS.Scheduling.StoryPoints` — the agreed points
@@ -489,7 +489,7 @@ For a **Bug**, fetch `Microsoft.VSTS.TCM.ReproSteps` and `Microsoft.VSTS.TCM.Sys
489
489
 
490
490
  For a **Hot Fix**, fetch `System.Description` and `Microsoft.VSTS.TCM.ReproSteps`, and confirm the narrative is in the former and the reproduction detail in the latter.
491
491
 
492
- If a check fails the write didn't take — fix it with `wit_update_work_item` before reporting success. Don't report a created item you haven't read back.
492
+ If a check fails the write didn't take — fix it with `wit_work_item_write` (action `update`) before reporting success. Don't report a created item you haven't read back.
493
493
 
494
494
  After creation, report:
495
495
 
@@ -20,7 +20,7 @@ Resolve branch names from the project's `CLAUDE.md` **Pipeline Configuration** t
20
20
 
21
21
  ## Step 1: Read the Release
22
22
 
23
- Query Azure DevOps for all work items tagged with `release-{N}` or assigned to the `Release #{N}` iteration using `search_workitem` or `wit_get_work_items_for_iteration`.
23
+ Query Azure DevOps for all work items tagged with `release-{N}` or assigned to the `Release #{N}` iteration using `search_workitem` or `wit_work_item` (action `list_for_iteration`).
24
24
 
25
25
  Present the release contents:
26
26
 
@@ -179,7 +179,7 @@ Cherry-picking commits for Release #{N}:
179
179
  - **targetRefName**: `refs/heads/<target-environment-branch>`
180
180
  - **title**: `Release #{N} → {Environment}`
181
181
  - **description**: List all work items included with their IDs and titles, and — under a `Scripts to run` heading — any deployment scripts found in Step 3b, so whoever merges sees them without opening the work items
182
- 3. Link all work items to the PR via `wit_link_work_item_to_pull_request`
182
+ 3. Link all work items to the PR via `wit_work_item_link_write` (action `link_to_pull_request`)
183
183
 
184
184
  ## Step 8: Pick Who Verifies Each Group (before the merge)
185
185
 
@@ -230,9 +230,9 @@ Render every Markdown section to HTML first — Azure DevOps description and acc
230
230
 
231
231
  Apply writes in this order, so a failure partway through leaves the most useful state behind:
232
232
 
233
- 1. **Update the parent item** — one `mcp__azure-devops__wit_update_work_item` call with every changed field. Never include `System.State` for a Feature.
233
+ 1. **Update the parent item** — one `mcp__azure-devops__wit_work_item_write` (action `update`) call with every changed field. Never include `System.State` for a Feature.
234
234
  2. **Update existing children** (verdict `Update`) — one call per story, points and `Custom.Order` in the same call as the text changes. If points were set on a story still at or before `Dev Ready`, set `System.State` = `Dev Ready` in that same call.
235
- 3. **Create added children** — `mcp__azure-devops__wit_create_work_item` with description, acceptance criteria, `Custom.Order`, agreed `Microsoft.VSTS.Scheduling.StoryPoints`, and `System.AssignedTo` copied from the Feature if it has an assignee. Then link each to the Feature as a child via `mcp__azure-devops__wit_work_item_link_write` (`System.LinkTypes.Hierarchy-Reverse`), then move pointed ones to `Dev Ready` in a follow-up call.
235
+ 3. **Create added children** — `mcp__azure-devops__wit_work_item_write` (action `create`) with description, acceptance criteria, `Custom.Order`, agreed `Microsoft.VSTS.Scheduling.StoryPoints`, and `System.AssignedTo` copied from the Feature if it has an assignee. Then link each to the Feature as a child via `mcp__azure-devops__wit_work_item_link_write` (`System.LinkTypes.Hierarchy-Reverse`), then move pointed ones to `Dev Ready` in a follow-up call.
236
236
  4. **Re-order** any story whose only change is `Custom.Order` — one call each, touching that field alone.
237
237
  5. **Retire** stories the user approved — set `System.State` = `Removed`, or remove the parent link, whichever the user chose. **Never delete a work item.**
238
238
  6. **Post comments** (if the user said yes) via `mcp__azure-devops__wit_work_item_comment_write` — one short comment per edited item saying what changed and why, and naming the Feature edit that drove it (e.g. `Scope updated via edit of AB#6240: acceptance criteria 2 reworded to cover SSO; re-ordered from wave 3 to wave 2.`).
@@ -32,7 +32,7 @@ The description and acceptance criteria fields may contain embedded images (scre
32
32
 
33
33
  ### Comments
34
34
 
35
- Read the work item comments via `wit_list_work_item_comments`. Comments often contain clarifications, scope changes, or additional requirements added after the work item was created. Incorporate any relevant information from comments into your understanding of the work item.
35
+ Read the work item comments via `wit_work_item` (action `list_comments`). Comments often contain clarifications, scope changes, or additional requirements added after the work item was created. Incorporate any relevant information from comments into your understanding of the work item.
36
36
 
37
37
  ## Step 2: Summarize and Confirm
38
38
 
@@ -82,6 +82,35 @@ Reply with your Ultracode choice (and any added context). Say **ready** once you
82
82
 
83
83
  1. **Explore** the codebase to map relevant files
84
84
  2. **Plan** the implementation approach
85
+ 3. **Re-analyze the plan as an architect** — the pass below, before the user sees anything
86
+
87
+ ### Architect Review (runs before the plan is presented)
88
+
89
+ The draft plan is a first answer, not the answer. Re-read it cold — as an experienced architect who did not write it and who cares what this codebase looks like a year from now. This happens on **every** plan, before the user sees anything.
90
+
91
+ > **Ultracode (if opted in):** run this as a separate `Workflow` agent so the review is actually independent. Give it the work item, the acceptance criteria, and the draft plan — but **not** your reasoning for the plan — and have it read the affected files itself. A reviewer who has seen the author's justification anchors to it. Without ultracode, run the pass in the main loop, but answer each question from the code, not from the plan's own prose.
92
+
93
+ Each question below is about a cost that is cheap now and expensive once the code exists:
94
+
95
+ | # | Question | What a bad answer looks like |
96
+ |---|----------|------------------------------|
97
+ | 1 | **Does this already exist?** A service, hook, component, or extension method that already does this, or is one call away. | A new `PaymentExportService` beside the `ExportService` that already handles three other exports |
98
+ | 2 | **Is each piece in the right layer?** Domain / Application / Infrastructure / API boundaries hold — no business rules in a controller, no Mongo or EF types in Domain, no HTTP concepts below API. | An `IMongoCollection<T>` parameter on a Domain method |
99
+ | 3 | **What is the simplest plan that still meets every AC?** State it, then adopt it or say in one line why the heavier one is needed. | An interface with exactly one implementation, added "for testability" |
100
+ | 4 | **What else touches the files being modified?** Name the callers. A change to a shared contract, DTO, or response shape is a breaking change until proven otherwise. | Editing a shared DTO with no note about its other consumers |
101
+ | 5 | **What happens to data that already exists?** New required fields, schema changes, and backfills each need an answer for rows written before this change. | A non-nullable field added with no default and no backfill |
102
+ | 6 | **How does it fail?** Partial failure, concurrent callers, a retried request. Is the operation idempotent, and does it need to be? | A multi-step write with no story for a crash between steps |
103
+ | 7 | **Does it hold at real data volume?** Queries inside loops, unbounded result sets, a missing index, a list endpoint with no paging. | A `foreach` over accounts issuing one query each |
104
+ | 8 | **Is it safe?** Authorization on every new endpoint, and **no sensitive field** (TIN, SSN, EIN, TaxId, BankAccountNumber, RoutingNumber, any `Encrypted*`) read, logged, returned, or projected — see the sensitive-data rule in CLAUDE.md. | A new endpoint returning a whole entity because it was convenient |
105
+ | 9 | **Can it be tested without heavy mocking?** A test needing five mocks is telling you the seams are in the wrong place. | A test plan that starts "mock the repository, the clock, and the HTTP client" |
106
+ | 10 | **Can it be undone?** `/rollback` reverts commits; it does not un-migrate data or un-send an email. Flag anything one-way. | A destructive migration with no reverse path |
107
+
108
+ **Two hard limits on this pass:**
109
+
110
+ - **It may not grow the scope.** It exists to simplify, correct, and de-risk — not to add caching, abstraction layers, or features nobody asked for. Anything outside the acceptance criteria goes in *Risks / Considerations*, or becomes a separate work item you mention. It is never folded into the plan silently.
111
+ - **It may not invent findings.** If the plan survives every question, say so in one line. A manufactured concern to look thorough spends the user's attention at the one gate that is supposed to protect it.
112
+
113
+ Apply what the pass finds, then report it in the plan as the **Architect Review** section below. The pass is never skipped; only its output scales — on a one-file config change most rows answer themselves and the report is two lines.
85
114
 
86
115
  Present the plan to the user:
87
116
 
@@ -115,6 +144,10 @@ List every test file you will add or modify and the scenarios each covers (happy
115
144
  ### Risks / Considerations
116
145
  - {any potential issues or trade-offs}
117
146
 
147
+ ### Architect Review
148
+ {One line per change the review made: what the draft said → what it says now → why.}
149
+ {If nothing changed: "Reviewed against every question — no changes." plus the one that came closest to a finding and why it is fine.}
150
+
118
151
  Approve this plan? (yes / no / suggest changes)
119
152
  ```
120
153
 
@@ -155,12 +188,14 @@ Remember the `BASE_BRANCH` — you will need it for the PR step.
155
188
 
156
189
  ### Move the Work Item to Active
157
190
 
158
- Once the branch is created, move the work item (User Story, Bug, Hot Fix, or other single work item — never a Feature) to `Active` via `wit_update_work_item`:
191
+ Once the branch is created, move the work item (User Story, Bug, Hot Fix, or other single work item — never a Feature) to `Active` via `wit_work_item_write` (action `update`):
159
192
  - **path**: `/fields/System.State`
160
193
  - **value**: `Active`
161
194
 
162
195
  If the work item is already `Active`, skip the update. If the project's process template does not have an `Active` state (the update call returns an invalid-state error), fall back in this order: `In Progress` → `Doing` → leave the current state and warn the user that the state could not be advanced automatically. Do not silently swallow the error.
163
196
 
197
+ After the update, **read the work item back** (`wit_work_item`, action `get`) and confirm `System.State` actually changed. If it didn't, say so explicitly — do not proceed reporting the item as in progress when the board still shows it otherwise.
198
+
164
199
  ### Ensure an Open Child Task Exists
165
200
 
166
201
  The child **Task** is where hours live: Step 10 closes it and logs the hours worked when the PR goes up. So an implementation run must never proceed without one — if there's nothing to close, nothing gets logged.
@@ -231,7 +266,7 @@ Create it? (yes / edit / skip)
231
266
  - `edit` → ask what to change (title or hours), revise, re-show, ask again
232
267
  - `skip` → continue without a Task, and **warn** that Step 10 will have no Task to close and no hours will be logged for this story
233
268
 
234
- On `yes`, create it with `mcp__azure-devops__wit_create_work_item`:
269
+ On `yes`, create it with `mcp__azure-devops__wit_work_item_write` (action `create`):
235
270
 
236
271
  - **workItemType**: `Task`
237
272
  - **title**: `{PREFIX} - Implement: {short summary of the story}` — reuse the parent's product prefix (`COM`, `PAY`, `CDA`, …), extracted from the parent's title
@@ -242,7 +277,7 @@ On `yes`, create it with `mcp__azure-devops__wit_create_work_item`:
242
277
  - `System.AssignedTo` — copy from the parent (pass the parent's `uniqueName` / email if the value is an identity object). If the parent is unassigned, leave it unset rather than failing.
243
278
  - `System.State` — `Active`, since implementation is starting right now (fall back to the template's in-progress equivalent, or leave it at the default and note it)
244
279
 
245
- Then link it as a child of the work item with `mcp__azure-devops__wit_add_child_work_items` (or `wit_work_items_link` with `System.LinkTypes.Hierarchy-Forward`, parent → task).
280
+ Then link it as a child of the work item with `mcp__azure-devops__wit_work_item_write` (action `add_child`) (or `wit_work_item_link_write` (action `link`) with `System.LinkTypes.Hierarchy-Forward`, parent → task).
246
281
 
247
282
  If the create or link call fails, report it and ask whether to implement without a Task or stop. Don't silently continue — the user needs to know hours won't be tracked.
248
283
 
@@ -354,9 +389,9 @@ Wait for the user's response before proceeding. Do NOT create a PR until confirm
354
389
  - **targetRefName**: `refs/heads/{BASE_BRANCH}` (the branch captured in Step 4)
355
390
  - **title**: `AB#{id}: {work item title}`
356
391
  - **labels**: `["hotfix"]` if the work item type is Hot Fix
357
- 3. Link the PR to the work item via `wit_link_work_item_to_pull_request`
392
+ 3. Link the PR to the work item via `wit_work_item_link_write` (action `link_to_pull_request`)
358
393
  4. **Close related Tasks and log hours** — see "Closing Related Tasks" below.
359
- 5. **Move the work item to `Code Review`** via `wit_update_work_item`:
394
+ 5. **Move the work item to `Code Review`** via `wit_work_item_write` (action `update`):
360
395
  - **path**: `/fields/System.State`
361
396
  - **value**: `Code Review`
362
397
 
@@ -419,7 +454,7 @@ For each task being processed, prompt for completed hours:
419
454
 
420
455
  **Wait for the user's response on every task.** Accept the suggested/current value (enter), a new numeric value, or `skip` to leave that one untouched.
421
456
 
422
- Once the user has answered, update each task in a **single** `wit_update_work_item` call per task:
457
+ Once the user has answered, update each task in a **single** `wit_work_item_write` (action `update`) call per task:
423
458
  - `Microsoft.VSTS.Scheduling.CompletedWork` → the agreed value
424
459
  - `Microsoft.VSTS.Scheduling.RemainingWork` → `0`
425
460
  - `Microsoft.VSTS.Scheduling.OriginalEstimate` → only if it is still empty; set it to the agreed completed hours so the Task isn't left with no estimate at all. Never overwrite an estimate that's already there — the gap between estimate and actual is the useful signal.
@@ -482,7 +517,7 @@ Capture `BASE_BRANCH` and create `feature/AB#{feature-id}-{sanitized-title}` per
482
517
 
483
518
  For each wave in ascending order:
484
519
 
485
- 1. **Explore & plan** each story in the wave (Step 3 rules; Ultracode fan-outs apply per story if opted in). Present **one combined plan** with a section per story — each section covering approach, files, unit tests, and agents — plus a note on any files touched by more than one story in the wave (a conflict warning). **One approval gate per wave**; wait for the user.
520
+ 1. **Explore & plan** each story in the wave (Step 3 rules; Ultracode fan-outs apply per story if opted in). Present **one combined plan** with a section per story — each section covering approach, files, unit tests, and agents — plus a note on any files touched by more than one story in the wave (a conflict warning). The **Architect Review** runs on the combined wave plan before you present it, and the shared-file conflicts are exactly what question 4 is for. **One approval gate per wave**; wait for the user.
486
521
  2. **Implement:**
487
522
  - **Move every story in the wave to `Active`** first (same rules and fallbacks as "Move the Work Item to Active" in Step 4). The Feature's state is never changed.
488
523
  - **Ensure each story in the wave has an open child Task** (Step 4's "Ensure an Open Child Task Exists" rules, applied per story — Tasks hang off the stories, never off the Feature). Batch the proposals into **one** table covering the whole wave and take a single approval, so parallel agents never wait on a prompt:
@@ -27,7 +27,7 @@ If the user types `list`, call `mcp__azure-devops__core_list_projects` and prese
27
27
 
28
28
  ## Step 2: Query the Backlog
29
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).
30
+ Run a WIQL query via `mcp__azure-devops__wit_query` (action `wiql`) to find candidate stories. "Backlog" means items at the **root iteration path** (not assigned to any sprint).
31
31
 
32
32
  ```sql
33
33
  SELECT [System.Id], [System.Title], [System.State],
@@ -55,7 +55,7 @@ and stop.
55
55
 
56
56
  ## Step 3: Filter Out Stories That Already Have Child Tasks
57
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.
58
+ For each candidate from Step 2, fetch the work item with `mcp__azure-devops__wit_work_item` (action `get`) 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
59
 
60
60
  Present a one-line summary of what was skipped:
61
61
 
@@ -175,7 +175,7 @@ Approve? (yes / edit / skip / cancel-all)
175
175
 
176
176
  ### 5e. Create the child task
177
177
 
178
- Create the approved task with `mcp__azure-devops__wit_create_work_item`:
178
+ Create the approved task with `mcp__azure-devops__wit_work_item_write` (action `create`):
179
179
 
180
180
  - **project**: the chosen project
181
181
  - **workItemType**: `Task`
@@ -187,7 +187,7 @@ Create the approved task with `mcp__azure-devops__wit_create_work_item`:
187
187
  - `System.AreaPath` — copy from the parent
188
188
  - `System.AssignedTo` — copy from the parent (pass the parent's `uniqueName` / email if its `System.AssignedTo` value is an identity object). If the parent is unassigned, leave this field unset rather than failing.
189
189
 
190
- 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).
190
+ Then link the new task as a child of the parent with `mcp__azure-devops__wit_work_item_write` (action `add_child`) (or fall back to `wit_work_item_link_write` (action `link`) with link type `System.LinkTypes.Hierarchy-Forward` from parent → task).
191
191
 
192
192
  If the create or link call fails, report the failure and ask the user whether to continue with the next story or abort the loop.
193
193
 
@@ -44,7 +44,7 @@ and stop.
44
44
 
45
45
  ## Step 3: Query the Sprint
46
46
 
47
- Run a WIQL query via `mcp__azure-devops__wit_query_by_wiql` using the **literal iteration path** from Step 2:
47
+ Run a WIQL query via `mcp__azure-devops__wit_query` (action `wiql`) using the **literal iteration path** from Step 2:
48
48
 
49
49
  ```sql
50
50
  SELECT [System.Id], [System.Title], [System.State],
@@ -73,7 +73,7 @@ and stop.
73
73
 
74
74
  ## Step 4: Filter Out Items That Already Have Child Tasks
75
75
 
76
- For each candidate from Step 3, 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.
76
+ For each candidate from Step 3, fetch the work item with `mcp__azure-devops__wit_work_item` (action `get`) 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.
77
77
 
78
78
  Present a one-line summary of what was skipped:
79
79
 
@@ -196,7 +196,7 @@ For unpointed items, the header line reads `(no points — estimated from descri
196
196
 
197
197
  ### 6e. Create the child task
198
198
 
199
- Create the approved task with `mcp__azure-devops__wit_create_work_item`:
199
+ Create the approved task with `mcp__azure-devops__wit_work_item_write` (action `create`):
200
200
 
201
201
  - **project**: the chosen project
202
202
  - **workItemType**: `Task`
@@ -208,7 +208,7 @@ Create the approved task with `mcp__azure-devops__wit_create_work_item`:
208
208
  - `System.AreaPath` — copy from the parent
209
209
  - `System.AssignedTo` — copy from the parent (pass the parent's `uniqueName` / email if its `System.AssignedTo` value is an identity object). If the parent is unassigned, leave this field unset rather than failing.
210
210
 
211
- 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).
211
+ Then link the new task as a child of the parent with `mcp__azure-devops__wit_work_item_write` (action `add_child`) (or fall back to `wit_work_item_link_write` (action `link`) with link type `System.LinkTypes.Hierarchy-Forward` from parent → task).
212
212
 
213
213
  If the create or link call fails, report the failure and ask the user whether to continue with the next item or abort the loop.
214
214
 
@@ -91,7 +91,7 @@ If the user types `list`, call `mcp__azure-devops__core_list_projects` and prese
91
91
 
92
92
  ## Step 2: Query the Backlog
93
93
 
94
- Run a WIQL query via `mcp__azure-devops__wit_query_by_wiql` to find candidate items. "Backlog" means items at the **root iteration path** (not assigned to any sprint).
94
+ Run a WIQL query via `mcp__azure-devops__wit_query` (action `wiql`) to find candidate items. "Backlog" means items at the **root iteration path** (not assigned to any sprint).
95
95
 
96
96
  ```sql
97
97
  SELECT [System.Id], [System.Title], [System.State],
@@ -203,7 +203,7 @@ For each item in the batch, do all of 3a–3e before presenting anything. Collec
203
203
 
204
204
  ### 3a. Fetch the full work item
205
205
 
206
- Fetch with `mcp__azure-devops__wit_get_work_item` expanding `relations`. Capture: title, type, description, acceptance criteria, tags, `System.CreatedBy` (display name + unique name — needed for the comment draft), child items, and any linked PRs, commits, or branches.
206
+ Fetch with `mcp__azure-devops__wit_work_item` (action `get`) expanding `relations`. Capture: title, type, description, acceptance criteria, tags, `System.CreatedBy` (display name + unique name — needed for the comment draft), child items, and any linked PRs, commits, or branches.
207
207
 
208
208
  ### 3b. Completeness review
209
209
 
@@ -368,8 +368,8 @@ Approve? (all / numbers e.g. "1,2,4" / edit N / skip N / apply rewrite N / cance
368
368
 
369
369
  Only for approved items, in batch order:
370
370
 
371
- 1. **Set Story Points and move to Dev Ready** (items with a proposed number): in one `mcp__azure-devops__wit_update_work_item` call, set `Microsoft.VSTS.Scheduling.StoryPoints` **and** `System.State` = `Dev Ready`. The state change applies only to `User Story`, `Bug`, and `Hot Fix` types, and never moves an item backward — if an item is somehow already past Dev Ready, set the points only and note it. Touch no other field — assignee, iteration, and tags stay as they are.
372
- 2. **Send unquotable User Stories back to Design Review** (approved `User Story` items with **no** proposed points, where the blocker is missing information): set `System.State` = `Design Review` via `mcp__azure-devops__wit_update_work_item`. Do this **before** posting the comment in step 4, so the creator's notification arrives with the item already back in their queue. Rules:
371
+ 1. **Set Story Points and move to Dev Ready** (items with a proposed number): in one `mcp__azure-devops__wit_work_item_write` (action `update`) call, set `Microsoft.VSTS.Scheduling.StoryPoints` **and** `System.State` = `Dev Ready`. The state change applies only to `User Story`, `Bug`, and `Hot Fix` types, and never moves an item backward — if an item is somehow already past Dev Ready, set the points only and note it. Touch no other field — assignee, iteration, and tags stay as they are.
372
+ 2. **Send unquotable User Stories back to Design Review** (approved `User Story` items with **no** proposed points, where the blocker is missing information): set `System.State` = `Design Review` via `mcp__azure-devops__wit_work_item_write` (action `update`). Do this **before** posting the comment in step 4, so the creator's notification arrives with the item already back in their queue. Rules:
373
373
 
374
374
  - **`User Story` only.** Do not attempt this on a `Bug` or a `Hot Fix` — those types have no `Design Review` state, so the update fails at runtime in the middle of the batch. They take step 3 instead.
375
375
  - Only from `Design Approved` — **never move an item backward past the design stage.** An item at `Dev Ready`, or anything at `Active` or later (`Active`, `Code Review`, `Ready for Testing`, `Testing`, `Ready for Staging`, `Staging`, `Ready to Deploy`, …), keeps its state; note it in the summary instead.
@@ -387,8 +387,8 @@ Only for approved items, in batch order:
387
387
  - Skip items whose only finding is **needs to be split** — nothing is missing, so no tag.
388
388
  - Touch no other field — points stay empty; assignee, iteration, and state stay as they are.
389
389
 
390
- 4. **Post the comment** (items with an approved draft): add it with `mcp__azure-devops__wit_add_work_item_comment` (or the server's work-item comment tool). Use the mention syntax the server supports so the creator is notified; otherwise lead with their display name as drafted. For a story that just moved to Design Review, the comment must say so — the creator needs to know why it left their Design Approved column. For a bug that just got the `needs-info` tag, the comment must say that too, and say that removing the tag re-queues it.
391
- 5. **Apply the rewrite** (only items the user marked `apply rewrite N`): update `System.Description` (and `System.Title` if the rewrite included one) via `wit_update_work_item`, and adjust the comment to say the rewrite was applied ("rewrote the description/AC per the above — please review") rather than suggesting it. Never apply a rewrite the user didn't explicitly mark.
390
+ 4. **Post the comment** (items with an approved draft): add it with `mcp__azure-devops__wit_work_item_comment_write` (action `add`) (or the server's work-item comment tool). Use the mention syntax the server supports so the creator is notified; otherwise lead with their display name as drafted. For a story that just moved to Design Review, the comment must say so — the creator needs to know why it left their Design Approved column. For a bug that just got the `needs-info` tag, the comment must say that too, and say that removing the tag re-queues it.
391
+ 5. **Apply the rewrite** (only items the user marked `apply rewrite N`): update `System.Description` (and `System.Title` if the rewrite included one) via `wit_work_item_write` (action `update`), and adjust the comment to say the rewrite was applied ("rewrote the description/AC per the above — please review") rather than suggesting it. Never apply a rewrite the user didn't explicitly mark.
392
392
 
393
393
  **Guard on `Microsoft.VSTS.Common.AcceptanceCriteria`:** write it only if the item's AC field was **non-empty** when fetched in 3a. Re-check the fetched value at write time — if it was blank, drop AC from the update payload and write the other fields. Blank means no criteria at all: empty string, whitespace, an empty HTML shell like `<div></div>` or `<p><br></p>`, **or the process template's placeholder tip text** (`💡 Tip: Add "@serena rewrite" to Description for AI suggestions Define acceptance criteria: - [ ] - [ ] - [ ]`). The placeholder is the one that bites — it is a stored, non-empty field value that means the exact opposite of what its length suggests.
394
394
 
@@ -111,7 +111,7 @@ After displaying the estimate, ask the user: *"Want me to set Story Points = {n}
111
111
 
112
112
  Only update the work item if the user explicitly says yes. Do not modify anything otherwise.
113
113
 
114
- When the user agrees, in the **same** `wit_update_work_item` call:
114
+ When the user agrees, in the **same** `wit_work_item_write` (action `update`) call:
115
115
 
116
116
  1. Set `Microsoft.VSTS.Scheduling.StoryPoints` to the agreed value (the user's number wins if they adjusted it).
117
117
  2. Set `System.State` to `Dev Ready` — **but only if** the work item type is `User Story`, `Bug`, or `Hot Fix` **and** the item is not already past Dev Ready in the workflow (e.g. `Active`, `Code Review`, `Testing`, `Staging`, `Ready to Deploy`). Never move an item backward — if it's already past Dev Ready, set the points only and mention the state was left alone.
@@ -134,7 +134,7 @@ In the CSI Development process template, `Bug` and `Hot Fix` have **no design st
134
134
 
135
135
  > *"I can't size this until {what's missing}. Want me to move AB#{id} back to Design Review so it's out of the next `/quote-backlog` sweep until the creator responds?"*
136
136
 
137
- **Wait for the user.** Only update the work item if they say yes. Then set `System.State` = `Design Review` with `mcp__azure-devops__wit_update_work_item`. Rules:
137
+ **Wait for the user.** Only update the work item if they say yes. Then set `System.State` = `Design Review` with `mcp__azure-devops__wit_work_item_write` (action `update`). Rules:
138
138
 
139
139
  - **`User Story` only** — never a Bug, Hot Fix, Feature, or Task. A Bug takes 5b; the update would fail on it anyway.
140
140
  - **Never move an item backward past the design stage.** Only from `Design Approved`; if it's already `Dev Ready` or anything at `Active` or later (`Active`, `Code Review`, `Ready for Testing`, `Testing`, `Ready for Staging`, `Staging`, `Ready to Deploy`, …), leave the state alone and say so — someone is already working on it, and a state bounce there does real damage.
@@ -146,7 +146,7 @@ In the CSI Development process template, `Bug` and `Hot Fix` have **no design st
146
146
 
147
147
  > *"I can't size this until {what's missing} — and a Bug has no design state to send it back to. Want me to tag AB#{id} `needs-info` so it drops out of the next `/quote-backlog` sweep? Removing the tag is what re-queues it — a reply alone leaves it excluded, though `/quote-backlog`'s stale-tag audit will surface it."*
148
148
 
149
- **Wait for the user.** Only update the work item if they say yes. Then add the tag with `mcp__azure-devops__wit_update_work_item`. Rules:
149
+ **Wait for the user.** Only update the work item if they say yes. Then add the tag with `mcp__azure-devops__wit_work_item_write` (action `update`). Rules:
150
150
 
151
151
  - **Append to `System.Tags`, never replace it.** Take the current tag list captured in Step 1, append `needs-info`, and write the whole semicolon-separated list back. Writing the field bare wipes tags someone else set — `release-{N}`, triage labels, scope hints.
152
152
  - Already tagged `needs-info` → no-op; say it's already there.
@@ -36,13 +36,13 @@ Save the PR's `creationDate` as `LAST_PR_DATE` — everything after this timesta
36
36
 
37
37
  ### New Comments
38
38
 
39
- Read the work item comments via `wit_list_work_item_comments`. Filter to only comments created **after** `LAST_PR_DATE`. These contain the rework feedback.
39
+ Read the work item comments via `wit_work_item` (action `list_comments`). Filter to only comments created **after** `LAST_PR_DATE`. These contain the rework feedback.
40
40
 
41
41
  For each new comment, check for embedded images (`<img>` tags with `src` URLs pointing to Azure DevOps attachments). **Download and view every embedded image** using WebFetch — they often contain screenshots of bugs, visual issues, or annotated UI showing what needs to change.
42
42
 
43
43
  ### Description & Acceptance Criteria Changes
44
44
 
45
- Read the work item revisions via `wit_list_work_item_revisions`. Check if the **description** or **acceptance criteria** fields were modified **after** `LAST_PR_DATE`.
45
+ Read the work item revisions via `wit_work_item` (action `list_revisions`). Check if the **description** or **acceptance criteria** fields were modified **after** `LAST_PR_DATE`.
46
46
 
47
47
  - If changed: extract the **current** description and acceptance criteria, and note what was added or modified
48
48
  - If unchanged: still read the current description and acceptance criteria — a comment may reference something that was in the original requirements but missing from the implementation
@@ -107,6 +107,37 @@ Reply with your Ultracode choice (and any reclassifications or context). Say **r
107
107
 
108
108
  1. **Explore** the codebase to map relevant files — focus on files changed in the last PR and any new areas needed
109
109
  2. **Plan** the rework approach
110
+ 3. **Re-analyze the plan as an architect** — the pass below, before the user sees anything
111
+
112
+ ### Architect Review (runs before the plan is presented)
113
+
114
+ The draft plan is a first answer, not the answer. Re-read it cold — as an experienced architect who did not write it and who cares what this codebase looks like a year from now. This happens on **every** rework plan, before the user sees anything.
115
+
116
+ > **Ultracode:** run this as a separate `Workflow` agent so the review is actually independent. Give it the work item, the acceptance criteria, the rework feedback, and the draft plan — but **not** your reasoning for the plan — and have it read the affected files itself. A reviewer who has seen the author's justification anchors to it.
117
+
118
+ Each question below is about a cost that is cheap now and expensive once the code exists:
119
+
120
+ | # | Question | What a bad answer looks like |
121
+ |---|----------|------------------------------|
122
+ | 1 | **Does this already exist?** A service, hook, component, or extension method that already does this, or is one call away. | A new `PaymentExportService` beside the `ExportService` that already handles three other exports |
123
+ | 2 | **Is each piece in the right layer?** Domain / Application / Infrastructure / API boundaries hold — no business rules in a controller, no Mongo or EF types in Domain, no HTTP concepts below API. | An `IMongoCollection<T>` parameter on a Domain method |
124
+ | 3 | **What is the simplest plan that still meets every AC?** State it, then adopt it or say in one line why the heavier one is needed. | An interface with exactly one implementation, added "for testability" |
125
+ | 4 | **What else touches the files being modified?** Name the callers. A change to a shared contract, DTO, or response shape is a breaking change until proven otherwise. | Editing a shared DTO with no note about its other consumers |
126
+ | 5 | **What happens to data that already exists?** New required fields, schema changes, and backfills each need an answer for rows written before this change. | A non-nullable field added with no default and no backfill |
127
+ | 6 | **How does it fail?** Partial failure, concurrent callers, a retried request. Is the operation idempotent, and does it need to be? | A multi-step write with no story for a crash between steps |
128
+ | 7 | **Does it hold at real data volume?** Queries inside loops, unbounded result sets, a missing index, a list endpoint with no paging. | A `foreach` over accounts issuing one query each |
129
+ | 8 | **Is it safe?** Authorization on every new endpoint, and **no sensitive field** (TIN, SSN, EIN, TaxId, BankAccountNumber, RoutingNumber, any `Encrypted*`) read, logged, returned, or projected — see the sensitive-data rule in CLAUDE.md. | A new endpoint returning a whole entity because it was convenient |
130
+ | 9 | **Can it be tested without heavy mocking?** A test needing five mocks is telling you the seams are in the wrong place. | A test plan that starts "mock the repository, the clock, and the HTTP client" |
131
+ | 10 | **Can it be undone?** `/rollback` reverts commits; it does not un-migrate data or un-send an email. Flag anything one-way. | A destructive migration with no reverse path |
132
+ | 11 | **Cause or symptom?** Rework feedback reports an instance. Does this plan fix why it happened, or only the case that was reported? | Special-casing the one date the tester tried |
133
+ | 12 | **What did the original PR get right that this could undo?** It passed review once. Name what this change puts back at risk, and the regression test that pins it. | A rewrite of a method whose edge cases were the point of the original review |
134
+
135
+ **Two hard limits on this pass:**
136
+
137
+ - **It may not grow the scope.** It exists to simplify, correct, and de-risk — not to add caching, abstraction layers, or features nobody asked for. Anything outside the acceptance criteria goes in *Risks / Considerations*, or becomes a separate work item you mention. It is never folded into the plan silently.
138
+ - **It may not invent findings.** If the plan survives every question, say so in one line. A manufactured concern to look thorough spends the user's attention at the one gate that is supposed to protect it.
139
+
140
+ Apply what the pass finds, then report it in the plan as the **Architect Review** section below. The pass is never skipped; only its output scales — on a one-file config change most rows answer themselves and the report is two lines.
110
141
 
111
142
  Present the plan to the user:
112
143
 
@@ -151,6 +182,10 @@ If any row reads "⚠ Not yet covered," fix the plan before presenting it — do
151
182
  ### Risks / Considerations
152
183
  - {any potential issues or trade-offs}
153
184
 
185
+ ### Architect Review
186
+ {One line per change the review made: what the draft said → what it says now → why.}
187
+ {If nothing changed: "Reviewed against every question — no changes." plus the one that came closest to a finding and why it is fine.}
188
+
154
189
  Approve this plan? (yes / no / suggest changes)
155
190
  ```
156
191
 
@@ -201,7 +236,7 @@ Enter the estimated hours for this task (press enter to accept {n}):
201
236
 
202
237
  If the user provided hours (suggested or overridden):
203
238
 
204
- 1. Call `mcp__azure-devops__wit_create_work_item`:
239
+ 1. Call `mcp__azure-devops__wit_work_item_write` (action `create`):
205
240
  - **workItemType**: `Task`
206
241
  - **title**: `Rework AB#{id} — round {N}`
207
242
  - **fields**: JSON Patch document setting:
@@ -227,8 +262,9 @@ If the user provided hours (suggested or overridden):
227
262
  - `System.AreaPath` — same as the parent
228
263
  - `System.IterationPath` — same as the parent
229
264
  - `System.AssignedTo` — same as the parent (copy the parent's `System.AssignedTo` value; pass the `uniqueName` / email if the parent's value is an identity object). If the parent is unassigned, leave this field unset rather than failing.
265
+ - `System.State` — `Active`, since the rework starts right now (fall back to the template's in-progress equivalent, or leave it at the default and note it). A rework Task left at `New` while the work is underway misreports the board.
230
266
 
231
- 2. Link the new Task as a child of the parent work item via `wit_work_items_link`:
267
+ 2. Link the new Task as a child of the parent work item via `wit_work_item_link_write` (action `link`):
232
268
  - **type**: `Child` (the parent → child link from the parent's perspective; equivalent to `Parent` from the task's perspective)
233
269
  - **source**: parent work item ID
234
270
  - **target**: new task ID
@@ -247,6 +283,18 @@ The work item already has a branch from the previous PR. Switch to it:
247
283
 
248
284
  If the PR was completed/merged and the branch was deleted, create a new branch from the PR's target branch following the same naming convention as `/implement` Step 4.
249
285
 
286
+ ### Move the Work Item to Active
287
+
288
+ Once you are on the branch, move the work item (User Story, Bug, Hot Fix, or other single work item — **never** a Feature) to `Active` via `wit_work_item_write` (action `update`):
289
+ - **path**: `/fields/System.State`
290
+ - **value**: `Active`
291
+
292
+ Rework restarts implementation, so the item must leave `Code Review` / `Rework` and go back to in-progress for the duration of this round — Step 12 hands it back to `Code Review` when the fixes are pushed. Without this the item sits in a review state while it is actively being worked, and the board lies.
293
+
294
+ If the work item is already `Active`, skip the update. If the project's process template does not have an `Active` state (the update call returns an invalid-state error), fall back in this order: `In Progress` → `Doing` → leave the current state and warn the user that the state could not be advanced automatically. Do not silently swallow the error.
295
+
296
+ After the update, **read the work item back** (`wit_work_item`, action `get`) and confirm `System.State` actually changed. If it didn't, say so explicitly — do not proceed reporting the item as in progress when the board still shows it otherwise.
297
+
250
298
  ## Step 7: Implement
251
299
 
252
300
  1. **Implement** the rework using backend and/or frontend agents according to the approved plan
@@ -340,9 +388,9 @@ Wait for the user's response before proceeding. Do NOT push until confirmed.
340
388
  ## Step 12: Push and Update
341
389
 
342
390
  1. Push the changes: `git push`
343
- 2. **Do not post a rework summary comment.** Do not add a summary of what changed to the work item Discussion (`wit_add_work_item_comment`) or as a PR thread. The pushed commits and the PR diff are the record of what changed — a prose summary duplicates them and clutters the work item. If the reviewer left specific PR comment threads, reply on those threads directly (that is what `/resolve-feedback` and `/fix-review` do); otherwise post nothing.
391
+ 2. **Do not post a rework summary comment.** Do not add a summary of what changed to the work item Discussion (`wit_work_item_comment_write` (action `add`)) or as a PR thread. The pushed commits and the PR diff are the record of what changed — a prose summary duplicates them and clutters the work item. If the reviewer left specific PR comment threads, reply on those threads directly (that is what `/resolve-feedback` and `/fix-review` do); otherwise post nothing.
344
392
  3. **Close related Tasks and log hours** — see "Closing Related Tasks" below. This includes the rework Task created in Step 5 as well as any other child Tasks that became `Completed` as a result of this rework round.
345
- 4. **Move the work item back to `Code Review`** via `wit_update_work_item`:
393
+ 4. **Move the work item back to `Code Review`** via `wit_work_item_write` (action `update`):
346
394
  - **path**: `/fields/System.State`
347
395
  - **value**: `Code Review`
348
396
 
@@ -405,7 +453,7 @@ For each task being processed, prompt for completed hours:
405
453
 
406
454
  **Wait for the user's response on every task.** Accept the suggested/current value (enter), a new numeric value, or `skip` to leave that one untouched.
407
455
 
408
- Once the user has answered, update each task via `wit_update_work_item`:
456
+ Once the user has answered, update each task via `wit_work_item_write` (action `update`):
409
457
  - `Microsoft.VSTS.Scheduling.CompletedWork` → the agreed value
410
458
  - `Microsoft.VSTS.Scheduling.RemainingWork` → `0`
411
459
  - `System.State` → `Closed` (fall back to `Done` if the project's task template uses Agile; warn if neither is valid)
@@ -49,7 +49,7 @@ Deployed to:
49
49
  Catch these up? (yes/no)
50
50
  ```
51
51
 
52
- If the user says yes, set `System.State` on each lagging item to the expected state via `wit_update_work_item` — never backward, never on a Feature or Task — and report `Was → Now`.
52
+ If the user says yes, set `System.State` on each lagging item to the expected state via `wit_work_item_write` (action `update`) — never backward, never on a Feature or Task — and report `Was → Now`.
53
53
 
54
54
  ## If Pipeline (e.g., `/track pipeline` or `/track build`):
55
55