Skip to content

[Feature]: disable-model-invocation flag for skills in SKILL.md #821

@xzavrel

Description

@xzavrel

Problem statement

Every enabled skill has its SKILL.md content injected into the system prompt on every turn of every conversation, regardless of whether the skill is relevant to that conversation.

With 101 bundled skills now shipped by default (PR #797), a user who has several skills enabled accumulates significant token overhead even in conversations where those skills are never used. There is currently no way to keep a skill available for on-demand invocation (e.g. via a slash command) without paying the token cost of having it in the system prompt at all times.

Proposed solution

Add a disable-model-invocation boolean flag to SKILL.md frontmatter:

---
name: my-skill
description: Runs a complex workflow, only needed occasionally
disable-model-invocation: true
---

When disable-model-invocation: true:

  • The skill is excluded from the system prompt — zero token cost per turn.
  • It remains available as a user-triggered slash command (/my-skill).
  • The model never sees it passively; it is only injected into context for the turn when the user explicitly invokes it.

Implementation scope

  • crates/skills/src/types.rs — add disable_model_invocation: bool to SkillMetadata (default false)
  • crates/agents/src/prompt/builder.rs — skip skills with disable_model_invocation = true in append_skills_section
  • Slash command palette — skills with this flag still appear and remain invocable by the user
  • On invocation, the skill's content is injected into context for that turn only

Alternatives considered

  • Globally disabling the skill[skills] enabled = false in the manifest (PR fix(chat): honor [skills] enabled=false at runtime #663) disables the skill entirely, including slash commands. Not a viable option for skills you want available on demand.
  • registry_mode = "lazy" for tools — moltis already has this for MCP tools, which replaces all tool schemas with a single tool_search meta-tool. There is no equivalent mechanism for skills.
  • Writing short skill descriptions — keeping SKILL.md minimal reduces per-skill overhead but doesn't eliminate it, and limits the skill's effectiveness when used.

Category

Agent loop / LLM providers

Priority

Medium — would be very helpful

Additional context

This feature is already implemented in OpenClaw (the upstream reference implementation) under the same disable-model-invocation frontmatter key. The proposed flag name is intentionally identical for compatibility with skills authored for OpenClaw.

From the OpenClaw docs:

disable-model-invocationtrue|false (default: false). When true, the skill is excluded from the model prompt (still available via user invocation).

The analogous token-saving feature for MCP tools (registry_mode = "lazy", which replaces all schemas with a tool_search meta-tool) already exists in moltis, making this a natural complement for skills.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions