Custom Skills for AI Coding Tools: From Instruction Files to Reusable Agent Workflows

    This article provides a practical guide to creating custom Skills for AI-powered coding tools. It explains the key differences between Skills and plugins, describes how the three-stage discovery, catalog, and loading mechanism works, and walks through the complete process of building a reusable Skill—from directory setup to writing effective instruction files. It also covers best practices for naming, placement, and version management, helping teams turn recurring workflow specifications into maintainable Agent assets.

    In daily use of AI coding tools, many teams run into the same problem: the same task specifications—such as code review checklists, release note templates, or commit message formats—have to be explained to the Agent over and over again. Custom Skills are designed to solve exactly this kind of repetitive instruction problem. A Skill is essentially a reusable task description stored in a local directory, with structured metadata describing what it does and a body of instructions specifying how the Agent should carry out that type of work. This article walks through the design philosophy, loading mechanism, and complete creation flow for Skills, helping you turn team experience into repeatable Agent workflows.

    1. First, Clarify the Boundary Between Skills and Plugins

    Before getting started, it is essential to understand where Skills fit in the overall tooling ecosystem, or they will easily be confused with plugins.

    A Skill addresses the question of “what steps should the task follow”—it operates at the instruction layer. A plugin addresses the question of “what additional capabilities are needed at runtime”—it operates at the capability layer. They serve different purposes:

    • A Skill itself requires no programming code and does not register new tools. Once loaded, it enters the current Agent’s context as instruction text, and can direct the Agent to use existing file read/write, command-line execution, content retrieval, or external protocol tools already available in the environment.
    • A plugin extends runtime capabilities, such as connecting new data sources, registering new commands, or providing new tool interfaces.

    The direct benefit of this layered design: people who define team conventions do not need to understand toolchain development. As long as they can describe a process in plain language, they can turn that process into a Skill reusable by all team members.

    2. Understanding the Three-Stage Mechanism: Discovery, Catalog, Loading

    Why can a large number of Skills exist without slowing down everyday conversations? The answer lies in the staged loading strategy:

    1. Discovery stage: When the tool starts, it scans all configured Skill directories, parses the structured metadata at the top of each instruction file, and extracts the name and description.
    2. Catalog stage: The names and one-line descriptions of all Skills are aggregated into a lightweight catalog, injected into the conversation context. At this point, the Agent only “knows what capabilities are available” without holding any details.
    3. Loading stage: Only when the user explicitly invokes a Skill, or when the Agent determines that the current task matches a Skill’s description, is the full body of that Skill read into the context.

    The significance of this lazy loading mechanism lies in context cost control: everyday requests only carry the brief catalog information, while instruction flows that can be hundreds of lines long only occupy context space when actually needed. For large teams with dozens or even hundreds of Skills, this is a key design decision that preserves response quality and speed.

    3. Step One: Choose the Right Location

    The storage path of a Skill determines its scope of applicability. The common location types, broken down by use case, are as follows:

    Location Type Typical Path Use Case
    Project-specific directory Tool-specific skills subdirectory under the project root Committed together with the code repository, shared by the team
    Project general directory Generic agent skills directory under the project root Intended to be recognized by multiple Agent tools
    User-level directory Corresponding skills subdirectory under the user home directory Personal, frequently used, reused across projects
    Custom directory Any directory specified through configuration A common Skill library distributed team-wide

    When Skills with the same name exist across multiple sources, the precedence mechanism determines which one takes effect. The usual convention is: project-level directories have the highest priority, followed by custom directories, and finally user-level directories. This means a project can provide an “override version” for a common Skill—for example, if the team is not satisfied with a generally available release note process authored by an individual, placing a Skill with the same name in the project-level directory achieves a local replacement without requiring every member to modify their personal directory. When designing team conventions, take full advantage of this override relationship to establish a layered structure of “organization defaults + project-specific exceptions.”

    4. Step Two: Create a Minimal Viable Skill

    Using the high-frequency task of “generating release notes” as an example, here is the complete process of creating a Skill from scratch.

    4.1 Set Up the Directory Structure

    In the skills directory under the project root, create a separate subdirectory for each Skill, and place the agreed instruction file inside it:

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

    There are two naming conventions to follow: first, directory names use kebab-case (lowercase letters with hyphens); second, the directory name must match the name field in the instruction file’s metadata—otherwise, discovery may fail or invocation may become inconsistent.

    4.2 Write the Metadata and Body

    The instruction file consists of two parts: a structured metadata block at the top of the file, and the Markdown body that follows. The metadata contains at least three fields—name (unique identifier), description (a one-sentence summary of what the Skill does), and whenToUse (explicit trigger scenarios to help the Agent decide when to automatically match). A minimal viable example:

    1. ---
    2. name: release-note
    3. description: Generate user-facing release notes in Chinese based on version differences, covering changes, impact, and upgrade guidance
    4. whenToUse: Use when the user asks to compile changelogs, release notes, or release announcements
    5. ---
    6. # Release Note Workflow
    7. 1. Read the code differences between the current branch and the previous release version.
    8. 2. Categorize changes into four dimensions: "New Features, Bug Fixes, Compatibility Changes, Upgrade Actions."
    9. 3. Remove internal implementation details, temporary branch names, and any sensitive credentials.
    10. 4. Mark any impact that cannot be determined as "pending maintainer confirmation"—do not make assumptions.
    11. 5. Output a Chinese release note of no more than 300 characters, along with the list of changed files.

    This example demonstrates several writing points worth learning from:

    • Executable steps: Each step is an action the Agent can immediately perform, not an abstract slogan.
    • Includes safety boundaries: Explicitly prohibits leaking sensitive information and making assumptions about uncertain impacts. This kind of negative constraint is critical for preventing the Agent from over-reaching.
    • Output has acceptance criteria: The character limit, categorization dimensions, and appended list make the output quality verifiable.

    5. Advanced Practices and Common Pitfalls

    Once the basic flow is clear, here are several practical recommendations drawn from real-world usage:

    1. Write description like a routing rule. The Agent primarily relies on description and whenToUse for task matching. The more specific the description, the fewer missed or mistaken invocations. Avoid vague phrasing like “a general-purpose tool.”
    2. Keep the body concise. The full Skill body enters the context, so lengthy background explanations dilute the key instructions. Move background knowledge into a separate document, and keep only the process and constraints in the body.
    3. One Skill should do one thing. Packing “review code, generate tests, and update documentation” into a single Skill degrades the quality of each step. Splitting it into three composable Skills works much better.
    4. Put Skills under version control. Project-level Skills should be reviewed and evolved together with the code. This way, process changes have an audit trail, and new members can get up to speed out of the box.
    5. Clean up stale Skills periodically. The same-name override mechanism is flexible, but it can also mask the fact that an older user-level version is still in effect. Regularly verify the actual contents in each layer of directories.

    6. Summary

    The core value of custom Skills lies in converting “process knowledge in people’s heads” into “instruction assets executable by Agents.” Once you understand the instruction-layer positioning, the three-stage loading mechanism, and the multi-level precedence rules, all it takes is a directory plus a Markdown file with metadata to codify any repetitive workflow. From release notes and code reviews to commit conventions, it is recommended that teams start by applying Skills to one or two of their highest-frequency scenarios, validate the approach, and then gradually build out their Skill library—this is one of the most cost-effective investments for improving human-Agent collaboration efficiency.