Skip to content

feat: add --allow-model-invocation flag for agent-orchestrated workflows#2099

Open
srobroek wants to merge 1 commit intogithub:mainfrom
srobroek:feat/allow-model-invocation
Open

feat: add --allow-model-invocation flag for agent-orchestrated workflows#2099
srobroek wants to merge 1 commit intogithub:mainfrom
srobroek:feat/allow-model-invocation

Conversation

@srobroek
Copy link
Copy Markdown

@srobroek srobroek commented Apr 5, 2026

Summary

  • Add --allow-model-invocation flag to specify init
  • Persist choice in .specify/init-options.json
  • build_skill_frontmatter() reads the option and conditionally sets disable-model-invocation
  • Extension and preset installs automatically respect the persisted option

Implementation Details

The flag defaults to false (skills disabled for model invocation) to maintain backward compatibility. When a user runs:

specify init --integration claude --allow-model-invocation

The generated SKILL.md files will have disable-model-invocation: false, allowing the AI model to invoke speckit skills programmatically for agent-orchestrated workflows.

Changes

  • CLI: Added --allow-model-invocation option to specify init command
  • Persistence: Flag stored in .specify/init-options.json for consistent behavior
  • Skill Generation: CommandRegistrar.build_skill_frontmatter() now accepts optional project_root parameter and reads init-options to determine the flag value
  • Integration Setup: ClaudeIntegration.setup() conditionally injects disable-model-invocation based on the persisted option
  • Extensions & Presets: All skill generation paths (init, extension install, preset install) respect the setting
  • Tests: Added comprehensive test coverage for all scenarios

Testing

All existing tests pass, plus 4 new tests covering:

  1. Default behavior (disable-model-invocation: true)
  2. Flag enabled behavior (disable-model-invocation: false)
  3. build_skill_frontmatter() respects init-options.json
  4. Preset installs respect the setting
pytest tests/integrations/test_integration_claude.py::TestAllowModelInvocation -xvs
# 4 passed

Fixes #2098

AI Disclosure (per CONTRIBUTING.md): Claude Code was used for code generation. Changes were reviewed and tested by the submitter.

Add `--allow-model-invocation` flag to `specify init` that controls
whether generated SKILL.md files get `disable-model-invocation: false`
(allowing the AI model to invoke skills programmatically) or `true`
(requiring explicit user invocation).

Changes:
- Add `--allow-model-invocation` CLI option to `specify init` command
- Persist flag in `.specify/init-options.json`
- Update `build_skill_frontmatter()` to read `allow_model_invocation`
  from init-options and conditionally set `disable-model-invocation`
- Update `ClaudeIntegration.setup()` to conditionally inject the flag
  based on the persisted option
- Extension and preset installs automatically respect the setting
- Add comprehensive test coverage for the new functionality

The flag defaults to false (skills disabled for model invocation) to
maintain backward compatibility and prevent unexpected behavior.

Fixes github#2098
@srobroek srobroek requested a review from mnriem as a code owner April 5, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: add --allow-model-invocation flag for agent-orchestrated workflows

2 participants