@chris1807/claude-kit 2.0.0

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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +821 -0
  3. package/bin/cli.js +521 -0
  4. package/package.json +50 -0
  5. package/templates/agents/global/api-tester.md +75 -0
  6. package/templates/agents/global/azure-ops.md +59 -0
  7. package/templates/agents/global/backend.md +245 -0
  8. package/templates/agents/global/build-validator.md +50 -0
  9. package/templates/agents/global/frontend.md +254 -0
  10. package/templates/agents/global/legacy.md +218 -0
  11. package/templates/agents/global/lint-checker.md +86 -0
  12. package/templates/agents/global/manager.md +138 -0
  13. package/templates/agents/global/mockup.md +95 -0
  14. package/templates/agents/global/reviewer.md +149 -0
  15. package/templates/agents/global/security-auditor.md +74 -0
  16. package/templates/agents/global/test-runner.md +98 -0
  17. package/templates/agents/global/uat-generator.md +107 -0
  18. package/templates/agents/project/db-admin.md +106 -0
  19. package/templates/agents/project/deployer.md +113 -0
  20. package/templates/agents/project/devops-tracker.md +101 -0
  21. package/templates/commands/add-to-release.md +55 -0
  22. package/templates/commands/cherry-pick.md +96 -0
  23. package/templates/commands/cleanup-branches.md +73 -0
  24. package/templates/commands/create-release.md +65 -0
  25. package/templates/commands/deploy-release.md +147 -0
  26. package/templates/commands/deploy.md +65 -0
  27. package/templates/commands/explain.md +49 -0
  28. package/templates/commands/implement.md +170 -0
  29. package/templates/commands/promote.md +71 -0
  30. package/templates/commands/quote.md +39 -0
  31. package/templates/commands/review.md +32 -0
  32. package/templates/commands/rework.md +158 -0
  33. package/templates/commands/rollback.md +106 -0
  34. package/templates/commands/status.md +111 -0
  35. package/templates/hooks/auto-format.sh +46 -0
  36. package/templates/hooks/protected-files.sh +52 -0
  37. package/templates/hooks/secret-blocker.sh +68 -0
  38. package/templates/hooks/self-improve.sh +7 -0
  39. package/templates/hooks/sensitive-data-blocker.sh +43 -0
  40. package/templates/hooks/sensitive-data-mcp-blocker.sh +40 -0
  41. package/templates/hooks/sensitive-data-output-blocker.sh +63 -0
  42. package/templates/hooks/test-on-change.sh +46 -0
  43. package/templates/hooks/uat-reminder.sh +9 -0
  44. package/templates/infrastructure/CLAUDE-WORKFLOW.md +274 -0
  45. package/templates/infrastructure/azure-pipelines-template.yml +199 -0
  46. package/templates/infrastructure/mcp.json +35 -0
  47. package/templates/infrastructure/settings.json +94 -0
