Labsco
sanity-io logo

write-a-skill

β˜… 6,200

by sanity-io Β· part of sanity-io/sanity

Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup
🧰 Not standalone. This skill ships with sanity-io/sanity and only works together with that tool β€” install the tool first, then add this skill.

This is the playbook your agent receives when the skill activates β€” you don't need to read it to use the skill, but it's here to audit before installing.


name: write-a-skill description: Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.

Writing Skills

Process

  1. Gather requirements - ask user about:

    • What task/domain does the skill cover?
    • What specific use cases should it handle?
    • Does it need executable scripts or just instructions?
    • Any reference materials to include?
  2. Draft the skill - create:

    • SKILL.md with concise instructions
    • Additional reference files if content exceeds 500 lines
    • Utility scripts if deterministic operations needed
  3. Review with user - present draft and ask:

    • Does this cover your use cases?
    • Anything missing or unclear?
    • Should any section be more/less detailed?

Skill Structure

skill-name/
β”œβ”€β”€ SKILL.md           # Main instructions (required)
β”œβ”€β”€ REFERENCE.md       # Detailed docs (if needed)
β”œβ”€β”€ EXAMPLES.md        # Usage examples (if needed)
└── scripts/           # Utility scripts (if needed)
    └── helper.js

SKILL.md Template

---
name: skill-name
description: Brief description of capability. Use when [specific triggers].
---

# Skill Name

## Workflows

[Step-by-step processes with checklists for complex tasks]

## Advanced features

[Link to separate files: See [REFERENCE.md](REFERENCE.md)]

When to Add Scripts

Add utility scripts when:

  • Operation is deterministic (validation, formatting)
  • Same code would be generated repeatedly
  • Errors need explicit handling

Scripts save tokens and improve reliability vs generated code.

When to Split Files

Split into separate files when:

  • SKILL.md exceeds 100 lines
  • Content has distinct domains (finance vs sales schemas)
  • Advanced features are rarely needed

Review Checklist

After drafting, verify:

  • Description includes triggers ("Use when...")
  • SKILL.md under 100 lines
  • No time-sensitive info
  • Consistent terminology
  • Concrete examples included
  • References one level deep