aiblueprint-cli 1.4.12 → 1.4.13
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/claude-code-config/scripts/.claude/commands/fix-on-my-computer.md +87 -0
- package/claude-code-config/scripts/command-validator/CLAUDE.md +112 -0
- package/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +62 -111
- package/claude-code-config/scripts/command-validator/src/cli.ts +5 -3
- package/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +3 -4
- package/claude-code-config/scripts/command-validator/src/lib/types.ts +1 -0
- package/claude-code-config/scripts/command-validator/src/lib/validator.ts +47 -317
- package/claude-code-config/scripts/statusline/CLAUDE.md +29 -7
- package/claude-code-config/scripts/statusline/README.md +89 -1
- package/claude-code-config/scripts/statusline/defaults.json +75 -0
- package/claude-code-config/scripts/statusline/src/index.ts +101 -24
- package/claude-code-config/scripts/statusline/src/lib/config-types.ts +100 -0
- package/claude-code-config/scripts/statusline/src/lib/config.ts +21 -0
- package/claude-code-config/scripts/statusline/src/lib/context.ts +32 -11
- package/claude-code-config/scripts/statusline/src/lib/formatters.ts +360 -22
- package/claude-code-config/scripts/statusline/src/lib/git.ts +100 -0
- package/claude-code-config/scripts/statusline/src/lib/render-pure.ts +177 -0
- package/claude-code-config/scripts/statusline/src/lib/types.ts +11 -0
- package/claude-code-config/scripts/statusline/statusline.config.json +93 -0
- package/claude-code-config/skills/claude-memory/SKILL.md +689 -0
- package/claude-code-config/skills/claude-memory/references/comprehensive-example.md +175 -0
- package/claude-code-config/skills/claude-memory/references/project-patterns.md +334 -0
- package/claude-code-config/skills/claude-memory/references/prompting-techniques.md +411 -0
- package/claude-code-config/skills/claude-memory/references/section-templates.md +347 -0
- package/claude-code-config/skills/create-slash-commands/SKILL.md +1110 -0
- package/claude-code-config/skills/create-slash-commands/references/arguments.md +273 -0
- package/claude-code-config/skills/create-slash-commands/references/patterns.md +947 -0
- package/claude-code-config/skills/create-slash-commands/references/prompt-examples.md +656 -0
- package/claude-code-config/skills/create-slash-commands/references/tool-restrictions.md +389 -0
- package/claude-code-config/skills/create-subagents/SKILL.md +425 -0
- package/claude-code-config/skills/create-subagents/references/context-management.md +567 -0
- package/claude-code-config/skills/create-subagents/references/debugging-agents.md +714 -0
- package/claude-code-config/skills/create-subagents/references/error-handling-and-recovery.md +502 -0
- package/claude-code-config/skills/create-subagents/references/evaluation-and-testing.md +374 -0
- package/claude-code-config/skills/create-subagents/references/orchestration-patterns.md +591 -0
- package/claude-code-config/skills/create-subagents/references/subagents.md +599 -0
- package/claude-code-config/skills/create-subagents/references/writing-subagent-prompts.md +513 -0
- package/package.json +1 -1
- package/claude-code-config/commands/apex.md +0 -109
- package/claude-code-config/commands/tasks/run-task.md +0 -220
- package/claude-code-config/commands/utils/watch-ci.md +0 -47
- package/claude-code-config/scripts/command-validator/biome.json +0 -29
- package/claude-code-config/scripts/command-validator/bun.lockb +0 -0
- package/claude-code-config/scripts/command-validator/package.json +0 -27
- package/claude-code-config/scripts/command-validator/vitest.config.ts +0 -7
- package/claude-code-config/scripts/hook-post-file.ts +0 -162
- package/claude-code-config/scripts/statusline/biome.json +0 -34
- package/claude-code-config/scripts/statusline/bun.lockb +0 -0
- package/claude-code-config/scripts/statusline/fixtures/test-input.json +0 -25
- package/claude-code-config/scripts/statusline/package.json +0 -19
- package/claude-code-config/scripts/statusline/statusline.config.ts +0 -25
- package/claude-code-config/scripts/statusline/test.ts +0 -20
- package/claude-code-config/scripts/validate-command.js +0 -712
- package/claude-code-config/scripts/validate-command.readme.md +0 -283
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
# Tool Restrictions Reference
|
|
2
|
+
|
|
3
|
+
Official documentation on restricting tool access in slash commands.
|
|
4
|
+
|
|
5
|
+
## Why Restrict Tools
|
|
6
|
+
|
|
7
|
+
Tool restrictions provide:
|
|
8
|
+
|
|
9
|
+
- **Security**: Prevent accidental destructive operations
|
|
10
|
+
- **Focus**: Limit scope for specialized commands
|
|
11
|
+
- **Safety**: Ensure commands only perform intended operations
|
|
12
|
+
|
|
13
|
+
## allowed-tools Field
|
|
14
|
+
|
|
15
|
+
**Location**: YAML frontmatter
|
|
16
|
+
|
|
17
|
+
**Format**: Array of tool names or patterns
|
|
18
|
+
|
|
19
|
+
**Default**: If omitted, all tools available
|
|
20
|
+
|
|
21
|
+
## Basic Patterns
|
|
22
|
+
|
|
23
|
+
### Array Format
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
---
|
|
27
|
+
description: My command
|
|
28
|
+
allowed-tools: [Read, Edit, Write]
|
|
29
|
+
---
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Single Tool
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
---
|
|
36
|
+
description: Thinking command
|
|
37
|
+
allowed-tools: SequentialThinking
|
|
38
|
+
---
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Bash Command Restrictions
|
|
42
|
+
|
|
43
|
+
**Source**: Official Claude Code documentation
|
|
44
|
+
|
|
45
|
+
Restrict bash commands to specific patterns using wildcards.
|
|
46
|
+
|
|
47
|
+
### Git-Only Commands
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
---
|
|
51
|
+
description: Create a git commit
|
|
52
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
|
|
53
|
+
---
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Allows**:
|
|
57
|
+
|
|
58
|
+
- `git add <anything>`
|
|
59
|
+
- `git status <anything>`
|
|
60
|
+
- `git commit <anything>`
|
|
61
|
+
|
|
62
|
+
**Prevents**:
|
|
63
|
+
|
|
64
|
+
- `rm -rf`
|
|
65
|
+
- `curl <url>`
|
|
66
|
+
- Any non-git bash commands
|
|
67
|
+
|
|
68
|
+
### NPM Script Restrictions
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
---
|
|
72
|
+
description: Run tests and lint
|
|
73
|
+
allowed-tools: Bash(npm test:*), Bash(npm run lint:*)
|
|
74
|
+
---
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Allows**:
|
|
78
|
+
|
|
79
|
+
- `npm test`
|
|
80
|
+
- `npm test -- --watch`
|
|
81
|
+
- `npm run lint`
|
|
82
|
+
- `npm run lint:fix`
|
|
83
|
+
|
|
84
|
+
**Prevents**:
|
|
85
|
+
|
|
86
|
+
- `npm install malicious-package`
|
|
87
|
+
- `npm run deploy`
|
|
88
|
+
- Other npm commands
|
|
89
|
+
|
|
90
|
+
### Multiple Bash Patterns
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
---
|
|
94
|
+
description: Development workflow
|
|
95
|
+
allowed-tools: Bash(git status:*), Bash(npm test:*), Bash(npm run build:*)
|
|
96
|
+
---
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Combines multiple bash command patterns.
|
|
100
|
+
|
|
101
|
+
## Common Tool Restriction Patterns
|
|
102
|
+
|
|
103
|
+
### Pattern 1: Git Workflows
|
|
104
|
+
|
|
105
|
+
**Use case**: Commands that create commits, check status, etc.
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
---
|
|
109
|
+
description: Create a git commit
|
|
110
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git diff:*), Bash(git commit:*)
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
Current status: ! `git status`
|
|
114
|
+
Changes: ! `git diff HEAD`
|
|
115
|
+
|
|
116
|
+
Create a commit for these changes.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Security benefit**: Cannot accidentally run destructive commands like `rm -rf` or `curl malicious-site.com`
|
|
120
|
+
|
|
121
|
+
### Pattern 2: Read-Only Analysis
|
|
122
|
+
|
|
123
|
+
**Use case**: Commands that analyze code without modifying it
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
---
|
|
127
|
+
description: Analyze codebase for pattern
|
|
128
|
+
allowed-tools: [Read, Grep, Glob]
|
|
129
|
+
---
|
|
130
|
+
Search codebase for: #$ARGUMENTS
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Security benefit**: Cannot write files or execute code
|
|
134
|
+
|
|
135
|
+
### Pattern 3: Thinking-Only Commands
|
|
136
|
+
|
|
137
|
+
**Use case**: Deep analysis or planning without file operations
|
|
138
|
+
|
|
139
|
+
```yaml
|
|
140
|
+
---
|
|
141
|
+
description: Analyze problem from first principles
|
|
142
|
+
allowed-tools: SequentialThinking
|
|
143
|
+
---
|
|
144
|
+
Analyze the current problem from first principles.
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Focus benefit**: Claude focuses purely on reasoning, no file operations
|
|
148
|
+
|
|
149
|
+
### Pattern 4: Controlled File Operations
|
|
150
|
+
|
|
151
|
+
**Use case**: Commands that should only read/edit specific types
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
---
|
|
155
|
+
description: Update documentation
|
|
156
|
+
allowed-tools: [Read, Edit(*.md)]
|
|
157
|
+
---
|
|
158
|
+
Update documentation in @ #$ARGUMENTS
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Note**: File pattern restrictions may not be supported in all versions.
|
|
162
|
+
|
|
163
|
+
## Real Examples from Official Docs
|
|
164
|
+
|
|
165
|
+
### Example 1: Git Commit Command
|
|
166
|
+
|
|
167
|
+
**Source**: Official Claude Code documentation
|
|
168
|
+
|
|
169
|
+
```markdown
|
|
170
|
+
---
|
|
171
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
|
|
172
|
+
description: Create a git commit
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Context
|
|
176
|
+
|
|
177
|
+
- Current git status: ! `git status`
|
|
178
|
+
- Current git diff (staged and unstaged changes): ! `git diff HEAD`
|
|
179
|
+
- Current branch: ! `git branch --show-current`
|
|
180
|
+
- Recent commits: ! `git log --oneline -10`
|
|
181
|
+
|
|
182
|
+
## Your task
|
|
183
|
+
|
|
184
|
+
Based on the above changes, create a single git commit.
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Allowed bash commands**:
|
|
188
|
+
|
|
189
|
+
- `git add .`
|
|
190
|
+
- `git add file.js`
|
|
191
|
+
- `git status`
|
|
192
|
+
- `git status --short`
|
|
193
|
+
- `git commit -m "message"`
|
|
194
|
+
- `git commit --amend`
|
|
195
|
+
|
|
196
|
+
**Blocked commands**:
|
|
197
|
+
|
|
198
|
+
- `rm file.js`
|
|
199
|
+
- `curl https://malicious.com`
|
|
200
|
+
- `npm install`
|
|
201
|
+
- Any non-git commands
|
|
202
|
+
|
|
203
|
+
### Example 2: Code Review (No Restrictions)
|
|
204
|
+
|
|
205
|
+
```markdown
|
|
206
|
+
---
|
|
207
|
+
description: Review this code for security vulnerabilities
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
Review this code for security vulnerabilities:
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**No allowed-tools field** = All tools available
|
|
214
|
+
|
|
215
|
+
Claude can:
|
|
216
|
+
|
|
217
|
+
- Read files
|
|
218
|
+
- Write files
|
|
219
|
+
- Execute bash commands
|
|
220
|
+
- Use any tool
|
|
221
|
+
|
|
222
|
+
**Use when**: Command needs full flexibility
|
|
223
|
+
|
|
224
|
+
## When to Restrict Tools
|
|
225
|
+
|
|
226
|
+
### ✅ Restrict when:
|
|
227
|
+
|
|
228
|
+
1. **Security-sensitive operations**
|
|
229
|
+
|
|
230
|
+
```yaml
|
|
231
|
+
# Git operations only
|
|
232
|
+
allowed-tools: Bash(git add:*), Bash(git status:*)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
2. **Focused tasks**
|
|
236
|
+
|
|
237
|
+
```yaml
|
|
238
|
+
# Deep thinking only
|
|
239
|
+
allowed-tools: SequentialThinking
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
3. **Read-only analysis**
|
|
243
|
+
|
|
244
|
+
```yaml
|
|
245
|
+
# No modifications
|
|
246
|
+
allowed-tools: [Read, Grep, Glob]
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
4. **Specific bash commands**
|
|
250
|
+
```yaml
|
|
251
|
+
# Only npm scripts
|
|
252
|
+
allowed-tools: Bash(npm run test:*), Bash(npm run build:*)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### ❌ Don't restrict when:
|
|
256
|
+
|
|
257
|
+
1. **Command needs flexibility**
|
|
258
|
+
- Complex workflows
|
|
259
|
+
- Exploratory tasks
|
|
260
|
+
- Multi-step operations
|
|
261
|
+
|
|
262
|
+
2. **Tool needs are unpredictable**
|
|
263
|
+
- General problem-solving
|
|
264
|
+
- Debugging unknown issues
|
|
265
|
+
|
|
266
|
+
3. **Already in safe environment**
|
|
267
|
+
- Sandboxed execution
|
|
268
|
+
- Non-production systems
|
|
269
|
+
|
|
270
|
+
## Best Practices
|
|
271
|
+
|
|
272
|
+
### 1. Use Wildcards for Command Families
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
# Good - allows all git commands
|
|
276
|
+
allowed-tools: Bash(git *)
|
|
277
|
+
|
|
278
|
+
# Better - specific git operations
|
|
279
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
|
|
280
|
+
|
|
281
|
+
# Best - minimal necessary permissions
|
|
282
|
+
allowed-tools: Bash(git status:*), Bash(git diff:*)
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### 2. Combine Tool Types Appropriately
|
|
286
|
+
|
|
287
|
+
```yaml
|
|
288
|
+
# Analysis with optional git context
|
|
289
|
+
allowed-tools: [Read, Grep, Bash(git status:*)]
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### 3. Test Restrictions
|
|
293
|
+
|
|
294
|
+
Create command and verify:
|
|
295
|
+
|
|
296
|
+
- Allowed operations work
|
|
297
|
+
- Blocked operations are prevented
|
|
298
|
+
- Error messages are clear
|
|
299
|
+
|
|
300
|
+
### 4. Document Why
|
|
301
|
+
|
|
302
|
+
```yaml
|
|
303
|
+
---
|
|
304
|
+
description: Create git commit (restricted to git commands only for security)
|
|
305
|
+
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
|
|
306
|
+
---
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Tool Types
|
|
310
|
+
|
|
311
|
+
### File Operations
|
|
312
|
+
|
|
313
|
+
- `Read` - Read files
|
|
314
|
+
- `Write` - Write new files
|
|
315
|
+
- `Edit` - Modify existing files
|
|
316
|
+
- `Grep` - Search file contents
|
|
317
|
+
- `Glob` - Find files by pattern
|
|
318
|
+
|
|
319
|
+
### Execution
|
|
320
|
+
|
|
321
|
+
- `Bash(pattern:*)` - Execute bash commands matching pattern
|
|
322
|
+
- `SequentialThinking` - Reasoning tool
|
|
323
|
+
|
|
324
|
+
### Other
|
|
325
|
+
|
|
326
|
+
- `Task` - Invoke subagents
|
|
327
|
+
- `WebSearch` - Search the web
|
|
328
|
+
- `WebFetch` - Fetch web pages
|
|
329
|
+
|
|
330
|
+
## Security Patterns
|
|
331
|
+
|
|
332
|
+
### Pattern: Prevent Data Exfiltration
|
|
333
|
+
|
|
334
|
+
```yaml
|
|
335
|
+
---
|
|
336
|
+
description: Analyze code locally
|
|
337
|
+
allowed-tools: [Read, Grep, Glob, SequentialThinking]
|
|
338
|
+
# No Bash, WebFetch - cannot send data externally
|
|
339
|
+
---
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Pattern: Prevent Destructive Operations
|
|
343
|
+
|
|
344
|
+
```yaml
|
|
345
|
+
---
|
|
346
|
+
description: Review changes
|
|
347
|
+
allowed-tools: [Read, Bash(git diff:*), Bash(git log:*)]
|
|
348
|
+
# No Write, Edit, git reset, git push --force
|
|
349
|
+
---
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Pattern: Controlled Deployment
|
|
353
|
+
|
|
354
|
+
```yaml
|
|
355
|
+
---
|
|
356
|
+
description: Deploy to staging
|
|
357
|
+
allowed-tools: Bash(npm run deploy:staging), Bash(git push origin:staging)
|
|
358
|
+
# Cannot deploy to production accidentally
|
|
359
|
+
---
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Limitations
|
|
363
|
+
|
|
364
|
+
1. **Wildcard patterns** may vary by version
|
|
365
|
+
2. **File-specific restrictions** (like `Edit(*.md)`) may not be supported
|
|
366
|
+
3. **Cannot blacklist** - only whitelist
|
|
367
|
+
4. **All or nothing** for tool types - can't partially restrict
|
|
368
|
+
|
|
369
|
+
## Testing Tool Restrictions
|
|
370
|
+
|
|
371
|
+
### Verify Restrictions Work
|
|
372
|
+
|
|
373
|
+
1. Create command with restrictions
|
|
374
|
+
2. Try to use restricted tool
|
|
375
|
+
3. Confirm operation is blocked
|
|
376
|
+
4. Check error message
|
|
377
|
+
|
|
378
|
+
Example test:
|
|
379
|
+
|
|
380
|
+
```markdown
|
|
381
|
+
---
|
|
382
|
+
description: Test restrictions
|
|
383
|
+
allowed-tools: [Read]
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
Try to write a file - this should fail.
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
Expected: Write operations blocked with error message.
|