Skill Frontmatter Configuration

Core

Create and configure custom slash commands and skills · Difficulty 3/5

0%
frontmatterskillsconfigurationforkallowed-tools

Skill files support YAML frontmatter that controls execution behavior, tool access, and user interaction.

Frontmatter Options

---
argument-hint: "migration name"
context: fork
allowed-tools:
  - write_file
model: haiku
---

context: fork

Runs the skill in an isolated sub-agent context:

  • Prevents verbose output from polluting the main conversation
  • Essential for exploration/analysis skills (e.g., codebase analysis, brainstorming alternatives)
  • Abandoned approaches in the fork don't influence subsequent implementation work
  • The fork returns only a summary to the main conversation
  • allowed-tools

    Restricts tool access during skill execution (principle of least privilege):

  • Limit to file write operations to prevent destructive actions
  • Prevent accidental deletion or modification of unrelated files
  • Each skill gets only the tools it needs
  • argument-hint

    Shows expected parameters during autocomplete:

  • Prompts developers for required parameters when they invoke the skill without arguments
  • Improves discoverability of skill parameters
  • Example: argument-hint: "migration name" tells the developer to provide a migration name
  • Key Takeaways

    • context: fork isolates skill execution from main conversation
    • allowed-tools restricts tool access for safety (principle of least privilege)
    • argument-hint prompts developers for required parameters
    • Use fork for exploration skills to prevent verbose output from polluting context