@@ -0,0 +1,96 @@
1
+ Cherry-pick specific work items to an environment. Usage: `/cherry-pick <work-item-ids> <environment>`
2
+
3
+ Parse `$ARGUMENTS` to extract:
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")
6
+
7
+ ## Step 1: Read the Work Items
8
+
9
+ Fetch each work item from Azure DevOps via MCP. Present the list:
10
+
11
+ ```
12
+ ## Cherry-Pick to {environment}
13
+
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 |
18
+
19
+ Cherry-pick {count} work items to {environment}? (yes/no)
20
+ ```
21
+
22
+ Wait for confirmation.
23
+
24
+ ## Step 2: Find Commits
25
+
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.
27
+
28
+ If no commits are found for a work item, STOP and report which work item has no associated commits.
29
+
30
+ ## Step 3: Create Cherry-Pick Branch
31
+
32
+ Determine the target environment branch. Do NOT hardcode branch names — check the project's CLAUDE.md or pipeline configuration.
33
+
34
+ ```bash
35
+ git checkout <target-environment-branch>
36
+ git pull origin <target-environment-branch>
37
+ git checkout -b cherry-pick/<date>-to-<environment>
38
+ ```
39
+
40
+ ## Step 4: Cherry-Pick Commits
41
+
42
+ Cherry-pick commits for each work item in chronological order:
43
+
44
+ ```bash
45
+ git cherry-pick <commit-hash>
46
+ ```
47
+
48
+ If conflicts arise, STOP and report them. Do not resolve automatically. Present recovery options:
49
+
50
+ ```
51
+ CONFLICT while cherry-picking AB#1235 (commit def5678)
52
+
53
+ Conflicting files:
54
+ - src/API/Controllers/PaymentController.cs
55
+
56
+ Options:
57
+ 1. Skip this work item and continue with the rest
58
+ 2. Abort the entire cherry-pick and clean up
59
+ 3. I will resolve the conflict manually — wait for me
60
+
61
+ Which option? (1 / 2 / 3)
62
+ ```
63
+
64
+ - **Option 1:** Run `git cherry-pick --skip` and continue with remaining work items. Note the skipped item in the summary.
65
+ - **Option 2:** Run `git cherry-pick --abort`, delete the cherry-pick branch, and switch back to the original branch.
66
+ - **Option 3:** Wait for the user to resolve conflicts and run `git cherry-pick --continue`, then proceed.
67
+
68
+ Track progress:
69
+ ```
70
+ Cherry-picking:
71
+ [x] AB#1234: Add payment export (2 commits)
72
+ [ ] AB#1235: Fix login redirect (1 commit) — CONFLICT
73
+ ```
74
+
75
+ ## Step 5: Push and Create PR
76
+
77
+ 1. Push: `git push -u origin HEAD`
78
+ 2. Create a PR via Azure DevOps MCP:
79
+ - **sourceRefName**: `refs/heads/cherry-pick/<date>-to-<environment>`
80
+ - **targetRefName**: `refs/heads/<target-environment-branch>`
81
+ - **title**: `Cherry-pick AB#1234, AB#1235 → {Environment}`
82
+ - **description**: List all work items with IDs and titles
83
+ 3. Link all work items to the PR via `wit_link_work_item_to_pull_request`
84
+
85
+ ## Step 6: Present Summary
86
+
87
+ ```
88
+ Cherry-pick PR created for {environment}.
89
+
90
+ PR: {pr-url}
91
+ Work items:
92
+ - AB#1234: Add payment export
93
+ - AB#1235: Fix login redirect
94
+
95
+ Merge the PR to trigger the CD pipeline for {environment}.
96
+ ```
@@ -0,0 +1,73 @@
1
+ Clean up merged branches. Usage: `/cleanup-branches [--dry-run]`
2
+
3
+ If `$ARGUMENTS` contains "dry-run" or "--dry-run", only list branches that would be deleted — do not delete them.
4
+
5
+ ## Step 1: Find Merged Branches
6
+
7
+ Find all local and remote branches that have been fully merged into the current branch:
8
+
9
+ ```bash
10
+ git branch --merged
11
+ git branch -r --merged
12
+ ```
13
+
14
+ Exclude protected branches — never delete these:
15
+ - `main`, `master`, `develop`, `development`
16
+ - `staging`, `Staging`
17
+ - `Dev`, `QA`
18
+ - Any branch listed in the project's CLAUDE.md Pipeline Configuration table
19
+
20
+ ## Step 2: Identify Candidates
21
+
22
+ Filter to only feature/work branches that follow our naming conventions or common patterns:
23
+
24
+ - `feature/*`, `story/*`, `bugfix/*`, `hotfix/*`, `work/*`
25
+ - `release/*-to-*`, `cherry-pick/*`, `revert/*`
26
+ - Task branches (e.g., `T3796`, `U3297`)
27
+
28
+ Present the list:
29
+
30
+ ```
31
+ ## Branch Cleanup
32
+
33
+ ### Branches to delete ({count}):
34
+ | Branch | Last Commit | Merged Into |
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 |
40
+
41
+ ### Protected (will NOT be deleted):
42
+ - main, develop, staging
43
+
44
+ Delete {count} merged branches? (yes/no)
45
+ ```
46
+
47
+ If `--dry-run`, show the list but do NOT ask for confirmation and do NOT delete.
48
+
49
+ Wait for confirmation before proceeding.
50
+
51
+ ## Step 3: Delete
52
+
53
+ For each confirmed branch:
54
+
55
+ ```bash
56
+ # Delete local branch
57
+ git branch -d <branch-name>
58
+
59
+ # Delete remote branch
60
+ git push origin --delete <branch-name>
61
+ ```
62
+
63
+ Report results:
64
+
65
+ ```
66
+ Cleaned up {count} branches.
67
+
68
+ Deleted:
69
+ - story/AB#4521-admin-export (local + remote)
70
+ - bugfix/AB#4589-login-plus-sign (local + remote)
71
+ - release/24-to-staging (remote only)
72
+ - cherry-pick/2026-03-22-to-production (remote only)
73
+ ```
@@ -0,0 +1,65 @@
1
+ Create a new release. Follow this workflow:
2
+
3
+ ## Step 1: Determine Release Number
4
+
5
+ Check existing iterations in the project via Azure DevOps MCP (`work_list_iterations`) to find iterations that follow the `Release #N` naming pattern. The new release number is the next sequential number.
6
+
7
+ If `$ARGUMENTS` is provided, use it as the release name (e.g., `$ARGUMENTS` = "24" creates "Release #24").
8
+
9
+ ## Step 2: Gather Work Items for the Release
10
+
11
+ Ask the user which work items to include. They may provide:
12
+ - A list of work item IDs (e.g., "AB#1234, AB#1235, AB#1236")
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")
15
+
16
+ Use the Azure DevOps MCP to search/query for the specified work items. Present the list for confirmation:
17
+
18
+ ```
19
+ ## Release #{N}
20
+
21
+ | ID | Type | Title | State |
22
+ |----|------|-------|-------|
23
+ | AB#1234 | User Story | Add payment export | Ready for Testing |
24
+ | AB#1235 | Bug | Fix login redirect | Ready for Testing |
25
+ | AB#1236 | User Story | View history | Ready for Testing |
26
+
27
+ Create this release with {count} work items? (yes/no)
28
+ ```
29
+
30
+ Wait for confirmation before proceeding.
31
+
32
+ ## Step 3: Create the Release Iteration
33
+
34
+ Create a new iteration in Azure DevOps via `work_create_iterations`:
35
+ - **Name**: `Release #{N}`
36
+ - **Start date**: today
37
+ - No finish date (set when deployed to production)
38
+
39
+ ## Step 4: Assign Work Items to the Release
40
+
41
+ Use `wit_update_work_items_batch` to set the Iteration Path on each work item to the new release iteration:
42
+ - **path**: `/fields/System.IterationPath`
43
+ - **value**: `{project}\Release #{N}`
44
+
45
+ ## Step 5: Tag Work Items
46
+
47
+ Use `wit_update_work_items_batch` to add a release tag to each work item:
48
+ - **path**: `/fields/System.Tags`
49
+ - **value**: append `release-{N}` to existing tags
50
+
51
+ ## Step 6: Confirm
52
+
53
+ Present the final summary:
54
+
55
+ ```
56
+ Release #{N} created with {count} work items.
57
+
58
+ Work items assigned:
59
+ - AB#1234: Add payment export
60
+ - AB#1235: Fix login redirect
61
+ - AB#1236: View history
62
+
63
+ To deploy this release to staging: /deploy-release {N} staging
64
+ To deploy this release to production: /deploy-release {N} production
65
+ ```
@@ -0,0 +1,147 @@
1
+ Deploy release to the next environment. Usage: `/deploy-release <release-number> [environment]`
2
+
3
+ Parse `$ARGUMENTS` to extract:
4
+ - **Release number**: required (e.g., "23" or "#23")
5
+ - **Target environment**: optional — if not provided, auto-detect the next environment in the promotion flow
6
+
7
+ ## Step 1: Read the Release
8
+
9
+ Query Azure DevOps for all work items tagged with `release-{N}` or assigned to the `Release #{N}` iteration using `search_workitem` or `wit_get_work_items_for_iteration`.
10
+
11
+ Present the release contents:
12
+
13
+ ```
14
+ ## Release #{N} — Deploy to {environment}
15
+
16
+ | ID | Type | Title | State | Branch |
17
+ |----|------|-------|-------|--------|
18
+ | AB#1234 | User Story | Add payment export | Ready for Testing | story/AB#1234-add-payment-export |
19
+ | AB#1235 | Bug | Fix login redirect | Ready for Testing | bugfix/AB#1235-fix-login-redirect |
20
+
21
+ {count} work items in this release.
22
+ ```
23
+
24
+ If no work items are found, STOP and report the error.
25
+
26
+ ## Step 2: Determine Target Environment
27
+
28
+ If the user specified an environment, use it. Otherwise, auto-detect by checking which environment the work items are currently in:
29
+
30
+ | Current State | Next Environment |
31
+ |---|---|
32
+ | Work items merged to `develop` | Deploy to **staging** |
33
+ | Work items merged to `staging` | Deploy to **production** |
34
+
35
+ Check which environment branches contain the commits for these work items using `repo_search_commits` with `includeWorkItems: true`.
36
+
37
+ **Validation:** Verify all work items in the release have commits on the same source branch. If they are inconsistent (e.g., AB#1234 is on `develop` but AB#1235 has no commits), present a warning listing which work items are on which branches and ask the user to confirm the target environment explicitly.
38
+
39
+ Confirm with the user:
40
+
41
+ ```
42
+ Deploy Release #{N} ({count} work items) to {environment}?
43
+
44
+ This will:
45
+ 1. Create a release branch: release/{N}-to-{environment}
46
+ 2. Cherry-pick all commits for the {count} work items
47
+ 3. Create a PR targeting the {environment} branch
48
+
49
+ Proceed? (yes/no)
50
+ ```
51
+
52
+ Wait for confirmation.
53
+
54
+ ## Step 3: Create Release Branch
55
+
56
+ Determine the target environment branch. Do NOT hardcode branch names — check the project's CLAUDE.md or use the branch-to-environment mapping:
57
+
58
+ ```bash
59
+ # Switch to the target environment branch and pull latest
60
+ git checkout <target-environment-branch>
61
+ git pull origin <target-environment-branch>
62
+
63
+ # Create the release branch
64
+ git checkout -b release/{N}-to-<environment>
65
+ ```
66
+
67
+ ## Step 4: Cherry-Pick Work Item Commits
68
+
69
+ For each work item in the release:
70
+
71
+ 1. Find the associated commits using `repo_search_commits` with `includeWorkItems: true`, or by searching for `AB#{id}` in commit messages
72
+ 2. Cherry-pick each commit in chronological order:
73
+ ```bash
74
+ git cherry-pick <commit-hash>
75
+ ```
76
+ 3. If conflicts arise, STOP and report them. Do not resolve automatically. Present recovery options:
77
+
78
+ ```
79
+ CONFLICT while cherry-picking AB#1236 (commit ghi9012)
80
+
81
+ Conflicting files:
82
+ - src/API/Controllers/HistoryController.cs
83
+
84
+ Options:
85
+ 1. Skip this work item and continue with the rest
86
+ 2. Abort the entire release deploy and clean up
87
+ 3. I will resolve the conflict manually — wait for me
88
+
89
+ Which option? (1 / 2 / 3)
90
+ ```
91
+
92
+ - **Option 1:** Run `git cherry-pick --skip` and continue. Note the skipped item in the summary.
93
+ - **Option 2:** Run `git cherry-pick --abort`, delete the release branch, switch back. Report which items were NOT deployed.
94
+ - **Option 3:** Wait for the user to resolve and run `git cherry-pick --continue`, then proceed.
95
+
96
+ Track progress as you go:
97
+
98
+ ```
99
+ Cherry-picking commits for Release #{N}:
100
+ [x] AB#1234: Add payment export (3 commits)
101
+ [x] AB#1235: Fix login redirect (1 commit)
102
+ [ ] AB#1236: View history (2 commits) — CONFLICT
103
+ ```
104
+
105
+ ## Step 5: Push and Create PR
106
+
107
+ 1. Push the release branch: `git push -u origin HEAD`
108
+ 2. Create a PR via Azure DevOps MCP:
109
+ - **sourceRefName**: `refs/heads/release/{N}-to-<environment>`
110
+ - **targetRefName**: `refs/heads/<target-environment-branch>`
111
+ - **title**: `Release #{N} → {Environment}`
112
+ - **description**: List all work items included with their IDs and titles
113
+ 3. Link all work items to the PR via `wit_link_work_item_to_pull_request`
114
+
115
+ ## Step 6: Present Summary
116
+
117
+ ```
118
+ Release #{N} PR created for {environment}.
119
+
120
+ PR: {pr-url}
121
+ Branch: release/{N}-to-{environment} → {target-branch}
122
+
123
+ Work items included:
124
+ - AB#1234: Add payment export
125
+ - AB#1235: Fix login redirect
126
+ - AB#1236: View history
127
+
128
+ Next steps:
129
+ - Review and approve the PR
130
+ - Merge triggers the CD pipeline for {environment}
131
+ - Update work item states in Azure DevOps after merge
132
+ ```
133
+
134
+ Do NOT trigger the CD pipeline — it triggers automatically on PR merge.
135
+
136
+ ## Step 7: Notify Team (if Teams MCP is configured)
137
+
138
+ Send a notification to the project's Teams channel via the Microsoft Teams MCP server:
139
+
140
+ ```
141
+ 🚀 Release #{N} PR created for {environment}
142
+ PR: {pr-url}
143
+ Work items: AB#1234, AB#1235, AB#1236
144
+ Awaiting review and merge.
145
+ ```
146
+
147
+ If the Teams MCP server is not configured, skip this step silently.
@@ -0,0 +1,65 @@
1
+ Commit, push, and deploy the current changes. Usage: `/deploy [message]`
2
+
3
+ `$ARGUMENTS` is an optional commit message. If not provided, auto-generate one from the changes.
4
+
5
+ ## Step 1: Pre-flight Checks
6
+
7
+ 1. Run `dotnet build` on any modified .NET projects
8
+ 2. If frontend files changed, run `npx tsc --noEmit` in the relevant client directory
9
+ 3. If either fails, STOP and report the errors — do not deploy broken code
10
+
11
+ ## Step 2: Review Changes
12
+
13
+ ```bash
14
+ git status --short
15
+ git diff --stat
16
+ ```
17
+
18
+ Present the changes:
19
+
20
+ ```
21
+ ## Changes to Deploy
22
+
23
+ | Status | File |
24
+ |--------|------|
25
+ | M | src/API/Controllers/PaymentController.cs |
26
+ | M | src/Application/Payments/ExportHandler.cs |
27
+ | A | src/Domain/Payments/ExportResult.cs |
28
+
29
+ {count} files changed. Deploy? (yes/no)
30
+ ```
31
+
32
+ Wait for confirmation.
33
+
34
+ ## Step 3: Commit
35
+
36
+ 1. Stage only the relevant files (never use `git add -A`)
37
+ 2. Never stage `.env`, `appsettings.*.json` with real secrets, or `node_modules`
38
+ 3. Commit with the provided message or auto-generated one
39
+ 4. Always end with: `Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>`
40
+ 5. Use HEREDOC format for the commit message
41
+
42
+ ## Step 4: Push
43
+
44
+ ```bash
45
+ git push -u origin HEAD
46
+ ```
47
+
48
+ Push only the current branch. Do NOT cross-push to other branches.
49
+
50
+ ## Step 5: Pipeline (Conditional)
51
+
52
+ Check if the current branch is an environment branch (a branch that a CD pipeline watches):
53
+
54
+ - **On an environment branch**: Trigger the appropriate CD pipeline via Azure DevOps MCP. Monitor the build and report status.
55
+ - **On a feature/work branch**: Do NOT trigger. Report that the pipeline will trigger on PR merge.
56
+
57
+ ## Step 6: Report
58
+
59
+ ```
60
+ Deployed successfully.
61
+
62
+ Branch: {branch}
63
+ Commit: {hash} - {message}
64
+ Pipeline: {triggered | will trigger on PR merge}
65
+ ```
@@ -0,0 +1,49 @@
1
+ Fetch a work item, summarize it, and explain it in plain language. Usage: `/explain <work-item-id>`
2
+
3
+ Parse `$ARGUMENTS` to extract the work item ID. Accept formats like `AB#1234`, `#1234`, or just `1234`.
4
+
5
+ ## Step 1: Fetch the Work Item
6
+
7
+ Read the work item from Azure DevOps using the project from the current repo's CLAUDE.md configuration. Expand with `relations` to include child items and links.
8
+
9
+ If the work item is not found, report the error and stop.
10
+
11
+ ## Step 2: Gather Context
12
+
13
+ Collect these fields from the work item:
14
+ - Title, type, state, assigned to
15
+ - Description
16
+ - Acceptance criteria
17
+ - Tags
18
+ - Child work items (if any — fetch their titles and states)
19
+ - Parent work item (if any — fetch its title)
20
+ - Linked PRs (if any)
21
+
22
+ ## Step 3: Present the Explanation
23
+
24
+ Output the following sections:
25
+
26
+ ### Summary
27
+ A 1–2 sentence plain-language summary of what this work item is about. Avoid jargon — explain it as if to someone unfamiliar with the codebase.
28
+
29
+ ### What needs to happen
30
+ A bullet list translating the acceptance criteria and description into concrete actions. If acceptance criteria are vague, interpret them based on the description and title. If there are child work items, use them to inform this list.
31
+
32
+ ### Why it matters
33
+ A short explanation of the business or user value — why this work item exists. Infer this from the description, parent work item context, and tags.
34
+
35
+ ### Current Status
36
+ - **State:** {state}
37
+ - **Assigned To:** {assignedTo or "Unassigned"}
38
+ - **Parent:** {parent title or "None"}
39
+ - **Child Items:** {count completed}/{count total} complete
40
+ - **PRs:** {list of linked PR numbers and their status, or "None yet"}
41
+
42
+ ### Scope & Risks
43
+ Flag anything that looks ambiguous, missing, or potentially risky:
44
+ - Vague acceptance criteria that may need clarification
45
+ - No acceptance criteria at all
46
+ - Large scope (many child items or broad description)
47
+ - Dependencies on other work items
48
+
49
+ If nothing stands out, say "No concerns — scope looks clear."
@@ -0,0 +1,170 @@
1
+ Implement work item AB#$ARGUMENTS. Follow this workflow:
2
+
3
+ ## Step 1: Read the Work Item
4
+
5
+ Read the work item from Azure DevOps via MCP. Extract:
6
+ - **System.WorkItemType** — determines branch prefix
7
+ - **System.Title** — determines branch suffix
8
+ - **Acceptance criteria / description** — needed for implementation
9
+
10
+ Handle `$ARGUMENTS` as either `1234` or `AB#1234` — strip the `AB#` prefix when calling the MCP API.
11
+
12
+ ### Embedded Images
13
+
14
+ The description and acceptance criteria fields may contain embedded images (screenshots, mockups, diagrams). These are typically `<img>` tags with `src` URLs pointing to Azure DevOps attachments. **Download and view every embedded image** using WebFetch — they often contain critical visual requirements (UI layouts, expected behavior, error states) that are not described in the text.
15
+
16
+ ### Comments
17
+
18
+ Read the work item comments via `wit_list_work_item_comments`. Comments often contain clarifications, scope changes, or additional requirements added after the work item was created. Incorporate any relevant information from comments into your understanding of the work item.
19
+
20
+ ## Step 2: Summarize and Confirm
21
+
22
+ Present a summary of the work item to the user:
23
+
24
+ ```
25
+ ## AB#{id}: {title}
26
+
27
+ **Type:** {work item type}
28
+ **State:** {state}
29
+ **Assigned To:** {assigned to}
30
+
31
+ ### Description
32
+ {description summary}
33
+
34
+ ### Acceptance Criteria
35
+ {acceptance criteria — numbered list}
36
+
37
+ Does this look correct? Do you have any additional context or requirements?
38
+ ```
39
+
40
+ **Wait for the user to respond.** Do NOT proceed until the user confirms or provides additional context. If they add context, incorporate it into the plan.
41
+
42
+ ## Step 3: Explore & Plan
43
+
44
+ 1. **Explore** the codebase to map relevant files
45
+ 2. **Plan** the implementation approach
46
+
47
+ Present the plan to the user:
48
+
49
+ ```
50
+ ## Implementation Plan for AB#{id}
51
+
52
+ ### Approach
53
+ {brief description of how you will implement this}
54
+
55
+ ### Files to Create
56
+ - `path/to/new/file.cs` — {purpose}
57
+ - `path/to/new/file.tsx` — {purpose}
58
+
59
+ ### Files to Modify
60
+ - `path/to/existing/file.cs` — {what changes and why}
61
+ - `path/to/existing/file.tsx` — {what changes and why}
62
+
63
+ ### Files to Delete (if any)
64
+ - `path/to/old/file.cs` — {why it's being removed}
65
+
66
+ ### Agents
67
+ - **backend**: {what it will do}
68
+ - **frontend**: {what it will do}
69
+
70
+ ### Risks / Considerations
71
+ - {any potential issues or trade-offs}
72
+
73
+ Approve this plan? (yes / no / suggest changes)
74
+ ```
75
+
76
+ **Wait for the user to approve the plan.** Do NOT start implementation until the user approves. If they suggest changes, revise the plan and present it again.
77
+
78
+ ## Step 4: Create Feature Branch
79
+
80
+ Only create the branch after the plan is approved.
81
+
82
+ Capture the current branch as the PR target — do NOT hardcode any branch name:
83
+
84
+ ```bash
85
+ BASE_BRANCH=$(git symbolic-ref --short HEAD)
86
+ ```
87
+
88
+ Determine the branch prefix from the work item type:
89
+
90
+ | Work Item Type | Branch Prefix |
91
+ |---|---|
92
+ | Feature | `feature/` |
93
+ | User Story | `story/` |
94
+ | Bug | `bugfix/` |
95
+ | Hot Fix | `hotfix/` |
96
+ | (anything else) | `work/` |
97
+
98
+ Construct the branch name as `{prefix}AB#{id}-{sanitized-title}`:
99
+ - Sanitize the title: lowercase, replace non-alphanumeric characters (except hyphens) with hyphens, collapse consecutive hyphens, truncate to 50 characters, trim leading/trailing hyphens
100
+ - Example: Feature AB#1234 "Add Payment History Export" → `feature/AB#1234-add-payment-history-export`
101
+
102
+ Create and switch to the branch:
103
+ ```bash
104
+ git checkout -b <branch-name>
105
+ ```
106
+
107
+ If the branch already exists, switch to it with `git checkout <branch-name>` instead of failing.
108
+
109
+ Remember the `BASE_BRANCH` — you will need it for the PR step.
110
+
111
+ ## Step 5: Implement
112
+
113
+ 1. **Implement** using backend and/or frontend agents according to the approved plan
114
+ 2. **Generate mockup** if there are UI changes
115
+
116
+ ## Step 6: Build Validation
117
+
118
+ Run a build check **before** any other quality checks. Use the `build-validator` agent to verify that all projects compile successfully.
119
+
120
+ - If the build fails, **fix the errors immediately** and re-run until the build passes
121
+ - Do NOT proceed to review, tests, or lint until the build is clean
122
+
123
+ ## Step 7: Quality Checks
124
+
125
+ 1. **Review** code for quality, security, and Clean Architecture compliance
126
+ 2. **Run tests** — unit, integration, and build validation
127
+ 3. **Run lint** — ESLint and dotnet format
128
+
129
+ ## Step 8: UAT Gate
130
+
131
+ ### If Hot Fix:
132
+ Skip manual UAT. Present an abbreviated confirmation:
133
+
134
+ ```
135
+ Hot Fix ready. All automated checks passed.
136
+
137
+ Create PR? (yes/no)
138
+ ```
139
+
140
+ Wait for confirmation before proceeding.
141
+
142
+ ### If Feature, User Story, Bug, or other:
143
+ Generate a UAT checklist from the acceptance criteria and present:
144
+
145
+ ```
146
+ Automated checks passed and the UAT checklist is ready.
147
+
148
+ ## UAT Checklist
149
+ [generated checklist here]
150
+
151
+ Please manually test the feature using the checklist above.
152
+
153
+ Did manual testing pass?
154
+ - If YES → reply "testing passed" and I will create the PR
155
+ - If NO → describe what failed or what behaved unexpectedly
156
+ and I will investigate and fix before asking you again
157
+ ```
158
+
159
+ Wait for the user's response before proceeding. Do NOT create a PR until confirmed.
160
+
161
+ ## Step 9: Push, Create PR, and Update Work Item
162
+
163
+ 1. Push the branch: `git push -u origin HEAD`
164
+ 2. Create a PR via Azure DevOps MCP:
165
+ - **sourceRefName**: `refs/heads/{branch-name}`
166
+ - **targetRefName**: `refs/heads/{BASE_BRANCH}` (the branch captured in Step 4)
167
+ - **title**: `AB#{id}: {work item title}`
168
+ - **labels**: `["hotfix"]` if the work item type is Hot Fix
169
+ 3. Link the PR to the work item via `wit_link_work_item_to_pull_request`
170
+ 4. Update the work item status in Azure DevOps