@chris1807/claude-kit 2.1.53 → 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 CHANGED
@@ -209,9 +209,9 @@ your-project/ ← Project-specific
209
209
  │ │ ├── deploy.md # /deploy "commit message"
210
210
  │ │ ├── create-release.md # /create-release 23
211
211
  │ │ ├── deploy-release.md # /deploy-release 23 staging
212
- │ │ ├── cherry-pick.md # /cherry-pick AB#1234 production
213
- │ │ ├── promote.md # /promote staging production
214
- │ │ ├── rollback.md # /rollback AB#1234 production
212
+ │ │ ├── cherry-pick.md # /cherry-pick AB#1234 prod
213
+ │ │ ├── promote.md # /promote main dev
214
+ │ │ ├── rollback.md # /rollback AB#1234 prod
215
215
  │ │ ├── add-to-release.md # /add-to-release 24 AB#4599
216
216
  │ │ ├── status.md # /status release 24
217
217
  │ │ ├── cleanup-branches.md # /cleanup-branches
@@ -305,7 +305,7 @@ Claude automatically:
305
305
  1. Runs pre-flight checks (dotnet build, tsc)
306
306
  2. Stages and commits with the provided message
307
307
  3. Pushes the current branch
308
- 4. Triggers the CD pipeline if on an environment branch
308
+ 4. Triggers the CD pipeline if on an environment branch (`dev`, `test`, `staging`, `prod`) — never on `main`, which has no pipeline
309
309
 
310
310
  ### Create a Release
311
311
 
@@ -325,31 +325,36 @@ Claude automatically:
325
325
  ```
326
326
 
327
327
  Claude automatically:
328
- 1. Finds all work items in Release #23
328
+ 1. Finds all work items in Release #23 and checks each against the environment's gate state (`Ready for Staging` here)
329
329
  2. Cherry-picks their commits into `release/23-to-staging`
330
- 3. Creates a PR targeting the staging branch
330
+ 3. Creates a PR targeting the `staging` branch — merging it triggers the Staging pipeline
331
331
  4. Links all work items to the PR
332
+ 5. After you reply `merged`, moves the work items to `Staging`
333
+
334
+ The same command walks a release through `test` → `staging` → `prod`; with no environment given it picks the next one.
332
335
 
333
336
  ### Cherry-Pick Work Items
334
337
 
335
338
  ```
336
- /cherry-pick AB#1234 AB#1235 production
339
+ /cherry-pick AB#1234 AB#1235 prod
337
340
  ```
338
341
 
339
- Cherry-picks specific work items to an environment without a formal release.
342
+ Cherry-picks specific work items to an environment without a formal release. Same gate check and post-merge state advance as `/deploy-release`. `main` is also a valid target — that's how a hot fix that went straight to `prod` is brought back into the compare branch.
340
343
 
341
344
  ### Promote an Environment
342
345
 
343
346
  ```
344
- /promote staging production
347
+ /promote main dev
348
+ /promote staging prod
349
+ /promote ← auto-detects from the current branch
345
350
  ```
346
351
 
347
- Creates a PR to promote all code from staging to production. Shows a summary of all included commits before confirming.
352
+ Creates a PR to promote all code from one branch to the next in the chain (`main → dev → test → staging → prod`). Shows every commit and work item before confirming, gate-checks the work items, and advances their states after you reply `merged`. `main → dev` is the usual first hop after feature PRs merge — nothing has deployed before that.
348
353
 
349
354
  ### Rollback a Deployment
350
355
 
351
356
  ```
352
- /rollback AB#1234 production
357
+ /rollback AB#1234 prod
353
358
  /rollback last staging
