A Practical Guide to Custom Skills for AI Coding Tools

    This article explains how to build custom Skills for AI coding tools. It covers why reusable task instructions matter, how Skills differ from plugins, the three-stage loading mechanism (discovery, matching, and on-demand loading), directory placement and priority rules, how to create a minimal working Skill, how to compose Skills into reusable workflows, and how to debug, review, and govern them as code assets. Readers will learn to turn team practices into versioned, reviewable instruction files while controlling context cost.

    1. Why Custom Skills Matter

    A recurring tension shows up when teams adopt AI coding tools: model capabilities keep improving, but the “rules for getting things done” still live in people’s heads and chat history. Which dimensions to check during code review, which fields a release note must cover, and what information to collect when reproducing a defect are often passed down as verbal agreements or scattered documents. The result is uneven output quality across different members and different sessions.

    Custom Skills address this layer of the problem: they turn “what steps a class of task should follow” into a reusable task instruction stored in a local directory. A Skill usually has two parts—YAML frontmatter that describes its name, purpose, and trigger scenarios, and a Markdown body that defines the Agent’s execution steps, output format, and prohibited actions. It is an instruction asset independent of the model and tools, so it can be reused across sessions and projects.

    It is worth clarifying the boundary between Skills and plugins. A plugin is about “what capability is added at runtime,” such as connecting a new data source or registering a new tool. A Skill is about “how a task is completed in an orderly way”; it contains no executable code and does not register tools. Once loaded, a Skill enters the current Agent’s context as instruction text, requiring the Agent to call existing capabilities such as file read/write, command execution, retrieval, or external service connections. Understanding this avoids writing a Skill as a “pseudo-plugin” and keeps responsibilities clearly separated.

    2. Three-Stage Loading: Directory, Discovery, and On-Demand Expansion

    Mature implementations usually split Skill handling into three stages, a design that is critical for context budget.

    The first stage is scanning and parsing. On startup or refresh, the tool traverses the agreed skill directory, reads each Skill’s frontmatter, validates required fields, and aggregates names and descriptions into a “session catalog.”

    The second stage is matching. Only when a user request is semantically related to a description, or the user explicitly names a Skill, does the system decide to load the corresponding body.

    The third stage is full loading. The Markdown body enters the context and becomes the execution constraint for the current task.

    This progressive “light catalog + heavy body” strategy yields two direct benefits: everyday requests pay a context cost only for brief metadata, and genuinely lengthy process specifications occupy the window only when needed. For teams that stuff large amounts of specification into the system prompt, this is often the most noticeable step in improving context quality.

    3. Placement and Priority: Keep Specifications Close to the Project

    Choosing a storage path is essentially choosing the “scope” of a specification.

    • Project level: placed in the agreed skill directory at the project root, committed and reviewed alongside code, effective as soon as team members pull it. Best for coding standards, review checklists, and release processes.
    • Cross-tool shared level: placed in another general agent configuration directory under the project root, suitable for scenarios shared across multiple AI coding tools.
    • User level: placed in the agreed directory under the user’s home directory, suitable for long-term personal habits such as personal commit message preferences or common troubleshooting paths.
    • Additional directories: explicitly appended via a configuration option, suitable for mounting a company-level specification library.

    Priority is usually ordered from low to high numeric value: project level first, then custom directories, and user level last. A smaller number means higher priority, so a project-level Skill overrides the user-level version when names collide. This mechanism is practical: an individual can keep a “general version” at the user level and a “project-specific version” in the project without interference. It also reminds teams that naming conflicts need review, otherwise hidden differences arise where “it runs locally but fails for others.”

    4. Start With a Minimal Viable Skill

    Using “generate release notes” as an example, first create the directory and file at the project root:

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

    The directory name should use kebab-case and match the name in the frontmatter to avoid ambiguity during scanning. The file content can be written as:

    1. ---
    2. name: release-note
    3. description: Generate user-facing Chinese notes from version differences, covering changes, impact, and upgrade tips
    4. whenToUse: Use when the user asks to compile a changelog, version notes, or a release announcement
    5. ---
    6. # Release Note Workflow
    7. 1. Read the diff between the current branch and the previous release point.
    8. 2. Group entries into four categories: new features / bug fixes / compatibility changes / upgrade actions.
    9. 3. Remove internal implementation details, temporary branch names, and any credential information.
    10. 4. Mark entries with uncertain impact as "pending maintainer confirmation"; do not infer.
    11. 5. Output a Chinese note within 300 characters, with a list of changed files attached.

    A few easily overlooked writing points: description is the sole basis for the matching stage and should state both “what it does” and “when to use it,” not just a feature summary; whenToUse fills in the boundaries to reduce false triggers; steps in the body should be verifiable, the output format checkable, and prohibited actions stated explicitly. The more specific the instruction, the higher the stability across sessions.

    5. Advanced: Compose Skills Into Reusable Workflows

    A single Skill solves a single-point problem; the real leverage lies in composition and layering.

    The first is splitting granularity. Separate “release notes” and “pre-release checks” into two Skills—the former for external text, the latter for internal quality gates—avoiding one file carrying too many responsibilities and bloating its body.

    The second is explicit orchestration. In a higher-level Skill body, declare the call order and how artifacts are passed, for example run checks first, then generate notes, and finally aggregate into a deliverable, and specify how to handle failure at each step.

    The third is artifact contracts. Agree on where intermediate artifacts are written and in what format, such as a unified checklist file or structured data file, so steps can be re-run independently and are easy for humans to review.

    The fourth is coordination with external capabilities. When a process needs to access requirement management, code hosting, or log monitoring systems, plugins or external service connections provide the capability, while the Skill only describes “what information to fetch under what conditions, how to validate it, and how to present it,” keeping the instruction layer decoupled from the capability layer.

    6. Debugging, Review, and Governance

    A Skill is a code asset and should be included in engineering processes.

    For debugging, first confirm the file is scanned, the frontmatter passes validation, and the name does not conflict; then use a minimal task to verify the trigger is accurate; finally check that the body is fully loaded. If a Skill “should trigger but does not,” modify description and whenToUse first rather than continually lengthening the body.

    For review, treat Skill changes as process changes, focusing on whether ambiguous wording is introduced, whether internal information is leaked, and whether responsibilities overlap with existing Skills.

    For governance, establish naming conventions, version records, and periodic cleanup; require high-risk processes to state human confirmation points explicitly in the body; and agree on sensitive information handling rules to avoid writing credentials or internal addresses into instructions or examples.

    7. Common Pitfalls

    One is treating a Skill as a plugin and trying to declare tool capabilities inside it, resulting in confused responsibilities. Two is an overly long body that piles in background knowledge, examples, and specifications, diluting key constraints. Three is descriptions that are too abstract, so the matching stage cannot hit and users must name the Skill every time. Four is ignoring priority and same-name overrides, causing behavior drift in shared team settings. Five is lacking output acceptance criteria, leaving output quality entirely to the model’s improvisation.

    8. Summary

    The value of custom Skills is not “making the model smarter” but turning a team’s way of working into versioned, reviewable, and reusable instruction assets. By mastering directory scope and priority, writing good metadata, controlling context cost with the three-stage mechanism, and connecting workflows with composition and artifact contracts, teams can reliably capture high-frequency repetitive tasks and let them evolve with the project.