@wbern/claude-instructions 1.3.0 → 1.5.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 +47 -13
- package/bin/cli.js +32 -8
- package/downloads/with-beads/add-command.md +2 -2
- package/downloads/with-beads/ask.md +14 -5
- package/downloads/with-beads/busycommit.md +56 -0
- package/downloads/with-beads/commands-metadata.json +5 -0
- package/downloads/with-beads/commit.md +0 -20
- package/downloads/with-beads/cycle.md +4 -1
- package/downloads/with-beads/gap.md +9 -6
- package/downloads/with-beads/green.md +4 -1
- package/downloads/with-beads/issue.md +3 -0
- package/downloads/with-beads/red.md +4 -0
- package/downloads/with-beads/refactor.md +4 -1
- package/downloads/with-beads/ship.md +7 -3
- package/downloads/with-beads/show.md +8 -2
- package/downloads/with-beads/spike.md +3 -0
- package/downloads/with-beads/summarize.md +3 -1
- package/downloads/with-beads/tdd.md +3 -0
- package/downloads/with-beads/worktree-add.md +1 -1
- package/downloads/with-beads/worktree-cleanup.md +2 -0
- package/downloads/without-beads/add-command.md +2 -2
- package/downloads/without-beads/ask.md +14 -5
- package/downloads/without-beads/busycommit.md +56 -0
- package/downloads/without-beads/commands-metadata.json +5 -0
- package/downloads/without-beads/commit.md +0 -20
- package/downloads/without-beads/cycle.md +4 -1
- package/downloads/without-beads/gap.md +8 -5
- package/downloads/without-beads/green.md +4 -1
- package/downloads/without-beads/issue.md +3 -0
- package/downloads/without-beads/red.md +4 -0
- package/downloads/without-beads/refactor.md +4 -1
- package/downloads/without-beads/ship.md +7 -3
- package/downloads/without-beads/show.md +8 -2
- package/downloads/without-beads/spike.md +3 -0
- package/downloads/without-beads/summarize.md +3 -1
- package/downloads/without-beads/tdd.md +3 -0
- package/downloads/without-beads/worktree-add.md +1 -1
- package/downloads/without-beads/worktree-cleanup.md +2 -0
- 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>]
|
|
@@ -117,10 +119,12 @@ flowchart TB
|
|
|
117
119
|
### Workflow
|
|
118
120
|
|
|
119
121
|
- `/commit` - Create a git commit following project standards
|
|
122
|
+
- `/busycommit` - Create multiple atomic git commits, one logical change at a time
|
|
120
123
|
- `/ship` - Ship code directly to main - for small, obvious changes that don't need review (Cursor's modern alternative to PRs)
|
|
121
124
|
- `/show` - Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)
|
|
122
125
|
- `/ask` - Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)
|
|
123
126
|
- `/summarize` - Summarize conversation progress and next steps
|
|
127
|
+
- `/gap` - Analyze conversation context for unaddressed items and gaps
|
|
124
128
|
|
|
125
129
|
### Worktree Management
|
|
126
130
|
|
|
@@ -140,6 +144,7 @@ flowchart TB
|
|
|
140
144
|
Here's a simple example to get you started with the TDD workflow:
|
|
141
145
|
|
|
142
146
|
**1. Write a failing test (`/red`)**
|
|
147
|
+
|
|
143
148
|
```
|
|
144
149
|
You: /red add a function that validates email addresses
|
|
145
150
|
|
|
@@ -149,6 +154,7 @@ Claude: I'll write a failing test for email validation.
|
|
|
149
154
|
```
|
|
150
155
|
|
|
151
156
|
**2. Make it pass (`/green`)**
|
|
157
|
+
|
|
152
158
|
```
|
|
153
159
|
You: /green
|
|
154
160
|
|
|
@@ -158,6 +164,7 @@ Claude: I'll implement the minimal code to pass the test.
|
|
|
158
164
|
```
|
|
159
165
|
|
|
160
166
|
**3. Refactor for quality (`/refactor`)**
|
|
167
|
+
|
|
161
168
|
```
|
|
162
169
|
You: /refactor extract regex pattern to a constant
|
|
163
170
|
|
|
@@ -169,18 +176,23 @@ Claude: I'll refactor while keeping tests green.
|
|
|
169
176
|
### Complete Workflow Example
|
|
170
177
|
|
|
171
178
|
**Starting from a GitHub issue:**
|
|
179
|
+
|
|
172
180
|
```
|
|
173
181
|
/issue 123
|
|
174
182
|
```
|
|
183
|
+
|
|
175
184
|
Claude analyzes the GitHub issue and creates a TDD implementation plan showing what tests to write.
|
|
176
185
|
|
|
177
186
|
**Running a full TDD cycle:**
|
|
187
|
+
|
|
178
188
|
```
|
|
179
189
|
/cycle implement user authentication with password hashing
|
|
180
190
|
```
|
|
191
|
+
|
|
181
192
|
Claude executes the complete red-green-refactor cycle: writes a failing test, implements it, then refactors.
|
|
182
193
|
|
|
183
194
|
**Individual phases for more control:**
|
|
195
|
+
|
|
184
196
|
```
|
|
185
197
|
/red test that users can't login with wrong password
|
|
186
198
|
/green
|
|
@@ -188,14 +200,17 @@ Claude executes the complete red-green-refactor cycle: writes a failing test, im
|
|
|
188
200
|
```
|
|
189
201
|
|
|
190
202
|
**Committing and creating PRs:**
|
|
203
|
+
|
|
191
204
|
```
|
|
192
205
|
/commit
|
|
193
206
|
```
|
|
207
|
+
|
|
194
208
|
Claude reviews changes, drafts a commit message following project standards, and creates the commit.
|
|
195
209
|
|
|
196
210
|
```
|
|
197
|
-
/
|
|
211
|
+
/ask
|
|
198
212
|
```
|
|
213
|
+
|
|
199
214
|
Claude analyzes commits, creates a PR with summary and test plan.
|
|
200
215
|
|
|
201
216
|
### What to Expect
|
|
@@ -220,69 +235,84 @@ The commands enforce TDD discipline: you can't refactor with failing tests, can'
|
|
|
220
235
|
|
|
221
236
|
👤 `/red` single element [1] returns 1
|
|
222
237
|
|
|
223
|
-
🔴
|
|
238
|
+
🔴 _writes test_
|
|
239
|
+
|
|
224
240
|
```typescript
|
|
225
241
|
expect(closestToZero([1])).toBe(1);
|
|
226
242
|
```
|
|
243
|
+
|
|
227
244
|
FAIL: closestToZero is not defined
|
|
228
245
|
|
|
229
246
|
👤 `/green`
|
|
230
247
|
|
|
231
|
-
🟢
|
|
248
|
+
🟢 _returns hardcoded 1_
|
|
249
|
+
|
|
232
250
|
```typescript
|
|
233
251
|
function closestToZero(nums: number[]): number {
|
|
234
252
|
return 1; // minimal - only need to pass current test
|
|
235
253
|
}
|
|
236
254
|
```
|
|
255
|
+
|
|
237
256
|
✅ Test passes
|
|
238
257
|
|
|
239
258
|
👤 `/red` two numbers [3, 2] returns 2
|
|
240
259
|
|
|
241
|
-
🔴
|
|
260
|
+
🔴 _writes test_
|
|
261
|
+
|
|
242
262
|
```typescript
|
|
243
263
|
expect(closestToZero([3, 2])).toBe(2);
|
|
244
264
|
```
|
|
265
|
+
|
|
245
266
|
FAIL: expected 1 to be 2
|
|
246
267
|
|
|
247
268
|
👤 `/green`
|
|
248
269
|
|
|
249
|
-
🟢
|
|
270
|
+
🟢 _sorts and returns first_
|
|
271
|
+
|
|
250
272
|
```typescript
|
|
251
273
|
function closestToZero(nums: number[]): number {
|
|
252
274
|
return nums.sort((a, b) => a - b)[0]; // minimal
|
|
253
275
|
}
|
|
254
276
|
```
|
|
277
|
+
|
|
255
278
|
✅ 2/2 tests pass
|
|
256
279
|
|
|
257
280
|
👤 `/red` with negative [-3, 2] returns 2
|
|
258
281
|
|
|
259
|
-
🔴
|
|
282
|
+
🔴 _writes test_
|
|
283
|
+
|
|
260
284
|
```typescript
|
|
261
285
|
expect(closestToZero([-3, 2])).toBe(2);
|
|
262
286
|
```
|
|
287
|
+
|
|
263
288
|
FAIL: expected -3 to be 2 (regular sort puts -3 first)
|
|
264
289
|
|
|
265
290
|
👤 `/green`
|
|
266
291
|
|
|
267
|
-
🟢
|
|
292
|
+
🟢 _sorts by absolute value_
|
|
293
|
+
|
|
268
294
|
```typescript
|
|
269
295
|
function closestToZero(nums: number[]): number {
|
|
270
296
|
return nums.sort((a, b) => Math.abs(a) - Math.abs(b))[0];
|
|
271
297
|
}
|
|
272
298
|
```
|
|
299
|
+
|
|
273
300
|
✅ 3/3 tests pass
|
|
274
301
|
|
|
275
302
|
👤 `/red` exact tie [-2, 2] returns positive 2
|
|
276
303
|
|
|
277
|
-
🔴
|
|
304
|
+
🔴 _writes test_
|
|
305
|
+
|
|
278
306
|
```typescript
|
|
279
307
|
expect(closestToZero([-2, 2])).toBe(2);
|
|
280
308
|
```
|
|
309
|
+
|
|
281
310
|
FAIL: expected -2 to be 2 (returns first when tied)
|
|
282
311
|
|
|
283
312
|
👤 `/green`
|
|
284
313
|
|
|
285
|
-
🟢
|
|
314
|
+
🟢 _adds tie-breaking: prefer positive_
|
|
315
|
+
|
|
286
316
|
```typescript
|
|
287
317
|
function closestToZero(nums: number[]): number {
|
|
288
318
|
return nums.sort((a, b) => {
|
|
@@ -291,11 +321,13 @@ function closestToZero(nums: number[]): number {
|
|
|
291
321
|
})[0];
|
|
292
322
|
}
|
|
293
323
|
```
|
|
324
|
+
|
|
294
325
|
✅ 4/4 tests pass
|
|
295
326
|
|
|
296
327
|
👤 `/refactor` extract helper and use iteration instead of sort
|
|
297
328
|
|
|
298
|
-
🔵
|
|
329
|
+
🔵 _extracts helper function for comparison logic_
|
|
330
|
+
|
|
299
331
|
```typescript
|
|
300
332
|
function isCloser(candidate: number, current: number): boolean {
|
|
301
333
|
const candAbs = Math.abs(candidate);
|
|
@@ -314,21 +346,23 @@ function closestToZero(nums: number[]): number {
|
|
|
314
346
|
return closest;
|
|
315
347
|
}
|
|
316
348
|
```
|
|
349
|
+
|
|
317
350
|
✅ 4/4 tests still pass
|
|
318
351
|
|
|
319
352
|
👤 `/refactor`
|
|
320
353
|
|
|
321
|
-
🔵
|
|
354
|
+
🔵 _uses reduce for more functional style_
|
|
355
|
+
|
|
322
356
|
```typescript
|
|
323
357
|
function closestToZero(nums: number[]): number {
|
|
324
358
|
if (nums.length === 0) return 0;
|
|
325
359
|
return nums.reduce((closest, num) =>
|
|
326
|
-
isCloser(num, closest) ? num : closest
|
|
360
|
+
isCloser(num, closest) ? num : closest,
|
|
327
361
|
);
|
|
328
362
|
}
|
|
329
363
|
```
|
|
330
|
-
✅ 4/4 tests still pass
|
|
331
364
|
|
|
365
|
+
✅ 4/4 tests still pass
|
|
332
366
|
|
|
333
367
|
## Contributing
|
|
334
368
|
|
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
|
|
@@ -58,7 +58,7 @@ echo "Review this code for bugs and suggest fixes" > ~/.claude/commands/review.m
|
|
|
58
58
|
|
|
59
59
|
### Command with Arguments
|
|
60
60
|
```markdown
|
|
61
|
-
Fix issue
|
|
61
|
+
Fix issue #ARGUMENTS following our coding standards
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
### Command with File References
|
|
@@ -83,7 +83,7 @@ Create commit for these changes.
|
|
|
83
83
|
### Namespaced Command
|
|
84
84
|
```bash
|
|
85
85
|
mkdir -p ~/.claude/commands/ai
|
|
86
|
-
echo "Ask GPT-5 about:
|
|
86
|
+
echo "Ask GPT-5 about: ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
|
|
87
87
|
# Creates: /ai:gpt5
|
|
88
88
|
```
|
|
89
89
|
|
|
@@ -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,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Bash(pnpm test:*), Bash(pnpm lint:*)
|
|
3
|
+
description: Create multiple atomic git commits, one logical change at a time
|
|
4
|
+
argument-hint: [optional-commit-description]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Create multiple atomic git commits, committing the smallest possible logical unit at a time
|
|
8
|
+
|
|
9
|
+
Include any of the following info if specified: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
1. Run `git status` and `git diff` to review changes
|
|
17
|
+
2. Run `git log --oneline -5` to see recent commit style
|
|
18
|
+
3. Stage relevant files with `git add`
|
|
19
|
+
4. Create commit with descriptive message
|
|
20
|
+
5. Verify with `git status`
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git add <files>
|
|
26
|
+
git commit -m "feat(#123): add validation to user input form"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Atomic Commit Approach
|
|
30
|
+
|
|
31
|
+
Each commit should represent ONE logical change. Do NOT bundle multiple unrelated changes into one commit.
|
|
32
|
+
|
|
33
|
+
- Identify the smallest atomic units of change
|
|
34
|
+
- For EACH atomic unit: stage only those files/hunks, commit, verify
|
|
35
|
+
- Use `git add -p` to stage partial file changes when a file contains multiple logical changes
|
|
36
|
+
- Repeat until all changes are committed
|
|
37
|
+
- It is OK to create multiple commits without stopping - keep going until `git status` shows clean
|
|
38
|
+
|
|
39
|
+
## Multi-Commit Example
|
|
40
|
+
|
|
41
|
+
If a single file contains multiple unrelated changes, use `git add -p` to stage hunks interactively:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Stage only the validation-related hunks from the file
|
|
45
|
+
git add -p src/user-service.ts
|
|
46
|
+
# Select 'y' for validation hunks, 'n' for others
|
|
47
|
+
git commit -m "feat(#123): add email format validation"
|
|
48
|
+
|
|
49
|
+
# Stage the error handling hunks
|
|
50
|
+
git add -p src/user-service.ts
|
|
51
|
+
git commit -m "fix(#124): handle null user gracefully"
|
|
52
|
+
|
|
53
|
+
# Stage remaining changes
|
|
54
|
+
git add src/user-service.ts
|
|
55
|
+
git commit -m "refactor: extract user lookup to helper"
|
|
56
|
+
```
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
"category": "Utilities",
|
|
15
15
|
"order": 2
|
|
16
16
|
},
|
|
17
|
+
"busycommit.md": {
|
|
18
|
+
"description": "Create multiple atomic git commits, one logical change at a time",
|
|
19
|
+
"category": "Workflow",
|
|
20
|
+
"order": 2
|
|
21
|
+
},
|
|
17
22
|
"commit.md": {
|
|
18
23
|
"description": "Create a git commit following project standards",
|
|
19
24
|
"category": "Workflow",
|
|
@@ -8,28 +8,8 @@ Create a git commit following project standards
|
|
|
8
8
|
|
|
9
9
|
Include any of the following info if specified: $ARGUMENTS
|
|
10
10
|
|
|
11
|
-
## General Guidelines
|
|
12
11
|
|
|
13
|
-
### Output Style
|
|
14
|
-
- **Never explicitly mention TDD** in code, comments, commits, PRs, or issues
|
|
15
|
-
- Write natural, descriptive code without meta-commentary about the development process
|
|
16
|
-
- The code should speak for itself - TDD is the process, not the product
|
|
17
12
|
|
|
18
|
-
## Commit Message Rules
|
|
19
|
-
|
|
20
|
-
Follows [Conventional Commits](https://www.conventionalcommits.org/) standard.
|
|
21
|
-
|
|
22
|
-
1. **Format**: `type(#issue): description`
|
|
23
|
-
- Use `#123` for local repo issues
|
|
24
|
-
- Use `owner/repo#123` for cross-repo issues
|
|
25
|
-
- Common types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`
|
|
26
|
-
|
|
27
|
-
2. **AI Credits**: **NEVER include AI credits in commit messages**
|
|
28
|
-
- No "Generated with Claude Code"
|
|
29
|
-
- No "Co-Authored-By: Claude" or "Co-Authored-By: Happy"
|
|
30
|
-
- Focus on the actual changes made, not conversation history
|
|
31
|
-
|
|
32
|
-
3. **Content**: Write clear, concise commit messages describing what changed and why
|
|
33
13
|
|
|
34
14
|
## Process
|
|
35
15
|
|
|
@@ -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
|
---
|
|
@@ -29,8 +29,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
29
29
|
|
|
30
30
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
31
31
|
- Only one test at a time - this is critical for TDD discipline
|
|
32
|
+
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
32
33
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
33
34
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
35
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
36
|
+
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
34
37
|
|
|
35
38
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
36
39
|
|
|
@@ -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,15 +7,19 @@ 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
|
|
21
21
|
|
|
22
22
|
If there are no gaps, confirm that everything discussed has been addressed.
|
|
23
|
+
|
|
24
|
+
Additional info:
|
|
25
|
+
$ARGUMENTS
|
|
@@ -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
|
---
|
|
@@ -29,8 +29,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
29
29
|
|
|
30
30
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
31
31
|
- Only one test at a time - this is critical for TDD discipline
|
|
32
|
+
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
32
33
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
33
34
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
35
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
36
|
+
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
34
37
|
|
|
35
38
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
36
39
|
|
|
@@ -81,8 +81,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
81
81
|
|
|
82
82
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
83
83
|
- Only one test at a time - this is critical for TDD discipline
|
|
84
|
+
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
84
85
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
85
86
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
87
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
88
|
+
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
86
89
|
|
|
87
90
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
88
91
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
allowed-tools: Read, Glob, Grep, Bash(pnpm test:*)
|
|
2
3
|
description: Execute TDD Red Phase - write ONE failing test
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -25,8 +26,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
25
26
|
|
|
26
27
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
27
28
|
- Only one test at a time - this is critical for TDD discipline
|
|
29
|
+
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
28
30
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
29
31
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
32
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
33
|
+
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
30
34
|
|
|
31
35
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
32
36
|
|
|
@@ -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 Refactor Phase - improve code structure while keeping tests green
|
|
4
4
|
argument-hint: <refactoring description>
|
|
5
5
|
---
|
|
@@ -27,8 +27,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
27
27
|
|
|
28
28
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
29
29
|
- Only one test at a time - this is critical for TDD discipline
|
|
30
|
+
- Exception: For browser-level tests or expensive setup (e.g., Storybook `*.stories.tsx`), group multiple assertions within a single test block to avoid redundant setup - but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.
|
|
30
31
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
31
32
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
33
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
34
|
+
- Avoid hard-coded timeouts both in form of sleep() or timeout: 5000 etc; use proper async patterns (`waitFor`, `findBy*`, event-based sync) instead and rely on global test configs for timeout settings
|
|
32
35
|
|
|
33
36
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
34
37
|
|
|
@@ -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
|
-
|