354
359
  ```
355
360
 
@@ -411,15 +416,30 @@ Finds and deletes branches that have been fully merged. Protects environment bra
411
416
 
412
417
  ### Target State (All Projects)
413
418
 
414
- Every project should converge to this standard. Each long-lived branch maps to an Azure subscription and environment:
419
+ `main` is the **compare branch** — the default branch, the one feature PRs target, and the one every environment is compared against. **Merging into `main` deploys nothing.** Each environment has its own branch, and a PR merging into that branch is what triggers its CD pipeline:
420
+
421
+ | Branch | Environment | Deploys When |
422
+ |--------|-------------|-------------|
423
+ | `main` | — (compare / integration) | **Never** — a PR merging into `main` does not deploy |
424
+ | `dev` | Development | PR merged into `dev` |
425
+ | `test` | Test (QA) | PR merged into `test` |
426
+ | `staging` | Staging | PR merged into `staging` |
427
+ | `prod` | Production | PR merged into `prod` |
428
+
429
+ > **Note:** A project that hasn't migrated yet (e.g. one that still has only `main` and `develop`) keeps working — every command reads the project's Pipeline Configuration table and uses the branch you're on. No branch names are hardcoded.
430
+
431
+ ### Work Item States Follow the Environments
432
+
433
+ Every environment has a work item state, and the promotion commands keep them in sync. The "Ready for …" states are human sign-offs; the commands never set them.
415
434
 
416
- | Branch | Azure Subscription | Environment | Deploys When |
417
- |--------|-------------------|-------------|-------------|
418
- | `develop` | Dev | Development | PR merged into `develop` |
419
- | `staging` | Staging | Staging | PR merged into `staging` |
420
- | `main` | Production | Production | PR merged into `main` (with approval gate) |
435
+ | Promotion | Gate (item should already be…) | State after the PR merges |
436
+ |-----------|-------------------------------|---------------------------|
437
+ | `main → dev` | `Code Review` | `Ready for Testing` |
438
+ | `dev → test` | `Ready for Testing` | `Testing` |
439
+ | `test → staging` | `Ready for Staging` (QA sign-off) | `Staging` |
440
+ | `staging → prod` | `Ready to Deploy` (stakeholder sign-off) | `Deployed` |
421
441
 
422
- > **Note:** Some projects are not yet in sync — they may use `master` instead of `main`, or lack a `staging` branch. All commands work dynamically with whatever branch you're on. No branch names are hardcoded.
442
+ `/deploy-release`, `/cherry-pick`, and `/promote` check the gate before creating the PR, then ask you to reply `merged` once the PR completes and advance the states. `/status` flags anything whose state lags the branch it's on.
423
443
 
424
444
  ### Branch Naming
425
445
 
@@ -439,11 +459,12 @@ The branch is always created off the **current branch** — no assumptions are m
439
459
 
440
460
  ### Code Promotion Flow
441
461
 
442
- Code flows through environments via PRs, never by direct push:
462
+ Code flows through environments via PRs, never by direct push. Every merge **after** `main` deploys:
443
463
 
444
464
  ```
445
- feature/AB#1234-... ──PR──▸ develop ──PR──▸ staging ──PR──▸ main
446
- (work branch) (Dev) (Staging) (Production)
465
+ feature/AB#1234-... ──PR──▸ main ──PR──▸ dev ──PR──▸ test ──PR──▸ staging ──PR──▸ prod
466
+ (work branch) (compare, (Dev) (Test) (Staging) (Production)
467
+ no deploy)
447
468
  ```
448
469
 
449
470
  ---
@@ -462,8 +483,8 @@ claude
462
483
  ```
463
484
 
464
485
  ```
465
- # Switch to the develop branch first
466
- git checkout develop
486
+ # Start from the compare branch
487
+ git checkout main
467
488
 
468
489
  # Implement the work item
469
490
  /implement AB#1234
@@ -478,9 +499,15 @@ Claude will:
478
499
  6. Implement using backend and/or frontend agents
479
500
  7. Run all quality checks (build, lint, tests, review)
480
501
  8. Generate a UAT checklist and **pause for you to manually test**
481
- 9. After you confirm "testing passed", create a PR targeting `develop`
502
+ 9. After you confirm "testing passed", create a PR targeting `main`, close the child Task with its hours, and move the work item to `Code Review`
482
503
 
483
- The PR merges into `develop`, which triggers the Dev environment CD pipeline.
504
+ The PR merges into `main`. **That merge deploys nothing** — `main` is the compare branch. The work reaches Dev when `main` is promoted:
505
+
506
+ ```
507
+ /promote main dev
508
+ ```
509
+
510
+ Merge that PR, reply `merged`, and the work items move to `Ready for Testing`.
484
511
 
485
512
  ### Step 2: Deploy Changes (Quick Commits)
486
513
 
@@ -490,11 +517,11 @@ For smaller changes that don't need the full `/implement` workflow:
490
517
  /deploy "Fix typo in dashboard header"
491
518
  ```
