Skip to content

[Bug]: create-plugin command's allowed-tools prevents git init and validation script execution #103

@sjnims

Description

@sjnims

Bug Description

The create-plugin command's frontmatter restricts Bash to only Bash(mkdir:*), but the command body instructs Claude to perform operations that require broader Bash permissions:

  1. Initialize git repos (line 147): "Initialize git repo if creating new directory"
  2. Run validation scripts (lines 202, 212, 265):
    • "Validate with validate-agent.sh script"
    • "Test with validate-hook-schema.sh and test-hook.sh utilities"
    • "Run validate-hook-schema.sh on hooks/hooks.json"

These instructions cannot be executed with the current tool restrictions.

Steps to Reproduce

  1. Load plugin with cc --plugin-dir plugins/plugin-dev
  2. Run /plugin-dev:create-plugin my-new-plugin
  3. Proceed through workflow to Phase 4 (Structure Creation)
  4. When Claude attempts to run git init, it will be blocked by Bash restrictions
  5. Similarly, Phase 5-6 validation script instructions cannot be executed

Expected Behavior

Claude should be able to execute git init and validation scripts as instructed in Phases 4, 5, and 6 of the workflow.

Actual Behavior

The allowed-tools frontmatter (line 4) only permits Bash(mkdir:*), which blocks:

  • git init commands (Phase 4)
  • ./scripts/validate-agent.sh execution (Phase 5)
  • ./scripts/validate-hook-schema.sh execution (Phase 5, 6)
  • ./scripts/test-hook.sh execution (Phase 5)

Current frontmatter:

allowed-tools: ["Read", "Write", "Edit", "Grep", "Glob", "Bash(mkdir:*)", "TodoWrite", "AskUserQuestion", "Skill", "Task"]

Command Used

/plugin-dev:create-plugin

Environment

  • File: plugins/plugin-dev/commands/create-plugin.md
  • Plugin Version: 0.1.0

Suggested Fix Options

Option 1: Expand Bash permissions (recommended)

allowed-tools: Read, Write, Edit, Grep, Glob, Bash(mkdir:*), Bash(git init:*), Bash(bash:*), TodoWrite, AskUserQuestion, Skill, Task

Option 2: Clarify agent-based validation
Update instructions to clarify that validation scripts should be executed via Task agents (plugin-validator, skill-reviewer) rather than direct Bash execution.

Option 3: Remove direct script references
Remove references to running validation scripts directly and rely solely on the validation agents.

Additional Context

Minor style note: The allowed-tools field uses JSON array format ["Tool1", "Tool2"] while official Claude Code documentation examples use comma-separated string format Tool1, Tool2, Tool3. Both formats are valid per the docs, but switching to string format would be more consistent with official examples. This can be addressed as part of the fix.

Reference: Official slash-commands documentation

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions