@wbern/claude-instructions 1.5.0 → 1.7.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
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
|
|
@@ -57,8 +57,9 @@ echo "Review this code for bugs and suggest fixes" > ~/.claude/commands/review.m
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
### Command with Arguments
|
|
60
|
+
**Note for AI**: The example below uses a fullwidth dollar sign ($, U+FF04) to prevent interpolation in this documentation. When creating actual commands, use the regular `$` character.
|
|
60
61
|
```markdown
|
|
61
|
-
Fix issue
|
|
62
|
+
Fix issue $ARGUMENTS following our coding standards
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
### Command with File References
|
|
@@ -81,9 +82,10 @@ Create commit for these changes.
|
|
|
81
82
|
**Note**: Only works with commands in the current project directory.
|
|
82
83
|
|
|
83
84
|
### Namespaced Command
|
|
85
|
+
**Note for AI**: The example below uses a fullwidth dollar sign ($, U+FF04) to prevent interpolation in this documentation. When creating actual commands, use the regular `$` character.
|
|
84
86
|
```bash
|
|
85
87
|
mkdir -p ~/.claude/commands/ai
|
|
86
|
-
echo "Ask GPT-5 about: ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
|
|
88
|
+
echo "Ask GPT-5 about: $ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
|
|
87
89
|
# Creates: /ai:gpt5
|
|
88
90
|
```
|
|
89
91
|
|
|
@@ -57,8 +57,9 @@ echo "Review this code for bugs and suggest fixes" > ~/.claude/commands/review.m
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
### Command with Arguments
|
|
60
|
+
**Note for AI**: The example below uses a fullwidth dollar sign ($, U+FF04) to prevent interpolation in this documentation. When creating actual commands, use the regular `$` character.
|
|
60
61
|
```markdown
|
|
61
|
-
Fix issue
|
|
62
|
+
Fix issue $ARGUMENTS following our coding standards
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
### Command with File References
|
|
@@ -81,9 +82,10 @@ Create commit for these changes.
|
|
|
81
82
|
**Note**: Only works with commands in the current project directory.
|
|
82
83
|
|
|
83
84
|
### Namespaced Command
|
|
85
|
+
**Note for AI**: The example below uses a fullwidth dollar sign ($, U+FF04) to prevent interpolation in this documentation. When creating actual commands, use the regular `$` character.
|
|
84
86
|
```bash
|
|
85
87
|
mkdir -p ~/.claude/commands/ai
|
|
86
|
-
echo "Ask GPT-5 about: ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
|
|
88
|
+
echo "Ask GPT-5 about: $ARGUMENTS" > ~/.claude/commands/ai/gpt5.md
|
|
87
89
|
# Creates: /ai:gpt5
|
|
88
90
|
```
|
|
89
91
|
|