492
519
 
493
- This commits, pushes, and triggers the pipeline if you're on an environment branch. If you're on a feature branch, it just pushes — the pipeline triggers on PR merge.
520
+ This commits, pushes, and triggers the pipeline if you're on an environment branch (`dev`, `test`, `staging`, `prod`). On `main` or a feature branch it just pushes — nothing deploys until the work is promoted.
494
521
 
495
522
  ### Step 3: Group Work Items into a Release
496
523
 
497
- Once multiple work items are merged to `develop` and tested in Dev, group them into a release:
524
+ Once multiple work items are merged to `main` and smoke-tested on Dev, group them into a release:
498
525
 
499
526
  ```
500
527
  /create-release 23
@@ -508,23 +535,24 @@ Claude will:
508
535
  2. Show you the list and ask for confirmation
509
536
  3. Create a `Release #23` iteration in Azure DevOps
510
537
  4. Assign all work items to the iteration and tag them with `release-23`
511
- 5. Tell you how to deploy: `/deploy-release 23 staging` or `/deploy-release 23 production`
538
+ 5. Tell you how to deploy: `/deploy-release 23 test`, then `staging`, then `prod`
512
539
 
513
- ### Step 4: Deploy a Release to Staging
540
+ ### Step 4: Deploy a Release to Test, then Staging
514
541
 
515
542
  ```
516
- /deploy-release 23 staging
543
+ /deploy-release 23 test
517
544
  ```
518
545
 
519
546
  Claude will:
520
- 1. Find all work items tagged `release-23`
521
- 2. Find their associated commits on the `develop` branch
522
- 3. Create a release branch: `release/23-to-staging`
547
+ 1. Find all work items tagged `release-23` and check each is at the gate for Test (`Ready for Testing`)
548
+ 2. Find their associated commits on `dev`
549
+ 3. Create a release branch: `release/23-to-test`
523
550
  4. Cherry-pick all commits for each work item
524
- 5. Create a PR from `release/23-to-staging` → `staging`
551
+ 5. Create a PR from `release/23-to-test` → `test`
525
552
  6. Link all work items to the PR
553
+ 7. After you reply `merged`, move the work items to `Testing`
526
554
 
527
- After the PR is reviewed and merged, the Staging CD pipeline triggers automatically.
555
+ After the PR is reviewed and merged, the Test CD pipeline triggers automatically. QA tests there and sets each passing item to `Ready for Staging`; then `/deploy-release 23 staging` repeats the process (gate `Ready for Staging`, state after merge `Staging`).
528
556
 
529
557
  ### Step 5: Test on Staging
530
558
 
@@ -532,45 +560,46 @@ QA and stakeholders test on the Staging environment. If issues are found, fix th
532
560
 
533
561
  ### Step 6: Deploy a Release to Production
534
562
 
535
- When staging testing passes:
563
+ When stakeholders have verified on Staging and set the items to `Ready to Deploy`:
536
564
 
537
565
  ```
538
- /deploy-release 23 production
566
+ /deploy-release 23 prod
539
567
  ```
540
568
 
541
- Same process — cherry-picks the release's commits to a PR targeting the production branch. After merge, the Production CD pipeline triggers (with approval gate).
569
+ Same process — gate `Ready to Deploy`, cherry-picks from `staging` into a PR targeting `prod`. After merge, the Production CD pipeline triggers; reply `merged` and the items move to `Deployed`.
542
570
 
543
571
  ### Selective Deployment
544
572
 
