Building and Using AI Coding Assistant Skills: A Practical Guide

    This article explains how to create reusable skills for AI coding assistants and apply them in real projects. It covers the core design principle of progressive disclosure, a three-level structure for organizing metadata, instructions, and linked resources, practical guidance on planning and defining skill boundaries, a step-by-step workflow for building your first skill in 15 to 30 minutes, and best practices for combining skills with external tools and sharing them across teams. Readers will learn how to reduce repetitive prompting, improve output consistency, and turn personal conventions into version-controlled, reviewable team assets.

    Building and Using AI Coding Assistant Skills: A Practical Guide

    Introduction: Why Add a Skill Layer?

    When teams work with intelligent coding assistants, two recurring problems tend to appear:

    • Repetitive prompting at the individual level: Every developer has to explain their code style, directory conventions, commenting habits, and commit message preferences over and over again. These explanations must be repeated in every session, which is costly and easy to forget.
    • Standard drift at the team level: Different members provide inconsistent context for the same type of task—for example, API design, code review, or incident triage—so the assistant produces results in different styles and review standards become hard to align.

    The skill mechanism was introduced to solve exactly these problems. It is a lightweight abstraction that turns knowledge, constraints, and operating procedures for completing a certain type of task into a structured set of documents and resources that the assistant can discover, load, and reuse. Compared with stuffing every rule into one extremely long prompt, the core value of skills is on-demand loading: content only occupies the context window when it is relevant to the task at hand, which balances capability expansion against context budget.

    This guide is written for two audiences:

    • Advanced individual users who want the assistant to consistently remember their preferences, directory structure, and workflow so they can avoid repeated explanations.
    • Team leads and technical managers who want to unify how the assistant works across the organization, along with review standards and output expectations.

    1. Who Should Read This Guide and Two Learning Paths

    1.1 Who This Guide Is For

    Role Typical Need Focus Areas
    Individual developer Make the assistant follow personal code style and debugging habits Fundamentals, skill planning and design, categorization
    Team lead Unify team standards and lower onboarding cost for new members Directory conventions, review checklists, collaboration workflows
    Platform/tooling builder Connect the assistant to existing system capabilities How skills combine with external tools and service integrations

    1.2 Path 1: Build a Standalone Skill

    Suitable for days 1 and 2. The focus is on mastering three fundamentals: the basics (what a skill is and how it gets loaded), planning and design (when a skill is worth creating and where its boundaries lie), and categorization (how to organize multiple skills so they do not interfere with each other).

    1.3 Path 2: Extend External Capability Integration

    Suitable for day 3. The focus is on understanding how skills work together with external tool-calling mechanisms: skills decide “how to think and which steps to follow,” while external tools handle “actually querying, changing, and verifying.”

    Important note: Both paths have the same technical difficulty; neither is a prerequisite for the other. Read selectively based on your own use case rather than going through the guide linearly.

    After finishing this guide, you should be able to deliver a working skill in one pass: define the metadata from scratch, write the instruction body, organize structured resources, and complete one end-to-end validation. With the help of skill-creation utilities, building and testing your first skill usually takes 15 to 30 minutes.


    2. Core Design Principle: Progressive Disclosure

    Progressive disclosure is the most important design idea behind the skill mechanism. Its purpose is to keep context cost proportional to actual benefit.

    2.1 The Three Levels

    Level 1: Metadata (preloaded information)

    Always resident in the assistant’s system prompt, this level acts as the assistant’s “catalog index.” It answers only one question: Is this skill relevant to the current task?

    As a result, level 1 must be extremely concise and typically contains only the skill name and a short capability description. Its design constraints are:

    • The description should include trigger-scenario keywords (when the skill should be used) rather than a list of features (what it can do);
    • Avoid semantic overlap with descriptions of other skills to prevent ambiguous selection;
    • Keep the length controlled, because this level imposes a fixed cost on every session.

    Level 2: Skill body (the main instruction document)

    Loaded only when the assistant determines that the skill is relevant to the current task. This level carries the complete methodology:

    • Applicable and non-applicable scenarios;
    • Standard operating steps;
    • Constraints and prohibitions;
    • Output format conventions;
    • Common failure modes and how to correct them.

    Level 3: Linked resources (additional files consulted on demand)

    Supplementary materials in the skill directory, such as templates, reference checklists, example code, glossaries, and checklists. The assistant reads them only when needed, avoiding a one-shot blowup of the context.

    2.2 The Benefit Model of the Three-Level Structure

    You can think of context budget as a scarce resource. The three-level structure effectively implements lazy loading:

    1. Resident cost = Level 1 metadata length × number of sessions
    2. Conditional cost = Level 2 body length × share of relevant tasks
    3. On-demand cost = Level 3 resource length × number of actual lookups

    By contrast, the “single large prompt” approach costs total content length × number of sessions and degrades linearly as skills are added. When the number of skills grows from 3 to 30, the gap between the two approaches widens by an order of magnitude. This is why progressive disclosure is an architectural constraint rather than a mere optimization technique.

    2.3 Common Anti-Patterns

    • Turning metadata into a long feature description: This gives up the index role of level 1 and directly inflates the resident cost.
    • Packing all reference material into the body: Level 2 only loads on a relevance hit, so placing large reference material there crowds out reasoning space.
    • Linked resources without an index: If level 3 files lack clear guidance on “which one to consult and when,” the assistant may never look at them and the resources become useless.
    • Blurred responsibility boundaries: A single skill that handles both “code style constraints” and “release process management” leads to unclear trigger conditions and difficult maintenance.

    3. Before You Start: Planning and Designing a Skill

    3.1 Decide Whether It Should Be a Skill

    Skills solve problems that are repeatable, have a clear procedure, and need to be reused consistently. When the following three signals appear, it is worth extracting a skill:

    1. High repetition rate: The same instructions have been restated more than three times within a week.
    2. Clear procedure: The task can be broken down into ordered steps rather than being one-off open-ended creative work.
    3. Need for consistency: Multiple people or multiple runs must produce structurally identical results.

    Conversely, if the task depends heavily on the immediate context and the approach varies a lot each time, forcing it into a skill will constrain the assistant. Such needs are better expressed through normal conversation.

    3.2 Define Boundaries: State Clearly “When Not to Use It”

    In a high-quality skill document, exclusions are often more important than inclusions. It is recommended to list them explicitly at the beginning of the body:

    1. ## Applicable Scenarios
    2. - Design and implementation constraints when adding a new backend API to this repository
    3. ## Non-Applicable Scenarios
    4. - Frontend style adjustments (see the "UI Style Standards" skill)
    5. - One-off script writing (no reuse or standardization requirements)

    This approach serves two purposes: it reduces false triggers, and it provides the assistant with routing information between skills, which is especially important when multiple skills coexist.

    3.3 Categorization: Avoid Skills Fighting Each Other

    Once the number of skills grows, categorize them by “responsibility domain” rather than by “file type.” A practical set of dimensions is:

    • Constraint-type: Define “what counts as acceptable,” such as code style, naming conventions, and comment requirements.
    • Process-type: Define “which steps to follow,” such as API development, incident triage, or release check procedures.
    • Domain-type: Provide proprietary knowledge for a specific business or technical domain, such as domain terminology, data models, and algorithm specifications.
    • Integration-type: Describe how to combine external tools and service capabilities into a closed loop.

    The value of categorization is that it makes level 1 metadata descriptions naturally mutually exclusive, reducing the probability of false triggers.

    3.4 Structural Skeleton

    Here is a reusable directory layout:

    1. my-skill/
    2. ├── SKILL.md # Level 2: metadata + full instruction body
    3. ├── references/ # Level 3: reference material consulted on demand
    4. │ ├── checklist.md # Pre-commit checklist
    5. │ ├── examples.md # Positive and negative examples
    6. │ └── glossary.md # Domain glossary
    7. └── assets/ # Level 3: templates and boilerplate files
    8. ├── template.py
    9. └── config.sample

    The header of SKILL.md carries the level 1 metadata:

    1. ---
    2. name: backend-api-convention
    3. description: Use when adding or modifying backend APIs in this repository; constrains layered structure, parameter validation, error codes, and log format.
    4. ---
    5. # Backend API Development Standards
    6. ## Applicable Scenarios
    7. ...
    8. ## Standard Workflow
    9. 1. Confirm the API contract and error code ownership
    10. 2. Implement according to the layered structure
    11. 3. Add parameter validation and boundary handling
    12. 4. Standardize log fields
    13. 5. Self-check against references/checklist.md
    14. ## Mandatory Constraints
    15. - Prohibited: accessing storage directly from the controller layer
    16. - All external errors must be mapped to unified error codes
    17. ## References
    18. - Pre-commit checklist: references/checklist.md
    19. - Positive and negative examples: references/examples.md

    3.5 Writing the Body

    • Write instructions in the imperative mood: use fewer “consider” or “you may” and more “must” and “must not” to reduce ambiguity.
    • Keep step numbering fixed so the assistant can execute in order and the results can be verified.
    • Provide verifiable acceptance criteria, for example “logs must include three fields: trace_id, elapsed time, and return code,” rather than “logs should be clear.”
    • Pair positive and negative examples: they constrain output shape better than long prose descriptions.
    • Control single-file length: keep only execution-critical information in the body and push the rest down to level 3.

    4. Hands-On: Build Your First Skill in 15 to 30 Minutes

    4.1 Stage Breakdown

    Step 1 (about 3 minutes): Clarify the use case
    Write one sentence stating “under which task, what to constrain, and what output is expected.” This sentence will directly evolve into the “Applicable Scenarios” and “Mandatory Constraints” of the main instruction document.

    Step 2 (about 5 minutes): Set up the skeleton
    Create the directory and main document. Fill in the metadata first, then the body heading hierarchy. At this stage, do not pursue content completeness; just ensure structural integrity.

    Step 3 (about 8 minutes): Fill in the body
    Write in this order: “Applicable Scenarios → Non-Applicable Scenarios → Standard Workflow → Mandatory Constraints → Acceptance Criteria → Reference Index.”

    Step 4 (about 5 minutes): Push reference material down
    Move long lists, templates, and glossaries to level 3, and leave clear lookup guidance in the body.

    Step 5 (about 5 minutes): End-to-end validation
    Test with three types of input:

    • Positive input: should trigger the skill and execute the workflow;
    • Near-negative input: should not trigger, verifying whether the boundary description is clear;
    • Boundary input: partially relevant; observe whether the assistant consults level 3 resources before acting.

    4.2 Acceptance Checklist

    1. [ ] The metadata description contains clear trigger-scenario keywords
    2. [ ] The body states non-applicable scenarios and routing to adjacent skills
    3. [ ] The standard workflow can be executed step by step and verified
    4. [ ] Mandatory constraints use explicit wording with no vague terms like "as much as possible" or "appropriately"
    5. [ ] Every acceptance criterion can be judged objectively
    6. [ ] Every level 3 resource has lookup guidance in the body
    7. [ ] All three test types—positive, near-negative, and boundary—pass

    5. Advanced: Combining Skills with External Capabilities

    A skill operates at the methodology level and does not replace actual execution capability. When a task requires reading real-time data, calling system APIs, or changing remote state, it needs to work with external tool-calling mechanisms.

    5.1 Division of Responsibilities

    Concern Owner Description
    When to act and in what order Skill Process and constraints
    Decision basis and acceptance criteria Skill Verifiable rules
    Actual querying and execution External tools Data retrieval and state changes
    Result verification Both The skill defines verification standards; tools produce evidence

    5.2 Writing Tips

    • Declare dependencies explicitly in the body: list the required capabilities and preconditions so the assistant does not blindly attempt actions when conditions are missing.
    • Specify failure fallback paths: for example, if an external query is unavailable, state that the task should be halted and explained to the user rather than filled in with guesses.
    • Constrain write scope: for operations that may have side effects, require an explanation of the impact before execution.
    • Ensure observability: specify what key information must be recorded during the process to support later tracing.

    5.3 Combining with General Cloud Capabilities

    If a skill needs to connect to an organization’s existing infrastructure, it can be organized around general capability categories rather than tied to specific APIs:

    • Object storage: store large level 3 reference material and template assets;
    • Message queues: distribute asynchronous tasks and return results;
    • Container platforms: provide isolated execution environments for verification steps that need a runtime;
    • Log services: retain call records to support auditing and troubleshooting;
    • Monitoring and alerting: establish observability metrics for failure rate and elapsed time of the process.

    On top of this, skill directories can be brought into a unified configuration management process to enable versioning, review, and canary releases, giving team standards a traceable evolution path. Baidu AI Cloud offers corresponding product forms for all of the general capability categories above, which can serve as an infrastructure selection reference for teams.


    6. Team Collaboration: From Personal Tips to Organizational Assets

    Personal skills solve efficiency problems; organizational skills solve consistency problems. When rolling out to a team, focus on three points:

    1. Single source of truth: host skill directories centrally with version control, and prohibit copying and modifying them independently in personal environments to avoid standard divergence.
    2. Change review mechanism: changes to “mandatory constraints” should go through review, because they are the carrier of team standards rather than personal preferences.
    3. Metrics and iteration: track skill trigger rate, task completion rate, and manual rework ratio, and use data to drive body simplification and boundary refinement. A skill that is frequently triggered by mistake almost always has a problem in its level 1 description or a missing “Non-Applicable Scenarios” section.

    Conclusion

    The technical substance of the skill mechanism lies not in syntax but in judgment about information architecture: which information should stay resident, which should load conditionally, and which should be consulted on demand; which rules must be written as hard constraints and which should be left to contextual inference.

    By mastering progressive disclosure as the core principle, along with clear categorization and verifiable acceptance criteria, you can turn scattered repetitive communication into version-controlled, reviewable, and reusable organizational assets. Start with one high-frequency pain point today—build a small skill that can be validated within 30 minutes, then gradually expand it into a team standards system.