Building Custom Skills for Coding Agents: From SKILL.md to Reusable Workflows

    Custom Skills let you turn recurring tasks like release notes, code reviews, and scaffolding into versioned, discoverable instruction files for AI coding agents. This article explains how Skills differ from plugins, how two-stage loading keeps context usage low, how to choose the right directory and priority level, and how to write a minimal SKILL.md with practical guidelines for high-quality, reusable agent workflows.

    Why Skills Matter: From “Chatting” to “Getting Work Done”

    The capability ceiling of an AI coding agent often depends less on the model itself and more on how clearly we can codify “how a certain class of task should be done.” Tasks that recur across development teams—writing release notes, reviewing code, scaffolding new modules—are typically handled through verbal descriptions or ad hoc prompts, which is both inefficient and inconsistent.

    A Skill is an instruction layer designed to solve exactly this problem: it is a reusable task instruction file stored in a local directory, with structured metadata describing itself and a Markdown body that specifies the concrete steps an agent should follow to complete a class of work. It is independent of the model and any specific tool implementation, can be managed at the project level, user level, or in custom directories, and serves as a lightweight vehicle for turning team knowledge into engineering assets.

    Skills vs. Plugins: A Fundamental Distinction

    Many developers conflate Skills and plugins, but their responsibilities are clearly separated:

    • Skills solve “what steps should a task follow.” They are pure instructions—no code required, and they register no runtime capabilities. Once loaded, a Skill enters the agent’s context as instruction text, guiding the agent to use existing tools such as file read/write, shell execution, code search, or MCP.
    • Plugins solve “what capabilities to add at runtime.” They typically involve code development and are responsible for registering new tools and extending the execution environment.

    A simple mental model: a plugin is “giving the agent new equipment,” while a Skill is “giving the agent an operations manual.” The manual doesn’t change the agent’s equipment, but it makes the agent use its existing tools far more effectively.

    On-Demand Loading: The Two-Stage Design

    Mature Skill mechanisms typically split the file lifecycle into two stages:

    1. Discovery and registration: The system scans Skill files across directories, parses their metadata headers, and injects only the name and description into the session. This step has minimal context overhead—essentially a “menu.”
    2. Loading and execution: Only when a task matches a Skill’s description, or the user explicitly invokes it, does the system load the full body into the context.

    The benefits are obvious: everyday requests only pay for the short directory entries, while large instruction blocks enter the context window only when genuinely needed. This avoids the problem of context being crowded out by irrelevant instructions—and it is the core advantage Skills have over “stuffing all your conventions into the system prompt.”

    Step 1: Choosing Where to Place Your Skill

    The directory layout determines a Skill’s scope and priority. Common levels include:

    Location Use Case Typical Priority
    Project-private directory (e.g., .dsh/skills) Committed with the project, shared with the team 100 (highest)
    Project-shared directory (e.g., .agents/skills) Shared with other agent tools 200
    Custom directory (specified via configuration) Centrally maintained team Skill library 300
    User home private directory Personal frequently used Skills 400
    User home shared directory Personal Skills used across tools 500

    A few practical recommendations:

    1. Commit project-level Skills to version control first. Managing them in the same repository as code lets them evolve alongside code reviews, keeping “conventions” and “code” in sync.
    2. Same-named Skills follow an override relationship. Discovery order is ranked by priority, and the higher-priority source wins—so a project-level Skill can override a user-level Skill with the same name. Teams can use this to override personal general habits for specific projects.
    3. Keep the directory name consistent with the name in the metadata, and use kebab-case naming uniformly to avoid cross-platform path issues.

    Step 2: Writing a Minimal Working Skill

    Here’s how to create a Skill from scratch, using “generate release notes” as an example. Run the following in your project root:

    1. mkdir -p .dsh/skills/release-note
    2. touch .dsh/skills/release-note/SKILL.md

    Write the following content into SKILL.md:

    1. ---
    2. name: release-note
    3. description: Generate user-facing release notes from the Git diff, covering changes, impact, and upgrade guidance
    4. whenToUse: Use when the user asks to organize a changelog, release notes, or a release announcement
    5. ---
    6. # Release Notes Workflow
    7. 1. Read the Git diff of the current branch relative to the previous release.
    8. 2. Organize the content into four categories: new features, bug fixes, compatibility changes, and upgrade actions.
    9. 3. Remove internal implementation details, temporary branch names, credentials, and other sensitive information.
    10. 4. Mark uncertain impacts as "pending maintainer confirmation" instead of making assumptions.
    11. 5. Output release notes of no more than 300 words, along with a list of changed files.

    This example illustrates the standard structure of a SKILL.md:

    • Metadata header: name is the unique identifier; description determines whether the agent can correctly match tasks during the discovery stage—be sure to state clearly what it does, who it’s for, and what it includes; whenToUse further clarifies the trigger conditions and is a key field for improving auto-matching accuracy.
    • Instruction body: Should be an executable checklist, with each step explicit and verifiable.

    Principles for Writing High-Quality Skills

    1. Make instructions specific enough to execute. “Write it well” is an invalid instruction; “organize into four categories, keep it under 300 words” is an effective one. Converting vague judgment calls into explicit rules is what separates good Skills from bad.
    2. Constrain the output boundaries. Word limits, format requirements, and prohibitions (e.g., no inferring unconfirmed information) significantly reduce output randomness.
    3. Build in security and review awareness. Rules like “remove sensitive information” and “flag uncertain items as pending confirmation”—as in the example—should be standard clauses in any Skill involving external publishing.
    4. Iterate rather than perfect upfront. Get a minimal version working first, observe how the agent actually deviates in execution, then gradually add rules for edge cases.
    5. Use layered overrides wisely. Put general habits at the user level and project-specific conventions at the project level, rather than piling everything into a single Skill.

    Conclusion

    At its core, the Skill mechanism transforms team task knowledge from tribal, word-of-mouth practices into versioned, discoverable, on-demand instruction assets. Understanding how Skills differ from plugins, mastering the two-stage loading model, planning directory levels and priorities sensibly, and writing clear, step-by-step instructions together enable an agent to consistently produce results that meet team standards on repetitive tasks. Starting with a release-notes Skill and gradually solidifying workflows like review processes and scaffolding conventions is a pragmatic path toward efficient human-AI collaboration.