545
- If staging has 5 user stories but only 3 are ready for production:
573
+ If staging has 5 user stories but only 3 are `Ready to Deploy`:
546
574
 
547
575
  **Option A: Create a smaller release**
548
576
  ```
549
577
  /create-release 24
550
578
  ```
551
- Include only the 3 ready stories, then `/deploy-release 24 production`.
579
+ Include only the 3 ready stories, then `/deploy-release 24 prod`.
552
580
 
553
581
  **Option B: Cherry-pick specific items**
554
582
  ```
555
- /cherry-pick AB#1234 AB#1235 AB#1236 production
583
+ /cherry-pick AB#1234 AB#1235 AB#1236 prod
556
584
  ```
557
585
  This cherry-picks just those 3 work items without creating a formal release.
558
586
 
559
587
  ### Promoting Without a Release
560
588
 
561
- To promote **all** code from one environment to the next (no cherry-picking):
589
+ To promote **all** code from one branch to the next (no cherry-picking):
562
590
 
563
591
  ```
564
- /promote staging production
592
+ /promote main dev
593
+ /promote staging prod
565
594
  ```
566
595
 
567
- This creates a PR from `staging` → production branch containing everything. Use this when all staging code is ready for production.
596
+ This creates a PR from the source branch to the next one in the chain containing everything. `main → dev` is the everyday first hop; `staging → prod` is for when everything on staging is approved.
568
597
 
569
598
  You can also auto-detect the next environment:
570
599
  ```
571
600
  /promote
572
601
  ```
573
- If you're on the `staging` branch, it auto-detects `staging → production`.
602
+ If you're on `main`, it auto-detects `main → dev`; on `staging`, `staging → prod`.
574
603
 
575
604
  ### Hot Fix Workflow
576
605
 
@@ -578,7 +607,7 @@ For critical production issues:
578
607
 
579
608
  1. Switch to the production branch:
580
609
  ```
581
- git checkout main
610
+ git checkout prod
582
611
  ```
583
612
  2. Run `/implement` with the Hot Fix work item:
584
613
  ```
@@ -587,7 +616,8 @@ For critical production issues:
587
616
  3. Claude creates a `hotfix/AB#9999-fix-crash-on-submit` branch
588
617
  4. Automated checks still run (build, lint, tests, review)
589
618
  5. **Manual UAT is skipped** — you get an abbreviated confirmation instead
590
- 6. PR targets the production branch directly with a `hotfix` label
619
+ 6. PR targets `prod` directly with a `hotfix` label — merging it deploys straight to production
620
+ 7. Then bring the fix back to `main` (a second PR from the same branch, or `/cherry-pick AB#9999 main`) so the next `main → dev` promotion doesn't overwrite it
591
621
 
592
622
  ### Rollback a Deployment
593
623
 
@@ -595,7 +625,7 @@ If a deployment causes issues:
595
625
 
596
626
  **Revert specific work items:**
597
627
  ```
598
- /rollback AB#1234 production
628
+ /rollback AB#1234 prod
599
629
  ```
600
630
 
601
631
  **Revert the most recent deployment:**
@@ -605,12 +635,12 @@ If a deployment causes issues:
605
635
 
606
636
  Claude will:
607
637
  1. Find the commits to revert
608
- 2. Create a revert branch (e.g., `revert/2026-03-21-on-production`)
638
+ 2. Create a revert branch (e.g., `revert/2026-09-06-on-prod`)
609
639
  3. Run `git revert` on each commit
610
640
  4. Run pre-flight checks on the reverted code
611
641
  5. Create a PR targeting the environment branch
612
642
 
613
- Merge the PR to deploy the rollback.
643
+ Merge the PR to deploy the rollback. Work item states are left alone — Claude tells you which items were reverted so you can decide. If the reverted commits are also on `main`, the next promotion brings them back unless the revert is applied there too.
614
644
 
615
645
  ### Code Review
616
646
 
