@wbern/claude-instructions 1.4.0 → 1.6.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 +82 -0
- package/downloads/with-beads/add-command.md +2 -2
- 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 +3 -0
- package/downloads/with-beads/gap.md +3 -0
- package/downloads/with-beads/green.md +3 -0
- package/downloads/with-beads/issue.md +3 -0
- package/downloads/with-beads/red.md +3 -0
- package/downloads/with-beads/refactor.md +3 -0
- package/downloads/with-beads/spike.md +3 -0
- package/downloads/with-beads/summarize.md +2 -0
- 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/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 +3 -0
- package/downloads/without-beads/gap.md +3 -0
- package/downloads/without-beads/green.md +3 -0
- package/downloads/without-beads/issue.md +3 -0
- package/downloads/without-beads/red.md +3 -0
- package/downloads/without-beads/refactor.md +3 -0
- package/downloads/without-beads/spike.md +3 -0
- package/downloads/without-beads/summarize.md +2 -0
- 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 +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,87 @@ The interactive installer lets you choose:
|
|
|
30
30
|
|
|
31
31
|
After installation, restart Claude Code if it's currently running.
|
|
32
32
|
|
|
33
|
+
### Adding to Your Repository
|
|
34
|
+
|
|
35
|
+
To automatically regenerate commands when teammates install dependencies, add it as a dev dependency with a postinstall script:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install --save-dev @wbern/claude-instructions
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then add a postinstall script to your `package.json`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"scripts": {
|
|
46
|
+
"postinstall": "npx @wbern/claude-instructions --variant=without-beads --scope=project --prefix="
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@wbern/claude-instructions": "^1.0.0"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This ensures commands are regenerated whenever anyone runs `npm install`, `pnpm install`, or `yarn install`.
|
|
55
|
+
|
|
56
|
+
**CLI Options:**
|
|
57
|
+
|
|
58
|
+
| Option | Description |
|
|
59
|
+
|--------|-------------|
|
|
60
|
+
| `--variant=with-beads` | Include Beads MCP integration |
|
|
61
|
+
| `--variant=without-beads` | Standard commands only |
|
|
62
|
+
| `--scope=project` | Install to `.claude/commands` in current directory |
|
|
63
|
+
| `--scope=user` | Install to `~/.claude/commands` (global) |
|
|
64
|
+
| `--prefix=my-` | Add prefix to command names (e.g., `my-commit.md`) |
|
|
65
|
+
| `--skip-template-injection` | Don't inject CLAUDE.md template content |
|
|
66
|
+
| `--commands=commit,red,green` | Install only specific commands |
|
|
67
|
+
|
|
68
|
+
## Customizing Commands
|
|
69
|
+
|
|
70
|
+
You can inject project-specific instructions into generated commands by adding a `<claude-commands-template>` block to your `CLAUDE.md` or `AGENTS.md` file.
|
|
71
|
+
|
|
72
|
+
### Basic Usage
|
|
73
|
+
|
|
74
|
+
Add this to your project's `CLAUDE.md`:
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
# My Project
|
|
78
|
+
|
|
79
|
+
Other instructions here...
|
|
80
|
+
|
|
81
|
+
<claude-commands-template>
|
|
82
|
+
## Project-Specific Rules
|
|
83
|
+
|
|
84
|
+
- Always use pnpm instead of npm
|
|
85
|
+
- Run tests with `pnpm test`
|
|
86
|
+
</claude-commands-template>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When you run `npx @wbern/claude-instructions`, the template content is appended to all generated commands.
|
|
90
|
+
|
|
91
|
+
### Targeting Specific Commands
|
|
92
|
+
|
|
93
|
+
Use the `commands` attribute to inject content only into specific commands:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
<claude-commands-template commands="commit,ask">
|
|
97
|
+
## Git Conventions
|
|
98
|
+
|
|
99
|
+
- Use conventional commits format
|
|
100
|
+
- Reference issue numbers in commits
|
|
101
|
+
</claude-commands-template>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This injects the content only into `commit.md` and `ask.md`.
|
|
105
|
+
|
|
106
|
+
### File Priority
|
|
107
|
+
|
|
108
|
+
The generator looks for template blocks in this order:
|
|
109
|
+
1. `CLAUDE.md` (checked first)
|
|
110
|
+
2. `AGENTS.md` (fallback)
|
|
111
|
+
|
|
112
|
+
Only the first file found is used.
|
|
113
|
+
|
|
33
114
|
## Which Command Should I Use?
|
|
34
115
|
|
|
35
116
|
### Main Workflow
|
|
@@ -119,6 +200,7 @@ flowchart TB
|
|
|
119
200
|
### Workflow
|
|
120
201
|
|
|
121
202
|
- `/commit` - Create a git commit following project standards
|
|
203
|
+
- `/busycommit` - Create multiple atomic git commits, one logical change at a time
|
|
122
204
|
- `/ship` - Ship code directly to main - for small, obvious changes that don't need review (Cursor's modern alternative to PRs)
|
|
123
205
|
- `/show` - Show code to team with auto-merge - for changes that should be visible but don't need approval (Cursor's modern workflow)
|
|
124
206
|
- `/ask` - Request team review and approval - for complex changes needing discussion (OK fine, traditional PRs still have their place - Cursor)
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -26,8 +26,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
26
26
|
|
|
27
27
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
28
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.
|
|
29
30
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
30
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
|
|
31
34
|
|
|
32
35
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
33
36
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -5,6 +5,8 @@ description: Summarize conversation progress and next steps
|
|
|
5
5
|
|
|
6
6
|
Create a concise summary of the current conversation suitable for transferring context to a new conversation.
|
|
7
7
|
|
|
8
|
+
Additional info: $ARGUMENTS
|
|
9
|
+
|
|
8
10
|
## Summary Structure
|
|
9
11
|
|
|
10
12
|
Provide a summary with these sections:
|
|
@@ -23,8 +23,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
23
23
|
|
|
24
24
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
25
25
|
- Only one test at a time - this is critical for TDD discipline
|
|
26
|
+
- 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.
|
|
26
27
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
27
28
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
29
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
30
|
+
- 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
|
|
28
31
|
|
|
29
32
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
30
33
|
|
|
@@ -69,7 +69,7 @@ Uncommitted changes: !git status --short`
|
|
|
69
69
|
|
|
70
70
|
<step_2>
|
|
71
71
|
<description>Parse the arguments</description>
|
|
72
|
-
<input
|
|
72
|
+
<input>The user-provided arguments</input>
|
|
73
73
|
<expected_format>branch-name-or-github-url [optional-base-branch]</expected_format>
|
|
74
74
|
<example>fix/issue-123-main-content-area-visually-clipped main</example>
|
|
75
75
|
<example_github_url>https://github.com/owner/project/issues/123 main</example_github_url>
|
|
@@ -15,6 +15,8 @@ argument-hint: (no arguments)
|
|
|
15
15
|
|
|
16
16
|
Clean up merged worktrees by finding the oldest merged branch, consolidating settings, and removing stale worktrees.
|
|
17
17
|
|
|
18
|
+
Additional info: $ARGUMENTS
|
|
19
|
+
|
|
18
20
|
<current_state>
|
|
19
21
|
Current branch: !git branch --show-current`
|
|
20
22
|
Current worktrees: !git worktree list`
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -73,8 +73,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
73
73
|
|
|
74
74
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
75
75
|
- Only one test at a time - this is critical for TDD discipline
|
|
76
|
+
- 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.
|
|
76
77
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
77
78
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
79
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
80
|
+
- 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
|
|
78
81
|
|
|
79
82
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
80
83
|
|
|
@@ -26,8 +26,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
26
26
|
|
|
27
27
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
28
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.
|
|
29
30
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
30
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
|
|
31
34
|
|
|
32
35
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
33
36
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -5,6 +5,8 @@ description: Summarize conversation progress and next steps
|
|
|
5
5
|
|
|
6
6
|
Create a concise summary of the current conversation suitable for transferring context to a new conversation.
|
|
7
7
|
|
|
8
|
+
Additional info: $ARGUMENTS
|
|
9
|
+
|
|
8
10
|
## Summary Structure
|
|
9
11
|
|
|
10
12
|
Provide a summary with these sections:
|
|
@@ -23,8 +23,11 @@ The foundation of TDD is the Red-Green-Refactor cycle:
|
|
|
23
23
|
|
|
24
24
|
- The test must fail for the RIGHT reason (not syntax/import errors)
|
|
25
25
|
- Only one test at a time - this is critical for TDD discipline
|
|
26
|
+
- 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.
|
|
26
27
|
- **Adding a single test to a test file is ALWAYS allowed** - no prior test output needed
|
|
27
28
|
- Starting TDD for a new feature is always valid, even if test output shows unrelated work
|
|
29
|
+
- For DOM-based tests, use `data-testid` attributes to select elements rather than CSS classes, tag names, or text content
|
|
30
|
+
- 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
|
|
28
31
|
|
|
29
32
|
2. **Green Phase**: Write MINIMAL code to make the test pass
|
|
30
33
|
|
|
@@ -69,7 +69,7 @@ Uncommitted changes: !git status --short`
|
|
|
69
69
|
|
|
70
70
|
<step_2>
|
|
71
71
|
<description>Parse the arguments</description>
|
|
72
|
-
<input
|
|
72
|
+
<input>The user-provided arguments</input>
|
|
73
73
|
<expected_format>branch-name-or-github-url [optional-base-branch]</expected_format>
|
|
74
74
|
<example>fix/issue-123-main-content-area-visually-clipped main</example>
|
|
75
75
|
<example_github_url>https://github.com/owner/project/issues/123 main</example_github_url>
|
|
@@ -15,6 +15,8 @@ argument-hint: (no arguments)
|
|
|
15
15
|
|
|
16
16
|
Clean up merged worktrees by finding the oldest merged branch, consolidating settings, and removing stale worktrees.
|
|
17
17
|
|
|
18
|
+
Additional info: $ARGUMENTS
|
|
19
|
+
|
|
18
20
|
<current_state>
|
|
19
21
|
Current branch: !git branch --show-current`
|
|
20
22
|
Current worktrees: !git worktree list`
|