@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
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
|
|
213
|
-
│ │ ├── promote.md # /promote
|
|
214
|
-
│ │ ├── rollback.md # /rollback AB#1234
|
|
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,37 @@ 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. Asks who verifies each product group on Staging (`COM`, `PAY`, …) — candidates are the non-developer names already on those work items
|
|
333
|
+
6. Watches the PR and the Staging pipeline; once it's green, moves the work items to `Staging` and assigns them to the approved verifiers
|
|
334
|
+
|
|
335
|
+
The same command walks a release through `test` → `staging` → `prod`; with no environment given it picks the next one.
|
|
332
336
|
|
|
333
337
|
### Cherry-Pick Work Items
|
|
334
338
|
|
|
335
339
|
```
|
|
336
|
-
/cherry-pick AB#1234 AB#1235
|
|
340
|
+
/cherry-pick AB#1234 AB#1235 prod
|
|
337
341
|
```
|
|
338
342
|
|
|
339
|
-
Cherry-picks specific work items to an environment without a formal release.
|
|
343
|
+
Cherry-picks specific work items to an environment without a formal release. Same gate check, same verifier question, and the same automatic state advance + assignment once the pipeline is green 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
344
|
|
|
341
345
|
### Promote an Environment
|
|
342
346
|
|
|
343
347
|
```
|
|
344
|
-
/promote
|
|
348
|
+
/promote main dev
|
|
349
|
+
/promote staging prod
|
|
350
|
+
/promote ← auto-detects from the current branch
|
|
345
351
|
```
|
|
346
352
|
|
|
347
|
-
Creates a PR to promote all code from
|
|
353
|
+
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, asks who verifies each product group, and advances and assigns them once the merge's pipeline is green. `main → dev` is the usual first hop after feature PRs merge — nothing has deployed before that.
|
|
348
354
|
|
|
349
355
|
### Rollback a Deployment
|
|
350
356
|
|
|
351
357
|
```
|
|
352
|
-
/rollback AB#1234
|
|
358
|
+
/rollback AB#1234 prod
|
|
353
359
|
/rollback last staging
|
|
354
360
|
```
|
|
355
361
|
|
|
@@ -411,15 +417,30 @@ Finds and deletes branches that have been fully merged. Protects environment bra
|
|
|
411
417
|
|
|
412
418
|
### Target State (All Projects)
|
|
413
419
|
|
|
414
|
-
|
|
420
|
+
`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:
|
|
421
|
+
|
|
422
|
+
| Branch | Environment | Deploys When |
|
|
423
|
+
|--------|-------------|-------------|
|
|
424
|
+
| `main` | — (compare / integration) | **Never** — a PR merging into `main` does not deploy |
|
|
425
|
+
| `dev` | Development | PR merged into `dev` |
|
|
426
|
+
| `test` | Test (QA) | PR merged into `test` |
|
|
427
|
+
| `staging` | Staging | PR merged into `staging` |
|
|
428
|
+
| `prod` | Production | PR merged into `prod` |
|
|
429
|
+
|
|
430
|
+
> **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.
|
|
431
|
+
|
|
432
|
+
### Work Item States Follow the Environments
|
|
433
|
+
|
|
434
|
+
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
435
|
|
|
416
|
-
|
|
|
417
|
-
|
|
418
|
-
| `
|
|
419
|
-
| `
|
|
420
|
-
| `
|
|
436
|
+
| Promotion | Gate (item should already be…) | State after the PR merges |
|
|
437
|
+
|-----------|-------------------------------|---------------------------|
|
|
438
|
+
| `main → dev` | `Code Review` | `Ready for Testing` |
|
|
439
|
+
| `dev → test` | `Ready for Testing` | `Testing` |
|
|
440
|
+
| `test → staging` | `Ready for Staging` (QA sign-off) | `Staging` |
|
|
441
|
+
| `staging → prod` | `Ready to Deploy` (stakeholder sign-off) | `Deployed` |
|
|
421
442
|
|
|
422
|
-
|
|
443
|
+
`/deploy-release`, `/cherry-pick`, and `/promote` check the gate before creating the PR, ask who verifies each product group while the PR is in review, then watch the PR and the environment's CD pipeline — on a green pipeline they set the state and the assignee together. A failed pipeline changes nothing. `/status` flags anything whose state lags the branch it's on.
|
|
423
444
|
|
|
424
445
|
### Branch Naming
|
|
425
446
|
|
|
@@ -439,11 +460,12 @@ The branch is always created off the **current branch** — no assumptions are m
|
|
|
439
460
|
|
|
440
461
|
### Code Promotion Flow
|
|
441
462
|
|
|
442
|
-
Code flows through environments via PRs, never by direct push:
|
|
463
|
+
Code flows through environments via PRs, never by direct push. Every merge **after** `main` deploys:
|
|
443
464
|
|
|
444
465
|
```
|
|
445
|
-
feature/AB#1234-... ──PR──▸
|
|
446
|
-
(work branch)
|
|
466
|
+
feature/AB#1234-... ──PR──▸ main ──PR──▸ dev ──PR──▸ test ──PR──▸ staging ──PR──▸ prod
|
|
467
|
+
(work branch) (compare, (Dev) (Test) (Staging) (Production)
|
|
468
|
+
no deploy)
|
|
447
469
|
```
|
|
448
470
|
|
|
449
471
|
---
|
|
@@ -462,8 +484,8 @@ claude
|
|
|
462
484
|
```
|
|
463
485
|
|
|
464
486
|
```
|
|
465
|
-
#
|
|
466
|
-
git checkout
|
|
487
|
+
# Start from the compare branch
|
|
488
|
+
git checkout main
|
|
467
489
|
|
|
468
490
|
# Implement the work item
|
|
469
491
|
/implement AB#1234
|
|
@@ -478,9 +500,15 @@ Claude will:
|
|
|
478
500
|
6. Implement using backend and/or frontend agents
|
|
479
501
|
7. Run all quality checks (build, lint, tests, review)
|
|
480
502
|
8. Generate a UAT checklist and **pause for you to manually test**
|
|
481
|
-
9. After you confirm "testing passed", create a PR targeting `
|
|
503
|
+
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
504
|
|
|
483
|
-
The PR merges into `
|
|
505
|
+
The PR merges into `main`. **That merge deploys nothing** — `main` is the compare branch. The work reaches Dev when `main` is promoted:
|
|
506
|
+
|
|
507
|
+
```
|
|
508
|
+
/promote main dev
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
Merge that PR. Claude asks who verifies each product group on Dev, watches the Dev pipeline, and once it's green moves the work items to `Ready for Testing` and assigns them to those people.
|
|
484
512
|
|
|
485
513
|
### Step 2: Deploy Changes (Quick Commits)
|
|
486
514
|
|
|
@@ -490,11 +518,11 @@ For smaller changes that don't need the full `/implement` workflow:
|
|
|
490
518
|
/deploy "Fix typo in dashboard header"
|
|
491
519
|
```
|
|
492
520
|
|
|
493
|
-
This commits, pushes, and triggers the pipeline if you're on an environment branch.
|
|
521
|
+
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
522
|
|
|
495
523
|
### Step 3: Group Work Items into a Release
|
|
496
524
|
|
|
497
|
-
Once multiple work items are merged to `
|
|
525
|
+
Once multiple work items are merged to `main` and smoke-tested on Dev, group them into a release:
|
|
498
526
|
|
|
499
527
|
```
|
|
500
528
|
/create-release 23
|
|
@@ -508,23 +536,25 @@ Claude will:
|
|
|
508
536
|
2. Show you the list and ask for confirmation
|
|
509
537
|
3. Create a `Release #23` iteration in Azure DevOps
|
|
510
538
|
4. Assign all work items to the iteration and tag them with `release-23`
|
|
511
|
-
5. Tell you how to deploy: `/deploy-release 23
|
|
539
|
+
5. Tell you how to deploy: `/deploy-release 23 test`, then `staging`, then `prod`
|
|
512
540
|
|
|
513
|
-
### Step 4: Deploy a Release to Staging
|
|
541
|
+
### Step 4: Deploy a Release to Test, then Staging
|
|
514
542
|
|
|
515
543
|
```
|
|
516
|
-
/deploy-release 23
|
|
544
|
+
/deploy-release 23 test
|
|
517
545
|
```
|
|
518
546
|
|
|
519
547
|
Claude will:
|
|
520
|
-
1. Find all work items tagged `release-23`
|
|
521
|
-
2. Find their associated commits on
|
|
522
|
-
3. Create a release branch: `release/23-to-
|
|
548
|
+
1. Find all work items tagged `release-23` and check each is at the gate for Test (`Ready for Testing`)
|
|
549
|
+
2. Find their associated commits on `dev`
|
|
550
|
+
3. Create a release branch: `release/23-to-test`
|
|
523
551
|
4. Cherry-pick all commits for each work item
|
|
524
|
-
5. Create a PR from `release/23-to-
|
|
552
|
+
5. Create a PR from `release/23-to-test` → `test`
|
|
525
553
|
6. Link all work items to the PR
|
|
554
|
+
7. Ask who verifies each product group on Test
|
|
555
|
+
8. Watch the PR and the Test pipeline; on a green pipeline, move the work items to `Testing` and assign them to the approved verifiers
|
|
526
556
|
|
|
527
|
-
After the PR is reviewed and merged, the
|
|
557
|
+
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
558
|
|
|
529
559
|
### Step 5: Test on Staging
|
|
530
560
|
|
|
@@ -532,45 +562,46 @@ QA and stakeholders test on the Staging environment. If issues are found, fix th
|
|
|
532
562
|
|
|
533
563
|
### Step 6: Deploy a Release to Production
|
|
534
564
|
|
|
535
|
-
When
|
|
565
|
+
When stakeholders have verified on Staging and set the items to `Ready to Deploy`:
|
|
536
566
|
|
|
537
567
|
```
|
|
538
|
-
/deploy-release 23
|
|
568
|
+
/deploy-release 23 prod
|
|
539
569
|
```
|
|
540
570
|
|
|
541
|
-
Same process — cherry-picks
|
|
571
|
+
Same process — gate `Ready to Deploy`, cherry-picks from `staging` into a PR targeting `prod`. After merge the Production CD pipeline triggers; when it comes back green the items move to `Deployed` and are assigned to whoever you named for each product group.
|
|
542
572
|
|
|
543
573
|
### Selective Deployment
|
|
544
574
|
|
|
545
|
-
If staging has 5 user stories but only 3 are
|
|
575
|
+
If staging has 5 user stories but only 3 are `Ready to Deploy`:
|
|
546
576
|
|
|
547
577
|
**Option A: Create a smaller release**
|
|
548
578
|
```
|
|
549
579
|
/create-release 24
|
|
550
580
|
```
|
|
551
|
-
Include only the 3 ready stories, then `/deploy-release 24
|
|
581
|
+
Include only the 3 ready stories, then `/deploy-release 24 prod`.
|
|
552
582
|
|
|
553
583
|
**Option B: Cherry-pick specific items**
|
|
554
584
|
```
|
|
555
|
-
/cherry-pick AB#1234 AB#1235 AB#1236
|
|
585
|
+
/cherry-pick AB#1234 AB#1235 AB#1236 prod
|
|
556
586
|
```
|
|
557
587
|
This cherry-picks just those 3 work items without creating a formal release.
|
|
558
588
|
|
|
559
589
|
### Promoting Without a Release
|
|
560
590
|
|
|
561
|
-
To promote **all** code from one
|
|
591
|
+
To promote **all** code from one branch to the next (no cherry-picking):
|
|
562
592
|
|
|
563
593
|
```
|
|
564
|
-
/promote
|
|
594
|
+
/promote main dev
|
|
595
|
+
/promote staging prod
|
|
565
596
|
```
|
|
566
597
|
|
|
567
|
-
This creates a PR from
|
|
598
|
+
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
599
|
|
|
569
600
|
You can also auto-detect the next environment:
|
|
570
601
|
```
|
|
571
602
|
/promote
|
|
572
603
|
```
|
|
573
|
-
If you're on
|
|
604
|
+
If you're on `main`, it auto-detects `main → dev`; on `staging`, `staging → prod`.
|
|
574
605
|
|
|
575
606
|
### Hot Fix Workflow
|
|
576
607
|
|
|
@@ -578,7 +609,7 @@ For critical production issues:
|
|
|
578
609
|
|
|
579
610
|
1. Switch to the production branch:
|
|
580
611
|
```
|
|
581
|
-
git checkout
|
|
612
|
+
git checkout prod
|
|
582
613
|
```
|
|
583
614
|
2. Run `/implement` with the Hot Fix work item:
|
|
584
615
|
```
|
|
@@ -587,7 +618,8 @@ For critical production issues:
|
|
|
587
618
|
3. Claude creates a `hotfix/AB#9999-fix-crash-on-submit` branch
|
|
588
619
|
4. Automated checks still run (build, lint, tests, review)
|
|
589
620
|
5. **Manual UAT is skipped** — you get an abbreviated confirmation instead
|
|
590
|
-
6. PR targets
|
|
621
|
+
6. PR targets `prod` directly with a `hotfix` label — merging it deploys straight to production
|
|
622
|
+
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
623
|
|
|
592
624
|
### Rollback a Deployment
|
|
593
625
|
|
|
@@ -595,7 +627,7 @@ If a deployment causes issues:
|
|
|
595
627
|
|
|
596
628
|
**Revert specific work items:**
|
|
597
629
|
```
|
|
598
|
-
/rollback AB#1234
|
|
630
|
+
/rollback AB#1234 prod
|
|
599
631
|
```
|
|
600
632
|
|
|
601
633
|
**Revert the most recent deployment:**
|
|
@@ -605,12 +637,12 @@ If a deployment causes issues:
|
|
|
605
637
|
|
|
606
638
|
Claude will:
|
|
607
639
|
1. Find the commits to revert
|
|
608
|
-
2. Create a revert branch (e.g., `revert/2026-
|
|
640
|
+
2. Create a revert branch (e.g., `revert/2026-09-06-on-prod`)
|
|
609
641
|
3. Run `git revert` on each commit
|
|
610
642
|
4. Run pre-flight checks on the reverted code
|
|
611
643
|
5. Create a PR targeting the environment branch
|
|
612
644
|
|
|
613
|
-
Merge the PR to deploy the rollback.
|
|
645
|
+
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
646
|
|
|
615
647
|
### Code Review
|
|
616
648
|
|
|
@@ -639,14 +671,14 @@ Claude reviews for:
|
|
|
639
671
|
| `/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
672
|
| `/resolve-feedback` | `/resolve-feedback 142` | Address unresolved PR comment threads, push fixes, reply + resolve threads |
|
|
641
673
|
| `/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 |
|
|
674
|
+
| `/deploy` | `/deploy "message"` | Commit, push, trigger pipeline if on an environment branch (`dev`/`test`/`staging`/`prod`) — never on `main` |
|
|
643
675
|
| `/create-release` | `/create-release 23` | Group work items into Release #23 iteration with tags |
|
|
644
|
-
| `/deploy-release` | `/deploy-release 23 staging` |
|
|
676
|
+
| `/deploy-release` | `/deploy-release 23 staging` | Gate-check → cherry-pick release work items to environment via PR → ask who verifies → advance + assign on a green pipeline |
|
|
645
677
|
| `/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
|
|
647
|
-
| `/promote` | `/promote
|
|
648
|
-
| `/rollback` | `/rollback AB#1234
|
|
649
|
-
| `/status` | `/status release 24` | Check status of a release, pipeline, work item, or environment |
|
|
678
|
+
| `/cherry-pick` | `/cherry-pick AB#1234 AB#1235 prod` | Gate-check → cherry-pick specific work items to environment via PR → ask who verifies → advance + assign on a green pipeline |
|
|
679
|
+
| `/promote` | `/promote main dev` | PR to promote all code to the next branch in the chain (`main → dev → test → staging → prod`) → ask who verifies → advance + assign on a green pipeline |
|
|
680
|
+
| `/rollback` | `/rollback AB#1234 prod` | Revert specific commits on an environment via PR |
|
|
681
|
+
| `/status` | `/status release 24` | Check status of a release, pipeline, work item, or environment; flags work items whose state lags their environment |
|
|
650
682
|
| `/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
683
|
| `/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
684
|
| `/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 +757,7 @@ Claude maintains persistent memory across sessions in `~/.claude/projects/.../me
|
|
|
725
757
|
| Memory Type | Purpose | Example |
|
|
726
758
|
|-------------|---------|---------|
|
|
727
759
|
| **user** | Who you are, preferences, expertise | "Senior .NET dev, prefers terse responses" |
|
|
728
|
-
| **feedback** | What to do / avoid (self-improving) | "
|
|
760
|
+
| **feedback** | What to do / avoid (self-improving) | "Never enable 'Complete associated work items' when merging a PR" |
|
|
729
761
|
| **project** | Decisions, priorities, blockers | "Using Stripe instead of Dwolla because..." |
|
|
730
762
|
| **reference** | URLs, credentials, external resources | "Staging URL: https://..." |
|
|
731
763
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chris1807/claude-kit",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.56",
|
|
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.
|
|
27
|
-
| `.env` | `.env.development`, `.env.
|
|
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
|
|
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** (
|
|
53
|
-
- **On
|
|
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
|
|
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 (
|
|
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
|
-
##
|
|
7
|
+
## Environment ↔ State Reference
|
|
8
8
|
|
|
9
|
-
|
|
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
|
|
17
|
-
| AB#1235 | Bug | Fix login redirect | Ready
|
|
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}?
|
|
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 or its assignee changed in Step 8.
|
|
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,15 +94,143 @@ 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:
|
|
97
|
+
## Step 6: Pick Who Verifies Each Group (before the merge)
|
|
98
|
+
|
|
99
|
+
When the target is `main` there is no pipeline, no state change, and **no assignment** — say so and skip to Step 8's summary.
|
|
100
|
+
|
|
101
|
+
Otherwise the items are 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 8 together with the state change, once the pipeline is green.
|
|
102
|
+
|
|
103
|
+
### 6a. Group by title prefix
|
|
104
|
+
|
|
105
|
+
Work item titles in the CSI Development project are `PREFIX - Title` (`COM`, `PAY`, `CDA`, `AUD`, `SER`, `PSSF`, `TPS`, `ILP`, `RBWO`, `MTG`, `CSI`). Group the cherry-picked **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 4) or dropped at the gate (Step 1) are not on the branch — leave them out. Features and Tasks are never assigned by this command.
|
|
106
|
+
|
|
107
|
+
One question per group. Different products usually have different verifiers, but the same person may take several groups — that is the normal case, not an error.
|
|
108
|
+
|
|
109
|
+
### 6b. Build each group's candidate list from the items themselves
|
|
110
|
+
|
|
111
|
+
For every item in the group, collect the distinct identities already on it:
|
|
112
|
+
|
|
113
|
+
- **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.
|
|
114
|
+
- `System.CreatedBy` — who asked for the work
|
|
115
|
+
- comment authors — `wit_work_item` `action: list_comments`
|
|
116
|
+
- `System.ChangedBy` — the most recent editor
|
|
117
|
+
|
|
118
|
+
Then **drop the developers**, so what remains is the non-developer names on the item:
|
|
119
|
+
|
|
120
|
+
- each item's current `System.AssignedTo` (the dev who implemented it)
|
|
121
|
+
- the PR author
|
|
122
|
+
- the authors of the cherry-picked commits — `git log --format='%an <%ae>' <target-branch>..HEAD | sort -u`
|
|
123
|
+
|
|
124
|
+
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.
|
|
125
|
+
|
|
126
|
+
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.
|
|
127
|
+
|
|
128
|
+
### 6c. Ask
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
## Who verifies on {environment}?
|
|
132
|
+
|
|
133
|
+
**COM** — 2 items (AB#1234, AB#1236)
|
|
134
|
+
1. Jane Doe (jane@caresolutions.com) — set Ready to Deploy on both
|
|
135
|
+
2. Sam Lee (sam@caresolutions.com) — commented on AB#1234
|
|
136
|
+
3. Someone else — give me a name or email
|
|
137
|
+
4. Leave the current assignee alone
|
|
138
|
+
|
|
139
|
+
**PAY** — 2 items (AB#1240, AB#1241)
|
|
140
|
+
1. Pat Ruiz (pat@caresolutions.com) — created both
|
|
141
|
+
2. Jane Doe (jane@caresolutions.com) — commented on AB#1240
|
|
142
|
+
3. Someone else
|
|
143
|
+
4. Leave the current assignee alone
|
|
144
|
+
|
|
145
|
+
Reply per group — `COM 1, PAY 1` — or `all 1` to give every group to the same person.
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 6d. Confirm the mapping
|
|
149
|
+
|
|
150
|
+
Echo the resolved plan and wait for an explicit `yes`:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
When the {environment} pipeline goes green I will apply:
|
|
154
|
+
|
|
155
|
+
| ID | Title | Prefix | Assign to | State |
|
|
156
|
+
|----|-------|--------|-----------|-------|
|
|
157
|
+
| AB#1234 | COM - Add payment export | COM | Jane Doe | Deployed |
|
|
158
|
+
| AB#1240 | PAY - Fix login redirect | PAY | Pat Ruiz | Deployed |
|
|
159
|
+
|
|
160
|
+
Approve? (yes / change)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
`change` re-asks 6c. Only after `yes` do you move on — if the PR merges before the user answers, keep waiting for the answer, then run Step 8.
|
|
164
|
+
|
|
165
|
+
## Step 7: Watch the Merge, Then the Pipeline
|
|
166
|
+
|
|
167
|
+
Do NOT merge the PR yourself — a reviewer approves and completes it. Report the PR, then watch for the deployment:
|
|
86
168
|
|
|
87
169
|
```
|
|
88
170
|
Cherry-pick PR created for {environment}.
|
|
89
171
|
|
|
90
172
|
PR: {pr-url}
|
|
91
173
|
Work items:
|
|
92
|
-
- AB#1234: Add payment export
|
|
93
|
-
- AB#
|
|
174
|
+
- AB#1234: COM - Add payment export
|
|
175
|
+
- AB#1240: PAY - Fix login redirect
|
|
94
176
|
|
|
95
|
-
|
|
177
|
+
Merging the PR triggers the CD pipeline for {environment}. I'm watching the PR
|
|
178
|
+
and that pipeline — when it comes back green I'll set these {count} items to
|
|
179
|
+
`{state after merge}` and assign them as approved above. Nothing is written
|
|
180
|
+
until then. Say `stop watching` to leave the states alone.
|
|
96
181
|
```
|
|
182
|
+
|
|
183
|
+
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.
|
|
184
|
+
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.
|
|
185
|
+
3. **Wait for a terminal result** on each run: `succeeded`, `partiallySucceeded`, `failed`, or `canceled`.
|
|
186
|
+
|
|
187
|
+
**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:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# <run-id> is the run identified in step 2 — never "the latest run on the branch",
|
|
191
|
+
# which can be a run queued before the merge and already completed.
|
|
192
|
+
until az pipelines runs show --org <org-url> --project <project> \
|
|
193
|
+
--id <run-id> --query status -o tsv | grep -qx completed; do
|
|
194
|
+
sleep 60
|
|
195
|
+
done
|
|
196
|
+
az pipelines runs show --org <org-url> --project <project> \
|
|
197
|
+
--id <run-id> --query "[buildNumber,status,result]" -o tsv
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
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.
|
|
201
|
+
|
|
202
|
+
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.
|
|
203
|
+
|
|
204
|
+
## Step 8: Assign and Advance States (automatic, on a green pipeline)
|
|
205
|
+
|
|
206
|
+
This step runs **by itself** the moment the pipeline reports success — do not ask again; the approval in Step 6d covers it. All three preconditions must hold: the PR is `completed`, **every** CD run for {environment} is `succeeded`, and a Step 6d mapping was approved.
|
|
207
|
+
|
|
208
|
+
- `partiallySucceeded` → not green. Report which stage failed and ask `proceed` / `hold`.
|
|
209
|
+
- `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.
|
|
210
|
+
- No Step 6d approval yet (user hasn't answered) → do the state changes only when they answer; don't guess an assignee.
|
|
211
|
+
|
|
212
|
+
For every cherry-picked work item of type **User Story**, **Bug**, or **Hot Fix**, one `wit_work_item_write` update per item setting both fields:
|
|
213
|
+
|
|
214
|
+
1. `System.State` → the target's state (`Ready for Testing` / `Testing` / `Staging` / `Deployed`).
|
|
215
|
+
- **Never move backward** — an item already past the target state keeps it; note it.
|
|
216
|
+
- Skipped (conflict) or dropped items are not on the branch — leave them alone.
|
|
217
|
+
- An invalid-state error means this project's template differs — confirm with `get_type`, report the item, continue. Don't silently swallow it.
|
|
218
|
+
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.
|
|
219
|
+
|
|
220
|
+
**Never touch a Feature or Task** — neither state nor assignee.
|
|
221
|
+
|
|
222
|
+
Report both fields, so a wrong assignment is easy to put back:
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
Cherry-pick is deployed to {environment} (pipeline {build-number}, succeeded).
|
|
226
|
+
|
|
227
|
+
| ID | State: was → now | Assignee: was → now |
|
|
228
|
+
|----|------------------|---------------------|
|
|
229
|
+
| AB#1234 | Ready to Deploy → Deployed | Chris Waters → Jane Doe |
|
|
230
|
+
| AB#1240 | Ready to Deploy → Deployed | Chris Waters → Pat Ruiz |
|
|
231
|
+
| AB#1250 | Deployed (unchanged — already ahead) | unchanged |
|
|
232
|
+
|
|
233
|
+
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"}.
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
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` will flag the lag later.
|