@@ -639,14 +669,14 @@ Claude reviews for:
639
669
  | `/deep-review` | `/deep-review 142` | Deep, Ultracode-orchestrated review: checks out the branch, builds/tests it, verifies every requirement, checks for regressions, flags out-of-scope changes, then comments + votes |
640
670
  | `/resolve-feedback` | `/resolve-feedback 142` | Address unresolved PR comment threads, push fixes, reply + resolve threads |
641
671
  | `/fix-review` | `/fix-review 142` | Fix everything flagged on a PR — human reviewer comments and automated `/review` findings alike: implement in severity order, validate, push, resolve threads |
642
- | `/deploy` | `/deploy "message"` | Commit, push, trigger pipeline if on environment branch |
672
+ | `/deploy` | `/deploy "message"` | Commit, push, trigger pipeline if on an environment branch (`dev`/`test`/`staging`/`prod`) — never on `main` |
643
673
  | `/create-release` | `/create-release 23` | Group work items into Release #23 iteration with tags |
644
- | `/deploy-release` | `/deploy-release 23 staging` | Cherry-pick release work items to environment via PR |
674
+ | `/deploy-release` | `/deploy-release 23 staging` | Gate-check → cherry-pick release work items to environment via PR → advance states after `merged` |
645
675
  | `/add-to-release` | `/add-to-release 24 AB#4599` | Add work items to an existing release |
646
- | `/cherry-pick` | `/cherry-pick AB#1234 AB#1235 production` | Cherry-pick specific work items to environment via PR |
647
- | `/promote` | `/promote staging production` | PR to promote all code between environments |
648
- | `/rollback` | `/rollback AB#1234 production` | Revert specific commits on an environment via PR |
649
- | `/status` | `/status release 24` | Check status of a release, pipeline, work item, or environment |
676
+ | `/cherry-pick` | `/cherry-pick AB#1234 AB#1235 prod` | Gate-check → cherry-pick specific work items to environment via PR → advance states after `merged` |
677
+ | `/promote` | `/promote main dev` | PR to promote all code to the next branch in the chain (`main → dev → test → staging → prod`) → advance states after `merged` |
678
+ | `/rollback` | `/rollback AB#1234 prod` | Revert specific commits on an environment via PR |
679
+ | `/status` | `/status release 24` | Check status of a release, pipeline, work item, or environment; flags work items whose state lags their environment |
650
680
  | `/plan-backlog` | `/plan-backlog [project]` | Sweep backlog for Dev Ready stories with points and no tasks → propose one child task with hours per story |
651
681
  | `/plan-sprint` | `/plan-sprint [project]` | Sweep the current sprint for stories/bugs with no child tasks → propose one child task with hours per item |
652
682
  | `/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). Also audits the drop-out queue — tagged bugs and stories bounced to Design Review — for items whose creator answered but which nobody returned to the sweep |
@@ -725,7 +755,7 @@ Claude maintains persistent memory across sessions in `~/.claude/projects/.../me
725
755
  | Memory Type | Purpose | Example |
726
756
  |-------------|---------|---------|
727
757
  | **user** | Who you are, preferences, expertise | "Senior .NET dev, prefers terse responses" |
728
- | **feedback** | What to do / avoid (self-improving) | "Always push to both main and develop" |
758
+ | **feedback** | What to do / avoid (self-improving) | "Never enable 'Complete associated work items' when merging a PR" |
729
759
  | **project** | Decisions, priorities, blockers | "Using Stripe instead of Dwolla because..." |
730
760
  | **reference** | URLs, credentials, external resources | "Staging URL: https://..." |
731
761
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chris1807/claude-kit",
3
- "version": "2.1.53",
3
+ "version": "2.1.55",
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": {
@@ -23,8 +23,8 @@ You deploy code changes to Azure environments. Follow the standard sequence for
23
23
 
24
24
  | File family | Parallel files to check |
25
25
  |-------------|------------------------|
