@wbern/claude-instructions 1.2.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 +48 -87
- package/bin/cli.js +156 -27
- package/downloads/with-beads/ask.md +14 -5
- package/downloads/with-beads/commands-metadata.json +92 -0
- package/downloads/with-beads/cycle.md +1 -1
- package/downloads/with-beads/gap.md +22 -0
- 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/commands-metadata.json +92 -0
- package/downloads/without-beads/cycle.md +1 -1
- package/downloads/without-beads/gap.md +21 -0
- 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 +12 -4
package/README.md
CHANGED
|
@@ -19,85 +19,14 @@ TDD workflow commands for Claude Code CLI.
|
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
|
-
### Quick Install (Recommended)
|
|
23
|
-
|
|
24
22
|
```bash
|
|
25
23
|
npx @wbern/claude-instructions
|
|
26
24
|
```
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### Manual Installation
|
|
31
|
-
|
|
32
|
-
#### Without Beads Integration (Recommended for Beginners)
|
|
33
|
-
|
|
34
|
-
Standalone TDD workflow commands without dependencies.
|
|
35
|
-
|
|
36
|
-
**User-level (global - available in all projects):**
|
|
37
|
-
```bash
|
|
38
|
-
# Clone the repository
|
|
39
|
-
git clone https://github.com/wbern/claude-instructions.git /tmp/claude-instructions
|
|
40
|
-
|
|
41
|
-
# Copy commands to your user directory
|
|
42
|
-
cp /tmp/claude-instructions/downloads/without-beads/*.md ~/.claude/commands/
|
|
43
|
-
|
|
44
|
-
# Clean up
|
|
45
|
-
rm -rf /tmp/claude-instructions
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Project-level (current repository only):**
|
|
49
|
-
```bash
|
|
50
|
-
# Clone the repository
|
|
51
|
-
git clone https://github.com/wbern/claude-instructions.git /tmp/claude-instructions
|
|
52
|
-
|
|
53
|
-
# Create commands directory and copy files
|
|
54
|
-
mkdir -p .claude/commands
|
|
55
|
-
cp /tmp/claude-instructions/downloads/without-beads/*.md .claude/commands/
|
|
56
|
-
|
|
57
|
-
# Clean up
|
|
58
|
-
rm -rf /tmp/claude-instructions
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
#### With Beads Integration
|
|
26
|
+
The interactive installer lets you choose:
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
**Choose this if you:**
|
|
66
|
-
- Are comfortable with TDD workflows
|
|
67
|
-
- Need issue tracking and workflow management
|
|
68
|
-
- Work in a team environment
|
|
69
|
-
- Want integrated project planning with `/plan`
|
|
70
|
-
|
|
71
|
-
**User-level (global - available in all projects):**
|
|
72
|
-
```bash
|
|
73
|
-
# Clone the repository
|
|
74
|
-
git clone https://github.com/wbern/claude-instructions.git /tmp/claude-instructions
|
|
75
|
-
|
|
76
|
-
# Copy commands to your user directory
|
|
77
|
-
cp /tmp/claude-instructions/downloads/with-beads/*.md ~/.claude/commands/
|
|
78
|
-
|
|
79
|
-
# Clean up
|
|
80
|
-
rm -rf /tmp/claude-instructions
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**Project-level (current repository only):**
|
|
84
|
-
```bash
|
|
85
|
-
# Clone the repository
|
|
86
|
-
git clone https://github.com/wbern/claude-instructions.git /tmp/claude-instructions
|
|
87
|
-
|
|
88
|
-
# Create commands directory and copy files
|
|
89
|
-
mkdir -p .claude/commands
|
|
90
|
-
cp /tmp/claude-instructions/downloads/with-beads/*.md .claude/commands/
|
|
91
|
-
|
|
92
|
-
# Clean up
|
|
93
|
-
rm -rf /tmp/claude-instructions
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**Requirements:**
|
|
97
|
-
- Install [Beads MCP](https://github.com/steveyegge/beads) for full functionality
|
|
98
|
-
- Configure Beads in your project with `bd init`
|
|
99
|
-
|
|
100
|
-
**Note:** User-level installation makes commands available globally in all your projects. Project-level installation only makes them available in the current repository.
|
|
28
|
+
- **Variant**: With or without [Beads MCP](https://github.com/steveyegge/beads) integration
|
|
29
|
+
- **Scope**: User-level (global) or project-level installation
|
|
101
30
|
|
|
102
31
|
After installation, restart Claude Code if it's currently running.
|
|
103
32
|
|
|
@@ -161,6 +90,7 @@ flowchart TB
|
|
|
161
90
|
Utils --> TDD[📚 /tdd<br/>Remind agent about TDD]
|
|
162
91
|
Utils --> AddCommand[➕ /add-command<br/>Create custom commands]
|
|
163
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>]
|
|
164
94
|
Utils --> Beepboop[🤖 /beepboop<br/>AI attribution]
|
|
165
95
|
|
|
166
96
|
Worktree[<b>WORKTREE MANAGEMENT</b>]
|
|
@@ -193,6 +123,7 @@ flowchart TB
|
|
|
193
123
|
- `/show` - Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)
|
|
194
124
|
- `/ask` - Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)
|
|
195
125
|
- `/summarize` - Summarize conversation progress and next steps
|
|
126
|
+
- `/gap` - Analyze conversation context for unaddressed items and gaps
|
|
196
127
|
|
|
197
128
|
### Worktree Management
|
|
198
129
|
|
|
@@ -212,6 +143,7 @@ flowchart TB
|
|
|
212
143
|
Here's a simple example to get you started with the TDD workflow:
|
|
213
144
|
|
|
214
145
|
**1. Write a failing test (`/red`)**
|
|
146
|
+
|
|
215
147
|
```
|
|
216
148
|
You: /red add a function that validates email addresses
|
|
217
149
|
|
|
@@ -221,6 +153,7 @@ Claude: I'll write a failing test for email validation.
|
|
|
221
153
|
```
|
|
222
154
|
|
|
223
155
|
**2. Make it pass (`/green`)**
|
|
156
|
+
|
|
224
157
|
```
|
|
225
158
|
You: /green
|
|
226
159
|
|
|
@@ -230,6 +163,7 @@ Claude: I'll implement the minimal code to pass the test.
|
|
|
230
163
|
```
|
|
231
164
|
|
|
232
165
|
**3. Refactor for quality (`/refactor`)**
|
|
166
|
+
|
|
233
167
|
```
|
|
234
168
|
You: /refactor extract regex pattern to a constant
|
|
235
169
|
|
|
@@ -241,18 +175,23 @@ Claude: I'll refactor while keeping tests green.
|
|
|
241
175
|
### Complete Workflow Example
|
|
242
176
|
|
|
243
177
|
**Starting from a GitHub issue:**
|
|
178
|
+
|
|
244
179
|
```
|
|
245
180
|
/issue 123
|
|
246
181
|
```
|
|
182
|
+
|
|
247
183
|
Claude analyzes the GitHub issue and creates a TDD implementation plan showing what tests to write.
|
|
248
184
|
|
|
249
185
|
**Running a full TDD cycle:**
|
|
186
|
+
|
|
250
187
|
```
|
|
251
188
|
/cycle implement user authentication with password hashing
|
|
252
189
|
```
|
|
190
|
+
|
|
253
191
|
Claude executes the complete red-green-refactor cycle: writes a failing test, implements it, then refactors.
|
|
254
192
|
|
|
255
193
|
**Individual phases for more control:**
|
|
194
|
+
|
|
256
195
|
```
|
|
257
196
|
/red test that users can't login with wrong password
|
|
258
197
|
/green
|
|
@@ -260,14 +199,17 @@ Claude executes the complete red-green-refactor cycle: writes a failing test, im
|
|
|
260
199
|
```
|
|
261
200
|
|
|
262
201
|
**Committing and creating PRs:**
|
|
202
|
+
|
|
263
203
|
```
|
|
264
204
|
/commit
|
|
265
205
|
```
|
|
206
|
+
|
|
266
207
|
Claude reviews changes, drafts a commit message following project standards, and creates the commit.
|
|
267
208
|
|
|
268
209
|
```
|
|
269
|
-
/
|
|
210
|
+
/ask
|
|
270
211
|
```
|
|
212
|
+
|
|
271
213
|
Claude analyzes commits, creates a PR with summary and test plan.
|
|
272
214
|
|
|
273
215
|
### What to Expect
|
|
@@ -292,69 +234,84 @@ The commands enforce TDD discipline: you can't refactor with failing tests, can'
|
|
|
292
234
|
|
|
293
235
|
👤 `/red` single element [1] returns 1
|
|
294
236
|
|
|
295
|
-
🔴
|
|
237
|
+
🔴 _writes test_
|
|
238
|
+
|
|
296
239
|
```typescript
|
|
297
240
|
expect(closestToZero([1])).toBe(1);
|
|
298
241
|
```
|
|
242
|
+
|
|
299
243
|
FAIL: closestToZero is not defined
|
|
300
244
|
|
|
301
245
|
👤 `/green`
|
|
302
246
|
|
|
303
|
-
🟢
|
|
247
|
+
🟢 _returns hardcoded 1_
|
|
248
|
+
|
|
304
249
|
```typescript
|
|
305
250
|
function closestToZero(nums: number[]): number {
|
|
306
251
|
return 1; // minimal - only need to pass current test
|
|
307
252
|
}
|
|
308
253
|
```
|
|
254
|
+
|
|
309
255
|
✅ Test passes
|
|
310
256
|
|
|
311
257
|
👤 `/red` two numbers [3, 2] returns 2
|
|
312
258
|
|
|
313
|
-
🔴
|
|
259
|
+
🔴 _writes test_
|
|
260
|
+
|
|
314
261
|
```typescript
|
|
315
262
|
expect(closestToZero([3, 2])).toBe(2);
|
|
316
263
|
```
|
|
264
|
+
|
|
317
265
|
FAIL: expected 1 to be 2
|
|
318
266
|
|
|
319
267
|
👤 `/green`
|
|
320
268
|
|
|
321
|
-
🟢
|
|
269
|
+
🟢 _sorts and returns first_
|
|
270
|
+
|
|
322
271
|
```typescript
|
|
323
272
|
function closestToZero(nums: number[]): number {
|
|
324
273
|
return nums.sort((a, b) => a - b)[0]; // minimal
|
|
325
274
|
}
|
|
326
275
|
```
|
|
276
|
+
|
|
327
277
|
✅ 2/2 tests pass
|
|
328
278
|
|
|
329
279
|
👤 `/red` with negative [-3, 2] returns 2
|
|
330
280
|
|
|
331
|
-
🔴
|
|
281
|
+
🔴 _writes test_
|
|
282
|
+
|
|
332
283
|
```typescript
|
|
333
284
|
expect(closestToZero([-3, 2])).toBe(2);
|
|
334
285
|
```
|
|
286
|
+
|
|
335
287
|
FAIL: expected -3 to be 2 (regular sort puts -3 first)
|
|
336
288
|
|
|
337
289
|
👤 `/green`
|
|
338
290
|
|
|
339
|
-
🟢
|
|
291
|
+
🟢 _sorts by absolute value_
|
|
292
|
+
|
|
340
293
|
```typescript
|
|
341
294
|
function closestToZero(nums: number[]): number {
|
|
342
295
|
return nums.sort((a, b) => Math.abs(a) - Math.abs(b))[0];
|
|
343
296
|
}
|
|
344
297
|
```
|
|
298
|
+
|
|
345
299
|
✅ 3/3 tests pass
|
|
346
300
|
|
|
347
301
|
👤 `/red` exact tie [-2, 2] returns positive 2
|
|
348
302
|
|
|
349
|
-
🔴
|
|
303
|
+
🔴 _writes test_
|
|
304
|
+
|
|
350
305
|
```typescript
|
|
351
306
|
expect(closestToZero([-2, 2])).toBe(2);
|
|
352
307
|
```
|
|
308
|
+
|
|
353
309
|
FAIL: expected -2 to be 2 (returns first when tied)
|
|
354
310
|
|
|
355
311
|
👤 `/green`
|
|
356
312
|
|
|
357
|
-
🟢
|
|
313
|
+
🟢 _adds tie-breaking: prefer positive_
|
|
314
|
+
|
|
358
315
|
```typescript
|
|
359
316
|
function closestToZero(nums: number[]): number {
|
|
360
317
|
return nums.sort((a, b) => {
|
|
@@ -363,11 +320,13 @@ function closestToZero(nums: number[]): number {
|
|
|
363
320
|
})[0];
|
|
364
321
|
}
|
|
365
322
|
```
|
|
323
|
+
|
|
366
324
|
✅ 4/4 tests pass
|
|
367
325
|
|
|
368
326
|
👤 `/refactor` extract helper and use iteration instead of sort
|
|
369
327
|
|
|
370
|
-
🔵
|
|
328
|
+
🔵 _extracts helper function for comparison logic_
|
|
329
|
+
|
|
371
330
|
```typescript
|
|
372
331
|
function isCloser(candidate: number, current: number): boolean {
|
|
373
332
|
const candAbs = Math.abs(candidate);
|
|
@@ -386,21 +345,23 @@ function closestToZero(nums: number[]): number {
|
|
|
386
345
|
return closest;
|
|
387
346
|
}
|
|
388
347
|
```
|
|
348
|
+
|
|
389
349
|
✅ 4/4 tests still pass
|
|
390
350
|
|
|
391
351
|
👤 `/refactor`
|
|
392
352
|
|
|
393
|
-
🔵
|
|
353
|
+
🔵 _uses reduce for more functional style_
|
|
354
|
+
|
|
394
355
|
```typescript
|
|
395
356
|
function closestToZero(nums: number[]): number {
|
|
396
357
|
if (nums.length === 0) return 0;
|
|
397
358
|
return nums.reduce((closest, num) =>
|
|
398
|
-
isCloser(num, closest) ? num : closest
|
|
359
|
+
isCloser(num, closest) ? num : closest,
|
|
399
360
|
);
|
|
400
361
|
}
|
|
401
362
|
```
|
|
402
|
-
✅ 4/4 tests still pass
|
|
403
363
|
|
|
364
|
+
✅ 4/4 tests still pass
|
|
404
365
|
|
|
405
366
|
## Contributing
|
|
406
367
|
|
package/bin/cli.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// scripts/cli.ts
|
|
4
|
-
import { select, isCancel, intro, outro } from "@clack/prompts";
|
|
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,55 @@ 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
|
+
}
|
|
52
|
+
async function getCommandsGroupedByCategory(variant) {
|
|
53
|
+
const sourcePath = path.join(__dirname, "..", DIRECTORIES.DOWNLOADS, variant || VARIANTS.WITH_BEADS);
|
|
54
|
+
const metadataPath = path.join(sourcePath, "commands-metadata.json");
|
|
55
|
+
const metadataContent = await fs.readFile(metadataPath, "utf-8");
|
|
56
|
+
const metadata = JSON.parse(metadataContent);
|
|
57
|
+
const grouped = {};
|
|
58
|
+
for (const [filename, data] of Object.entries(metadata)) {
|
|
59
|
+
const category = data.category;
|
|
60
|
+
if (!grouped[category]) {
|
|
61
|
+
grouped[category] = [];
|
|
62
|
+
}
|
|
63
|
+
grouped[category].push({
|
|
64
|
+
value: filename,
|
|
65
|
+
label: filename
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
for (const category of Object.keys(grouped)) {
|
|
69
|
+
grouped[category].sort((a, b) => {
|
|
70
|
+
const orderA = metadata[a.value].order;
|
|
71
|
+
const orderB = metadata[b.value].order;
|
|
72
|
+
return orderA - orderB;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return grouped;
|
|
76
|
+
}
|
|
35
77
|
function getDestinationPath(outputPath, scope) {
|
|
36
78
|
if (outputPath) {
|
|
37
79
|
return outputPath;
|
|
@@ -64,8 +106,23 @@ async function generateToDirectory(outputPath, variant, scope, options) {
|
|
|
64
106
|
if (!destinationPath) {
|
|
65
107
|
throw new Error("Either outputPath or scope must be provided");
|
|
66
108
|
}
|
|
67
|
-
const
|
|
68
|
-
|
|
109
|
+
const allFiles = await fs.readdir(sourcePath);
|
|
110
|
+
const files = options?.commands ? allFiles.filter((f) => options.commands.includes(f)) : allFiles;
|
|
111
|
+
if (options?.commands) {
|
|
112
|
+
await fs.ensureDir(destinationPath);
|
|
113
|
+
for (const file of files) {
|
|
114
|
+
await fs.copy(path.join(sourcePath, file), path.join(destinationPath, file));
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
await fs.copy(sourcePath, destinationPath, {});
|
|
118
|
+
}
|
|
119
|
+
if (options?.commandPrefix) {
|
|
120
|
+
for (const file of files) {
|
|
121
|
+
const oldPath = path.join(destinationPath, file);
|
|
122
|
+
const newPath = path.join(destinationPath, options.commandPrefix + file);
|
|
123
|
+
await fs.rename(oldPath, newPath);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
69
126
|
let templateInjected = false;
|
|
70
127
|
if (!options?.skipTemplateInjection) {
|
|
71
128
|
let templateSourcePath = null;
|
|
@@ -85,7 +142,8 @@ async function generateToDirectory(outputPath, variant, scope, options) {
|
|
|
85
142
|
if (template.commands && !template.commands.includes(commandName)) {
|
|
86
143
|
continue;
|
|
87
144
|
}
|
|
88
|
-
const
|
|
145
|
+
const actualFileName = options?.commandPrefix ? options.commandPrefix + file : file;
|
|
146
|
+
const filePath = path.join(destinationPath, actualFileName);
|
|
89
147
|
const content = await fs.readFile(filePath, "utf-8");
|
|
90
148
|
await fs.writeFile(filePath, content + "\n\n" + template.content);
|
|
91
149
|
}
|
|
@@ -119,25 +177,96 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
|
119
177
|
|
|
120
178
|
@wbern/claude-instructions
|
|
121
179
|
`;
|
|
122
|
-
async function main() {
|
|
180
|
+
async function main(args) {
|
|
123
181
|
intro(BATMAN_LOGO);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
182
|
+
let variant;
|
|
183
|
+
let scope;
|
|
184
|
+
let commandPrefix;
|
|
185
|
+
let selectedCommands;
|
|
186
|
+
if (args?.variant && args?.scope && args?.prefix !== void 0) {
|
|
187
|
+
variant = args.variant;
|
|
188
|
+
scope = args.scope;
|
|
189
|
+
commandPrefix = args.prefix;
|
|
190
|
+
selectedCommands = args.commands;
|
|
191
|
+
} else {
|
|
192
|
+
variant = await select({
|
|
193
|
+
message: "Select variant",
|
|
194
|
+
options: [...VARIANT_OPTIONS]
|
|
195
|
+
});
|
|
196
|
+
if (isCancel(variant)) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const terminalWidth = process.stdout.columns || 80;
|
|
200
|
+
const uiOverhead = 25;
|
|
201
|
+
scope = await select({
|
|
202
|
+
message: "Select installation scope",
|
|
203
|
+
options: getScopeOptions(terminalWidth - uiOverhead)
|
|
204
|
+
});
|
|
205
|
+
if (isCancel(scope)) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
commandPrefix = await text({
|
|
209
|
+
message: "Command prefix (optional)",
|
|
210
|
+
placeholder: "e.g. my-"
|
|
211
|
+
});
|
|
212
|
+
if (isCancel(commandPrefix)) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const groupedCommands = await getCommandsGroupedByCategory(variant);
|
|
216
|
+
const allCommandValues = Object.values(groupedCommands).flat().map((cmd) => cmd.value);
|
|
217
|
+
selectedCommands = await groupMultiselect({
|
|
218
|
+
message: "Select commands to install (Enter to accept all)",
|
|
219
|
+
options: groupedCommands,
|
|
220
|
+
initialValues: allCommandValues
|
|
221
|
+
});
|
|
222
|
+
if (isCancel(selectedCommands)) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
137
225
|
}
|
|
138
|
-
const result = await generateToDirectory(void 0, variant, scope);
|
|
139
|
-
|
|
226
|
+
const result = await generateToDirectory(void 0, variant, scope, { commandPrefix, skipTemplateInjection: args?.skipTemplateInjection, commands: selectedCommands });
|
|
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!`);
|
|
140
233
|
}
|
|
141
234
|
|
|
142
235
|
// scripts/bin.ts
|
|
143
|
-
|
|
236
|
+
var STRING_ARGS = ["variant", "scope", "prefix"];
|
|
237
|
+
var ARRAY_ARGS = ["commands"];
|
|
238
|
+
var BOOLEAN_FLAGS = [
|
|
239
|
+
{ flag: "--skip-template-injection", key: "skipTemplateInjection" }
|
|
240
|
+
];
|
|
241
|
+
function parseArgs(argv) {
|
|
242
|
+
const args = {};
|
|
243
|
+
for (const arg of argv) {
|
|
244
|
+
for (const { flag, key } of BOOLEAN_FLAGS) {
|
|
245
|
+
if (arg === flag) {
|
|
246
|
+
args[key] = true;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
for (const key of STRING_ARGS) {
|
|
250
|
+
const prefix = `--${key}=`;
|
|
251
|
+
if (arg.startsWith(prefix)) {
|
|
252
|
+
args[key] = arg.slice(prefix.length);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
for (const key of ARRAY_ARGS) {
|
|
256
|
+
const prefix = `--${key}=`;
|
|
257
|
+
if (arg.startsWith(prefix)) {
|
|
258
|
+
args[key] = arg.slice(prefix.length).split(",");
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return args;
|
|
263
|
+
}
|
|
264
|
+
async function run(argv) {
|
|
265
|
+
const args = parseArgs(argv);
|
|
266
|
+
await main(args);
|
|
267
|
+
}
|
|
268
|
+
run(process.argv.slice(2)).catch(console.error);
|
|
269
|
+
export {
|
|
270
|
+
parseArgs,
|
|
271
|
+
run
|
|
272
|
+
};
|
|
@@ -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
|
-
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"add-command.md": {
|
|
3
|
+
"description": "Guide for creating new slash commands",
|
|
4
|
+
"category": "Utilities",
|
|
5
|
+
"order": 3
|
|
6
|
+
},
|
|
7
|
+
"ask.md": {
|
|
8
|
+
"description": "Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)",
|
|
9
|
+
"category": "Workflow",
|
|
10
|
+
"order": 4
|
|
11
|
+
},
|
|
12
|
+
"beepboop.md": {
|
|
13
|
+
"description": "Communicate AI-generated content with transparent attribution",
|
|
14
|
+
"category": "Utilities",
|
|
15
|
+
"order": 2
|
|
16
|
+
},
|
|
17
|
+
"commit.md": {
|
|
18
|
+
"description": "Create a git commit following project standards",
|
|
19
|
+
"category": "Workflow",
|
|
20
|
+
"order": 1
|
|
21
|
+
},
|
|
22
|
+
"cycle.md": {
|
|
23
|
+
"description": "Execute complete TDD cycle - Red, Green, and Refactor phases in sequence",
|
|
24
|
+
"category": "TDD Cycle",
|
|
25
|
+
"order": 5
|
|
26
|
+
},
|
|
27
|
+
"gap.md": {
|
|
28
|
+
"description": "Analyze conversation context for unaddressed items and gaps",
|
|
29
|
+
"category": "Workflow",
|
|
30
|
+
"order": 11
|
|
31
|
+
},
|
|
32
|
+
"green.md": {
|
|
33
|
+
"description": "Execute TDD Green Phase - write minimal implementation to pass the failing test",
|
|
34
|
+
"category": "TDD Cycle",
|
|
35
|
+
"order": 3
|
|
36
|
+
},
|
|
37
|
+
"issue.md": {
|
|
38
|
+
"description": "Analyze GitHub issue and create TDD implementation plan",
|
|
39
|
+
"category": "Planning",
|
|
40
|
+
"order": 1
|
|
41
|
+
},
|
|
42
|
+
"plan.md": {
|
|
43
|
+
"description": "Create implementation plan from feature/requirement with PRD-style discovery and TDD acceptance criteria",
|
|
44
|
+
"category": "Planning",
|
|
45
|
+
"order": 2
|
|
46
|
+
},
|
|
47
|
+
"red.md": {
|
|
48
|
+
"description": "Execute TDD Red Phase - write ONE failing test",
|
|
49
|
+
"category": "TDD Cycle",
|
|
50
|
+
"order": 2
|
|
51
|
+
},
|
|
52
|
+
"refactor.md": {
|
|
53
|
+
"description": "Execute TDD Refactor Phase - improve code structure while keeping tests green",
|
|
54
|
+
"category": "TDD Cycle",
|
|
55
|
+
"order": 4
|
|
56
|
+
},
|
|
57
|
+
"ship.md": {
|
|
58
|
+
"description": "Ship code directly to main - for small, obvious changes that don't need review (Cursor's modern alternative to PRs)",
|
|
59
|
+
"category": "Workflow",
|
|
60
|
+
"order": 2
|
|
61
|
+
},
|
|
62
|
+
"show.md": {
|
|
63
|
+
"description": "Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)",
|
|
64
|
+
"category": "Workflow",
|
|
65
|
+
"order": 3
|
|
66
|
+
},
|
|
67
|
+
"spike.md": {
|
|
68
|
+
"description": "Execute TDD Spike Phase - exploratory coding to understand problem space before TDD",
|
|
69
|
+
"category": "TDD Cycle",
|
|
70
|
+
"order": 1
|
|
71
|
+
},
|
|
72
|
+
"summarize.md": {
|
|
73
|
+
"description": "Summarize conversation progress and next steps",
|
|
74
|
+
"category": "Workflow",
|
|
75
|
+
"order": 10
|
|
76
|
+
},
|
|
77
|
+
"tdd.md": {
|
|
78
|
+
"description": "Remind agent about TDD approach and continue conversation",
|
|
79
|
+
"category": "Utilities",
|
|
80
|
+
"order": 1
|
|
81
|
+
},
|
|
82
|
+
"worktree-add.md": {
|
|
83
|
+
"description": "Add a new git worktree from branch name or GitHub issue URL, copy settings, install deps, and open in current IDE",
|
|
84
|
+
"category": "Worktree Management",
|
|
85
|
+
"order": 1
|
|
86
|
+
},
|
|
87
|
+
"worktree-cleanup.md": {
|
|
88
|
+
"description": "Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees",
|
|
89
|
+
"category": "Worktree Management",
|
|
90
|
+
"order": 2
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -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
|
---
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze conversation context for unaddressed items and gaps
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Analyze the current conversation context and identify things that have not yet been addressed. Look for:
|
|
6
|
+
|
|
7
|
+
1. **Incomplete implementations** - Code that was started but not finished
|
|
8
|
+
2. **Unused variables/results** - Values that were captured but never used
|
|
9
|
+
3. **Missing tests** - Functionality without test coverage
|
|
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
|
|
15
|
+
|
|
16
|
+
Present findings as a prioritized list with:
|
|
17
|
+
|
|
18
|
+
- What the gap is
|
|
19
|
+
- Why it matters
|
|
20
|
+
- Suggested next action
|
|
21
|
+
|
|
22
|
+
If there are no gaps, confirm that everything discussed has been addressed.
|
|
@@ -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
|
-
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"add-command.md": {
|
|
3
|
+
"description": "Guide for creating new slash commands",
|
|
4
|
+
"category": "Utilities",
|
|
5
|
+
"order": 3
|
|
6
|
+
},
|
|
7
|
+
"ask.md": {
|
|
8
|
+
"description": "Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)",
|
|
9
|
+
"category": "Workflow",
|
|
10
|
+
"order": 4
|
|
11
|
+
},
|
|
12
|
+
"beepboop.md": {
|
|
13
|
+
"description": "Communicate AI-generated content with transparent attribution",
|
|
14
|
+
"category": "Utilities",
|
|
15
|
+
"order": 2
|
|
16
|
+
},
|
|
17
|
+
"commit.md": {
|
|
18
|
+
"description": "Create a git commit following project standards",
|
|
19
|
+
"category": "Workflow",
|
|
20
|
+
"order": 1
|
|
21
|
+
},
|
|
22
|
+
"cycle.md": {
|
|
23
|
+
"description": "Execute complete TDD cycle - Red, Green, and Refactor phases in sequence",
|
|
24
|
+
"category": "TDD Cycle",
|
|
25
|
+
"order": 5
|
|
26
|
+
},
|
|
27
|
+
"gap.md": {
|
|
28
|
+
"description": "Analyze conversation context for unaddressed items and gaps",
|
|
29
|
+
"category": "Workflow",
|
|
30
|
+
"order": 11
|
|
31
|
+
},
|
|
32
|
+
"green.md": {
|
|
33
|
+
"description": "Execute TDD Green Phase - write minimal implementation to pass the failing test",
|
|
34
|
+
"category": "TDD Cycle",
|
|
35
|
+
"order": 3
|
|
36
|
+
},
|
|
37
|
+
"issue.md": {
|
|
38
|
+
"description": "Analyze GitHub issue and create TDD implementation plan",
|
|
39
|
+
"category": "Planning",
|
|
40
|
+
"order": 1
|
|
41
|
+
},
|
|
42
|
+
"plan.md": {
|
|
43
|
+
"description": "Create implementation plan from feature/requirement with PRD-style discovery and TDD acceptance criteria",
|
|
44
|
+
"category": "Planning",
|
|
45
|
+
"order": 2
|
|
46
|
+
},
|
|
47
|
+
"red.md": {
|
|
48
|
+
"description": "Execute TDD Red Phase - write ONE failing test",
|
|
49
|
+
"category": "TDD Cycle",
|
|
50
|
+
"order": 2
|
|
51
|
+
},
|
|
52
|
+
"refactor.md": {
|
|
53
|
+
"description": "Execute TDD Refactor Phase - improve code structure while keeping tests green",
|
|
54
|
+
"category": "TDD Cycle",
|
|
55
|
+
"order": 4
|
|
56
|
+
},
|
|
57
|
+
"ship.md": {
|
|
58
|
+
"description": "Ship code directly to main - for small, obvious changes that don't need review (Cursor's modern alternative to PRs)",
|
|
59
|
+
"category": "Workflow",
|
|
60
|
+
"order": 2
|
|
61
|
+
},
|
|
62
|
+
"show.md": {
|
|
63
|
+
"description": "Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)",
|
|
64
|
+
"category": "Workflow",
|
|
65
|
+
"order": 3
|
|
66
|
+
},
|
|
67
|
+
"spike.md": {
|
|
68
|
+
"description": "Execute TDD Spike Phase - exploratory coding to understand problem space before TDD",
|
|
69
|
+
"category": "TDD Cycle",
|
|
70
|
+
"order": 1
|
|
71
|
+
},
|
|
72
|
+
"summarize.md": {
|
|
73
|
+
"description": "Summarize conversation progress and next steps",
|
|
74
|
+
"category": "Workflow",
|
|
75
|
+
"order": 10
|
|
76
|
+
},
|
|
77
|
+
"tdd.md": {
|
|
78
|
+
"description": "Remind agent about TDD approach and continue conversation",
|
|
79
|
+
"category": "Utilities",
|
|
80
|
+
"order": 1
|
|
81
|
+
},
|
|
82
|
+
"worktree-add.md": {
|
|
83
|
+
"description": "Add a new git worktree from branch name or GitHub issue URL, copy settings, install deps, and open in current IDE",
|
|
84
|
+
"category": "Worktree Management",
|
|
85
|
+
"order": 1
|
|
86
|
+
},
|
|
87
|
+
"worktree-cleanup.md": {
|
|
88
|
+
"description": "Clean up merged worktrees by verifying PR/issue status, consolidating settings, and removing stale worktrees",
|
|
89
|
+
"category": "Worktree Management",
|
|
90
|
+
"order": 2
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -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
|
---
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze conversation context for unaddressed items and gaps
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Analyze the current conversation context and identify things that have not yet been addressed. Look for:
|
|
6
|
+
|
|
7
|
+
1. **Incomplete implementations** - Code that was started but not finished
|
|
8
|
+
2. **Unused variables/results** - Values that were captured but never used
|
|
9
|
+
3. **Missing tests** - Functionality without test coverage
|
|
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
|
|
14
|
+
|
|
15
|
+
Present findings as a prioritized list with:
|
|
16
|
+
|
|
17
|
+
- What the gap is
|
|
18
|
+
- Why it matters
|
|
19
|
+
- Suggested next action
|
|
20
|
+
|
|
21
|
+
If there are no gaps, confirm that everything discussed has been addressed.
|
|
@@ -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,25 +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",
|
|
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",
|
|
35
34
|
"generate": "tsx scripts/cli-generator.ts",
|
|
36
35
|
"test": "vitest run",
|
|
37
36
|
"test:watch": "vitest",
|
|
38
37
|
"typecheck": "tsc --noEmit",
|
|
38
|
+
"knip": "knip",
|
|
39
|
+
"duplication-check": "jscpd",
|
|
39
40
|
"prepublishOnly": "bash scripts/check-publish.sh && pnpm build && pnpm build:cli",
|
|
40
41
|
"prepare": "husky"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
44
|
+
"@eslint/js": "^9.39.1",
|
|
43
45
|
"@types/fs-extra": "^11.0.4",
|
|
44
46
|
"@types/node": "^24.10.1",
|
|
47
|
+
"eslint": "^9.39.1",
|
|
45
48
|
"husky": "^9.1.7",
|
|
49
|
+
"jscpd": "^4.0.5",
|
|
50
|
+
"knip": "^5.70.2",
|
|
51
|
+
"lint-staged": "^16.2.7",
|
|
46
52
|
"markdown-magic": "^4.0.4",
|
|
53
|
+
"prettier": "^3.7.2",
|
|
47
54
|
"tsup": "^8.5.1",
|
|
48
55
|
"tsx": "^4.20.6",
|
|
49
56
|
"typescript": "^5.9.3",
|
|
57
|
+
"typescript-eslint": "^8.48.0",
|
|
50
58
|
"vitest": "^4.0.8"
|
|
51
59
|
},
|
|
52
60
|
"dependencies": {
|