@chris1807/claude-kit 2.1.54 → 2.1.55
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 +87 -57
- package/package.json +1 -1
- package/templates/agents/project/deployer.md +13 -7
- package/templates/commands/cherry-pick.md +44 -15
- 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 +85 -22
- 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 +70 -20
- 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 +100 -50
- package/templates/infrastructure/azure-pipelines-template.yml +62 -7
|
@@ -1,63 +1,96 @@
|
|
|
1
|
-
Check the status of a release, pipeline, or work item. Usage: `/status <target>`
|
|
1
|
+
Check the status of a release, pipeline, environment, or work item. Usage: `/status <target>`
|
|
2
2
|
|
|
3
3
|
Parse `$ARGUMENTS` to determine what to check:
|
|
4
4
|
- **Release**: "release 24" or "r24" → show release status
|
|
5
5
|
- **Pipeline**: "pipeline" or "build" → show recent pipeline runs
|
|
6
6
|
- **Work item**: "AB#1234" or "1234" → show work item status
|
|
7
|
-
- **Environment**: "staging" or "
|
|
7
|
+
- **Environment**: "dev", "test", "staging", or "prod" → show what's deployed
|
|
8
8
|
- **No argument**: show an overview of everything
|
|
9
9
|
|
|
10
|
+
Read the project's `CLAUDE.md` **Pipeline Configuration** table for the branch chain. The first row is the compare branch (`main` — feature PRs merge there; **nothing deploys from it**); the rows below are environment branches in promotion order (`dev → test → staging → prod`). Do not hardcode branch names.
|
|
11
|
+
|
|
12
|
+
## Environment ↔ State Reference
|
|
13
|
+
|
|
14
|
+
Work item states track environments. Use this to spot **state lag** — an item whose commits are on a branch but whose state hasn't caught up:
|
|
15
|
+
|
|
16
|
+
| Commits are on… | State should be at least… |
|
|
17
|
+
|---|---|
|
|
18
|
+
| `main` | `Code Review` |
|
|
19
|
+
| `dev` | `Ready for Testing` |
|
|
20
|
+
| `test` | `Testing` |
|
|
21
|
+
| `staging` | `Staging` |
|
|
22
|
+
| `prod` | `Deployed` |
|
|
23
|
+
|
|
24
|
+
`Ready for Staging` and `Ready to Deploy` are human sign-offs and are never "lag". Only User Stories, Bugs, and Hot Fixes are checked — Features and Tasks have no environment state.
|
|
25
|
+
|
|
10
26
|
## If Release (e.g., `/status release 24`):
|
|
11
27
|
|
|
12
|
-
Query all work items tagged `release-{N}` or in the `Release #{N}` iteration.
|
|
28
|
+
Query all work items tagged `release-{N}` or in the `Release #{N}` iteration. For each, find which environment branches contain its commits (`repo_search_commits` with `includeWorkItems: true`, or `git merge-base --is-ancestor`).
|
|
13
29
|
|
|
14
30
|
```
|
|
15
31
|
## Release #24 Status
|
|
16
32
|
|
|
17
|
-
| ID | Type | Title | State | Environment |
|
|
18
|
-
|
|
19
|
-
| AB#4521 | User Story | Add payment export |
|
|
20
|
-
| AB#4522 | User Story | Bulk approval workflow |
|
|
21
|
-
| AB#4530 | User Story | Dashboard trends |
|
|
33
|
+
| ID | Type | Title | State | Furthest Environment |
|
|
34
|
+
|----|------|-------|-------|----------------------|
|
|
35
|
+
| AB#4521 | User Story | Add payment export | Deployed | Production |
|
|
36
|
+
| AB#4522 | User Story | Bulk approval workflow | Staging | Staging |
|
|
37
|
+
| AB#4530 | User Story | Dashboard trends | Testing | Staging ⚠ |
|
|
22
38
|
| AB#4589 | Bug | Login plus sign fix | Closed | Production |
|
|
23
39
|
|
|
24
40
|
Deployed to:
|
|
25
41
|
- Dev: All 4 items
|
|
42
|
+
- Test: All 4 items
|
|
26
43
|
- Staging: All 4 items
|
|
27
44
|
- Production: 2 of 4 items (AB#4521, AB#4589)
|
|
45
|
+
|
|
46
|
+
⚠ State lag:
|
|
47
|
+
- AB#4530 is on `staging` but still in `Testing` — expected at least `Staging`.
|
|
48
|
+
|
|
49
|
+
Catch these up? (yes/no)
|
|
28
50
|
```
|
|
29
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`.
|
|
53
|
+
|
|
30
54
|
## If Pipeline (e.g., `/status pipeline` or `/status build`):
|
|
31
55
|
|
|
32
|
-
|
|
56
|
+
Query recent builds for each pipeline in the Pipeline Configuration table.
|
|
33
57
|
|
|
34
58
|
```
|
|
35
59
|
## Recent Pipeline Runs
|
|
36
60
|
|
|
37
61
|
| Pipeline | Branch | Status | Time | Build # |
|
|
38
62
|
|----------|--------|--------|------|---------|
|
|
39
|
-
| Compass API |
|
|
40
|
-
| Compass Client |
|
|
41
|
-
| Compass API |
|
|
63
|
+
| Compass API (YAML) | prod | Succeeded | 2026-09-06 14:26 | 20260906.1 |
|
|
64
|
+
| Compass Client (YAML) | prod | Succeeded | 2026-09-06 14:27 | 20260906.1 |
|
|
65
|
+
| Compass API (YAML) | test | Succeeded | 2026-09-05 10:15 | 20260905.3 |
|
|
42
66
|
```
|
|
43
67
|
|
|
68
|
+
A run on `main` would be unexpected — `main` has no pipeline. If one appears, say so.
|
|
69
|
+
|
|
44
70
|
## If Work Item (e.g., `/status AB#4521`):
|
|
45
71
|
|
|
46
|
-
Read the work item from Azure DevOps and show its full status.
|
|
72
|
+
Read the work item from Azure DevOps and show its full status, including which environment branches contain its commits.
|
|
47
73
|
|
|
48
74
|
```
|
|
49
75
|
## AB#4521: Admin Can Export Payment History to CSV
|
|
50
76
|
|
|
51
77
|
**Type:** User Story
|
|
52
|
-
**State:**
|
|
78
|
+
**State:** Staging
|
|
53
79
|
**Assigned To:** Chris Waters
|
|
54
80
|
**Release:** Release #24
|
|
55
81
|
**Branch:** story/AB#4521-admin-can-export-payment-history
|
|
56
|
-
**PR:** #287 (merged to
|
|
82
|
+
**PR:** #287 (merged to main)
|
|
57
83
|
|
|
58
|
-
###
|
|
59
|
-
|
|
60
|
-
|
|
84
|
+
### Environments
|
|
85
|
+
| Environment | Branch | Present |
|
|
86
|
+
|-------------|--------|---------|
|
|
87
|
+
| — (compare) | main | Yes — PR #287 merged 2026-09-01 |
|
|
88
|
+
| Dev | dev | Yes — PR #290 merged 2026-09-02 |
|
|
89
|
+
| Test | test | Yes — PR #291 merged 2026-09-03 |
|
|
90
|
+
| Staging | staging | Yes — PR #295 merged 2026-09-05 |
|
|
91
|
+
| Production | prod | No |
|
|
92
|
+
|
|
93
|
+
State `Staging` matches the furthest environment. ✓
|
|
61
94
|
|
|
62
95
|
### Child Tasks
|
|
63
96
|
| ID | Title | State |
|
|
@@ -67,24 +100,31 @@ Read the work item from Azure DevOps and show its full status.
|
|
|
67
100
|
| AB#4527 | Add export button UI | Closed |
|
|
68
101
|
```
|
|
69
102
|
|
|
103
|
+
If the state lags the furthest environment, flag it and offer to catch it up as in the release view.
|
|
104
|
+
|
|
70
105
|
## If Environment (e.g., `/status staging`):
|
|
71
106
|
|
|
72
|
-
|
|
107
|
+
Map the name to its branch through the Pipeline Configuration table. Show the last deployment and what's currently there.
|
|
73
108
|
|
|
74
109
|
```
|
|
75
110
|
## Staging Environment
|
|
76
111
|
|
|
77
112
|
**Branch:** staging
|
|
78
|
-
**Last deployment:** 2026-
|
|
79
|
-
**Pipeline:** Compass API — Succeeded
|
|
113
|
+
**Last deployment:** 2026-09-05 15:30 (Build #20260905.2)
|
|
114
|
+
**Pipeline:** Compass API (YAML) — Succeeded
|
|
80
115
|
|
|
81
116
|
### Recent merges to staging:
|
|
82
117
|
| Commit | Message | Date |
|
|
83
118
|
|--------|---------|------|
|
|
84
|
-
| a1b2c3d | Release #24 → Staging | 2026-
|
|
85
|
-
| d4e5f6a | Cherry-pick AB#4601 | 2026-
|
|
119
|
+
| a1b2c3d | Release #24 → Staging | 2026-09-05 |
|
|
120
|
+
| d4e5f6a | Cherry-pick AB#4601 → Staging | 2026-09-06 |
|
|
121
|
+
|
|
122
|
+
### Not yet promoted from test:
|
|
123
|
+
{count} commits on `test` are not on `staging` — run `/promote test staging` or `/deploy-release <N> staging`.
|
|
86
124
|
```
|
|
87
125
|
|
|
126
|
+
`/status main` is allowed but reports "compare branch — nothing deploys from main" and lists what's on `main` that hasn't been promoted to `dev`.
|
|
127
|
+
|
|
88
128
|
## If No Argument (e.g., `/status`):
|
|
89
129
|
|
|
90
130
|
Show a high-level overview.
|
|
@@ -93,19 +133,29 @@ Show a high-level overview.
|
|
|
93
133
|
## Project Status
|
|
94
134
|
|
|
95
135
|
### Active Releases
|
|
96
|
-
| Release | Work Items |
|
|
97
|
-
|
|
136
|
+
| Release | Work Items | Furthest Environment |
|
|
137
|
+
|---------|-----------|----------------------|
|
|
98
138
|
| Release #24 | 6 items | Staging |
|
|
99
139
|
| Release #23 | 4 items | Production |
|
|
100
140
|
|
|
141
|
+
### Environment Chain
|
|
142
|
+
| Branch | Environment | Behind previous by |
|
|
143
|
+
|--------|-------------|--------------------|
|
|
144
|
+
| main | — (compare) | — |
|
|
145
|
+
| dev | Dev | 0 commits |
|
|
146
|
+
| test | Test | 3 commits |
|
|
147
|
+
| staging | Staging | 3 commits |
|
|
148
|
+
| prod | Production | 9 commits |
|
|
149
|
+
|
|
101
150
|
### Recent Pipelines
|
|
102
|
-
| Pipeline | Last Run | Status |
|
|
103
|
-
|
|
104
|
-
| Compass API |
|
|
105
|
-
| Compass Client |
|
|
151
|
+
| Pipeline | Last Run | Branch | Status |
|
|
152
|
+
|----------|----------|--------|--------|
|
|
153
|
+
| Compass API (YAML) | 20260906.1 | prod | Succeeded |
|
|
154
|
+
| Compass Client (YAML) | 20260906.1 | prod | Succeeded |
|
|
106
155
|
|
|
107
156
|
### Open PRs
|
|
108
157
|
| PR # | Title | Target |
|
|
109
158
|
|------|-------|--------|
|
|
110
|
-
| #292 | AB#4601: Fix bulk approval |
|
|
159
|
+
| #292 | AB#4601: Fix bulk approval | main |
|
|
160
|
+
| #296 | Promote test → staging | staging |
|
|
111
161
|
```
|
|
@@ -12,14 +12,16 @@ Capture: id, title, type, state, and any linked Pull Request artifacts from `rel
|
|
|
12
12
|
|
|
13
13
|
## Step 2: Resolve the Environment Chain
|
|
14
14
|
|
|
15
|
-
Read the **Pipeline Configuration** table from the current repo's `CLAUDE.md`. The table rows define the
|
|
15
|
+
Read the **Pipeline Configuration** table from the current repo's `CLAUDE.md`. The table rows define the branches in promotion order (top → bottom). The **first row is the compare branch** (`main`) — feature PRs merge there, but nothing deploys from it; the rows below are the environment branches. Example:
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
| Branch | Environment | Pipeline(s) |
|
|
19
19
|
|--------|------------|-------------|
|
|
20
|
-
|
|
|
20
|
+
| main | — (compare branch, no deployment) | — |
|
|
21
|
+
| dev | Dev | ... |
|
|
22
|
+
| test | Test | ... |
|
|
21
23
|
| staging | Staging | ... |
|
|
22
|
-
|
|
|
24
|
+
| prod | Production | ... |
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
If the table is missing, report that the project has no pipeline configuration in `CLAUDE.md` and stop.
|
|
@@ -62,19 +64,21 @@ AB#<id>: <title>
|
|
|
62
64
|
This work item is in <env list joined with " and ">.
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
Where `<env list>` is the environments where the work item is present, in promotion order.
|
|
67
|
+
Where `<env list>` is the environments where the work item is present, in promotion order. The compare branch is not an environment: if the commits are on `main` only, say "merged to main, not deployed to any environment yet." If not even on `main`, say "not merged yet."
|
|
66
68
|
|
|
67
69
|
Then a details table:
|
|
68
70
|
|
|
69
71
|
```
|
|
70
|
-
| Environment | Branch |
|
|
71
|
-
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
72
|
+
| Environment | Branch | Present | Commits |
|
|
73
|
+
|-------------|---------|---------|---------|
|
|
74
|
+
| — (compare) | main | Yes | 2 of 2 |
|
|
75
|
+
| Dev | dev | Yes | 2 of 2 |
|
|
76
|
+
| Test | test | Yes | 2 of 2 |
|
|
77
|
+
| Staging | staging | Yes | 1 of 2 |
|
|
78
|
+
| Production | prod | No | 0 of 2 |
|
|
75
79
|
```
|
|
76
80
|
|
|
77
|
-
- **
|
|
81
|
+
- **Present**: Yes if at least one commit is reachable from the branch tip; No otherwise. For the compare branch this means "merged", not "deployed".
|
|
78
82
|
- **Commits**: how many of the work item's commits are present on that branch (e.g. `1 of 2` flags a partial cherry-pick).
|
|
79
83
|
|
|
80
84
|
If any linked PRs are still open (not merged), append:
|
|
@@ -84,4 +88,6 @@ Open PRs:
|
|
|
84
88
|
- PR #<n> → <target branch> (<status>)
|
|
85
89
|
```
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
Finally, compare the work item's state with its furthest environment (`dev` → `Ready for Testing`, `test` → `Testing`, `staging` → `Staging`, `prod` → `Deployed`). If the state lags — e.g. commits on `staging` but the item is still `Testing` — add one line: `⚠ State lags environment: Testing, expected at least Staging — /status AB#<id> can catch it up.`
|
|
92
|
+
|
|
93
|
+
That's it — read-only. Do not modify branches, push, create PRs, or change states.
|
|
@@ -98,9 +98,9 @@ Claude maintains persistent memory across sessions in `~/.claude/projects/.../me
|
|
|
98
98
|
1. **Pick a work item** from Azure DevOps (or describe what you need)
|
|
99
99
|
2. **Claude implements** using `/implement AB#<id>` (auto-creates branch)
|
|
100
100
|
3. **Hooks guard** against secrets and bad patterns automatically
|
|
101
|
-
4. **PR merges** into `
|
|
102
|
-
5. **
|
|
103
|
-
6. **
|
|
101
|
+
4. **PR merges** into `main` — the compare branch. **Nothing deploys yet.** The work item stays in `Code Review` until it is promoted
|
|
102
|
+
5. **Promote or release** — `/promote main dev` carries everything on `main` to Dev; `/create-release <N>` groups work items so `/deploy-release <N> test` → `staging` → `prod` can carry just those
|
|
103
|
+
6. **Merge each promotion PR** — that merge is what triggers the environment's CD pipeline. Reply `merged` and the command advances the work items to `Testing`, `Staging`, or `Deployed`
|
|
104
104
|
7. **Test** using Playwright MCP for browser testing
|
|
105
105
|
8. **Track** work items via the Azure DevOps MCP server
|
|
106
106
|
9. **Learn** — Claude saves what worked for next time
|
|
@@ -121,33 +121,61 @@ These rules apply to **every** command or flow that creates or estimates work it
|
|
|
121
121
|
An item that merely **needs to be split** keeps its state and gets no tag — the work is understood, nothing is missing.
|
|
122
122
|
|
|
123
123
|
**The drop-out mechanism has no expiry, so every sweep must audit it.** Removing the `needs-info` tag is the *only* thing that re-queues a bug, and moving a story back to `Design Approved` is the only thing that re-queues a story. A creator who supplies the missing information but leaves the tag on — or answers in a comment instead of editing the field — makes the item invisible to every future sweep, permanently. That failure looks exactly like a clean backlog. `/quote-backlog` Step 2b therefore audits tagged items for activity after the tag was applied and reports the stale ones; it never clears a tag on the creator's behalf. Two traps when writing such a check: automation bots bump a revision after nearly every human write, so the *latest* revision author is unreliable — scan the whole range after the tag revision; and a `System.CommentCount` increase counts as a creator response.
|
|
124
|
-
6. **Never assume two work item types share a state list.** WIQL doesn't validate state names, so a query filtering on a state the type doesn't have returns **zero rows instead of an error** — the classic symptom is a backlog sweep that silently never surfaces a single bug. Confirm with `mcp__azure-devops__wit_work_item` (`action: get_type`) before writing a state name into a query or an update. In CSI Development: `User Story` has `New → Dev Ready → In Design → Design Review → Design Approved → Active →
|
|
124
|
+
6. **Never assume two work item types share a state list.** WIQL doesn't validate state names, so a query filtering on a state the type doesn't have returns **zero rows instead of an error** — the classic symptom is a backlog sweep that silently never surfaces a single bug. Confirm with `mcp__azure-devops__wit_work_item` (`action: get_type`) before writing a state name into a query or an update. In CSI Development (verified 2026-09-06): `User Story` has `New → Dev Ready → In Design → Design Review → Design Approved → Active → Code Review → Ready for Testing → Testing → Ready for Staging → Staging → Ready to Deploy → Deployed → Closed`; `Bug` and `Hot Fix` have the same list minus the three design states (`New → Dev Ready → Active → Code Review → …`). `Ready for Staging` and `Staging` were added on 2026-09-06 so every environment has a state — see **Work Item States ↔ Environments** below.
|
|
125
125
|
|
|
126
126
|
### Branching Strategy
|
|
127
127
|
|
|
128
128
|
#### Target Branch-to-Environment Mapping
|
|
129
129
|
|
|
130
|
-
All projects
|
|
130
|
+
All projects converge to this standard. `main` is the **compare branch** — the default branch, the one feature PRs target, and the one every environment branch is compared against. **Merging into `main` deploys nothing.** Each environment has its own long-lived branch, and a PR merging into that branch is what triggers its CD pipeline:
|
|
131
131
|
|
|
132
|
-
| Branch |
|
|
133
|
-
|
|
134
|
-
| `
|
|
135
|
-
| `
|
|
136
|
-
| `
|
|
132
|
+
| Branch | Environment | CD Pipeline Trigger |
|
|
133
|
+
|---|---|---|
|
|
134
|
+
| `main` | — (compare / integration branch) | **None** — merging a PR into `main` does not deploy |
|
|
135
|
+
| `dev` | Development | Auto when a PR merges into `dev` |
|
|
136
|
+
| `test` | Test (QA) | Auto when a PR merges into `test` |
|
|
137
|
+
| `staging` | Staging | Auto when a PR merges into `staging` |
|
|
138
|
+
| `prod` | Production | Auto when a PR merges into `prod` |
|
|
137
139
|
|
|
138
|
-
|
|
140
|
+
Branch names are lowercase. COMPASS and CSIPay are on this layout (CSIPay renamed its branches on 2026-09-04; `test` replaced `QA`).
|
|
141
|
+
|
|
142
|
+
> **Note:** A project that hasn't migrated yet (e.g. one that still has only `main` and `develop`) keeps working — the deployer and every slash command read the project's **Pipeline Configuration** table and use the **current branch** dynamically; no branch names are hardcoded.
|
|
139
143
|
|
|
140
144
|
#### Promotion Flow
|
|
141
145
|
|
|
142
|
-
Code flows through environments via PRs — never by direct push:
|
|
146
|
+
Code flows through environments via PRs — never by direct push. Every arrow below is a PR, and every merge **after** `main` deploys:
|
|
143
147
|
|
|
144
148
|
```
|
|
145
|
-
feature/AB#1234-... ──PR──▸
|
|
146
|
-
(work branch)
|
|
149
|
+
feature/AB#1234-... ──PR──▸ main ──PR──▸ dev ──PR──▸ test ──PR──▸ staging ──PR──▸ prod
|
|
150
|
+
(work branch) (compare, (Dev) (Test) (Staging) (Production)
|
|
151
|
+
no deploy)
|
|
147
152
|
```
|
|
148
153
|
|
|
149
|
-
- **
|
|
150
|
-
- **
|
|
154
|
+
- **feature → main**: the `/implement` PR. Code review happens here. Merging it deploys nothing.
|
|
155
|
+
- **main → dev**: `/promote main dev` — usually everything on `main`, so developers can smoke-test on Dev.
|
|
156
|
+
- **dev → test**: `/promote dev test` or `/deploy-release <N> test` — hands the work to QA.
|
|
157
|
+
- **test → staging**: `/deploy-release <N> staging` — only what QA passed (`Ready for Staging`).
|
|
158
|
+
- **staging → prod**: `/deploy-release <N> prod` — only what stakeholders approved (`Ready to Deploy`). Cherry-pick a subset when only some stories are ready (see Cherry-Pick Deployments below).
|
|
159
|
+
|
|
160
|
+
#### Work Item States ↔ Environments
|
|
161
|
+
|
|
162
|
+
Every environment in the chain has a work item state, so the board shows where each story physically is. The **"Ready for …" states are human gates** — QA or stakeholders set them when something passes; the slash commands never do. The **environment states** (`Testing`, `Staging`, `Deployed`) are set by the promotion commands once the PR into that branch has merged.
|
|
163
|
+
|
|
164
|
+
| Branch | Environment | Gate — items should already be in… | Set once the PR into this branch merges |
|
|
165
|
+
|---|---|---|---|
|
|
166
|
+
| `main` | — | `Code Review` (the `/implement` PR is open) | *(no change — nothing deployed)* |
|
|
167
|
+
| `dev` | Dev | `Code Review` (merged to `main`) | `Ready for Testing` |
|
|
168
|
+
| `test` | Test | `Ready for Testing` | `Testing` |
|
|
169
|
+
| `staging` | Staging | `Ready for Staging` | `Staging` |
|
|
170
|
+
| `prod` | Production | `Ready to Deploy` | `Deployed` |
|
|
171
|
+
|
|
172
|
+
Human-only transitions — no slash command ever makes these: `Testing → Ready for Staging` (QA sign-off), `Staging → Ready to Deploy` (stakeholder / UAT sign-off), `Deployed → Closed` (verified in production).
|
|
173
|
+
|
|
174
|
+
How the commands use this table:
|
|
175
|
+
|
|
176
|
+
- **Gate check before the PR.** `/deploy-release`, `/cherry-pick`, and `/promote` compare each carried work item's state against the gate for the target environment. Anything behind the gate (e.g. still `Testing` when deploying to `staging`) is flagged and the user decides whether to include it. Items *ahead* of the gate (e.g. already `Deployed` on a cherry-pick to `prod`) are reported and left alone.
|
|
177
|
+
- **Advance after the merge, not before.** The commands can't see the PR merge, so they finish by asking you to reply `merged` once the PR has completed and the pipeline is green; only then do they write the new state — for every carried User Story, Bug, and Hot Fix, never a Feature or Task, and never backward. `/status` reports items whose state lags the branch their commits are on and offers to catch them up.
|
|
178
|
+
- **Never assume the state list.** Confirm with `mcp__azure-devops__wit_work_item` (`action: get_type`) on an unfamiliar project before writing a state name — a bad name is accepted silently by a query and rejected only at write time.
|
|
151
179
|
|
|
152
180
|
#### Release Management
|
|
153
181
|
|
|
@@ -161,43 +189,47 @@ This creates a `Release #23` iteration, assigns the selected work items to it, a
|
|
|
161
189
|
|
|
162
190
|
**Deploying a release to an environment:**
|
|
163
191
|
```
|
|
192
|
+
/deploy-release 23 test
|
|
164
193
|
/deploy-release 23 staging
|
|
165
|
-
/deploy-release 23
|
|
194
|
+
/deploy-release 23 prod
|
|
166
195
|
```
|
|
167
|
-
This finds all work items in Release #23, cherry-picks their commits into a release branch (`release/23-to-staging`), creates a PR targeting the environment branch,
|
|
196
|
+
This finds all work items in Release #23, checks each one against the target environment's gate state, cherry-picks their commits into a release branch (`release/23-to-staging`), creates a PR targeting the environment branch, links all work items, and — once you reply `merged` — advances them to the environment's state (`Testing`, `Staging`, `Deployed`).
|
|
168
197
|
|
|
169
|
-
**Selective deployment:** Since releases are deployed via cherry-pick, you can deploy a full release or a subset. If staging has 5 user stories but only 3
|
|
198
|
+
**Selective deployment:** Since releases are deployed via cherry-pick, you can deploy a full release or a subset. If staging has 5 user stories but only 3 are `Ready to Deploy`, create a release with just those 3 and deploy it.
|
|
170
199
|
|
|
171
200
|
**Release flow:**
|
|
172
201
|
```
|
|
173
202
|
/create-release 23 → Groups work items into Release #23
|
|
174
|
-
/deploy-release 23
|
|
175
|
-
(QA
|
|
176
|
-
/deploy-release 23
|
|
203
|
+
/deploy-release 23 test → Cherry-picks Release #23 to test → items go to Testing
|
|
204
|
+
(QA passes → sets Ready for Staging)
|
|
205
|
+
/deploy-release 23 → Auto-detects next env (staging) → items go to Staging
|
|
206
|
+
(stakeholders approve → set Ready to Deploy)
|
|
207
|
+
/deploy-release 23 → Auto-detects next env (prod) → items go to Deployed
|
|
177
208
|
```
|
|
178
209
|
|
|
179
210
|
#### Cherry-Pick Deployments
|
|
180
211
|
|
|
181
212
|
Cherry-pick specific work items to an environment without a formal release:
|
|
182
213
|
```
|
|
183
|
-
/cherry-pick AB#1234 AB#1235
|
|
214
|
+
/cherry-pick AB#1234 AB#1235 prod
|
|
184
215
|
```
|
|
185
|
-
This finds commits for the specified work items, cherry-picks them into a branch (`cherry-pick/<date>-to-<environment>`),
|
|
216
|
+
This finds commits for the specified work items, checks them against the target's gate state, cherry-picks them into a branch (`cherry-pick/<date>-to-<environment>`), creates a PR, and advances the work items once you confirm the merge.
|
|
186
217
|
|
|
187
218
|
#### Promoting Environments
|
|
188
219
|
|
|
189
220
|
Promote all code from one environment to the next:
|
|
190
221
|
```
|
|
191
|
-
/promote
|
|
222
|
+
/promote main dev
|
|
223
|
+
/promote staging prod
|
|
192
224
|
/promote ← auto-detects source and target from current branch
|
|
193
225
|
```
|
|
194
|
-
This creates a PR from the source branch to the target branch with a summary of all included commits.
|
|
226
|
+
This creates a PR from the source branch to the target branch with a summary of all included commits and their work items, checks the work items against the target's gate state, and advances them once you confirm the merge. `main → dev` is the usual first hop after feature PRs merge.
|
|
195
227
|
|
|
196
228
|
#### Rollbacks
|
|
197
229
|
|
|
198
230
|
Roll back a deployment on any environment:
|
|
199
231
|
```
|
|
200
|
-
/rollback AB#1234
|
|
232
|
+
/rollback AB#1234 prod ← revert specific work items
|
|
201
233
|
/rollback last staging ← revert the most recent deployment
|
|
202
234
|
```
|
|
203
235
|
This creates a revert branch, reverts the specified commits, runs pre-flight checks, and creates a PR.
|
|
@@ -211,7 +243,7 @@ Commit, push, and deploy the current changes:
|
|
|
211
243
|
/deploy "Add payment export feature"
|
|
212
244
|
/deploy ← auto-generates commit message
|
|
213
245
|
```
|
|
214
|
-
This runs pre-flight checks, commits, pushes the current branch, and triggers the CD pipeline if on an environment branch.
|
|
246
|
+
This runs pre-flight checks, commits, pushes the current branch, and triggers the CD pipeline if on an environment branch (`dev`, `test`, `staging`, `prod`). On `main` or a work branch nothing is triggered — `main` has no pipeline.
|
|
215
247
|
|
|
216
248
|
#### Branch Naming Convention
|
|
217
249
|
|
|
@@ -235,13 +267,13 @@ PRs always target the branch you were on when `/implement` was invoked. The base
|
|
|
235
267
|
|
|
236
268
|
#### Hot Fix Workflow
|
|
237
269
|
|
|
238
|
-
Hot Fix work items follow the same automated checks (build, lint, tests, review) but skip manual UAT. An abbreviated confirmation is shown instead. Hot Fix PRs get a `hotfix` label. Hot Fixes target the current branch (
|
|
270
|
+
Hot Fix work items follow the same automated checks (build, lint, tests, review) but skip manual UAT. An abbreviated confirmation is shown instead. Hot Fix PRs get a `hotfix` label. Hot Fixes target the current branch — for a production hot fix, start on `prod` so the PR merges (and deploys) straight there. **Then bring the fix back to `main`:** open a second PR from the same hotfix branch into `main` (or `/cherry-pick AB#<id> main`) so the next `main → dev` promotion doesn't overwrite it. A hot fix that lives only on `prod` is lost on the next release.
|
|
239
271
|
|
|
240
272
|
#### Feature Workflow (ordered story waves)
|
|
241
273
|
|
|
242
274
|
Running `/implement` on a **Feature** implements its child User Stories in **waves** driven by the `Custom.Order` field: stories sharing the same order value are implemented **in parallel** (one agent per story, each in an isolated git worktree), and waves run sequentially in ascending order so later stories build on earlier ones. All work merges into a single `feature/AB#<id>-...` branch; quality checks, code review, UAT, and one PR happen at the feature level, and every implemented story is linked to that PR. Stories without a `Custom.Order` value run in a final catch-all wave (flagged for confirmation first).
|
|
243
275
|
|
|
244
|
-
**Work item states:** `/implement` moves the work item to `Active` when implementation starts — for a single work item (User Story, Bug, Hot Fix) right after the branch is created; for a Feature, each child story goes `Active` as its wave begins. When the PR is created, each implemented child **User Story** moves to `Code Review` — the **Feature's state is never changed**. The Feature is a parent container; it advances only as its child stories are verified/closed. Only child **Tasks** are ever closed — never the stories or the Feature.
|
|
276
|
+
**Work item states:** `/implement` moves the work item to `Active` when implementation starts — for a single work item (User Story, Bug, Hot Fix) right after the branch is created; for a Feature, each child story goes `Active` as its wave begins. When the PR is created, each implemented child **User Story** moves to `Code Review` — the **Feature's state is never changed**. The Feature is a parent container; it advances only as its child stories are verified/closed. Only child **Tasks** are ever closed — never the stories or the Feature. From `Code Review` onward the stories follow the **Work Item States ↔ Environments** table above as they are promoted.
|
|
245
277
|
|
|
246
278
|
**Hours live on the Task.** `/implement` will not implement a story that has no open child Task: if there isn't one, it proposes a title and an hour estimate (from the story's points, same mapping `/plan-backlog` uses — points set the hour band, complexity picks where in the band it lands) and creates it once the user agrees — exactly one per story, inheriting the parent's assignee, area, and iteration. When the PR is created, that Task is closed with the hours worked logged to `CompletedWork` and `RemainingWork` zeroed. Closing happens at **PR creation**, not at merge, so hours are recorded while they're still known. Never enable Azure DevOps's "Complete associated work items" when merging — it transitions the parent too.
|
|
247
279
|
|
|
@@ -254,14 +286,15 @@ All deployment and release operations are available as slash commands:
|
|
|
254
286
|
| `/implement` | `/implement AB#1234` | Summarize work item → approve plan → ensure an open child Task with hours → implement → PR (closes the Task, logs hours). On a Feature: child stories in `Custom.Order` waves, same-order stories in parallel |
|
|
255
287
|
| `/review` | `/review 142` | Automated code review on a PR |
|
|
256
288
|
| `/resolve-feedback` | `/resolve-feedback 142` | Address unresolved PR comment threads, push fixes, reply + resolve threads |
|
|
257
|
-
| `/deploy` | `/deploy "commit message"` | Commit, push, trigger pipeline |
|
|
289
|
+
| `/deploy` | `/deploy "commit message"` | Commit, push, trigger pipeline (only on `dev`/`test`/`staging`/`prod` — never on `main`) |
|
|
258
290
|
| `/create-release` | `/create-release 23` | Group work items into Release #23 |
|
|
259
|
-
| `/deploy-release` | `/deploy-release 23 staging` |
|
|
291
|
+
| `/deploy-release` | `/deploy-release 23 staging` | Gate-check → cherry-pick release to environment → PR → advance states after merge |
|
|
260
292
|
| `/add-to-release` | `/add-to-release 24 AB#4599` | Add work items to existing release |
|
|
261
|
-
| `/cherry-pick` | `/cherry-pick AB#1234 AB#1235
|
|
262
|
-
| `/promote` | `/promote
|
|
263
|
-
| `/rollback` | `/rollback AB#1234
|
|
264
|
-
| `/status` | `/status release 24` | Check release, pipeline, or work item status |
|
|
293
|
+
| `/cherry-pick` | `/cherry-pick AB#1234 AB#1235 prod` | Gate-check → cherry-pick specific work items → PR → advance states after merge |
|
|
294
|
+
| `/promote` | `/promote main dev` | Promote all code between environments (`main → dev → test → staging → prod`) → advance states after merge |
|
|
295
|
+
| `/rollback` | `/rollback AB#1234 prod` | Revert commits on an environment |
|
|
296
|
+
| `/status` | `/status release 24` | Check release, pipeline, environment, or work item status; flags work items whose state lags their environment |
|
|
297
|
+
| `/where` | `/where AB#1234` | Show which environment branches contain a work item's commits |
|
|
265
298
|
| `/plan-backlog` | `/plan-backlog [project]` | Sweep backlog for Dev Ready stories with points and no tasks → propose child tasks with hours |
|
|
266
299
|
| `/plan-sprint` | `/plan-sprint [project]` | Sweep the current sprint for stories/bugs with no child tasks → propose one child task with hours per item |
|
|
267
300
|
| `/quote-backlog` | `/quote-backlog [project]` | Sweep backlog for unpointed items ready to estimate — stories in `Design Approved`, **bugs in `New`** (bugs have no design states) → review completeness, check for duplicates, suggest rewrites, propose points + creator comments (10 at a time, approval-gated). Pointed items move to Dev Ready; stories that can't be quoted move back to **Design Review**, bugs that can't be quoted get a **`needs-info`** tag, so the next sweep skips them. Every run also audits the drop-out queue (tagged bugs **and** stories bounced to Design Review) and reports any whose creator answered but which nobody returned to the sweep — neither mechanism expires, so those are otherwise invisible forever |
|
|
@@ -271,11 +304,11 @@ All deployment and release operations are available as slash commands:
|
|
|
271
304
|
| `/cleanup-branches` | `/cleanup-branches` | Delete merged branches |
|
|
272
305
|
| `/close-orphan-tasks` | `/close-orphan-tasks [scope] [--dry-run]` | Close open Tasks whose parent is Ready to Deploy / Deployed / Closed |
|
|
273
306
|
|
|
274
|
-
The CD pipeline is only triggered manually when pushing directly to an environment branch. For feature/work branches
|
|
307
|
+
The CD pipeline is only triggered manually when pushing directly to an environment branch (`dev`, `test`, `staging`, `prod`). For feature/work branches and for `main`, nothing is triggered — a feature PR merging into `main` deploys nothing; the first deployment happens when `main` is promoted to `dev`.
|
|
275
308
|
|
|
276
309
|
### Pipeline Configuration
|
|
277
310
|
|
|
278
|
-
Each project must define its environment chain and pipeline IDs so the slash commands (`/deploy`, `/promote`, `/deploy-release`) know which pipelines to trigger and what the promotion order is.
|
|
311
|
+
Each project must define its compare branch, its environment chain, and its pipeline IDs so the slash commands (`/deploy`, `/promote`, `/deploy-release`, `/cherry-pick`, `/where`, `/status`) know which pipelines to trigger and what the promotion order is.
|
|
279
312
|
|
|
280
313
|
Add this section to your project's `CLAUDE.md`:
|
|
281
314
|
|
|
@@ -284,33 +317,50 @@ Add this section to your project's `CLAUDE.md`:
|
|
|
284
317
|
|
|
285
318
|
| Branch | Environment | Pipeline(s) |
|
|
286
319
|
|--------|------------|-------------|
|
|
287
|
-
|
|
|
320
|
+
| main | — (compare branch, no deployment) | — |
|
|
321
|
+
| dev | Dev | My API (ID), My Client (ID) |
|
|
322
|
+
| test | Test | My API (ID), My Client (ID) |
|
|
288
323
|
| staging | Staging | My API (ID), My Client (ID) |
|
|
289
|
-
|
|
|
324
|
+
| prod | Production | My API (ID), My Client (ID) |
|
|
290
325
|
```
|
|
291
326
|
|
|
292
327
|
**Rules for slash commands:**
|
|
293
|
-
-
|
|
294
|
-
-
|
|
295
|
-
- `/deploy
|
|
296
|
-
-
|
|
328
|
+
- The **first row is the compare branch**. Feature PRs target it. It has no pipeline — merging into it deploys nothing. A row whose Pipeline(s) cell is `—` is never triggered.
|
|
329
|
+
- The **order of rows** defines the promotion flow (top to bottom): `main → dev → test → staging → prod`.
|
|
330
|
+
- `/deploy` triggers the pipeline(s) listed for the current branch. If the current branch is not in this table, or its pipeline cell is `—`, no pipeline is triggered.
|
|
331
|
+
- `/promote` uses this table to determine the next environment (the next row down).
|
|
332
|
+
- `/deploy-release` and `/cherry-pick` create PRs targeting environment branches listed here, and use the **Work Item States ↔ Environments** table to gate-check and advance work items.
|
|
333
|
+
- `/where` and `/status` check every row; the compare branch reports as "merged to main", not as a deployment.
|
|
297
334
|
|
|
298
335
|
**Examples from actual projects:**
|
|
299
336
|
|
|
300
|
-
|
|
337
|
+
COMPASS:
|
|
338
|
+
```markdown
|
|
339
|
+
| Branch | Environment | Pipeline(s) |
|
|
340
|
+
|--------|------------|-------------|
|
|
341
|
+
| main | — (compare branch, no deployment) | — |
|
|
342
|
+
| dev | Dev | Compass API (YAML) (32), Compass Client (YAML) (33) |
|
|
343
|
+
| test | Test | Compass API (YAML) (32), Compass Client (YAML) (33) |
|
|
344
|
+
| staging | Staging | Compass API (YAML) (32), Compass Client (YAML) (33) |
|
|
345
|
+
| prod | Production | Compass API (YAML) (32), Compass Client (YAML) (33) |
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
CSIPay:
|
|
301
349
|
```markdown
|
|
302
350
|
| Branch | Environment | Pipeline(s) |
|
|
303
351
|
|--------|------------|-------------|
|
|
304
|
-
|
|
|
305
|
-
|
|
|
306
|
-
|
|
|
307
|
-
|
|
|
352
|
+
| main | — (compare branch, no deployment) | — |
|
|
353
|
+
| dev | Dev | CSIPay API (12), CSIPay Client (13) |
|
|
354
|
+
| test | Test | CSIPay API (12), CSIPay Client (13) |
|
|
355
|
+
| staging | Staging | CSIPay API (12), CSIPay Client (13) |
|
|
356
|
+
| prod | Production | CSIPay API (12), CSIPay Client (13) |
|
|
308
357
|
```
|
|
309
358
|
|
|
310
|
-
Glasswing and Monarch (1 environment
|
|
359
|
+
Glasswing and Monarch (not yet migrated — 1 environment):
|
|
311
360
|
```markdown
|
|
312
361
|
| Branch | Environment | Pipeline(s) |
|
|
313
362
|
|--------|------------|-------------|
|
|
363
|
+
| main | — (compare branch, no deployment) | — |
|
|
314
364
|
| develop | Dev | CD - Development (28) |
|
|
315
365
|
```
|
|
316
366
|
|