26
- | `appsettings.json` | `appsettings.Development.json`, `appsettings.Staging.json`, `appsettings.QA.json`, `appsettings.Production.json` |
27
- | `.env` | `.env.development`, `.env.staging`, `.env.qa`, `.env.production`, `.env.local`, `.env.example` |
26
+ | `appsettings.json` | `appsettings.Development.json`, `appsettings.Test.json`, `appsettings.QA.json`, `appsettings.Staging.json`, `appsettings.Production.json` |
27
+ | `.env` | `.env.development`, `.env.test`, `.env.qa`, `.env.staging`, `.env.production`, `.env.local`, `.env.example` |
28
28
 
29
29
  Present a (key × environment) table to the user. For any missing cell, prompt the user to supply a value (real, placeholder, or empty) before pushing, or to confirm the omission is intentional because the key is wired through a pipeline variable group, Key Vault, or App Configuration for that environment. Do NOT push until every missing entry is either filled in or explicitly skipped by the user.
30
30
 
@@ -47,10 +47,11 @@ Push only the current branch. Do NOT cross-push to other branches — deployment
47
47
 
48
48
  ### Step 4: Trigger Pipeline (Conditional)
49
49
 
50
- Only trigger the CD pipeline if you are pushing directly to an environment branch (the branch a CD pipeline watches). Check the project's CLAUDE.md or pipeline configuration for which branches map to which environments.
50
+ Only trigger the CD pipeline if you are pushing directly to an environment branch (the branch a CD pipeline watches). Check the project's CLAUDE.md **Pipeline Configuration** table for which branches map to which environments. The standard layout is `main` (compare branch — **no pipeline, merging into it deploys nothing**) followed by the environment branches `dev → test → staging → prod`, each deploying when a PR merges into it.
51
51
 
52
- - **On an environment branch** (e.g., `develop`, `staging`, `main`): Trigger the appropriate CD pipeline using the Azure DevOps MCP server.
53
- - **On a feature/hotfix/bugfix/story/work branch**: Do NOT trigger the pipeline. It will trigger automatically when the PR is merged into the target branch.
52
+ - **On an environment branch** (`dev`, `test`, `staging`, `prod` — a row with pipeline IDs): Trigger the listed CD pipeline(s) using the Azure DevOps MCP server.
53
+ - **On `main`**: Do NOT trigger anything. Report that the change will deploy when `main` is promoted to `dev`.
54
+ - **On a feature/hotfix/bugfix/story/work branch**: Do NOT trigger the pipeline. The work deploys when it is promoted after the PR merges into `main`.
54
55
 
55
56
  ### Step 5: Monitor
56
57
 
@@ -69,9 +70,10 @@ These operations are performed when the user explicitly requests promotions, che
69
70
 
70
71
  When asked to promote code from one environment to the next:
71
72
 
72
- 1. Create a PR from the source branch to the target branch (e.g., `develop` → `staging`, or `staging` → `main`)
73
- 2. Include a summary of all changes being promoted
73
+ 1. Create a PR from the source branch to the next branch in the chain (`main` → `dev`, `dev` → `test`, `test` → `staging`, `staging` → `prod`)
74
+ 2. Include a summary of all changes being promoted and the work items they carry
74
75
  3. After PR is merged, the CD pipeline for the target environment triggers automatically
76
+ 4. Once the user confirms the merge, advance the carried User Stories / Bugs / Hot Fixes to the environment's state (`dev` → `Ready for Testing`, `test` → `Testing`, `staging` → `Staging`, `prod` → `Deployed`) — never backward, never a Feature or Task. The `/promote` command documents the full gate-check and state rules
75
77
 
76
78
  ### Deploy Release
77
79
 
@@ -86,6 +88,7 @@ When asked to deploy a release (e.g., "deploy release #23 to staging"):
86
88
  7. Push the release branch and create a PR to the target environment branch
87
89
  8. Link all work items to the PR
88
90
  9. After merge, the CD pipeline triggers automatically
91
+ 10. Once the user confirms the merge, advance the carried work items to the environment's state (see Promote to Environment, item 4)
89
92
 
90
93
  ### Cherry-Pick Deployment (Ad-Hoc)
91
94
 
