Commit af67349
fix: make Bash tool validation rule contextual for workflow commands (#101)
## Summary
Updates the component validation workflow to use a contextual Bash tool
rule instead of a blanket restriction, and corrects the Bash pattern
syntax to match official documentation.
## Problem
The validation rule at line 99 was:
```
- MUST use `Bash(gh:*)` not unrestricted `Bash` (security requirement)
```
This caused PR #100 to fail validation because `create-plugin.md` uses
unrestricted `Bash` - but it **legitimately needs** broader access for:
- `mkdir -p` - creating plugin directory structures
- `git init` - initializing git repositories
- Other filesystem operations
Additionally, the syntax `Bash(gh:*)` doesn't match official
documentation, which specifies prefix matching with `:*` (e.g., `Bash(gh
pr:*)`).
## Solution
Updated the validation rule to be contextual:
1. **For simple commands**: Recommend Bash prefix patterns like `Bash(gh
pr:*)`, `Bash(npm run:*)`
2. **For workflow/scaffolding commands**: Allow unrestricted `Bash` when
the command's purpose justifies filesystem operations
3. **Fixed syntax**: Use correct `:*` wildcard notation per [official
docs](https://docs.anthropic.com/en/docs/claude-code/settings#tool-specific-permission-rules)
### Alternatives Considered
| Option | Why Not Chosen |
|--------|----------------|
| Keep blanket restriction | Breaks legitimate workflow commands |
| Allowlist specific commands | Doesn't scale, maintenance burden |
| Remove rule entirely | Loses security guidance for simple commands |
## Changes
- `.github/workflows/component-validation.yml`: Updated Bash validation
rule (lines 99-100)
## Testing
- [x] actionlint passes
- [x] Syntax matches official Claude Code documentation
## Related
- Unblocks PR #100 (fix: correct phase count and add Edit tool to
create-plugin command)
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 42d1562 commit af67349
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
0 commit comments