@chris1807/claude-kit 2.1.54 → 2.1.56
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 +89 -57
- package/package.json +1 -1
- package/templates/agents/project/deployer.md +13 -7
- package/templates/commands/cherry-pick.md +157 -17
- package/templates/commands/cleanup-branches.md +9 -9
- package/templates/commands/create-release.md +6 -3
- package/templates/commands/deep-review.md +1 -1
- package/templates/commands/deploy-release.md +199 -29
- package/templates/commands/deploy.md +9 -8
- package/templates/commands/edit-work-item.md +1 -1
- package/templates/commands/implement.md +3 -3
- package/templates/commands/plan-sprint.md +1 -1
- package/templates/commands/promote.md +180 -21
- package/templates/commands/quote-backlog.md +1 -1
- package/templates/commands/quote.md +3 -3
- package/templates/commands/review.md +1 -1
- package/templates/commands/rework.md +2 -2
- package/templates/commands/rollback.md +7 -3
- package/templates/commands/status.md +80 -30
- package/templates/commands/where.md +17 -11
- package/templates/infrastructure/CLAUDE-WORKFLOW.md +114 -53
- package/templates/infrastructure/azure-pipelines-template.yml +62 -7
|
@@ -12,9 +12,9 @@ git branch -r --merged
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Exclude protected branches — never delete these:
|
|
15
|
-
- `main`, `master
|
|
16
|
-
- `staging`, `Staging`
|
|
17
|
-
- `
|
|
15
|
+
- The compare branch: `main`, `master`
|
|
16
|
+
- The environment branches: `dev`, `test`, `staging`, `prod` (any casing — `Dev`, `Test`, `Staging`, `Prod`)
|
|
17
|
+
- Legacy names still in use on unmigrated projects: `develop`, `development`, `QA`
|
|
18
18
|
- Any branch listed in the project's CLAUDE.md Pipeline Configuration table
|
|
19
19
|
|
|
20
20
|
## Step 2: Identify Candidates
|
|
@@ -33,13 +33,13 @@ Present the list:
|
|
|
33
33
|
### Branches to delete ({count}):
|
|
34
34
|
| Branch | Last Commit | Merged Into |
|
|
35
35
|
|--------|-------------|-------------|
|
|
36
|
-
| story/AB#4521-admin-export | 2026-
|
|
37
|
-
| bugfix/AB#4589-login-plus-sign | 2026-
|
|
38
|
-
| release/24-to-staging | 2026-
|
|
39
|
-
| cherry-pick/2026-
|
|
36
|
+
| story/AB#4521-admin-export | 2026-09-01 | main |
|
|
37
|
+
| bugfix/AB#4589-login-plus-sign | 2026-09-02 | main |
|
|
38
|
+
| release/24-to-staging | 2026-09-05 | staging |
|
|
39
|
+
| cherry-pick/2026-09-06-to-prod | 2026-09-06 | prod |
|
|
40
40
|
|
|
41
41
|
### Protected (will NOT be deleted):
|
|
42
|
-
- main,
|
|
42
|
+
- main, dev, test, staging, prod
|
|
43
43
|
|
|
44
44
|
Delete {count} merged branches? (yes/no)
|
|
45
45
|
```
|
|
@@ -69,5 +69,5 @@ Deleted:
|
|
|
69
69
|
- story/AB#4521-admin-export (local + remote)
|
|
70
70
|
- bugfix/AB#4589-login-plus-sign (local + remote)
|
|
71
71
|
- release/24-to-staging (remote only)
|
|
72
|
-
- cherry-pick/2026-
|
|
72
|
+
- cherry-pick/2026-09-06-to-prod (remote only)
|
|
73
73
|
```
|
|
@@ -11,7 +11,7 @@ If `$ARGUMENTS` is provided, use it as the release name (e.g., `$ARGUMENTS` = "2
|
|
|
11
11
|
Ask the user which work items to include. They may provide:
|
|
12
12
|
- A list of work item IDs (e.g., "AB#1234, AB#1235, AB#1236")
|
|
13
13
|
- A query (e.g., "all completed user stories in the current sprint")
|
|
14
|
-
- A state filter (e.g., "all items in Ready for Testing")
|
|
14
|
+
- A state filter (e.g., "all items in Ready for Testing" for a release heading to Test, "all items in Ready for Staging" for one heading to Staging)
|
|
15
15
|
|
|
16
16
|
Use the Azure DevOps MCP to search/query for the specified work items. Present the list for confirmation:
|
|
17
17
|
|
|
@@ -60,6 +60,9 @@ Work items assigned:
|
|
|
60
60
|
- AB#1235: Fix login redirect
|
|
61
61
|
- AB#1236: View history
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
Deploy it one environment at a time — each merge deploys, and once the pipeline is green the command advances the work items' states and assigns them to the verifiers you pick:
|
|
64
|
+
/deploy-release {N} test → items go to Testing
|
|
65
|
+
/deploy-release {N} staging → items go to Staging (after QA sets Ready for Staging)
|
|
66
|
+
/deploy-release {N} prod → items go to Deployed (after stakeholders set Ready to Deploy)
|
|
67
|
+
`/deploy-release {N}` with no environment picks the next one automatically.
|
|
65
68
|
```
|
|
@@ -111,7 +111,7 @@ Verify the change is safe beyond the lines it touched.
|
|
|
111
111
|
Specifically check:
|
|
112
112
|
- **Changed shared code** — for every public method/class/interface/DTO the diff modifies, find its other callers and confirm the change is backward-compatible or all callers were updated.
|
|
113
113
|
- **Test fallout** — any failing test from Step 4 in an area this PR didn't intend to change is a regression; surface it as **critical**.
|
|
114
|
-
- **Environment configuration parity** — if the diff adds or changes any key in `appsettings.*.json` or `.env*`, every parallel environment file (Development/
|
|
114
|
+
- **Environment configuration parity** — if the diff adds or changes any key in `appsettings.*.json` or `.env*`, every parallel environment file (Development/Test/QA/Staging/Production for backend; `.env.development`/`.env.test`/`.env.staging`/`.env.production`/`.env.example` for React) must have a corresponding entry, or the omission must be called out. Build a (key × environment) table and flag any missing cell as **critical**. A pipeline variable group, Key Vault, or App Configuration counts as a valid source for an environment — verify it exists rather than assume it.
|
|
115
115
|
|
|
116
116
|
## Step 7: Detect Unwanted / Out-of-Scope Changes — and Confirm With the User
|
|
117
117
|
|
|
@@ -2,7 +2,21 @@ Deploy release to the next environment. Usage: `/deploy-release <release-number>
|
|
|
2
2
|
|
|
3
3
|
Parse `$ARGUMENTS` to extract:
|
|
4
4
|
- **Release number**: required (e.g., "23" or "#23")
|
|
5
|
-
- **Target environment**: optional —
|
|
5
|
+
- **Target environment**: optional — an environment name (`dev`, `test`, `staging`, `prod`/`production`) or its branch. If not provided, auto-detect the next environment in the promotion flow.
|
|
6
|
+
|
|
7
|
+
## Environment ↔ State Reference
|
|
8
|
+
|
|
9
|
+
Resolve branch names from the project's `CLAUDE.md` **Pipeline Configuration** table — never hardcode them. The first row is the compare branch (`main`; feature PRs target it, **merging into it deploys nothing**); the rows below are the environment branches in promotion order, and a PR merging into one of them is what triggers its pipeline. The standard layout, with the work item state that goes with each environment:
|
|
10
|
+
|
|
11
|
+
| Branch | Environment | Gate — items should already be in… | State set after the PR merges |
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
| `main` | — (compare branch) | — | — |
|
|
14
|
+
| `dev` | Dev | `Code Review` (merged to `main`) | `Ready for Testing` |
|
|
15
|
+
| `test` | Test | `Ready for Testing` | `Testing` |
|
|
16
|
+
| `staging` | Staging | `Ready for Staging` | `Staging` |
|
|
17
|
+
| `prod` | Production | `Ready to Deploy` | `Deployed` |
|
|
18
|
+
|
|
19
|
+
`Ready for Staging` and `Ready to Deploy` are set by QA and stakeholders — **never by this command**. If the project's table has different environments, confirm the type's states with `mcp__azure-devops__wit_work_item` (`action: get_type`) and map them the same way: a "Ready for X" gate → an "in X" state.
|
|
6
20
|
|
|
7
21
|
## Step 1: Read the Release
|
|
8
22
|
|
|
@@ -15,8 +29,8 @@ Present the release contents:
|
|
|
15
29
|
|
|
16
30
|
| ID | Type | Title | State | Branch |
|
|
17
31
|
|----|------|-------|-------|--------|
|
|
18
|
-
| AB#1234 | User Story | Add payment export | Ready for
|
|
19
|
-
| AB#1235 | Bug | Fix login redirect | Ready for
|
|
32
|
+
| AB#1234 | User Story | Add payment export | Ready for Staging | story/AB#1234-add-payment-export |
|
|
33
|
+
| AB#1235 | Bug | Fix login redirect | Ready for Staging | bugfix/AB#1235-fix-login-redirect |
|
|
20
34
|
|
|
21
35
|
{count} work items in this release.
|
|
22
36
|
```
|
|
@@ -25,18 +39,42 @@ If no work items are found, STOP and report the error.
|
|
|
25
39
|
|
|
26
40
|
## Step 2: Determine Target Environment
|
|
27
41
|
|
|
28
|
-
If the user specified an environment, use it. Otherwise
|
|
42
|
+
If the user specified an environment, use it. Otherwise auto-detect: find the **furthest** branch in the Pipeline Configuration table that already contains the work items' commits (`repo_search_commits` with `includeWorkItems: true`, or `git merge-base --is-ancestor <commit> origin/<branch>`), and target the **next row down**:
|
|
29
43
|
|
|
30
|
-
|
|
|
44
|
+
| Work items' commits are on… | Next target |
|
|
31
45
|
|---|---|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
46
|
+
| `main` only | `dev` |
|
|
47
|
+
| `dev` | `test` |
|
|
48
|
+
| `test` | `staging` |
|
|
49
|
+
| `staging` | `prod` |
|
|
50
|
+
| `prod` | Nothing — report that the release is fully deployed and stop |
|
|
51
|
+
|
|
52
|
+
**Validation:** Verify all work items in the release have commits on the same source branch. If they are inconsistent (e.g., AB#1234 is on `test` but AB#1235 has nothing past `main`), present a warning listing which work items are on which branches and ask the user to confirm the target environment explicitly.
|
|
53
|
+
|
|
54
|
+
## Step 3: Gate Check
|
|
55
|
+
|
|
56
|
+
Compare each work item's `System.State` with the gate for the target environment. Sort into three buckets:
|
|
57
|
+
|
|
58
|
+
- **At the gate** — proceed silently.
|
|
59
|
+
- **Behind the gate** (e.g. still `Testing` when the target is `staging`, or `Active` when the target is `test`) — QA or a stakeholder hasn't signed off yet.
|
|
60
|
+
- **Ahead of the gate** (e.g. already `Deployed`, or `Staging` when the target is `test`) — it has already been through this environment; a redeploy is usually harmless but worth knowing.
|
|
34
61
|
|
|
35
|
-
|
|
62
|
+
Features and Tasks aren't carried by state — list them and skip the check. If anything is behind or ahead, show it before asking to proceed:
|
|
36
63
|
|
|
37
|
-
|
|
64
|
+
```
|
|
65
|
+
⚠ Gate check for {environment} (expects `{gate state}`):
|
|
66
|
+
|
|
67
|
+
| ID | State | Note |
|
|
68
|
+
|----|-------|------|
|
|
69
|
+
| AB#1236 | Testing | behind — QA hasn't marked it Ready for Staging |
|
|
70
|
+
| AB#1240 | Deployed | ahead — already in production |
|
|
71
|
+
|
|
72
|
+
Include them anyway, or drop them from this deploy? (include / drop / cancel)
|
|
73
|
+
```
|
|
38
74
|
|
|
39
|
-
|
|
75
|
+
Wait for the answer. `drop` removes them from **this deploy only** — they stay in the release.
|
|
76
|
+
|
|
77
|
+
## Step 4: Confirm
|
|
40
78
|
|
|
41
79
|
```
|
|
42
80
|
Deploy Release #{N} ({count} work items) to {environment}?
|
|
@@ -44,16 +82,16 @@ Deploy Release #{N} ({count} work items) to {environment}?
|
|
|
44
82
|
This will:
|
|
45
83
|
1. Create a release branch: release/{N}-to-{environment}
|
|
46
84
|
2. Cherry-pick all commits for the {count} work items
|
|
47
|
-
3. Create a PR targeting the {environment}
|
|
85
|
+
3. Create a PR targeting `{target-branch}` — merging it triggers the {environment} pipeline
|
|
86
|
+
4. Ask who verifies each product group on {environment} (before the merge)
|
|
87
|
+
5. Watch the pipeline — once it's green, set the work items to `{state after merge}` and assign them to the approved verifiers
|
|
48
88
|
|
|
49
89
|
Proceed? (yes/no)
|
|
50
90
|
```
|
|
51
91
|
|
|
52
92
|
Wait for confirmation.
|
|
53
93
|
|
|
54
|
-
## Step
|
|
55
|
-
|
|
56
|
-
Determine the target environment branch. Do NOT hardcode branch names — check the project's CLAUDE.md or use the branch-to-environment mapping:
|
|
94
|
+
## Step 5: Create Release Branch
|
|
57
95
|
|
|
58
96
|
```bash
|
|
59
97
|
# Switch to the target environment branch and pull latest
|
|
@@ -64,7 +102,7 @@ git pull origin <target-environment-branch>
|
|
|
64
102
|
git checkout -b release/{N}-to-<environment>
|
|
65
103
|
```
|
|
66
104
|
|
|
67
|
-
## Step
|
|
105
|
+
## Step 6: Cherry-Pick Work Item Commits
|
|
68
106
|
|
|
69
107
|
For each work item in the release:
|
|
70
108
|
|
|
@@ -89,7 +127,7 @@ Options:
|
|
|
89
127
|
Which option? (1 / 2 / 3)
|
|
90
128
|
```
|
|
91
129
|
|
|
92
|
-
- **Option 1:** Run `git cherry-pick --skip` and continue. Note the skipped item in the summary.
|
|
130
|
+
- **Option 1:** Run `git cherry-pick --skip` and continue. Note the skipped item in the summary — it does **not** get its state advanced or its assignee changed in Step 10.
|
|
93
131
|
- **Option 2:** Run `git cherry-pick --abort`, delete the release branch, switch back. Report which items were NOT deployed.
|
|
94
132
|
- **Option 3:** Wait for the user to resolve and run `git cherry-pick --continue`, then proceed.
|
|
95
133
|
|
|
@@ -102,7 +140,7 @@ Cherry-picking commits for Release #{N}:
|
|
|
102
140
|
[ ] AB#1236: View history (2 commits) — CONFLICT
|
|
103
141
|
```
|
|
104
142
|
|
|
105
|
-
## Step
|
|
143
|
+
## Step 7: Push and Create PR
|
|
106
144
|
|
|
107
145
|
1. Push the release branch: `git push -u origin HEAD`
|
|
108
146
|
2. Create a PR via Azure DevOps MCP:
|
|
@@ -112,7 +150,76 @@ Cherry-picking commits for Release #{N}:
|
|
|
112
150
|
- **description**: List all work items included with their IDs and titles
|
|
113
151
|
3. Link all work items to the PR via `wit_link_work_item_to_pull_request`
|
|
114
152
|
|
|
115
|
-
## Step
|
|
153
|
+
## Step 8: Pick Who Verifies Each Group (before the merge)
|
|
154
|
+
|
|
155
|
+
The release is about to land in {environment} for **someone** to verify. Decide who now, while the PR is still in review — nothing is written yet; the assignment is applied in Step 10 together with the state change, once the pipeline is green.
|
|
156
|
+
|
|
157
|
+
### 8a. Group by title prefix
|
|
158
|
+
|
|
159
|
+
Work item titles in the CSI Development project are `PREFIX - Title` (`COM`, `PAY`, `CDA`, `AUD`, `SER`, `PSSF`, `TPS`, `ILP`, `RBWO`, `MTG`, `CSI`). Group the deployed **User Stories, Bugs, and Hot Fixes** by that prefix. Titles with a missing or unrecognized prefix go in a `(no prefix)` group. Items skipped on a conflict (Step 6) or dropped at the gate (Step 3) are not on the branch — leave them out. Features and Tasks are never assigned by this command.
|
|
160
|
+
|
|
161
|
+
A release that spans products lands in several groups — one question each. Different products usually have different verifiers, but the same person may take several groups; that is the normal case, not an error.
|
|
162
|
+
|
|
163
|
+
### 8b. Build each group's candidate list from the items themselves
|
|
164
|
+
|
|
165
|
+
For every item in the group, collect the distinct identities already on it:
|
|
166
|
+
|
|
167
|
+
- **whoever set the gate state** — `wit_work_item` `action: list_revisions`, then the `System.ChangedBy` on the revision where `System.State` became the target's gate state (`Ready for Staging`, `Ready to Deploy`, …). That is the QA person or stakeholder who signed the item off, and it is usually the right verifier.
|
|
168
|
+
- `System.CreatedBy` — who asked for the work
|
|
169
|
+
- comment authors — `wit_work_item` `action: list_comments`
|
|
170
|
+
- `System.ChangedBy` — the most recent editor
|
|
171
|
+
|
|
172
|
+
Then **drop the developers**, so what remains is the non-developer names on the item:
|
|
173
|
+
|
|
174
|
+
- each item's current `System.AssignedTo` (the dev who implemented it)
|
|
175
|
+
- the PR author
|
|
176
|
+
- the authors of the release commits — `git log --format='%an <%ae>' <target-branch>..HEAD | sort -u`
|
|
177
|
+
|
|
178
|
+
Rank the survivors by how many items in the group they appear on — the gate-state signer first, then creators. **Do not invent names**, do not pull from the org directory or a team list, and do not carry a name over from another group's items — every candidate must come from the items in that group.
|
|
179
|
+
|
|
180
|
+
If the developer filter empties a group's list, say so and show the unfiltered names marked `(also a developer here)`, plus the option to type a name.
|
|
181
|
+
|
|
182
|
+
### 8c. Ask
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
## Who verifies Release #{N} on {environment}?
|
|
186
|
+
|
|
187
|
+
**COM** — 2 items (AB#1234, AB#1236)
|
|
188
|
+
1. Jane Doe (jane@caresolutions.com) — set Ready to Deploy on both
|
|
189
|
+
2. Sam Lee (sam@caresolutions.com) — commented on AB#1234
|
|
190
|
+
3. Someone else — give me a name or email
|
|
191
|
+
4. Leave the current assignee alone
|
|
192
|
+
|
|
193
|
+
**PAY** — 2 items (AB#1240, AB#1241)
|
|
194
|
+
1. Pat Ruiz (pat@caresolutions.com) — created both
|
|
195
|
+
2. Jane Doe (jane@caresolutions.com) — commented on AB#1240
|
|
196
|
+
3. Someone else
|
|
197
|
+
4. Leave the current assignee alone
|
|
198
|
+
|
|
199
|
+
Reply per group — `COM 1, PAY 1` — or `all 1` to give the whole release to one person.
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 8d. Confirm the mapping
|
|
203
|
+
|
|
204
|
+
Echo the resolved plan and wait for an explicit `yes`:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
When the {environment} pipeline goes green I will apply:
|
|
208
|
+
|
|
209
|
+
| ID | Title | Prefix | Assign to | State |
|
|
210
|
+
|----|-------|--------|-----------|-------|
|
|
211
|
+
| AB#1234 | COM - Add payment export | COM | Jane Doe | Staging |
|
|
212
|
+
| AB#1236 | COM - View history | COM | Jane Doe | Staging |
|
|
213
|
+
| AB#1240 | PAY - Fix login redirect | PAY | Pat Ruiz | Staging |
|
|
214
|
+
|
|
215
|
+
Approve? (yes / change)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`change` re-asks 8c. Only after `yes` do you move on — if the PR merges before the user answers, keep waiting for the answer, then run Step 10.
|
|
219
|
+
|
|
220
|
+
## Step 9: Watch the Merge, Then the Pipeline
|
|
221
|
+
|
|
222
|
+
Do NOT merge the PR yourself, and do NOT trigger the CD pipeline — it triggers on the merge. Report the PR, then watch for the deployment:
|
|
116
223
|
|
|
117
224
|
```
|
|
118
225
|
Release #{N} PR created for {environment}.
|
|
@@ -121,27 +228,90 @@ PR: {pr-url}
|
|
|
121
228
|
Branch: release/{N}-to-{environment} → {target-branch}
|
|
122
229
|
|
|
123
230
|
Work items included:
|
|
124
|
-
- AB#1234: Add payment export
|
|
125
|
-
- AB#
|
|
126
|
-
- AB#
|
|
231
|
+
- AB#1234: COM - Add payment export
|
|
232
|
+
- AB#1236: COM - View history
|
|
233
|
+
- AB#1240: PAY - Fix login redirect
|
|
234
|
+
|
|
235
|
+
Review and approve the PR — merging it triggers the CD pipeline for {environment}.
|
|
236
|
+
I'm watching the PR and that pipeline; when it comes back green I'll set these
|
|
237
|
+
{count} items to `{state after merge}` and assign them as approved above.
|
|
238
|
+
Nothing is written until then. Say `stop watching` to leave the states alone.
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
1. **Wait for the PR to complete.** Poll `repo_pull_request` until `status` is `completed`; note the merge commit and completion time. `abandoned` → stop, change nothing, report it.
|
|
242
|
+
2. **Find the CD run.** Look up the target branch's pipeline ID(s) in the Pipeline Configuration table, then poll `pipelines_build` for runs on `refs/heads/<target-branch>` queued at or after the merge time — match the merge commit when the run exposes it — and **capture each run's id**. A run that was already completed before the merge is not this deployment; ignore it. A branch with more than one pipeline (API + Client) must have **all** of them green.
|
|
243
|
+
3. **Wait for a terminal result** on each run: `succeeded`, `partiallySucceeded`, `failed`, or `canceled`.
|
|
244
|
+
|
|
245
|
+
**How to wait.** Never block on a foreground `sleep`. If the Azure CLI with the `azure-devops` extension is available, arm a background watch that notifies you on a terminal state:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# <run-id> is the run identified in step 2 — never "the latest run on the branch",
|
|
249
|
+
# which can be a run queued before the merge and already completed.
|
|
250
|
+
until az pipelines runs show --org <org-url> --project <project> \
|
|
251
|
+
--id <run-id> --query status -o tsv | grep -qx completed; do
|
|
252
|
+
sleep 60
|
|
253
|
+
done
|
|
254
|
+
az pipelines runs show --org <org-url> --project <project> \
|
|
255
|
+
--id <run-id> --query "[buildNumber,status,result]" -o tsv
|
|
256
|
+
```
|
|
127
257
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
258
|
+
Run it with `Monitor` (or Bash `run_in_background`) so the session stays usable. Watch the **run id**, and print `result` when it exits — a guard that only greps for success is silent through a failed or canceled deploy, which looks identical to one still running. One watch per pipeline when the branch has more than one.
|
|
259
|
+
|
|
260
|
+
Without the CLI, re-poll through the Azure DevOps MCP on roughly a 60-second cadence and report progress as you go. If the deploy outlasts the session's attention, say where it stands and that `check` will re-poll immediately — never claim a pipeline succeeded that you have not seen succeed.
|
|
261
|
+
|
|
262
|
+
## Step 10: Assign and Advance States (automatic, on a green pipeline)
|
|
263
|
+
|
|
264
|
+
This step runs **by itself** the moment the pipeline reports success — do not ask again; the approval in Step 8d covers it. All three preconditions must hold: the PR is `completed`, **every** CD run for {environment} is `succeeded`, and a Step 8d mapping was approved.
|
|
265
|
+
|
|
266
|
+
- `partiallySucceeded` → not green. Report which stage failed and ask `proceed` / `hold`.
|
|
267
|
+
- `failed` / `canceled` → change nothing. Report the run, the failing stage, and the log link (`pipelines_build_log`), and offer `/rollback` if the environment is broken.
|
|
268
|
+
- No Step 8d approval yet (user hasn't answered) → do the state changes only when they answer; don't guess an assignee.
|
|
269
|
+
|
|
270
|
+
For every carried work item of type **User Story**, **Bug**, or **Hot Fix**, one `wit_work_item_write` update per item (or the batch variant) setting both fields:
|
|
271
|
+
|
|
272
|
+
1. `System.State` → the target environment's state (`Ready for Testing` / `Testing` / `Staging` / `Deployed`).
|
|
273
|
+
- **Never move backward.** An item already past the target state (e.g. `Deployed` when deploying to `staging`) keeps its state; note it.
|
|
274
|
+
- Items skipped in Step 6 (conflict) or dropped in Step 3 are not on the branch — leave them alone.
|
|
275
|
+
- An invalid-state error means this project's template differs — confirm with `get_type`, report the item, continue with the rest. Don't silently swallow it.
|
|
276
|
+
2. `System.AssignedTo` → the person approved for that item's prefix group. Pass the identity's `uniqueName` / email, not the display name; if the update rejects it, resolve with `core_get_identity_ids` and retry once. A `Leave the current assignee alone` group keeps its assignee — never clear a field the user didn't ask you to clear.
|
|
277
|
+
|
|
278
|
+
**Never touch a Feature or Task** — neither state nor assignee. Features advance as their stories do; Tasks were closed at PR creation.
|
|
279
|
+
|
|
280
|
+
Report both fields, so a wrong assignment is easy to put back:
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
Release #{N} is on {environment} (pipeline {build-number}, succeeded).
|
|
284
|
+
|
|
285
|
+
| ID | State: was → now | Assignee: was → now |
|
|
286
|
+
|----|------------------|---------------------|
|
|
287
|
+
| AB#1234 | Ready for Staging → Staging | Chris Waters → Jane Doe |
|
|
288
|
+
| AB#1236 | Ready for Staging → Staging | Chris Waters → Jane Doe |
|
|
289
|
+
| AB#1240 | Ready for Staging → Staging | Chris Waters → Pat Ruiz |
|
|
290
|
+
| AB#1250 | Deployed (unchanged — already ahead) | unchanged |
|
|
291
|
+
|
|
292
|
+
Next: {the human step — "QA tests on Test and sets Ready for Staging" / "stakeholders verify on Staging and set Ready to Deploy" / "verify in production, then Close"}.
|
|
132
293
|
```
|
|
133
294
|
|
|
134
|
-
|
|
295
|
+
If the user said `stop watching`, or an update fails, leave the rest alone, say exactly which items were and were not updated, and note that `/status release {N}` will flag the lag later.
|
|
135
296
|
|
|
136
|
-
## Step
|
|
297
|
+
## Step 11: Notify Team (if Teams MCP is configured)
|
|
137
298
|
|
|
138
|
-
Send a notification to the project's Teams channel via the Microsoft Teams MCP server:
|
|
299
|
+
Send a notification to the project's Teams channel via the Microsoft Teams MCP server — once when the PR is created:
|
|
139
300
|
|
|
140
301
|
```
|
|
141
302
|
🚀 Release #{N} PR created for {environment}
|
|
142
303
|
PR: {pr-url}
|
|
143
|
-
Work items: AB#1234, AB#
|
|
304
|
+
Work items: AB#1234, AB#1236, AB#1240
|
|
144
305
|
Awaiting review and merge.
|
|
145
306
|
```
|
|
146
307
|
|
|
308
|
+
…and once when Step 10 completes, so the verifiers know it's their turn:
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
✅ Release #{N} deployed to {environment}
|
|
312
|
+
COM (AB#1234, AB#1236) → Jane Doe
|
|
313
|
+
PAY (AB#1240) → Pat Ruiz
|
|
314
|
+
Items are now `{state}` — please verify.
|
|
315
|
+
```
|
|
316
|
+
|
|
147
317
|
If the Teams MCP server is not configured, skip this step silently.
|
|
@@ -11,16 +11,16 @@ Commit, push, and deploy the current changes. Usage: `/deploy [message]`
|
|
|
11
11
|
|
|
12
12
|
| File family | Parallel files to check |
|
|
13
13
|
|-------------|------------------------|
|
|
14
|
-
| `appsettings.json` | `appsettings.Development.json`, `appsettings.
|
|
15
|
-
| `.env` | `.env.development`, `.env.
|
|
14
|
+
| `appsettings.json` | `appsettings.Development.json`, `appsettings.Test.json`, `appsettings.QA.json`, `appsettings.Staging.json`, `appsettings.Production.json` |
|
|
15
|
+
| `.env` | `.env.development`, `.env.test`, `.env.qa`, `.env.staging`, `.env.production`, `.env.local`, `.env.example` |
|
|
16
16
|
|
|
17
17
|
Present a table of new/changed keys and which environment files contain them. If any are missing, STOP and prompt:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
⚠ The following keys are missing from one or more environment files:
|
|
21
21
|
|
|
22
|
-
| Key | Dev |
|
|
23
|
-
|
|
22
|
+
| Key | Dev | Test | Staging | Prod |
|
|
23
|
+
|-----|-----|------|---------|------|
|
|
24
24
|
| Foo:Bar | ✅ | ❌ | ❌ | ❌ |
|
|
25
25
|
|
|
26
26
|
Add values (real, placeholder, or empty) for the missing environments before pushing?
|
|
@@ -70,10 +70,11 @@ Push only the current branch. Do NOT cross-push to other branches.
|
|
|
70
70
|
|
|
71
71
|
## Step 5: Pipeline (Conditional)
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
Look the current branch up in the project's `CLAUDE.md` **Pipeline Configuration** table:
|
|
74
74
|
|
|
75
|
-
- **On an environment branch
|
|
76
|
-
- **On
|
|
75
|
+
- **On an environment branch** (`dev`, `test`, `staging`, `prod` — a row with pipeline IDs): Trigger the listed CD pipeline(s) via Azure DevOps MCP. Monitor the build and report status.
|
|
76
|
+
- **On `main`** (the compare branch — its pipeline cell is `—`): Do NOT trigger anything. **Merging or pushing to `main` never deploys.** Report that the change is on `main` and will deploy when `main` is promoted to `dev` (`/promote main dev`).
|
|
77
|
+
- **On a feature/work branch**: Do NOT trigger. Report that the pipeline will trigger when the work is promoted after the PR merges.
|
|
77
78
|
|
|
78
79
|
## Step 6: Report
|
|
79
80
|
|
|
@@ -82,5 +83,5 @@ Deployed successfully.
|
|
|
82
83
|
|
|
83
84
|
Branch: {branch}
|
|
84
85
|
Commit: {hash} - {message}
|
|
85
|
-
Pipeline: {triggered | will trigger
|
|
86
|
+
Pipeline: {triggered | none — main deploys nothing; promote to dev | will trigger when promoted after PR merge}
|
|
86
87
|
```
|
|
@@ -168,7 +168,7 @@ Show the field-level diff for every story marked **Update**, and the full draft
|
|
|
168
168
|
|
|
169
169
|
## Step 5: Safety Gate — In-Flight Work
|
|
170
170
|
|
|
171
|
-
Before asking for approval, check the state of everything you propose to write and flag anything that is **past `Dev Ready`** in the workflow (`Active`, `Code Review`, `Ready for Testing`, `Testing`, `Ready to Deploy`, `Deployed`, `Closed`) or has a **linked pull request**.
|
|
171
|
+
Before asking for approval, check the state of everything you propose to write and flag anything that is **past `Dev Ready`** in the workflow (`Active`, `Code Review`, `Ready for Testing`, `Testing`, `Ready for Staging`, `Staging`, `Ready to Deploy`, `Deployed`, `Closed`) or has a **linked pull request**.
|
|
172
172
|
|
|
173
173
|
Editing the acceptance criteria of a story that is already implemented silently invalidates a PR that was reviewed against the old criteria. So for each such item, call it out explicitly:
|
|
174
174
|
|
|
@@ -269,8 +269,8 @@ Run a build check **before** any other quality checks. Use the `build-validator`
|
|
|
269
269
|
|
|
270
270
|
| File family | Parallel files to check |
|
|
271
271
|
|-------------|------------------------|
|
|
272
|
-
| `appsettings.json` | `appsettings.Development.json`, `appsettings.
|
|
273
|
-
| `.env` | `.env.development`, `.env.
|
|
272
|
+
| `appsettings.json` | `appsettings.Development.json`, `appsettings.Test.json`, `appsettings.QA.json`, `appsettings.Staging.json`, `appsettings.Production.json` |
|
|
273
|
+
| `.env` | `.env.development`, `.env.test`, `.env.qa`, `.env.staging`, `.env.production`, `.env.local`, `.env.example` |
|
|
274
274
|
|
|
275
275
|
Present a (key × environment) table. For every missing cell, prompt the user for a value (real, placeholder, or empty) **before creating the PR**. The PR should not be opened until every environment file is accounted for, or the user explicitly confirms the omission is intentional (e.g., the key is supplied via a pipeline variable group, Key Vault, or App Configuration for that environment).
|
|
276
276
|
|
|
@@ -362,7 +362,7 @@ Wait for the user's response before proceeding. Do NOT create a PR until confirm
|
|
|
362
362
|
|
|
363
363
|
If the project's process template does not have a `Code Review` state (the update call returns an invalid-state error), fall back in this order: `Resolved` → `In Review` → leave the current state and warn the user that the state could not be advanced automatically. Do not silently swallow the error.
|
|
364
364
|
|
|
365
|
-
> **Only the Task ever gets closed — never the parent.** The child Task is closed here, at PR creation (step 4 above). When the PR is later completed/merged, do **not** enable Azure DevOps's "Complete associated work items" option: it transitions *every* linked work item, including the parent this PR is linked to. The parent User Story or Bug stays in `Code Review` until
|
|
365
|
+
> **Only the Task ever gets closed — never the parent.** The child Task is closed here, at PR creation (step 4 above). When the PR is later completed/merged, do **not** enable Azure DevOps's "Complete associated work items" option: it transitions *every* linked work item, including the parent this PR is linked to. The parent User Story or Bug stays in `Code Review` until it is promoted: merging this PR into `main` deploys nothing, and the item advances to `Ready for Testing` → `Testing` → `Staging` → `Deployed` as `/promote` and `/deploy-release` carry it through `dev → test → staging → prod` (see **Work Item States ↔ Environments** in CLAUDE.md).
|
|
366
366
|
|
|
367
367
|
### Closing Related Tasks
|
|
368
368
|
|
|
@@ -54,7 +54,7 @@ FROM WorkItems
|
|
|
54
54
|
WHERE [System.TeamProject] = '{project}'
|
|
55
55
|
AND [System.WorkItemType] IN ('User Story', 'Bug')
|
|
56
56
|
AND [System.IterationPath] UNDER '{current sprint iteration path}'
|
|
57
|
-
AND [System.State] NOT IN ('Closed', 'Removed', 'Done', 'Resolved', 'Code Review', 'Ready to Deploy', 'Deployed')
|
|
57
|
+
AND [System.State] NOT IN ('Closed', 'Removed', 'Done', 'Resolved', 'Code Review', 'Ready for Testing', 'Testing', 'Ready for Staging', 'Staging', 'Ready to Deploy', 'Deployed')
|
|
58
58
|
ORDER BY [Microsoft.VSTS.Common.StackRank] ASC
|
|
59
59
|
```
|
|
60
60
|
|