@wbern/claude-instructions 1.3.0 → 1.4.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/README.md +46 -13
- package/bin/cli.js +32 -8
- package/downloads/with-beads/ask.md +14 -5
- package/downloads/with-beads/cycle.md +1 -1
- package/downloads/with-beads/gap.md +6 -6
- package/downloads/with-beads/green.md +1 -1
- package/downloads/with-beads/red.md +1 -0
- package/downloads/with-beads/refactor.md +1 -1
- package/downloads/with-beads/ship.md +7 -3
- package/downloads/with-beads/show.md +8 -2
- package/downloads/with-beads/summarize.md +1 -1
- package/downloads/without-beads/ask.md +14 -5
- package/downloads/without-beads/cycle.md +1 -1
- package/downloads/without-beads/gap.md +5 -5
- package/downloads/without-beads/green.md +1 -1
- package/downloads/without-beads/red.md +1 -0
- package/downloads/without-beads/refactor.md +1 -1
- package/downloads/without-beads/ship.md +7 -3
- package/downloads/without-beads/show.md +8 -2
- package/downloads/without-beads/summarize.md +1 -1
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ npx @wbern/claude-instructions
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
The interactive installer lets you choose:
|
|
27
|
+
|
|
27
28
|
- **Variant**: With or without [Beads MCP](https://github.com/steveyegge/beads) integration
|
|
28
29
|
- **Scope**: User-level (global) or project-level installation
|
|
29
30
|
|
|
@@ -89,6 +90,7 @@ flowchart TB
|
|
|
89
90
|
Utils --> TDD[📚 /tdd<br/>Remind agent about TDD]
|
|
90
91
|
Utils --> AddCommand[➕ /add-command<br/>Create custom commands]
|
|
91
92
|
Utils --> Summarize[📄 /summarize<br/>Summarize conversation<br/><i>Optional: Beads MCP</i>]
|
|
93
|
+
Utils --> Gap[🔍 /gap<br/>Find unaddressed items<br/><i>Optional: Beads MCP</i>]
|
|
92
94
|
Utils --> Beepboop[🤖 /beepboop<br/>AI attribution]
|
|
93
95
|
|
|
94
96
|
Worktree[<b>WORKTREE MANAGEMENT</b>]
|
|
@@ -121,6 +123,7 @@ flowchart TB
|
|
|
121
123
|
- `/show` - Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)
|
|
122
124
|
- `/ask` - Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)
|
|
123
125
|
- `/summarize` - Summarize conversation progress and next steps
|
|
126
|
+
- `/gap` - Analyze conversation context for unaddressed items and gaps
|
|
124
127
|
|
|
125
128
|
### Worktree Management
|
|
126
129
|
|
|
@@ -140,6 +143,7 @@ flowchart TB
|
|
|
140
143
|
Here's a simple example to get you started with the TDD workflow:
|
|
141
144
|
|
|
142
145
|
**1. Write a failing test (`/red`)**
|
|
146
|
+
|
|
143
147
|
```
|
|
144
148
|
You: /red add a function that validates email addresses
|
|
145
149
|
|
|
@@ -149,6 +153,7 @@ Claude: I'll write a failing test for email validation.
|
|
|
149
153
|
```
|
|
150
154
|
|
|
151
155
|
**2. Make it pass (`/green`)**
|
|
156
|
+
|
|
152
157
|
```
|
|
153
158
|
You: /green
|
|
154
159
|
|
|
@@ -158,6 +163,7 @@ Claude: I'll implement the minimal code to pass the test.
|
|
|
158
163
|
```
|
|
159
164
|
|
|
160
165
|
**3. Refactor for quality (`/refactor`)**
|
|
166
|
+
|
|
161
167
|
```
|
|
162
168
|
You: /refactor extract regex pattern to a constant
|
|
163
169
|
|
|
@@ -169,18 +175,23 @@ Claude: I'll refactor while keeping tests green.
|
|
|
169
175
|
### Complete Workflow Example
|
|
170
176
|
|
|
171
177
|
**Starting from a GitHub issue:**
|
|
178
|
+
|
|
172
179
|
```
|
|
173
180
|
/issue 123
|
|
174
181
|
```
|
|
182
|
+
|
|
175
183
|
Claude analyzes the GitHub issue and creates a TDD implementation plan showing what tests to write.
|
|
176
184
|
|
|
177
185
|
**Running a full TDD cycle:**
|
|
186
|
+
|
|
178
187
|
```
|
|
179
188
|
/cycle implement user authentication with password hashing
|
|
180
189
|
```
|
|
190
|
+
|
|
181
191
|
Claude executes the complete red-green-refactor cycle: writes a failing test, implements it, then refactors.
|
|
182
192
|
|
|
183
193
|
**Individual phases for more control:**
|
|
194
|
+
|
|
184
195
|
```
|
|
185
196
|
/red test that users can't login with wrong password
|
|
186
197
|
/green
|
|
@@ -188,14 +199,17 @@ Claude executes the complete red-green-refactor cycle: writes a failing test, im
|
|
|
188
199
|
```
|
|
189
200
|
|
|
190
201
|
**Committing and creating PRs:**
|
|
202
|
+
|
|
191
203
|
```
|
|
192
204
|
/commit
|
|
193
205
|
```
|
|
206
|
+
|
|
194
207
|
Claude reviews changes, drafts a commit message following project standards, and creates the commit.
|
|
195
208
|
|
|
196
209
|
```
|
|
197
|
-
/
|
|
210
|
+
/ask
|
|
198
211
|
```
|
|
212
|
+
|
|
199
213
|
Claude analyzes commits, creates a PR with summary and test plan.
|
|
200
214
|
|
|
201
215
|
### What to Expect
|
|
@@ -220,69 +234,84 @@ The commands enforce TDD discipline: you can't refactor with failing tests, can'
|
|
|
220
234
|
|
|
221
235
|
👤 `/red` single element [1] returns 1
|
|
222
236
|
|
|
223
|
-
🔴
|
|
237
|
+
🔴 _writes test_
|
|
238
|
+
|
|
224
239
|
```typescript
|
|
225
240
|
expect(closestToZero([1])).toBe(1);
|
|
226
241
|
```
|
|
242
|
+
|
|
227
243
|
FAIL: closestToZero is not defined
|
|
228
244
|
|
|
229
245
|
👤 `/green`
|
|
230
246
|
|
|
231
|
-
🟢
|
|
247
|
+
🟢 _returns hardcoded 1_
|
|
248
|
+
|
|
232
249
|
```typescript
|
|
233
250
|
function closestToZero(nums: number[]): number {
|
|
234
251
|
return 1; // minimal - only need to pass current test
|
|
235
252
|
}
|
|
236
253
|
```
|
|
254
|
+
|
|
237
255
|
✅ Test passes
|
|
238
256
|
|
|
239
257
|
👤 `/red` two numbers [3, 2] returns 2
|
|
240
258
|
|
|
241
|
-
🔴
|
|
259
|
+
🔴 _writes test_
|
|
260
|
+
|
|
242
261
|
```typescript
|
|
243
262
|
expect(closestToZero([3, 2])).toBe(2);
|
|
244
263
|
```
|
|
264
|
+
|
|
245
265
|
FAIL: expected 1 to be 2
|
|
246
266
|
|
|
247
267
|
👤 `/green`
|
|
248
268
|
|
|
249
|
-
🟢
|
|
269
|
+
🟢 _sorts and returns first_
|
|
270
|
+
|
|
250
271
|
```typescript
|
|
251
272
|
function closestToZero(nums: number[]): number {
|
|
252
273
|
return nums.sort((a, b) => a - b)[0]; // minimal
|
|
253
274
|
}
|
|
254
275
|
```
|
|
276
|
+
|
|
255
277
|
✅ 2/2 tests pass
|
|
256
278
|
|
|
257
279
|
👤 `/red` with negative [-3, 2] returns 2
|
|
258
280
|
|
|
259
|
-
🔴
|
|
281
|
+
🔴 _writes test_
|
|
282
|
+
|
|
260
283
|
```typescript
|
|
261
284
|
expect(closestToZero([-3, 2])).toBe(2);
|
|
262
285
|
```
|
|
286
|
+
|
|
263
287
|
FAIL: expected -3 to be 2 (regular sort puts -3 first)
|
|
264
288
|
|
|
265
289
|
👤 `/green`
|
|
266
290
|
|
|
267
|
-
🟢
|
|
291
|
+
🟢 _sorts by absolute value_
|
|
292
|
+
|
|
268
293
|
```typescript
|
|
269
294
|
function closestToZero(nums: number[]): number {
|
|
270
295
|
return nums.sort((a, b) => Math.abs(a) - Math.abs(b))[0];
|
|
271
296
|
}
|
|
272
297
|
```
|
|
298
|
+
|
|
273
299
|
✅ 3/3 tests pass
|
|
274
300
|
|
|
275
301
|
👤 `/red` exact tie [-2, 2] returns positive 2
|
|
276
302
|
|
|
277
|
-
🔴
|
|
303
|
+
🔴 _writes test_
|
|
304
|
+
|
|
278
305
|
```typescript
|
|
279
306
|
expect(closestToZero([-2, 2])).toBe(2);
|
|
280
307
|
```
|
|
308
|
+
|
|
281
309
|
FAIL: expected -2 to be 2 (returns first when tied)
|
|
282
310
|
|
|
283
311
|
👤 `/green`
|
|
284
312
|
|
|
285
|
-
🟢
|
|
313
|
+
🟢 _adds tie-breaking: prefer positive_
|
|
314
|
+
|
|
286
315
|
```typescript
|
|
287
316
|
function closestToZero(nums: number[]): number {
|
|
288
317
|
return nums.sort((a, b) => {
|
|
@@ -291,11 +320,13 @@ function closestToZero(nums: number[]): number {
|
|
|
291
320
|
})[0];
|
|
292
321
|
}
|
|
293
322
|
```
|
|
323
|
+
|
|
294
324
|
✅ 4/4 tests pass
|
|
295
325
|
|
|
296
326
|
👤 `/refactor` extract helper and use iteration instead of sort
|
|
297
327
|
|
|
298
|
-
🔵
|
|
328
|
+
🔵 _extracts helper function for comparison logic_
|
|
329
|
+
|
|
299
330
|
```typescript
|
|
300
331
|
function isCloser(candidate: number, current: number): boolean {
|
|
301
332
|
const candAbs = Math.abs(candidate);
|
|
@@ -314,21 +345,23 @@ function closestToZero(nums: number[]): number {
|
|
|
314
345
|
return closest;
|
|
315
346
|
}
|
|
316
347
|
```
|
|
348
|
+
|
|
317
349
|
✅ 4/4 tests still pass
|
|
318
350
|
|
|
319
351
|
👤 `/refactor`
|
|
320
352
|
|
|
321
|
-
🔵
|
|
353
|
+
🔵 _uses reduce for more functional style_
|
|
354
|
+
|
|
322
355
|
```typescript
|
|
323
356
|
function closestToZero(nums: number[]): number {
|
|
324
357
|
if (nums.length === 0) return 0;
|
|
325
358
|
return nums.reduce((closest, num) =>
|
|
326
|
-
isCloser(num, closest) ? num : closest
|
|
359
|
+
isCloser(num, closest) ? num : closest,
|
|
327
360
|
);
|
|
328
361
|
}
|
|
329
362
|
```
|
|
330
|
-
✅ 4/4 tests still pass
|
|
331
363
|
|
|
364
|
+
✅ 4/4 tests still pass
|
|
332
365
|
|
|
333
366
|
## Contributing
|
|
334
367
|
|
package/bin/cli.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// scripts/cli.ts
|
|
4
4
|
import { select, text, groupMultiselect, isCancel, intro, outro } from "@clack/prompts";
|
|
5
|
+
import os2 from "os";
|
|
5
6
|
|
|
6
7
|
// scripts/cli-generator.ts
|
|
7
8
|
import fs from "fs-extra";
|
|
@@ -24,14 +25,30 @@ var DIRECTORIES = {
|
|
|
24
25
|
DOWNLOADS: "downloads"
|
|
25
26
|
};
|
|
26
27
|
var TEMPLATE_SOURCE_FILES = ["CLAUDE.md", "AGENTS.md"];
|
|
28
|
+
var ELLIPSIS = "...";
|
|
29
|
+
function truncatePathFromLeft(pathStr, maxLength) {
|
|
30
|
+
if (pathStr.length <= maxLength) {
|
|
31
|
+
return pathStr;
|
|
32
|
+
}
|
|
33
|
+
const truncated = pathStr.slice(-(maxLength - ELLIPSIS.length));
|
|
34
|
+
const firstSlash = truncated.indexOf("/");
|
|
35
|
+
if (firstSlash > 0) {
|
|
36
|
+
return ELLIPSIS + truncated.slice(firstSlash);
|
|
37
|
+
}
|
|
38
|
+
return ELLIPSIS + truncated;
|
|
39
|
+
}
|
|
27
40
|
var VARIANT_OPTIONS = [
|
|
28
|
-
{ value: VARIANTS.WITH_BEADS, label: "With Beads" },
|
|
29
|
-
{ value: VARIANTS.WITHOUT_BEADS, label: "Without Beads" }
|
|
30
|
-
];
|
|
31
|
-
var SCOPE_OPTIONS = [
|
|
32
|
-
{ value: SCOPES.PROJECT, label: "Project/Repository" },
|
|
33
|
-
{ value: SCOPES.USER, label: "User (Global)" }
|
|
41
|
+
{ value: VARIANTS.WITH_BEADS, label: "With Beads", hint: "Includes Beads task tracking" },
|
|
42
|
+
{ value: VARIANTS.WITHOUT_BEADS, label: "Without Beads", hint: "Standard commands only" }
|
|
34
43
|
];
|
|
44
|
+
function getScopeOptions(terminalWidth = 80) {
|
|
45
|
+
const projectPath = path.join(process.cwd(), DIRECTORIES.CLAUDE, DIRECTORIES.COMMANDS);
|
|
46
|
+
const userPath = path.join(os.homedir(), DIRECTORIES.CLAUDE, DIRECTORIES.COMMANDS);
|
|
47
|
+
return [
|
|
48
|
+
{ value: SCOPES.PROJECT, label: "Project/Repository", hint: truncatePathFromLeft(projectPath, terminalWidth) },
|
|
49
|
+
{ value: SCOPES.USER, label: "User (Global)", hint: truncatePathFromLeft(userPath, terminalWidth) }
|
|
50
|
+
];
|
|
51
|
+
}
|
|
35
52
|
async function getCommandsGroupedByCategory(variant) {
|
|
36
53
|
const sourcePath = path.join(__dirname, "..", DIRECTORIES.DOWNLOADS, variant || VARIANTS.WITH_BEADS);
|
|
37
54
|
const metadataPath = path.join(sourcePath, "commands-metadata.json");
|
|
@@ -179,9 +196,11 @@ async function main(args) {
|
|
|
179
196
|
if (isCancel(variant)) {
|
|
180
197
|
return;
|
|
181
198
|
}
|
|
199
|
+
const terminalWidth = process.stdout.columns || 80;
|
|
200
|
+
const uiOverhead = 25;
|
|
182
201
|
scope = await select({
|
|
183
202
|
message: "Select installation scope",
|
|
184
|
-
options:
|
|
203
|
+
options: getScopeOptions(terminalWidth - uiOverhead)
|
|
185
204
|
});
|
|
186
205
|
if (isCancel(scope)) {
|
|
187
206
|
return;
|
|
@@ -205,7 +224,12 @@ async function main(args) {
|
|
|
205
224
|
}
|
|
206
225
|
}
|
|
207
226
|
const result = await generateToDirectory(void 0, variant, scope, { commandPrefix, skipTemplateInjection: args?.skipTemplateInjection, commands: selectedCommands });
|
|
208
|
-
|
|
227
|
+
const fullPath = scope === "project" ? `${process.cwd()}/.claude/commands` : `${os2.homedir()}/.claude/commands`;
|
|
228
|
+
outro(`Installed ${result.filesGenerated} commands to ${fullPath}
|
|
229
|
+
|
|
230
|
+
If Claude Code is already running, restart it to pick up the new commands.
|
|
231
|
+
|
|
232
|
+
Happy TDD'ing!`);
|
|
209
233
|
}
|
|
210
234
|
|
|
211
235
|
// scripts/bin.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools:
|
|
2
|
+
allowed-tools: mcp__github__create_pull_request, mcp__github__update_pull_request, Bash(git status:*), Bash(git log:*), Bash(git push:*), Bash(git branch:*)
|
|
3
3
|
description: Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)
|
|
4
4
|
argument-hint: [optional-pr-title-and-description]
|
|
5
5
|
---
|
|
@@ -18,6 +18,7 @@ argument-hint: [optional-pr-title-and-description]
|
|
|
18
18
|
> 💭 **Cursor says**: Fine, SOME things still need traditional PRs. But be intentional about it.
|
|
19
19
|
|
|
20
20
|
Ask is for complex changes that need team discussion and approval. Examples:
|
|
21
|
+
|
|
21
22
|
- Breaking API changes
|
|
22
23
|
- New architecture decisions
|
|
23
24
|
- Significant feature additions
|
|
@@ -27,6 +28,7 @@ Ask is for complex changes that need team discussion and approval. Examples:
|
|
|
27
28
|
## When to Ask
|
|
28
29
|
|
|
29
30
|
Use **Ask** when:
|
|
31
|
+
|
|
30
32
|
- Changes affect multiple systems
|
|
31
33
|
- Breaking changes are needed
|
|
32
34
|
- You need input on approach
|
|
@@ -54,10 +56,11 @@ Arguments: $ARGUMENTS
|
|
|
54
56
|
- Push to remote: `git push origin [branch-name]`
|
|
55
57
|
|
|
56
58
|
2. **Create Ask PR**: Create a PR that clearly needs review
|
|
57
|
-
|
|
59
|
+
|
|
58
60
|
Title: conventional commits format, prefixed with `[ASK]`
|
|
59
|
-
|
|
61
|
+
|
|
60
62
|
Description template:
|
|
63
|
+
|
|
61
64
|
```markdown
|
|
62
65
|
## 🤔 Ask - Review and Approval Needed
|
|
63
66
|
|
|
@@ -68,32 +71,38 @@ Arguments: $ARGUMENTS
|
|
|
68
71
|
-->
|
|
69
72
|
|
|
70
73
|
### What changed
|
|
74
|
+
|
|
71
75
|
[Detailed description of changes]
|
|
72
76
|
|
|
73
77
|
### Why
|
|
78
|
+
|
|
74
79
|
[Rationale and context]
|
|
75
80
|
|
|
76
81
|
### Questions for reviewers
|
|
82
|
+
|
|
77
83
|
- [ ] Question 1
|
|
78
84
|
- [ ] Question 2
|
|
79
85
|
|
|
80
86
|
### Concerns
|
|
87
|
+
|
|
81
88
|
- Potential concern 1
|
|
82
89
|
- Potential concern 2
|
|
83
90
|
|
|
84
91
|
### Test Plan
|
|
92
|
+
|
|
85
93
|
- [ ] Unit tests
|
|
86
94
|
- [ ] Integration tests
|
|
87
95
|
- [ ] Manual testing steps
|
|
88
96
|
|
|
89
97
|
### Alternatives considered
|
|
98
|
+
|
|
90
99
|
- Alternative 1: [why not chosen]
|
|
91
100
|
- Alternative 2: [why not chosen]
|
|
92
101
|
```
|
|
93
102
|
|
|
94
103
|
3. **Request Reviewers**: Assign specific reviewers who should weigh in
|
|
95
104
|
|
|
96
|
-
4. **Add Labels**:
|
|
105
|
+
4. **Add Labels**:
|
|
97
106
|
- "needs-review"
|
|
98
107
|
- "breaking-change" (if applicable)
|
|
99
108
|
- "security" (if applicable)
|
|
@@ -113,6 +122,7 @@ Arguments: $ARGUMENTS
|
|
|
113
122
|
## Decision Guide
|
|
114
123
|
|
|
115
124
|
Use **Ask** when:
|
|
125
|
+
|
|
116
126
|
- ✅ Change is complex or risky
|
|
117
127
|
- ✅ Breaking changes involved
|
|
118
128
|
- ✅ Need team input on approach
|
|
@@ -131,4 +141,3 @@ Use Beads MCP to:
|
|
|
131
141
|
- Track dependencies with `bd dep add`
|
|
132
142
|
|
|
133
143
|
See https://github.com/steveyegge/beads for more information.
|
|
134
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
3
3
|
description: Execute complete TDD cycle - Red, Green, and Refactor phases in sequence
|
|
4
4
|
argument-hint: <feature or requirement description>
|
|
5
5
|
---
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: mcp__beads__list, mcp__beads__ready
|
|
3
2
|
description: Analyze conversation context for unaddressed items and gaps
|
|
4
3
|
---
|
|
5
4
|
|
|
@@ -8,13 +7,14 @@ Analyze the current conversation context and identify things that have not yet b
|
|
|
8
7
|
1. **Incomplete implementations** - Code that was started but not finished
|
|
9
8
|
2. **Unused variables/results** - Values that were captured but never used
|
|
10
9
|
3. **Missing tests** - Functionality without test coverage
|
|
11
|
-
4. **Open issues** - Beads issues that are still open or in progress
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
4. **Open issues** - Beads issues that are still open or in progress
|
|
11
|
+
4. **User requests** - Things the user asked for that weren't fully completed
|
|
12
|
+
5. **TODO comments** - Any TODOs mentioned in conversation
|
|
13
|
+
6. **Error handling gaps** - Missing error cases or edge cases
|
|
14
|
+
7. **Documentation gaps** - Undocumented APIs or features
|
|
16
15
|
|
|
17
16
|
Present findings as a prioritized list with:
|
|
17
|
+
|
|
18
18
|
- What the gap is
|
|
19
19
|
- Why it matters
|
|
20
20
|
- Suggested next action
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
3
3
|
description: Execute TDD Green Phase - write minimal implementation to pass the failing test
|
|
4
4
|
argument-hint: <implementation description>
|
|
5
5
|
---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools:
|
|
2
|
+
allowed-tools: Bash(git status:*), Bash(git log:*), Bash(git diff:*), Bash(git checkout:*), Bash(git pull:*), Bash(git merge:*), Bash(git push:*), Bash(git branch:*)
|
|
3
3
|
description: Ship code directly to main - for small, obvious changes that don't need review (Cursor's modern alternative to PRs)
|
|
4
4
|
argument-hint: [optional-commit-message]
|
|
5
5
|
---
|
|
@@ -18,6 +18,7 @@ argument-hint: [optional-commit-message]
|
|
|
18
18
|
> 🎯 **Cursor says**: It's 2025! Not everything needs a PR. Ship small, obvious changes directly.
|
|
19
19
|
|
|
20
20
|
Ship is for small, obvious changes that don't need code review. Examples:
|
|
21
|
+
|
|
21
22
|
- Typo fixes
|
|
22
23
|
- Formatting changes
|
|
23
24
|
- Documentation updates
|
|
@@ -27,6 +28,7 @@ Ship is for small, obvious changes that don't need code review. Examples:
|
|
|
27
28
|
## Prerequisites
|
|
28
29
|
|
|
29
30
|
Before shipping directly to main:
|
|
31
|
+
|
|
30
32
|
1. All tests must pass
|
|
31
33
|
2. Linter must pass
|
|
32
34
|
3. Changes must be small and low-risk
|
|
@@ -57,10 +59,11 @@ Arguments: $ARGUMENTS
|
|
|
57
59
|
- Is this a small, obvious change?
|
|
58
60
|
- Do all tests pass?
|
|
59
61
|
- Is CI green?
|
|
60
|
-
|
|
62
|
+
|
|
61
63
|
If ANY of these are "no", suggest using `/show` or `/ask` instead.
|
|
62
64
|
|
|
63
65
|
5. **Merge to Main**: If all checks pass and user confirms:
|
|
66
|
+
|
|
64
67
|
```bash
|
|
65
68
|
git checkout main
|
|
66
69
|
git pull origin main
|
|
@@ -69,6 +72,7 @@ Arguments: $ARGUMENTS
|
|
|
69
72
|
```
|
|
70
73
|
|
|
71
74
|
6. **Cleanup**: Delete the feature branch
|
|
75
|
+
|
|
72
76
|
```bash
|
|
73
77
|
git branch -d [feature-branch]
|
|
74
78
|
git push origin --delete [feature-branch]
|
|
@@ -79,6 +83,7 @@ Arguments: $ARGUMENTS
|
|
|
79
83
|
## Safety Rails
|
|
80
84
|
|
|
81
85
|
If tests fail, linter fails, or changes are large/complex, STOP and suggest:
|
|
86
|
+
|
|
82
87
|
- Use `/show` for changes that should be seen but don't need approval
|
|
83
88
|
- Use `/ask` (traditional PR) for complex changes needing discussion
|
|
84
89
|
|
|
@@ -90,4 +95,3 @@ Use Beads MCP to:
|
|
|
90
95
|
- Track dependencies with `bd dep add`
|
|
91
96
|
|
|
92
97
|
See https://github.com/steveyegge/beads for more information.
|
|
93
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools:
|
|
2
|
+
allowed-tools: mcp__github__create_pull_request, mcp__github__update_pull_request, Bash(git status:*), Bash(git log:*), Bash(git push:*), Bash(git branch:*)
|
|
3
3
|
description: Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)
|
|
4
4
|
argument-hint: [optional-pr-title-and-description]
|
|
5
5
|
---
|
|
@@ -18,6 +18,7 @@ argument-hint: [optional-pr-title-and-description]
|
|
|
18
18
|
> 🚀 **Cursor says**: Not every change needs a traditional review. Show your work, then merge.
|
|
19
19
|
|
|
20
20
|
Show is for changes that teammates should see, but don't require approval. Examples:
|
|
21
|
+
|
|
21
22
|
- Refactoring with test coverage
|
|
22
23
|
- New features with comprehensive tests
|
|
23
24
|
- Performance improvements
|
|
@@ -26,6 +27,7 @@ Show is for changes that teammates should see, but don't require approval. Examp
|
|
|
26
27
|
## Prerequisites
|
|
27
28
|
|
|
28
29
|
Before using show:
|
|
30
|
+
|
|
29
31
|
1. All tests must pass
|
|
30
32
|
2. Changes should have good test coverage
|
|
31
33
|
3. Changes should be non-breaking or backward compatible
|
|
@@ -60,6 +62,7 @@ Arguments: $ARGUMENTS
|
|
|
60
62
|
- Add notice that feedback is welcome but not required
|
|
61
63
|
|
|
62
64
|
4. **PR Description Template**:
|
|
65
|
+
|
|
63
66
|
```markdown
|
|
64
67
|
## 🚀 Show - Auto-merging after CI
|
|
65
68
|
|
|
@@ -71,12 +74,15 @@ Arguments: $ARGUMENTS
|
|
|
71
74
|
-->
|
|
72
75
|
|
|
73
76
|
### What changed
|
|
77
|
+
|
|
74
78
|
[Brief description]
|
|
75
79
|
|
|
76
80
|
### Why
|
|
81
|
+
|
|
77
82
|
[Rationale for change]
|
|
78
83
|
|
|
79
84
|
### Test coverage
|
|
85
|
+
|
|
80
86
|
- [ ] All tests pass
|
|
81
87
|
- [ ] Coverage maintained/improved
|
|
82
88
|
- [ ] No breaking changes
|
|
@@ -87,6 +93,7 @@ Arguments: $ARGUMENTS
|
|
|
87
93
|
## Decision Guide
|
|
88
94
|
|
|
89
95
|
Use **Show** when:
|
|
96
|
+
|
|
90
97
|
- ✅ Tests are comprehensive
|
|
91
98
|
- ✅ Changes are non-breaking
|
|
92
99
|
- ✅ You're confident in the approach
|
|
@@ -104,4 +111,3 @@ Use Beads MCP to:
|
|
|
104
111
|
- Track dependencies with `bd dep add`
|
|
105
112
|
|
|
106
113
|
See https://github.com/steveyegge/beads for more information.
|
|
107
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools:
|
|
2
|
+
allowed-tools: mcp__github__create_pull_request, mcp__github__update_pull_request, Bash(git status:*), Bash(git log:*), Bash(git push:*), Bash(git branch:*)
|
|
3
3
|
description: Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)
|
|
4
4
|
argument-hint: [optional-pr-title-and-description]
|
|
5
5
|
---
|
|
@@ -18,6 +18,7 @@ argument-hint: [optional-pr-title-and-description]
|
|
|
18
18
|
> 💭 **Cursor says**: Fine, SOME things still need traditional PRs. But be intentional about it.
|
|
19
19
|
|
|
20
20
|
Ask is for complex changes that need team discussion and approval. Examples:
|
|
21
|
+
|
|
21
22
|
- Breaking API changes
|
|
22
23
|
- New architecture decisions
|
|
23
24
|
- Significant feature additions
|
|
@@ -27,6 +28,7 @@ Ask is for complex changes that need team discussion and approval. Examples:
|
|
|
27
28
|
## When to Ask
|
|
28
29
|
|
|
29
30
|
Use **Ask** when:
|
|
31
|
+
|
|
30
32
|
- Changes affect multiple systems
|
|
31
33
|
- Breaking changes are needed
|
|
32
34
|
- You need input on approach
|
|
@@ -54,10 +56,11 @@ Arguments: $ARGUMENTS
|
|
|
54
56
|
- Push to remote: `git push origin [branch-name]`
|
|
55
57
|
|
|
56
58
|
2. **Create Ask PR**: Create a PR that clearly needs review
|
|
57
|
-
|
|
59
|
+
|
|
58
60
|
Title: conventional commits format, prefixed with `[ASK]`
|
|
59
|
-
|
|
61
|
+
|
|
60
62
|
Description template:
|
|
63
|
+
|
|
61
64
|
```markdown
|
|
62
65
|
## 🤔 Ask - Review and Approval Needed
|
|
63
66
|
|
|
@@ -68,32 +71,38 @@ Arguments: $ARGUMENTS
|
|
|
68
71
|
-->
|
|
69
72
|
|
|
70
73
|
### What changed
|
|
74
|
+
|
|
71
75
|
[Detailed description of changes]
|
|
72
76
|
|
|
73
77
|
### Why
|
|
78
|
+
|
|
74
79
|
[Rationale and context]
|
|
75
80
|
|
|
76
81
|
### Questions for reviewers
|
|
82
|
+
|
|
77
83
|
- [ ] Question 1
|
|
78
84
|
- [ ] Question 2
|
|
79
85
|
|
|
80
86
|
### Concerns
|
|
87
|
+
|
|
81
88
|
- Potential concern 1
|
|
82
89
|
- Potential concern 2
|
|
83
90
|
|
|
84
91
|
### Test Plan
|
|
92
|
+
|
|
85
93
|
- [ ] Unit tests
|
|
86
94
|
- [ ] Integration tests
|
|
87
95
|
- [ ] Manual testing steps
|
|
88
96
|
|
|
89
97
|
### Alternatives considered
|
|
98
|
+
|
|
90
99
|
- Alternative 1: [why not chosen]
|
|
91
100
|
- Alternative 2: [why not chosen]
|
|
92
101
|
```
|
|
93
102
|
|
|
94
103
|
3. **Request Reviewers**: Assign specific reviewers who should weigh in
|
|
95
104
|
|
|
96
|
-
4. **Add Labels**:
|
|
105
|
+
4. **Add Labels**:
|
|
97
106
|
- "needs-review"
|
|
98
107
|
- "breaking-change" (if applicable)
|
|
99
108
|
- "security" (if applicable)
|
|
@@ -113,6 +122,7 @@ Arguments: $ARGUMENTS
|
|
|
113
122
|
## Decision Guide
|
|
114
123
|
|
|
115
124
|
Use **Ask** when:
|
|
125
|
+
|
|
116
126
|
- ✅ Change is complex or risky
|
|
117
127
|
- ✅ Breaking changes involved
|
|
118
128
|
- ✅ Need team input on approach
|
|
@@ -123,4 +133,3 @@ Use **/show** instead if: confident in approach, just want visibility
|
|
|
123
133
|
|
|
124
134
|
Use **/ship** instead if: change is tiny, obvious, and safe
|
|
125
135
|
|
|
126
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
3
3
|
description: Execute complete TDD cycle - Red, Green, and Refactor phases in sequence
|
|
4
4
|
argument-hint: <feature or requirement description>
|
|
5
5
|
---
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: mcp__beads__list, mcp__beads__ready
|
|
3
2
|
description: Analyze conversation context for unaddressed items and gaps
|
|
4
3
|
---
|
|
5
4
|
|
|
@@ -8,12 +7,13 @@ Analyze the current conversation context and identify things that have not yet b
|
|
|
8
7
|
1. **Incomplete implementations** - Code that was started but not finished
|
|
9
8
|
2. **Unused variables/results** - Values that were captured but never used
|
|
10
9
|
3. **Missing tests** - Functionality without test coverage
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
4. **User requests** - Things the user asked for that weren't fully completed
|
|
11
|
+
5. **TODO comments** - Any TODOs mentioned in conversation
|
|
12
|
+
6. **Error handling gaps** - Missing error cases or edge cases
|
|
13
|
+
7. **Documentation gaps** - Undocumented APIs or features
|
|
15
14
|
|
|
16
15
|
Present findings as a prioritized list with:
|
|
16
|
+
|
|
17
17
|
- What the gap is
|
|
18
18
|
- Why it matters
|
|
19
19
|
- Suggested next action
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
3
3
|
description: Execute TDD Green Phase - write minimal implementation to pass the failing test
|
|
4
4
|
argument-hint: <implementation description>
|
|
5
5
|
---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools:
|
|
2
|
+
allowed-tools: Bash(git status:*), Bash(git log:*), Bash(git diff:*), Bash(git checkout:*), Bash(git pull:*), Bash(git merge:*), Bash(git push:*), Bash(git branch:*)
|
|
3
3
|
description: Ship code directly to main - for small, obvious changes that don't need review (Cursor's modern alternative to PRs)
|
|
4
4
|
argument-hint: [optional-commit-message]
|
|
5
5
|
---
|
|
@@ -18,6 +18,7 @@ argument-hint: [optional-commit-message]
|
|
|
18
18
|
> 🎯 **Cursor says**: It's 2025! Not everything needs a PR. Ship small, obvious changes directly.
|
|
19
19
|
|
|
20
20
|
Ship is for small, obvious changes that don't need code review. Examples:
|
|
21
|
+
|
|
21
22
|
- Typo fixes
|
|
22
23
|
- Formatting changes
|
|
23
24
|
- Documentation updates
|
|
@@ -27,6 +28,7 @@ Ship is for small, obvious changes that don't need code review. Examples:
|
|
|
27
28
|
## Prerequisites
|
|
28
29
|
|
|
29
30
|
Before shipping directly to main:
|
|
31
|
+
|
|
30
32
|
1. All tests must pass
|
|
31
33
|
2. Linter must pass
|
|
32
34
|
3. Changes must be small and low-risk
|
|
@@ -57,10 +59,11 @@ Arguments: $ARGUMENTS
|
|
|
57
59
|
- Is this a small, obvious change?
|
|
58
60
|
- Do all tests pass?
|
|
59
61
|
- Is CI green?
|
|
60
|
-
|
|
62
|
+
|
|
61
63
|
If ANY of these are "no", suggest using `/show` or `/ask` instead.
|
|
62
64
|
|
|
63
65
|
5. **Merge to Main**: If all checks pass and user confirms:
|
|
66
|
+
|
|
64
67
|
```bash
|
|
65
68
|
git checkout main
|
|
66
69
|
git pull origin main
|
|
@@ -69,6 +72,7 @@ Arguments: $ARGUMENTS
|
|
|
69
72
|
```
|
|
70
73
|
|
|
71
74
|
6. **Cleanup**: Delete the feature branch
|
|
75
|
+
|
|
72
76
|
```bash
|
|
73
77
|
git branch -d [feature-branch]
|
|
74
78
|
git push origin --delete [feature-branch]
|
|
@@ -79,7 +83,7 @@ Arguments: $ARGUMENTS
|
|
|
79
83
|
## Safety Rails
|
|
80
84
|
|
|
81
85
|
If tests fail, linter fails, or changes are large/complex, STOP and suggest:
|
|
86
|
+
|
|
82
87
|
- Use `/show` for changes that should be seen but don't need approval
|
|
83
88
|
- Use `/ask` (traditional PR) for complex changes needing discussion
|
|
84
89
|
|
|
85
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
allowed-tools:
|
|
2
|
+
allowed-tools: mcp__github__create_pull_request, mcp__github__update_pull_request, Bash(git status:*), Bash(git log:*), Bash(git push:*), Bash(git branch:*)
|
|
3
3
|
description: Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)
|
|
4
4
|
argument-hint: [optional-pr-title-and-description]
|
|
5
5
|
---
|
|
@@ -18,6 +18,7 @@ argument-hint: [optional-pr-title-and-description]
|
|
|
18
18
|
> 🚀 **Cursor says**: Not every change needs a traditional review. Show your work, then merge.
|
|
19
19
|
|
|
20
20
|
Show is for changes that teammates should see, but don't require approval. Examples:
|
|
21
|
+
|
|
21
22
|
- Refactoring with test coverage
|
|
22
23
|
- New features with comprehensive tests
|
|
23
24
|
- Performance improvements
|
|
@@ -26,6 +27,7 @@ Show is for changes that teammates should see, but don't require approval. Examp
|
|
|
26
27
|
## Prerequisites
|
|
27
28
|
|
|
28
29
|
Before using show:
|
|
30
|
+
|
|
29
31
|
1. All tests must pass
|
|
30
32
|
2. Changes should have good test coverage
|
|
31
33
|
3. Changes should be non-breaking or backward compatible
|
|
@@ -60,6 +62,7 @@ Arguments: $ARGUMENTS
|
|
|
60
62
|
- Add notice that feedback is welcome but not required
|
|
61
63
|
|
|
62
64
|
4. **PR Description Template**:
|
|
65
|
+
|
|
63
66
|
```markdown
|
|
64
67
|
## 🚀 Show - Auto-merging after CI
|
|
65
68
|
|
|
@@ -71,12 +74,15 @@ Arguments: $ARGUMENTS
|
|
|
71
74
|
-->
|
|
72
75
|
|
|
73
76
|
### What changed
|
|
77
|
+
|
|
74
78
|
[Brief description]
|
|
75
79
|
|
|
76
80
|
### Why
|
|
81
|
+
|
|
77
82
|
[Rationale for change]
|
|
78
83
|
|
|
79
84
|
### Test coverage
|
|
85
|
+
|
|
80
86
|
- [ ] All tests pass
|
|
81
87
|
- [ ] Coverage maintained/improved
|
|
82
88
|
- [ ] No breaking changes
|
|
@@ -87,6 +93,7 @@ Arguments: $ARGUMENTS
|
|
|
87
93
|
## Decision Guide
|
|
88
94
|
|
|
89
95
|
Use **Show** when:
|
|
96
|
+
|
|
90
97
|
- ✅ Tests are comprehensive
|
|
91
98
|
- ✅ Changes are non-breaking
|
|
92
99
|
- ✅ You're confident in the approach
|
|
@@ -96,4 +103,3 @@ Use **/ship** instead if: change is tiny and obvious (typo, formatting)
|
|
|
96
103
|
|
|
97
104
|
Use **/ask** instead if: change needs discussion, breaks APIs, or you're uncertain
|
|
98
105
|
|
|
99
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wbern/claude-instructions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "TDD workflow commands for Claude Code CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin/cli.js",
|
|
@@ -28,26 +28,33 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"scripts": {
|
|
30
30
|
"clean": "rm -rf downloads",
|
|
31
|
-
"
|
|
32
|
-
"build": "bash scripts/build.sh",
|
|
33
|
-
"build:dev": "bash scripts/build-dev.sh",
|
|
31
|
+
"build": "tsx scripts/build.ts",
|
|
34
32
|
"build:cli": "tsup",
|
|
35
33
|
"test:manual": "pnpm build:cli && TMPDIR=$(mktemp -d) && pnpm pack --pack-destination $TMPDIR && cd $TMPDIR && tar -xzf *.tgz && cd package && pnpm i && node bin/cli.js",
|
|
36
34
|
"generate": "tsx scripts/cli-generator.ts",
|
|
37
35
|
"test": "vitest run",
|
|
38
36
|
"test:watch": "vitest",
|
|
39
37
|
"typecheck": "tsc --noEmit",
|
|
38
|
+
"knip": "knip",
|
|
39
|
+
"duplication-check": "jscpd",
|
|
40
40
|
"prepublishOnly": "bash scripts/check-publish.sh && pnpm build && pnpm build:cli",
|
|
41
41
|
"prepare": "husky"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@eslint/js": "^9.39.1",
|
|
44
45
|
"@types/fs-extra": "^11.0.4",
|
|
45
46
|
"@types/node": "^24.10.1",
|
|
47
|
+
"eslint": "^9.39.1",
|
|
46
48
|
"husky": "^9.1.7",
|
|
49
|
+
"jscpd": "^4.0.5",
|
|
50
|
+
"knip": "^5.70.2",
|
|
51
|
+
"lint-staged": "^16.2.7",
|
|
47
52
|
"markdown-magic": "^4.0.4",
|
|
53
|
+
"prettier": "^3.7.2",
|
|
48
54
|
"tsup": "^8.5.1",
|
|
49
55
|
"tsx": "^4.20.6",
|
|
50
56
|
"typescript": "^5.9.3",
|
|
57
|
+
"typescript-eslint": "^8.48.0",
|
|
51
58
|
"vitest": "^4.0.8"
|
|
52
59
|
},
|
|
53
60
|
"dependencies": {
|