@@ -97,6 +100,7 @@ When asked to deploy specific stories/commits outside of a formal release:
97
100
  4. If conflicts arise, STOP and report them — do not resolve automatically
98
101
  5. Push the cherry-pick branch and create a PR to the target environment branch
99
102
  6. After merge, the CD pipeline triggers automatically
103
+ 7. Once the user confirms the merge, advance the carried work items to the environment's state (see Promote to Environment, item 4)
100
104
 
101
105
  ### Rollback
102
106
 
@@ -108,6 +112,8 @@ When asked to roll back a deployment:
108
112
  4. Run pre-flight checks (Step 1) on the reverted code
109
113
  5. Push and create a PR to the environment branch
110
114
  6. For production rollbacks, treat as urgent — flag to the user immediately
115
+ 7. Do not change work item states on a rollback — tell the user which items were reverted and let them decide
116
+ 8. If the reverted commits are also on `main`, warn that the next promotion brings them back unless the revert is applied to `main` too
111
117
 
112
118
  ---
113
119
 
@@ -2,35 +2,47 @@ Cherry-pick specific work items to an environment. Usage: `/cherry-pick <work-it
2
2
 
3
3
  Parse `$ARGUMENTS` to extract:
4
4
  - **Work item IDs**: one or more IDs (e.g., "AB#1234 AB#1235" or "1234, 1235")
5
- - **Target environment**: the environment to deploy to (e.g., "staging", "production")
5
+ - **Target environment**: the environment to deploy to (`dev`, `test`, `staging`, `prod`/`production`) or its branch. `main` is also a valid target — that is how a hot fix that went straight to `prod` gets brought back into the compare branch.
6
6
 
7
- ## Step 1: Read the Work Items
7
+ ## Environment ↔ State Reference
8
8
 
9
- Fetch each work item from Azure DevOps via MCP. Present the list:
9
+ Resolve branch names from the project's `CLAUDE.md` **Pipeline Configuration** table — never hardcode them. The first row is the compare branch (`main`; **merging into it deploys nothing**); the rows below are the environment branches in promotion order, and a PR merging into one of them triggers its pipeline:
10
+
11
+ | Branch | Environment | Gate — items should already be in… | State set after the PR merges |
12
+ |---|---|---|---|
13
+ | `main` | — (compare branch) | — | *(no change)* |
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**.
20
+
21
+ ## Step 1: Read the Work Items and Gate-Check Them
22
+
23
+ Fetch each work item from Azure DevOps via MCP. Compare each one's `System.State` with the target's gate and annotate anything behind it (QA or a stakeholder hasn't signed off) or ahead of it (already been through this environment). Features and Tasks are listed but not gate-checked.
10
24
 
11
25
  ```
12
26
  ## Cherry-Pick to {environment}
13
27
 
14
- | ID | Type | Title | State |
15
- |----|------|-------|-------|
16
- | AB#1234 | User Story | Add payment export | Ready for Testing |
17
- | AB#1235 | Bug | Fix login redirect | Ready for Testing |
28
+ | ID | Type | Title | State | Gate ({gate state}) |
29
+ |----|------|-------|-------|---------------------|
30
+ | AB#1234 | User Story | Add payment export | Ready to Deploy | ✓ |
31
+ | AB#1235 | Bug | Fix login redirect | Staging | ⚠ behind — stakeholders haven't set Ready to Deploy |
18
32
 
19
- Cherry-pick {count} work items to {environment}? (yes/no)
33
+ Cherry-pick {count} work items to {environment}? Items behind the gate: include / drop / cancel
20
34
  ```
21
35
 
22
- Wait for confirmation.
36
+ Wait for confirmation. `drop` removes flagged items from this cherry-pick only.
23
37
 
24
38
  ## Step 2: Find Commits
25
39
 
26
- For each work item, find associated commits using `repo_search_commits` with `includeWorkItems: true`, or by searching for `AB#{id}` in commit messages on the source branch.
40
+ For each work item, find associated commits using `repo_search_commits` with `includeWorkItems: true`, or by searching for `AB#{id}` in commit messages on the source branch (the environment one step before the target — e.g. `staging` when targeting `prod`, `main` when targeting `dev`).
27
41
 
