Skip to content

feat: skill/prompt frontmatter now supports model, model-group, and thinking - #20

Open
ofriw wants to merge 14 commits into
mainfrom
feat/models-frontmatter
Open

feat: skill/prompt frontmatter now supports model, model-group, and thinking#20
ofriw wants to merge 14 commits into
mainfrom
feat/models-frontmatter

Conversation

@ofriw

@ofriw ofriw commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Skill/prompt frontmatter model selection

Skills and prompt templates can now declare model, model-group, and thinking alongside readonly. Interactive invocations apply model selection during input preflight, before slash-command expansion. readonly remains deferred to before_agent_start, where final skill metadata is available.

What changed

  • Generalized the readonly-only cache into frontmatter-cache.ts, which parses and validates readonly, model-group, model, and thinking for skills and prompts.
  • Added input preflight for model selection:
    1. model: provider/model-id selects that configured, authenticated model.
    2. Otherwise model-group: group-name resolves through the existing Model Group router.
    3. thinking: overrides the selected/current model’s level after capability clamping.
  • Explicit model takes precedence over model-group and shows a warning when both are present.
  • Unknown/unusable models or groups visibly block command expansion. Invalid frontmatter shows a warning and leaves valid independent fields usable.
  • Model-selection frontmatter is ignored in headless sessions and blocked during streaming; no model/thinking mutation occurs.
  • Preserved deferred readonly behavior and renamed internal readonly cache state/types to frontmatter cache equivalents.
  • Added integration coverage for prompt/skill preflight, precedence, validation, auth and routing failures, thinking clamping, streaming, headless mode, cache freshness, and state reset.

Documentation

docs/architecture.md now documents the frontmatter fields, resolution order, and lifecycle split.

Verification

  • npm run typecheck
  • npm test (the existing audit-config check currently fails because npm audit reports an additional transitive advisory path; this PR does not change dependencies, the lockfile, or that test)

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.

1 participant