Skip to content

Commit af67349

Browse files
sjnimsclaude
andauthored
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

File tree

.github/workflows/component-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ jobs:
9696
- [ ] YAML frontmatter exists with `name`, `description`, `allowed-tools` fields
9797
- [ ] `description` is 60 characters or fewer
9898
- [ ] `allowed-tools` follows these rules:
99-
- MUST use `Bash(gh:*)` not unrestricted `Bash` (security requirement)
99+
- For simple commands needing only specific CLI operations: prefer Bash prefix patterns like `Bash(gh pr:*)`, `Bash(npm run:*)` (uses prefix matching with `:*` wildcard)
100+
- Unrestricted `Bash` is acceptable for workflow/scaffolding commands that legitimately need filesystem operations (mkdir, git init, directory creation) - verify the command's stated purpose justifies broader access
100101
- `Read` is always allowed (reading files is safe)
101102
- `Write` is allowed ONLY if the command creates/exports files (e.g., status export)
102103
- `AskUserQuestion` is always allowed (user interaction is safe)

0 commit comments

Comments
 (0)