SKILL.md Skills: Four Categories and Reusable Templates for AI Coding Agents

    This guide treats SKILL.md as a reusable, loadable capability unit for AI coding assistants and agents. It explains the standard directory structure and the progressive-disclosure loading mechanism, compares three usage entry points (local development tools, conversational web assistants, and API calls) with a selection principle, presents a practical four-category taxonomy (workflow, knowledge, tool/action, and guardrail/quality) with sample snippets, and provides a ready-to-use skeleton template plus best practices and common pitfalls for building a maintainable skill library.

    1. Why SKILL.md: From One-Off Prompts to Reusable Skills

    In daily work with AI coding assistants, teams repeatedly hit three pain points: the same prompt for a complex task gets pasted over and over, context keeps piling up until the model’s attention is diluted, and individual know-how can’t be standardized and reused across the team. The solution is to distill the “knowledge you have to re-explain every time” into a loadable capability unit — which is exactly what SKILL.md provides.

    A skill typically consists of “one standalone directory plus a manifest file named SKILL.md inside it.” The manifest uses natural language to describe what the skill does, when to use it, and which steps to follow, and it can bundle scripts, templates, reference material, and other resources. Its role is similar to a “reusable component” in traditional engineering: it packages domain knowledge, workflows, and constraints, then assembles them on demand for an AI coding tool or AI agent instead of being typed from scratch every time.

    2. Basic Structure and Loading Mechanism

    A well-formed skill directory usually looks like this:

    1. my-skill/
    2. ├── SKILL.md # Required: skill manifest and metadata
    3. ├── reference/ # Optional: reference material and spec documents
    4. ├── templates/ # Optional: ready-to-use template files
    5. └── scripts/ # Optional: helper scripts the skill can call on demand

    SKILL.md generally has two parts: frontmatter metadata (YAML frontmatter that declares the name, description, trigger semantics, and so on) and body instructions (the concrete execution steps and constraints). A minimal example:

    1. ---
    2. name: code-review-checklist
    3. description: Use when the user asks for a code review, a pre-commit check, or a quality gate; output structured review comments
    4. ---
    5. # Code Review Checklist
    6. 1. Read the changed files and outline the intent of the changes
    7. 2. Check item by item across four dimensions: correctness, readability, security, and performance
    8. 3. For each issue, provide: location, severity, and a suggested fix
    9. 4. Consolidate into a tiered list (blocking / suggested / optional)

    The key design here is progressive disclosure: when the entry point is loaded, usually only the short description is read to decide whether to trigger; only after a real match are the full body and referenced resources expanded. This ensures the skill is dispatched accurately while avoiding stuffing large amounts of content into context all at once — which keeps token costs under control and preserves the model’s attention.

    3. Differences Between the Three Usage Entry Points and How to Choose

    A skill’s “assembly” usually happens in three different usage scenarios. Understanding the differences helps you pick the right way to deploy:

    • Local development tools (CLI or IDE-embedded coding assistants): Skills live as directories in a conventional location within the project or globally. Once installed, you can name and call them directly in a conversation. Suitable for engineering tasks that are tightly coupled to the codebase and need to run frequently.
    • Conversational web assistants: Some paid tiers already bundle a set of general-purpose skills that often work out of the box. So the first step should be to confirm whether the target capability is already covered by a built-in skill — if you can use it directly, don’t rush to rebuild it locally, which avoids maintaining two sets of logic.
    • API programmability: Suitable for embedding skills into automation pipelines or self-built systems, calling them via an interface as preset skills or uploaded custom skills to achieve unattended batch processing.
    Entry point Typical form Suitable scenarios Setup cost
    Local tooling Project/global directory Engineering tasks tightly coupled to the codebase Medium
    Conversational assistant Built into the platform General capabilities, quick validation Low
    API calls Interface integration Automation, batch processing Higher

    Selection principle: evaluate built-in capabilities first, then decide whether to build locally, and only then consider moving to API-based calls — so you avoid duplicate investment.

    4. The Four Categories of SKILL.md Skills

    Grouping skills by responsibility significantly improves maintainability. A practical four-category framework — with positioning and a sample snippet for each — is as follows:

    1. Workflow — turn a multi-step task into a standard process.

    1. ---
    2. name: release-flow
    3. description: Use when the user needs to kick off a release, generate change notes, or run a pre-launch check
    4. ---
    5. Steps: pull changes → run tests → generate changelog → output release checklist

    2. Knowledge — inject background constraints for a specific business or technology.

    1. ---
    2. name: api-convention
    3. description: Provides team conventions when dealing with API design, naming, or versioning
    4. ---
    5. Follow REST style; use pagination parameters consistently; breaking changes require a major version bump

    3. Tool/Action — call external capabilities or scripts to perform a concrete action.

    1. ---
    2. name: dependency-audit
    3. description: Use when you need to check dependencies, investigate vulnerabilities, or upgrade versions
    4. ---
    5. Read dependency manifest → call audit script → output risk items and recommended versions

    4. Guardrail/Quality — constrain output boundaries and enforce quality.

    1. ---
    2. name: commit-guard
    3. description: Use when generating commit messages or running pre-commit validation
    4. ---
    5. Commit messages must include a type prefix; never commit secrets; large files need a separate note

    5. Ready-to-Use Skeleton Template

    When creating a new skill, start from the general skeleton below, then fill it in according to the characteristics of the four categories:

    1. ---
    2. name: <kebab-case-unique-name>
    3. description: <one-line "what it does" + "when to trigger"; getting the trigger semantics right is the most important part>
    4. ---
    5. # <Skill Title>
    6. ## Use Cases
    7. <When this skill should be loaded>
    8. ## Execution Steps
    9. 1. <Step one>
    10. 2. <Step two>
    11. 3. <Output format and deliverables>
    12. ## Constraints and Notes
    13. <Prohibited actions, boundary conditions, and the failure-handling strategy>

    Filling tips: strengthen “steps and state transitions” for workflow skills; strengthen “facts and conventions” for knowledge skills; strengthen “invocation method and the input/output contract” for tool skills; strengthen “checklists and decision criteria” for validation skills.

    6. Best Practices and Common Pitfalls

    • The description determines the hit rate: It is almost the only piece of information read during loading, so clearly state “what it does + when to use it.” The more precise the semantics, the more accurate the automatic dispatch.
    • Single responsibility: One skill should solve one type of problem. Avoid turning it into a “universal manual,” which bloats the context and makes it hard to reuse.
    • Make good use of progressive disclosure: Keep only necessary instructions in the body, and put long-form material in reference/, reading it only when needed.
    • Versioning and testing: Bring the skill directory under version control, and prepare sample inputs for key workflows to verify output stability.
    • Least-privilege security: If a skill needs to call scripts or access resources, follow the principle of least privilege, and never hardcode secrets or sensitive information in files.

    7. Summary

    The essence of SKILL.md is to solidify the knowledge you “have to re-explain every time” within a team into a loadable, reusable, and versionable capability unit. By mastering “the differences among the three entry points, the four skill categories, and one general template,” you can upgrade scattered prompts into structured assets: controlling context costs while letting experience flow steadily across the team. Start from one high-frequency scenario, pilot two or three skills under the four-category framework, verify the effect, and then gradually expand into a full skill library.