Files
OpenSpec/openspec/changes/add-skill-cli-auto-approval/specs/cli-init/spec.md
T
Clay GoodandClaude Opus 4.8 a5bfedafc8 feat(skills): auto-approve the openspec CLI in generated skills and commands (#1300)
* feat(skills): auto-approve the openspec CLI in generated skills

Emit `allowed-tools: Bash(openspec:*)` in every generated SKILL.md so
agents that honor the Agent Skills standard run `openspec` commands
without prompting on each call. Scope is limited to the CLI; per the
standard `allowed-tools` pre-approves rather than restricts, so every
other tool a skill uses stays available under the user's normal
permission settings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(commands): auto-approve the openspec CLI in Claude slash commands

Extend the allowed-tools pre-approval to the second surface: Claude Code
/opsx:* slash commands share the skill frontmatter contract, so the
Claude command adapter now emits `allowed-tools: Bash(openspec:*)` too.
The value is single-sourced in `src/core/shared/allowed-tools.ts` (a
leaf module both surfaces import). Other command adapters are unchanged
— no other tool's slash-command format defines a per-command
pre-approval field; on the skills side every tool already gets the
standard field via generateSkillContent and non-implementing tools
ignore the unknown key.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 16:31:00 +00:00

1.2 KiB

MODIFIED Requirements

Requirement: Skill Generation

The command SHALL generate Agent Skills for selected AI tools.

Scenario: Generating skills for a tool

  • WHEN a tool is selected during initialization
  • THEN create 9 skill directories under .<tool>/skills/:
    • openspec-explore/SKILL.md
    • openspec-new-change/SKILL.md
    • openspec-continue-change/SKILL.md
    • openspec-apply-change/SKILL.md
    • openspec-ff-change/SKILL.md
    • openspec-verify-change/SKILL.md
    • openspec-sync-specs/SKILL.md
    • openspec-archive-change/SKILL.md
    • openspec-bulk-archive-change/SKILL.md
  • AND each SKILL.md SHALL contain YAML frontmatter with name and description
  • AND each SKILL.md SHALL contain the skill instructions

Scenario: Pre-approving the OpenSpec CLI in skill frontmatter

  • WHEN generating a skill's YAML frontmatter
  • THEN the frontmatter SHALL include an allowed-tools field with the value Bash(openspec:*)
  • AND an agent that honors allowed-tools SHALL run openspec commands from the skill without prompting for approval
  • AND because allowed-tools pre-approves rather than restricts, any other tool the skill uses SHALL remain available under the user's existing permission settings