28
42
  If no commits are found for a work item, STOP and report which work item has no associated commits.
29
43
 
30
44
  ## Step 3: Create Cherry-Pick Branch
31
45
 
32
- Determine the target environment branch. Do NOT hardcode branch names — check the project's CLAUDE.md or pipeline configuration.
33
-
34
46
  ```bash
35
47
  git checkout <target-environment-branch>
36
48
  git pull origin <target-environment-branch>
@@ -61,7 +73,7 @@ Options:
61
73
  Which option? (1 / 2 / 3)
62
74
  ```
63
75
 
64
- - **Option 1:** Run `git cherry-pick --skip` and continue with remaining work items. Note the skipped item in the summary.
76
+ - **Option 1:** Run `git cherry-pick --skip` and continue with remaining work items. Note the skipped item in the summary — it does **not** get its state advanced in Step 7.
65
77
  - **Option 2:** Run `git cherry-pick --abort`, delete the cherry-pick branch, and switch back to the original branch.
66
78
  - **Option 3:** Wait for the user to resolve conflicts and run `git cherry-pick --continue`, then proceed.
67
79
 
@@ -82,7 +94,7 @@ Cherry-picking:
82
94
  - **description**: List all work items with IDs and titles
83
95
  3. Link all work items to the PR via `wit_link_work_item_to_pull_request`
84
96
 
85
- ## Step 6: Present Summary
97
+ ## Step 6: Present Summary and Wait for the Merge
86
98
 
87
99
  ```
88
100
  Cherry-pick PR created for {environment}.
@@ -92,5 +104,22 @@ Work items:
92
104
  - AB#1234: Add payment export
93
105
  - AB#1235: Fix login redirect
94
106
 
95
- Merge the PR to trigger the CD pipeline for {environment}.
107
+ Merging the PR triggers the CD pipeline for {environment}.
108
+ Reply `merged` once the PR is complete and the pipeline is green — I'll move these {count} work items to `{state after merge}`. (Or `skip`.)
96
109
  ```
110
+
111
+ When the target is `main`, there is no pipeline and no state change — say so and stop here.
112
+
113
+ ## Step 7: Advance Work Item States (after `merged`)
114
+
115
+ When the user replies `merged`:
116
+
117
+ 1. **Confirm the PR is actually completed** via the Azure DevOps MCP. If it isn't, say so and wait.
118
+ 2. For every cherry-picked work item of type **User Story**, **Bug**, or **Hot Fix**, set `System.State` to the target's state (`Ready for Testing` / `Testing` / `Staging` / `Deployed`) via `wit_update_work_item`.
119
+ - **Never move backward** — an item already past the target state keeps it; note it.
120
+ - **Never touch a Feature or Task.**
121
+ - Skipped (conflict) or dropped items are not on the branch — leave them alone.
122
+ - An invalid-state error means this project's template differs — confirm with `get_type`, report the item, continue. Don't silently swallow it.
123
+ 3. Report a `Was → Now` table per item and the next human step.
124
+
125
+ If the user replies `skip`, leave the states alone and note that `/status` will flag the lag later.
@@ -12,9 +12,9 @@ git branch -r --merged
12
12
  ```
13
13
 
14
14
  Exclude protected branches — never delete these:
15
- - `main`, `master`, `develop`, `development`
16
- - `staging`, `Staging`
17
- - `Dev`, `QA`
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-03-18 | develop |
37
- | bugfix/AB#4589-login-plus-sign | 2026-03-19 | develop |
38
- | release/24-to-staging | 2026-03-21 | staging |
39
- | cherry-pick/2026-03-22-to-production | 2026-03-22 | main |
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, develop, staging
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-03-22-to-production (remote only)
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
- To deploy this release to staging: /deploy-release {N} staging
64
- To deploy this release to production: /deploy-release {N} production
63
+ Deploy it one environment at a time — each merge deploys, and the command advances the work items' states after you confirm the merge:
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
  ```