@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.
- package/LICENSE +21 -0
- package/README.md +821 -0
- package/bin/cli.js +521 -0
- package/package.json +50 -0
- package/templates/agents/global/api-tester.md +75 -0
- package/templates/agents/global/azure-ops.md +59 -0
- package/templates/agents/global/backend.md +245 -0
- package/templates/agents/global/build-validator.md +50 -0
- package/templates/agents/global/frontend.md +254 -0
- package/templates/agents/global/legacy.md +218 -0
- package/templates/agents/global/lint-checker.md +86 -0
- package/templates/agents/global/manager.md +138 -0
- package/templates/agents/global/mockup.md +95 -0
- package/templates/agents/global/reviewer.md +149 -0
- package/templates/agents/global/security-auditor.md +74 -0
- package/templates/agents/global/test-runner.md +98 -0
- package/templates/agents/global/uat-generator.md +107 -0
- package/templates/agents/project/db-admin.md +106 -0
- package/templates/agents/project/deployer.md +113 -0
- package/templates/agents/project/devops-tracker.md +101 -0
- package/templates/commands/add-to-release.md +55 -0
- package/templates/commands/cherry-pick.md +96 -0
- package/templates/commands/cleanup-branches.md +73 -0
- package/templates/commands/create-release.md +65 -0
- package/templates/commands/deploy-release.md +147 -0
- package/templates/commands/deploy.md +65 -0
- package/templates/commands/explain.md +49 -0
- package/templates/commands/implement.md +170 -0
- package/templates/commands/promote.md +71 -0
- package/templates/commands/quote.md +39 -0
- package/templates/commands/review.md +32 -0
- package/templates/commands/rework.md +158 -0
- package/templates/commands/rollback.md +106 -0
- package/templates/commands/status.md +111 -0
- package/templates/hooks/auto-format.sh +46 -0
- package/templates/hooks/protected-files.sh +52 -0
- package/templates/hooks/secret-blocker.sh +68 -0
- package/templates/hooks/self-improve.sh +7 -0
- package/templates/hooks/sensitive-data-blocker.sh +43 -0
- package/templates/hooks/sensitive-data-mcp-blocker.sh +40 -0
- package/templates/hooks/sensitive-data-output-blocker.sh +63 -0
- package/templates/hooks/test-on-change.sh +46 -0
- package/templates/hooks/uat-reminder.sh +9 -0
- package/templates/infrastructure/CLAUDE-WORKFLOW.md +274 -0
- package/templates/infrastructure/azure-pipelines-template.yml +199 -0
- package/templates/infrastructure/mcp.json +35 -0
- package/templates/infrastructure/settings.json +94 -0
package/README.md
ADDED
|
@@ -0,0 +1,821 @@
|
|
|
1
|
+
# Claude Kit
|
|
2
|
+
|
|
3
|
+
> A starter kit for [Claude Code](https://claude.ai/code) — agents, hooks, MCP servers, slash commands, and workflow automation, installed into any project with a single `npx` command.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@chris1807/claude-kit)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## About
|
|
10
|
+
|
|
11
|
+
This package installs a complete AI development infrastructure into any project. It includes specialized agents that handle specific tasks (deployment, database ops, code review), security hooks that prevent mistakes automatically, MCP server connections to your tools (databases, Teams, Stripe, Azure CLI), and slash commands that automate your entire workflow from work item to pull request.
|
|
12
|
+
|
|
13
|
+
Every session Claude learns from your feedback and gets better at helping you specifically. The infrastructure is modular — install only what your project needs.
|
|
14
|
+
|
|
15
|
+
### What's Included
|
|
16
|
+
|
|
17
|
+
| Component | Count | Where Installed | Description |
|
|
18
|
+
|-----------|-------|----------------|-------------|
|
|
19
|
+
| **Global Agents** | 13 | `~/.claude/agents/` (your machine, all projects) | backend, frontend, legacy (Lucee/CFML), manager, mockup, reviewer, test-runner, build-validator, lint-checker, uat-generator, azure-ops, security-auditor, api-tester |
|
|
20
|
+
| **Project Agents** | 3 | `.claude/agents/` (in the project) | deployer, db-admin, devops-tracker |
|
|
21
|
+
| **Hooks** | 9 | `.claude/hooks/` (in the project) | Secret blocker, sensitive data blocker (Bash + MCP + output), protected files, auto-format, test suggestions, UAT reminder, self-improve |
|
|
22
|
+
| **Slash Commands** | 13 | `.claude/commands/` (in the project) | `/implement`, `/review`, `/deploy`, `/create-release`, `/deploy-release`, `/add-to-release`, `/cherry-pick`, `/promote`, `/rollback`, `/status`, `/cleanup-branches`, `/quote`, `/explain` |
|
|
23
|
+
| **MCP Servers** | Up to 6 | `.mcp.json` (in the project) | Playwright, MongoDB/SQL/Postgres, Teams, Stripe, Azure CLI |
|
|
24
|
+
| **Workflow Template** | 1 | Appended to `CLAUDE.md` | Documents the full development process |
|
|
25
|
+
| **Settings** | 1 | `.claude/settings.json` (in the project) | Registers all hooks and MCP servers |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
- [Claude Code CLI](https://claude.ai/code) installed
|
|
32
|
+
- [Node.js](https://nodejs.org/) 18 or later
|
|
33
|
+
|
|
34
|
+
### Verify it works
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @chris1807/claude-kit --help
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
You should see the help output. The package is published publicly on [npmjs.com](https://www.npmjs.com/package/@chris1807/claude-kit) — no authentication or `.npmrc` setup required.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
### How It Works
|
|
47
|
+
|
|
48
|
+
**Every install mode does two things:**
|
|
49
|
+
1. **Global agents** → installed to `~/.claude/agents/` (works across ALL your projects)
|
|
50
|
+
2. **Project files** → installed to the target project directory (agents, hooks, commands, MCP config, settings)
|
|
51
|
+
|
|
52
|
+
### Option 1: Interactive Install (Recommended)
|
|
53
|
+
|
|
54
|
+
Best for first-time setup or when you want to pick exactly what you need.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx @chris1807/claude-kit init
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You'll be asked:
|
|
61
|
+
1. **Target directory** — where is your project?
|
|
62
|
+
2. **Components** — checkboxes to pick which parts to install:
|
|
63
|
+
- ☑ Project Agents (deployer, db-admin, devops-tracker)
|
|
64
|
+
- ☑ Hooks (secret blocker, auto-format, etc.)
|
|
65
|
+
- ☑ Slash Commands (13 commands — /implement, /review, /deploy, /create-release, /deploy-release, /add-to-release, /cherry-pick, /promote, /rollback, /status, /cleanup-branches, /quote, /explain)
|
|
66
|
+
- ☑ MCP Servers
|
|
67
|
+
- ☑ Settings
|
|
68
|
+
- ☑ CLAUDE.md Workflow
|
|
69
|
+
- ☑ .gitignore Updates
|
|
70
|
+
3. **Database type** — MongoDB, SQL Server, Azure SQL, PostgreSQL, or None
|
|
71
|
+
4. **MCP servers** — pick which ones:
|
|
72
|
+
- ☑ Playwright (browser testing)
|
|
73
|
+
- ☑ Microsoft Teams (notifications)
|
|
74
|
+
- ☐ Stripe (payments) — off by default
|
|
75
|
+
- ☑ Azure CLI (infrastructure)
|
|
76
|
+
5. **Existing files** — for each file that already exists, choose overwrite or skip
|
|
77
|
+
|
|
78
|
+
### Option 2: Install to a Specific Project
|
|
79
|
+
|
|
80
|
+
Same as Option 1, but you specify the project path upfront:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx @chris1807/claude-kit init /path/to/your/project
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Option 3: Install Everything (Minimal Prompts)
|
|
87
|
+
|
|
88
|
+
Installs all components. Only asks which database type (there's no sensible default).
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx @chris1807/claude-kit init --all
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This installs:
|
|
95
|
+
- ✅ Global agents (backend, frontend, legacy, manager, mockup, reviewer, test-runner, build-validator, lint-checker, uat-generator, azure-ops, security-auditor, api-tester)
|
|
96
|
+
- ✅ Project agents (deployer, db-admin, devops-tracker)
|
|
97
|
+
- ✅ All 9 hooks
|
|
98
|
+
- ✅ All 13 slash commands
|
|
99
|
+
- ✅ MCP servers: Playwright, Teams, Azure CLI (+ your DB choice)
|
|
100
|
+
- ✅ Settings, CLAUDE.md workflow, .gitignore
|
|
101
|
+
- ❌ Stripe (not included in --all, add via interactive mode)
|
|
102
|
+
- ⏭️ Skips files that are already identical
|
|
103
|
+
- 🔄 Overwrites files that have changed
|
|
104
|
+
|
|
105
|
+
### Option 4: Fully Automated (Zero Prompts)
|
|
106
|
+
|
|
107
|
+
Specify the database type as a flag — no prompts at all:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx @chris1807/claude-kit init --all --db=mongo
|
|
111
|
+
npx @chris1807/claude-kit init --all --db=mssql
|
|
112
|
+
npx @chris1807/claude-kit init --all --db=azuresql
|
|
113
|
+
npx @chris1807/claude-kit init --all --db=postgres
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
You can also target a specific directory:
|
|
117
|
+
```bash
|
|
118
|
+
npx @chris1807/claude-kit init /path/to/project --all --db=mongo
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Option 5: Global Agents Only
|
|
122
|
+
|
|
123
|
+
Just installs the 13 global agents to `~/.claude/agents/`. No project files, no prompts.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npx @chris1807/claude-kit init --global-only
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use this when you just want the global agents on a new machine and will install project files separately per project.
|
|
130
|
+
|
|
131
|
+
### Re-Running the Installer
|
|
132
|
+
|
|
133
|
+
**Safe to run as many times as you want.** The installer:
|
|
134
|
+
- **Skips** files that are identical (no unnecessary changes)
|
|
135
|
+
- **Asks** before overwriting files that have changed (in interactive mode)
|
|
136
|
+
- **Overwrites** changed files silently (in `--all` mode)
|
|
137
|
+
- **Merges** MCP server configs (adds missing servers without removing existing ones)
|
|
138
|
+
|
|
139
|
+
### Installing on Additional Projects
|
|
140
|
+
|
|
141
|
+
Already installed on one project? Just run the same command for the next one:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npx @chris1807/claude-kit init /path/to/another/project
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The installer automatically **skips global agents** that are already installed (they're identical) and only installs the project-specific files. You don't need `--global-only` or any special flag — it just works.
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
📦 Global Agents → ~/.claude/agents/
|
|
151
|
+
= azure-ops.md (identical, skipped) ← already installed, skipped
|
|
152
|
+
= security-auditor.md (identical, skipped)
|
|
153
|
+
= api-tester.md (identical, skipped)
|
|
154
|
+
|
|
155
|
+
📦 Project Agents → .claude/agents/ ← fresh install for this project
|
|
156
|
+
✓ deployer.md
|
|
157
|
+
✓ db-admin.md
|
|
158
|
+
✓ devops-tracker.md
|
|
159
|
+
...
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## What Gets Installed
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
~/.claude/agents/ ← Global (all projects)
|
|
168
|
+
├── backend.md # .NET/C# backend developer (Clean Architecture)
|
|
169
|
+
├── frontend.md # React/TypeScript frontend developer
|
|
170
|
+
├── legacy.md # Lucee/CFML legacy app developer (RBWO + others)
|
|
171
|
+
├── manager.md # Workflow orchestrator (delegates to other agents)
|
|
172
|
+
├── mockup.md # HTML mockup designer
|
|
173
|
+
├── reviewer.md # Code reviewer (read-only)
|
|
174
|
+
├── test-runner.md # Test executor — xUnit, Vitest, Playwright (read-only)
|
|
175
|
+
├── build-validator.md # Build checker (read-only)
|
|
176
|
+
├── lint-checker.md # ESLint + dotnet format checker
|
|
177
|
+
├── uat-generator.md # UAT checklist generator (read-only)
|
|
178
|
+
├── azure-ops.md # Azure infrastructure management
|
|
179
|
+
├── security-auditor.md # Security scanning (read-only)
|
|
180
|
+
└── api-tester.md # API endpoint testing
|
|
181
|
+
|
|
182
|
+
your-project/ ← Project-specific
|
|
183
|
+
├── .claude/
|
|
184
|
+
│ ├── agents/
|
|
185
|
+
│ │ ├── deployer.md # Commit → push → deploy → monitor
|
|
186
|
+
│ │ ├── db-admin.md # Database queries and data management
|
|
187
|
+
│ │ └── devops-tracker.md # Azure DevOps work item management
|
|
188
|
+
│ │
|
|
189
|
+
│ ├── hooks/
|
|
190
|
+
│ │ ├── sensitive-data-blocker.sh # BLOCKS mongosh queries for TIN/SSN/PII
|
|
191
|
+
│ │ ├── sensitive-data-mcp-blocker.sh # BLOCKS MCP DB queries for TIN/SSN/PII
|
|
192
|
+
│ │ ├── sensitive-data-output-blocker.sh # BLOCKS output containing PII fields
|
|
193
|
+
│ │ ├── secret-blocker.sh # BLOCKS hardcoded secrets before write
|
|
194
|
+
│ │ ├── protected-files.sh # BLOCKS/warns on critical file edits
|
|
195
|
+
│ │ ├── auto-format.sh # Auto-runs formatters after edits
|
|
196
|
+
│ │ ├── test-on-change.sh # Suggests related tests after edits
|
|
197
|
+
│ │ ├── uat-reminder.sh # Reminds to run UAT after features
|
|
198
|
+
│ │ └── self-improve.sh # Saves learnings after each session
|
|
199
|
+
│ │
|
|
200
|
+
│ ├── commands/
|
|
201
|
+
│ │ ├── implement.md # /implement AB#1234
|
|
202
|
+
│ │ ├── review.md # /review 142
|
|
203
|
+
│ │ ├── deploy.md # /deploy "commit message"
|
|
204
|
+
│ │ ├── create-release.md # /create-release 23
|
|
205
|
+
│ │ ├── deploy-release.md # /deploy-release 23 staging
|
|
206
|
+
│ │ ├── cherry-pick.md # /cherry-pick AB#1234 production
|
|
207
|
+
│ │ ├── promote.md # /promote staging production
|
|
208
|
+
│ │ ├── rollback.md # /rollback AB#1234 production
|
|
209
|
+
│ │ ├── add-to-release.md # /add-to-release 24 AB#4599
|
|
210
|
+
│ │ ├── status.md # /status release 24
|
|
211
|
+
│ │ ├── cleanup-branches.md # /cleanup-branches
|
|
212
|
+
│ │ ├── quote.md # /quote AB#1234
|
|
213
|
+
│ │ └── explain.md # /explain AB#1234
|
|
214
|
+
│ │
|
|
215
|
+
│ └── settings.json # Hook and MCP registration
|
|
216
|
+
│
|
|
217
|
+
├── .mcp.json # MCP server configuration
|
|
218
|
+
└── CLAUDE.md # Gets workflow section appended
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Usage
|
|
224
|
+
|
|
225
|
+
### Start Working
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
cd /path/to/your/project
|
|
229
|
+
claude
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Verify MCP servers are connected:
|
|
233
|
+
```
|
|
234
|
+
/mcp
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Implement a Work Item
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
/implement AB#1234
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Claude automatically:
|
|
244
|
+
1. Reads the work item from Azure DevOps
|
|
245
|
+
2. **Summarizes and asks you to confirm** — shows title, description, acceptance criteria. Waits for you to agree or add context
|
|
246
|
+
3. Creates a feature branch based on work item type
|
|
247
|
+
4. Explores the codebase and **presents an implementation plan** — lists files to create, modify, and delete. Waits for your approval before writing any code
|
|
248
|
+
5. Implements using backend/frontend agents (only after plan approval)
|
|
249
|
+
6. Runs tests, linting, and build validation
|
|
250
|
+
7. Generates a UAT checklist from acceptance criteria
|
|
251
|
+
8. **Pauses for you to manually test**
|
|
252
|
+
9. Creates the PR after you confirm
|
|
253
|
+
|
|
254
|
+
### Review a Pull Request
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
/review 142
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Claude automatically:
|
|
261
|
+
1. Reads the full PR diff
|
|
262
|
+
2. Reads the linked work item and checks all acceptance criteria
|
|
263
|
+
3. Reviews for Clean Architecture, security, missing tests, code quality
|
|
264
|
+
4. Posts inline comments on all findings
|
|
265
|
+
5. Posts a PR-level summary
|
|
266
|
+
6. Asks: "Approve, Request Changes, or skip the vote?"
|
|
267
|
+
|
|
268
|
+
### Deploy Changes
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
/deploy "Add payment export feature"
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Claude automatically:
|
|
275
|
+
1. Runs pre-flight checks (dotnet build, tsc)
|
|
276
|
+
2. Stages and commits with the provided message
|
|
277
|
+
3. Pushes the current branch
|
|
278
|
+
4. Triggers the CD pipeline if on an environment branch
|
|
279
|
+
|
|
280
|
+
### Create a Release
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
/create-release 23
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Claude automatically:
|
|
287
|
+
1. Asks which work items to include
|
|
288
|
+
2. Creates a `Release #23` iteration in Azure DevOps
|
|
289
|
+
3. Assigns and tags all work items with `release-23`
|
|
290
|
+
|
|
291
|
+
### Deploy a Release
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
/deploy-release 23 staging
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Claude automatically:
|
|
298
|
+
1. Finds all work items in Release #23
|
|
299
|
+
2. Cherry-picks their commits into `release/23-to-staging`
|
|
300
|
+
3. Creates a PR targeting the staging branch
|
|
301
|
+
4. Links all work items to the PR
|
|
302
|
+
|
|
303
|
+
### Cherry-Pick Work Items
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
/cherry-pick AB#1234 AB#1235 production
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Cherry-picks specific work items to an environment without a formal release.
|
|
310
|
+
|
|
311
|
+
### Promote an Environment
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
/promote staging production
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Creates a PR to promote all code from staging to production. Shows a summary of all included commits before confirming.
|
|
318
|
+
|
|
319
|
+
### Rollback a Deployment
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
/rollback AB#1234 production
|
|
323
|
+
/rollback last staging
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Reverts specific commits or the last deployment on an environment. Creates a revert branch and PR.
|
|
327
|
+
|
|
328
|
+
### Add Work Items to a Release
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
/add-to-release 24 AB#4599 AB#4600
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Adds work items to an existing release — assigns them to the iteration and tags them.
|
|
335
|
+
|
|
336
|
+
### Check Status
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
/status release 24
|
|
340
|
+
/status pipeline
|
|
341
|
+
/status AB#4521
|
|
342
|
+
/status staging
|
|
343
|
+
/status
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Shows the status of a release, pipeline, work item, environment, or a high-level overview of everything.
|
|
347
|
+
|
|
348
|
+
### Quote a Work Item
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
/quote AB#1234
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Displays a work item as a formatted blockquote — title, type, state, assignee, description, acceptance criteria, and child items. Useful for pasting into PR descriptions, Teams messages, or discussions.
|
|
355
|
+
|
|
356
|
+
### Explain a Work Item
|
|
357
|
+
|
|
358
|
+
```
|
|
359
|
+
/explain AB#1234
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Reads a work item and explains it in plain language:
|
|
363
|
+
1. **Summary** — what the work item is about in 1–2 sentences
|
|
364
|
+
2. **What needs to happen** — acceptance criteria translated into concrete actions
|
|
365
|
+
3. **Why it matters** — business/user value
|
|
366
|
+
4. **Current status** — state, assignee, parent, child progress, linked PRs
|
|
367
|
+
5. **Scope & risks** — flags ambiguity, missing criteria, or large scope
|
|
368
|
+
|
|
369
|
+
### Clean Up Merged Branches
|
|
370
|
+
|
|
371
|
+
```
|
|
372
|
+
/cleanup-branches
|
|
373
|
+
/cleanup-branches --dry-run
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Finds and deletes branches that have been fully merged. Protects environment branches. Use `--dry-run` to preview without deleting.
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Branching Strategy
|
|
381
|
+
|
|
382
|
+
### Target State (All Projects)
|
|
383
|
+
|
|
384
|
+
Every project should converge to this standard. Each long-lived branch maps to an Azure subscription and environment:
|
|
385
|
+
|
|
386
|
+
| Branch | Azure Subscription | Environment | Deploys When |
|
|
387
|
+
|--------|-------------------|-------------|-------------|
|
|
388
|
+
| `develop` | Dev | Development | PR merged into `develop` |
|
|
389
|
+
| `staging` | Staging | Staging | PR merged into `staging` |
|
|
390
|
+
| `main` | Production | Production | PR merged into `main` (with approval gate) |
|
|
391
|
+
|
|
392
|
+
> **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.
|
|
393
|
+
|
|
394
|
+
### Branch Naming
|
|
395
|
+
|
|
396
|
+
When you run `/implement`, a branch is automatically created based on the Azure DevOps work item type:
|
|
397
|
+
|
|
398
|
+
| Work Item Type | Branch Prefix | Example |
|
|
399
|
+
|----------------|--------------|---------|
|
|
400
|
+
| Feature | `feature/` | `feature/AB#1234-add-payment-export` |
|
|
401
|
+
| User Story | `story/` | `story/AB#1235-user-can-view-history` |
|
|
402
|
+
| Bug | `bugfix/` | `bugfix/AB#1236-fix-login-redirect` |
|
|
403
|
+
| Hot Fix | `hotfix/` | `hotfix/AB#1237-fix-crash-on-submit` |
|
|
404
|
+
| (other) | `work/` | `work/AB#1238-update-dependencies` |
|
|
405
|
+
|
|
406
|
+
The branch is always created off the **current branch** — no assumptions are made about which branch you're on.
|
|
407
|
+
|
|
408
|
+
> **Note:** The Azure DevOps work item type is "Hot Fix" (two words), but the branch prefix and PR label use `hotfix` (one word, lowercase).
|
|
409
|
+
|
|
410
|
+
### Code Promotion Flow
|
|
411
|
+
|
|
412
|
+
Code flows through environments via PRs, never by direct push:
|
|
413
|
+
|
|
414
|
+
```
|
|
415
|
+
feature/AB#1234-... ──PR──▸ develop ──PR──▸ staging ──PR──▸ main
|
|
416
|
+
(work branch) (Dev) (Staging) (Production)
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Development Workflow Guide
|
|
422
|
+
|
|
423
|
+
This section walks through the complete workflow from picking up a work item to deploying to production.
|
|
424
|
+
|
|
425
|
+
### Step 1: Implement a Work Item
|
|
426
|
+
|
|
427
|
+
Start by switching to your project's development branch and running `/implement`:
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
cd /path/to/your/project
|
|
431
|
+
claude
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
```
|
|
435
|
+
# Switch to the develop branch first
|
|
436
|
+
git checkout develop
|
|
437
|
+
|
|
438
|
+
# Implement the work item
|
|
439
|
+
/implement AB#1234
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
Claude will:
|
|
443
|
+
1. Read the work item from Azure DevOps (extracts type, title, acceptance criteria)
|
|
444
|
+
2. **Summarize the work item** and ask you to confirm understanding. You can add context or corrections here
|
|
445
|
+
3. Create a branch automatically (e.g., `story/AB#1234-user-can-view-history`)
|
|
446
|
+
4. Explore the codebase and **present an implementation plan** showing which files will be created, modified, or deleted
|
|
447
|
+
5. **Wait for your approval** before writing any code
|
|
448
|
+
6. Implement using backend and/or frontend agents
|
|
449
|
+
7. Run all quality checks (build, lint, tests, review)
|
|
450
|
+
8. Generate a UAT checklist and **pause for you to manually test**
|
|
451
|
+
9. After you confirm "testing passed", create a PR targeting `develop`
|
|
452
|
+
|
|
453
|
+
The PR merges into `develop`, which triggers the Dev environment CD pipeline.
|
|
454
|
+
|
|
455
|
+
### Step 2: Deploy Changes (Quick Commits)
|
|
456
|
+
|
|
457
|
+
For smaller changes that don't need the full `/implement` workflow:
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
/deploy "Fix typo in dashboard header"
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
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.
|
|
464
|
+
|
|
465
|
+
### Step 3: Group Work Items into a Release
|
|
466
|
+
|
|
467
|
+
Once multiple work items are merged to `develop` and tested in Dev, group them into a release:
|
|
468
|
+
|
|
469
|
+
```
|
|
470
|
+
/create-release 23
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
Claude will:
|
|
474
|
+
1. Ask which work items to include — you can provide:
|
|
475
|
+
- Specific IDs: `AB#1234, AB#1235, AB#1236`
|
|
476
|
+
- A query: `all Ready for Testing user stories`
|
|
477
|
+
- A state filter: `all items tagged sprint-5`
|
|
478
|
+
2. Show you the list and ask for confirmation
|
|
479
|
+
3. Create a `Release #23` iteration in Azure DevOps
|
|
480
|
+
4. Assign all work items to the iteration and tag them with `release-23`
|
|
481
|
+
5. Tell you how to deploy: `/deploy-release 23 staging` or `/deploy-release 23 production`
|
|
482
|
+
|
|
483
|
+
### Step 4: Deploy a Release to Staging
|
|
484
|
+
|
|
485
|
+
```
|
|
486
|
+
/deploy-release 23 staging
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
Claude will:
|
|
490
|
+
1. Find all work items tagged `release-23`
|
|
491
|
+
2. Find their associated commits on the `develop` branch
|
|
492
|
+
3. Create a release branch: `release/23-to-staging`
|
|
493
|
+
4. Cherry-pick all commits for each work item
|
|
494
|
+
5. Create a PR from `release/23-to-staging` → `staging`
|
|
495
|
+
6. Link all work items to the PR
|
|
496
|
+
|
|
497
|
+
After the PR is reviewed and merged, the Staging CD pipeline triggers automatically.
|
|
498
|
+
|
|
499
|
+
### Step 5: Test on Staging
|
|
500
|
+
|
|
501
|
+
QA and stakeholders test on the Staging environment. If issues are found, fix them with `/implement` and add the fixes to the release.
|
|
502
|
+
|
|
503
|
+
### Step 6: Deploy a Release to Production
|
|
504
|
+
|
|
505
|
+
When staging testing passes:
|
|
506
|
+
|
|
507
|
+
```
|
|
508
|
+
/deploy-release 23 production
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
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).
|
|
512
|
+
|
|
513
|
+
### Selective Deployment
|
|
514
|
+
|
|
515
|
+
If staging has 5 user stories but only 3 are ready for production:
|
|
516
|
+
|
|
517
|
+
**Option A: Create a smaller release**
|
|
518
|
+
```
|
|
519
|
+
/create-release 24
|
|
520
|
+
```
|
|
521
|
+
Include only the 3 ready stories, then `/deploy-release 24 production`.
|
|
522
|
+
|
|
523
|
+
**Option B: Cherry-pick specific items**
|
|
524
|
+
```
|
|
525
|
+
/cherry-pick AB#1234 AB#1235 AB#1236 production
|
|
526
|
+
```
|
|
527
|
+
This cherry-picks just those 3 work items without creating a formal release.
|
|
528
|
+
|
|
529
|
+
### Promoting Without a Release
|
|
530
|
+
|
|
531
|
+
To promote **all** code from one environment to the next (no cherry-picking):
|
|
532
|
+
|
|
533
|
+
```
|
|
534
|
+
/promote staging production
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
This creates a PR from `staging` → production branch containing everything. Use this when all staging code is ready for production.
|
|
538
|
+
|
|
539
|
+
You can also auto-detect the next environment:
|
|
540
|
+
```
|
|
541
|
+
/promote
|
|
542
|
+
```
|
|
543
|
+
If you're on the `staging` branch, it auto-detects `staging → production`.
|
|
544
|
+
|
|
545
|
+
### Hot Fix Workflow
|
|
546
|
+
|
|
547
|
+
For critical production issues:
|
|
548
|
+
|
|
549
|
+
1. Switch to the production branch:
|
|
550
|
+
```
|
|
551
|
+
git checkout main
|
|
552
|
+
```
|
|
553
|
+
2. Run `/implement` with the Hot Fix work item:
|
|
554
|
+
```
|
|
555
|
+
/implement AB#9999
|
|
556
|
+
```
|
|
557
|
+
3. Claude creates a `hotfix/AB#9999-fix-crash-on-submit` branch
|
|
558
|
+
4. Automated checks still run (build, lint, tests, review)
|
|
559
|
+
5. **Manual UAT is skipped** — you get an abbreviated confirmation instead
|
|
560
|
+
6. PR targets the production branch directly with a `hotfix` label
|
|
561
|
+
|
|
562
|
+
### Rollback a Deployment
|
|
563
|
+
|
|
564
|
+
If a deployment causes issues:
|
|
565
|
+
|
|
566
|
+
**Revert specific work items:**
|
|
567
|
+
```
|
|
568
|
+
/rollback AB#1234 production
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
**Revert the most recent deployment:**
|
|
572
|
+
```
|
|
573
|
+
/rollback last staging
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
Claude will:
|
|
577
|
+
1. Find the commits to revert
|
|
578
|
+
2. Create a revert branch (e.g., `revert/2026-03-21-on-production`)
|
|
579
|
+
3. Run `git revert` on each commit
|
|
580
|
+
4. Run pre-flight checks on the reverted code
|
|
581
|
+
5. Create a PR targeting the environment branch
|
|
582
|
+
|
|
583
|
+
Merge the PR to deploy the rollback.
|
|
584
|
+
|
|
585
|
+
### Code Review
|
|
586
|
+
|
|
587
|
+
For any open PR:
|
|
588
|
+
|
|
589
|
+
```
|
|
590
|
+
/review 142
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
Claude reviews for:
|
|
594
|
+
- Clean Architecture boundaries (Domain has no infrastructure dependencies)
|
|
595
|
+
- Tenant/organizationId enforcement on all database queries
|
|
596
|
+
- Missing unit or integration tests for new code
|
|
597
|
+
- `any` types in TypeScript (should be properly typed)
|
|
598
|
+
- Security issues (OWASP Top 10, hardcoded secrets)
|
|
599
|
+
- Acceptance criteria coverage from the linked work item
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
## Slash Commands Reference
|
|
604
|
+
|
|
605
|
+
| Command | Usage | What It Does |
|
|
606
|
+
|---------|-------|-------------|
|
|
607
|
+
| `/implement` | `/implement AB#1234` | Read work item → summarize → approve plan → implement → quality checks → UAT → PR |
|
|
608
|
+
| `/review` | `/review 142` | Full code review on a PR with inline comments |
|
|
609
|
+
| `/deploy` | `/deploy "message"` | Commit, push, trigger pipeline if on environment branch |
|
|
610
|
+
| `/create-release` | `/create-release 23` | Group work items into Release #23 iteration with tags |
|
|
611
|
+
| `/deploy-release` | `/deploy-release 23 staging` | Cherry-pick release work items to environment via PR |
|
|
612
|
+
| `/add-to-release` | `/add-to-release 24 AB#4599` | Add work items to an existing release |
|
|
613
|
+
| `/cherry-pick` | `/cherry-pick AB#1234 AB#1235 production` | Cherry-pick specific work items to environment via PR |
|
|
614
|
+
| `/promote` | `/promote staging production` | PR to promote all code between environments |
|
|
615
|
+
| `/rollback` | `/rollback AB#1234 production` | Revert specific commits on an environment via PR |
|
|
616
|
+
| `/status` | `/status release 24` | Check status of a release, pipeline, work item, or environment |
|
|
617
|
+
| `/quote` | `/quote AB#1234` | Display a work item as a formatted blockquote |
|
|
618
|
+
| `/explain` | `/explain AB#1234` | Summarize and explain a work item in plain language |
|
|
619
|
+
| `/cleanup-branches` | `/cleanup-branches` | Delete merged feature/work branches |
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
## Hooks
|
|
624
|
+
|
|
625
|
+
These run automatically — no action needed:
|
|
626
|
+
|
|
627
|
+
| When | Hook | What It Does |
|
|
628
|
+
|------|------|-------------|
|
|
629
|
+
| **Before** any Bash command | `sensitive-data-blocker.sh` | Blocks `mongosh` commands that reference sensitive PII fields (TIN, SSN, bank accounts). **Blocks the command.** |
|
|
630
|
+
| **Before** any MCP database tool | `sensitive-data-mcp-blocker.sh` | Blocks MongoDB/MSSQL/Postgres MCP tool calls that reference PII fields. **Blocks the call.** |
|
|
631
|
+
| **After** any Bash/MCP/Read/Grep | `sensitive-data-output-blocker.sh` | Scans output for PII field names in JSON, C#, YAML formats — catches broad queries, seed data, test fixtures, log files, and git diffs. **Blocks the output.** |
|
|
632
|
+
| **Before** any file write | `secret-blocker.sh` | Scans for hardcoded credentials (MongoDB URIs, AWS keys, Stripe keys, passwords). **Blocks the write.** |
|
|
633
|
+
| **Before** any file edit | `protected-files.sh` | Blocks edits to production/staging configs. Warns on critical files (CLAUDE.md, pipelines, Program.cs). |
|
|
634
|
+
| **After** any file edit | `auto-format.sh` | Runs `dotnet format` on .cs files, `eslint --fix` on .ts/.tsx files |
|
|
635
|
+
| **After** any file edit | `test-on-change.sh` | Suggests the relevant test command for the modified file |
|
|
636
|
+
| **When Claude stops** | `uat-reminder.sh` | Reminds to run UAT if a feature was implemented |
|
|
637
|
+
| **When Claude stops** | `self-improve.sh` | Prompts Claude to save learnings to memory for next time |
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
641
|
+
## Environment Variables
|
|
642
|
+
|
|
643
|
+
Each team member sets their own. **Never commit these.**
|
|
644
|
+
|
|
645
|
+
Add to `~/.zshrc` (Mac) or System Environment Variables (Windows):
|
|
646
|
+
|
|
647
|
+
```bash
|
|
648
|
+
# MongoDB (if your project uses MongoDB)
|
|
649
|
+
export MONGODB_CONNECTION_STRING="mongodb+srv://user:password@cluster.mongodb.net/"
|
|
650
|
+
|
|
651
|
+
# SQL Server (if your project uses SQL Server or Azure SQL)
|
|
652
|
+
export MSSQL_CONNECTION_STRING="Server=localhost;Database=MyDb;User Id=sa;Password=...;"
|
|
653
|
+
|
|
654
|
+
# PostgreSQL (if your project uses PostgreSQL)
|
|
655
|
+
export POSTGRES_CONNECTION_STRING="postgresql://user:password@localhost:5432/mydb"
|
|
656
|
+
|
|
657
|
+
# Microsoft Teams (for team notifications and messages)
|
|
658
|
+
export TEAMS_TENANT_ID="your-azure-ad-tenant-id"
|
|
659
|
+
export TEAMS_CLIENT_ID="your-app-registration-client-id"
|
|
660
|
+
export TEAMS_CLIENT_SECRET="your-client-secret"
|
|
661
|
+
|
|
662
|
+
# Stripe (if your project uses Stripe payments)
|
|
663
|
+
export STRIPE_SECRET_KEY="sk_test_..."
|
|
664
|
+
|
|
665
|
+
# Azure CLI (no env var needed — just log in)
|
|
666
|
+
az login
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
### Setting Up the Teams MCP Server
|
|
670
|
+
|
|
671
|
+
1. Go to [Azure Portal > App Registrations](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps)
|
|
672
|
+
2. Click **New Registration** → name it "Claude Code Teams Bot"
|
|
673
|
+
3. **API Permissions** → Add Microsoft Graph:
|
|
674
|
+
- `ChannelMessage.Send`
|
|
675
|
+
- `ChannelMessage.Read.All`
|
|
676
|
+
- `Chat.ReadWrite`
|
|
677
|
+
- `Team.ReadBasic.All`
|
|
678
|
+
4. **Certificates & Secrets** → Create a new client secret
|
|
679
|
+
5. Copy the Tenant ID, Client ID, and Client Secret
|
|
680
|
+
6. Set the three `TEAMS_*` environment variables above
|
|
681
|
+
|
|
682
|
+
---
|
|
683
|
+
|
|
684
|
+
## Memory System
|
|
685
|
+
|
|
686
|
+
Claude maintains persistent memory across sessions in `~/.claude/projects/.../memory/`. The self-improvement hook prompts Claude to save learnings after each session.
|
|
687
|
+
|
|
688
|
+
| Memory Type | Purpose | Example |
|
|
689
|
+
|-------------|---------|---------|
|
|
690
|
+
| **user** | Who you are, preferences, expertise | "Senior .NET dev, prefers terse responses" |
|
|
691
|
+
| **feedback** | What to do / avoid (self-improving) | "Always push to both main and develop" |
|
|
692
|
+
| **project** | Decisions, priorities, blockers | "Using Stripe instead of Dwolla because..." |
|
|
693
|
+
| **reference** | URLs, credentials, external resources | "Staging URL: https://..." |
|
|
694
|
+
|
|
695
|
+
### Setting Up Your Memory
|
|
696
|
+
|
|
697
|
+
After installing, start a Claude Code session and say:
|
|
698
|
+
```
|
|
699
|
+
Set up my memory profile. I'm [your name], a [your role] at [your company].
|
|
700
|
+
I work on [your projects]. I prefer [your preferences].
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
Claude creates the initial memory files. Each subsequent session adds to them automatically.
|
|
704
|
+
|
|
705
|
+
---
|
|
706
|
+
|
|
707
|
+
## Customization
|
|
708
|
+
|
|
709
|
+
### Adding Custom Agents
|
|
710
|
+
|
|
711
|
+
Create `.claude/agents/your-agent.md` in your project:
|
|
712
|
+
|
|
713
|
+
```markdown
|
|
714
|
+
---
|
|
715
|
+
name: your-agent
|
|
716
|
+
description: What this agent does
|
|
717
|
+
tools:
|
|
718
|
+
- Bash
|
|
719
|
+
- Read
|
|
720
|
+
- Write
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
Instructions for the agent...
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### Adding Custom Hooks
|
|
727
|
+
|
|
728
|
+
1. Create `.claude/hooks/your-hook.sh` and make it executable
|
|
729
|
+
2. Add it to `.claude/settings.json` under PreToolUse, PostToolUse, or Stop
|
|
730
|
+
|
|
731
|
+
### Adding Custom Slash Commands
|
|
732
|
+
|
|
733
|
+
Create `.claude/commands/your-command.md`:
|
|
734
|
+
|
|
735
|
+
```markdown
|
|
736
|
+
Do something with $ARGUMENTS.
|
|
737
|
+
|
|
738
|
+
1. Step one
|
|
739
|
+
2. Step two
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
Use it: `/your-command some-argument`
|
|
743
|
+
|
|
744
|
+
### Removing Components
|
|
745
|
+
|
|
746
|
+
Delete any agent, hook, command, or MCP server you don't need. Everything works independently.
|
|
747
|
+
|
|
748
|
+
---
|
|
749
|
+
|
|
750
|
+
## Updating
|
|
751
|
+
|
|
752
|
+
When the infrastructure package is updated:
|
|
753
|
+
|
|
754
|
+
```bash
|
|
755
|
+
# npx always fetches the latest version
|
|
756
|
+
npx @chris1807/claude-kit init /path/to/project
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
The installer detects existing files and asks whether to overwrite or skip each one.
|
|
760
|
+
|
|
761
|
+
### Publishing Updates (Maintainers Only)
|
|
762
|
+
|
|
763
|
+
```bash
|
|
764
|
+
cd claude-kit
|
|
765
|
+
|
|
766
|
+
# Make your changes, then bump the version
|
|
767
|
+
npm version patch # 2.0.0 → 2.0.1
|
|
768
|
+
|
|
769
|
+
# Push the tag — GitHub Actions publishes to npm automatically
|
|
770
|
+
git push && git push --tags
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
> The `.github/workflows/publish.yml` workflow runs on any pushed `v*` tag and publishes to npm using the `NPM_TOKEN` repo secret. You should not run `npm publish` from a dev machine.
|
|
774
|
+
|
|
775
|
+
---
|
|
776
|
+
|
|
777
|
+
## Security
|
|
778
|
+
|
|
779
|
+
- **No secrets in the repo** — `.mcp.json` only contains `${ENV_VAR}` references
|
|
780
|
+
- **Sensitive data blocker hooks (4 layers)** — blocks database queries referencing TIN, SSN, bank account numbers, or other PII fields before execution (Bash + MCP), and scans all output (Bash, MCP, Read, Grep) for PII field names. Even encrypted values are never exposed. CLAUDE.md policy is injected at the top of every project
|
|
781
|
+
- **Secret blocker hook** — automatically blocks writes containing hardcoded credentials
|
|
782
|
+
- **Protected files hook** — prevents edits to production/staging configs
|
|
783
|
+
- **`.claude/settings.local.json`** is gitignored — personal permissions stay private
|
|
784
|
+
- **Public npm package** — published from a GitHub Actions workflow gated on a tag-version match check
|
|
785
|
+
|
|
786
|
+
---
|
|
787
|
+
|
|
788
|
+
## Troubleshooting
|
|
789
|
+
|
|
790
|
+
### `npm ERR! 404 Not Found`
|
|
791
|
+
|
|
792
|
+
If `npx @chris1807/claude-kit` reports 404, your local npm registry may be set to a private feed that overrides the public one. Check with `npm config get registry` — it should be `https://registry.npmjs.org/`.
|
|
793
|
+
|
|
794
|
+
### Hooks not running
|
|
795
|
+
|
|
796
|
+
Verify the settings file is loaded:
|
|
797
|
+
```
|
|
798
|
+
claude
|
|
799
|
+
/config
|
|
800
|
+
```
|
|
801
|
+
Check that `.claude/settings.json` shows your hooks.
|
|
802
|
+
|
|
803
|
+
### MCP server not connecting
|
|
804
|
+
|
|
805
|
+
Check that the environment variable is set:
|
|
806
|
+
```bash
|
|
807
|
+
echo $MONGODB_CONNECTION_STRING # Should show your connection string
|
|
808
|
+
echo $STRIPE_SECRET_KEY # Should show sk_test_...
|
|
809
|
+
az account show # Should show your Azure subscription
|
|
810
|
+
```
|
|
811
|
+
|
|
812
|
+
---
|
|
813
|
+
|
|
814
|
+
## Support
|
|
815
|
+
|
|
816
|
+
- **Issues:** [github.com/Christopher-Waters/claude-kit/issues](https://github.com/Christopher-Waters/claude-kit/issues)
|
|
817
|
+
- **Source:** [github.com/Christopher-Waters/claude-kit](https://github.com/Christopher-Waters/claude-kit)
|
|
818
|
+
|
|
819
|
+
## License
|
|
820
|
+
|
|
821
|
+
MIT
|