Custom Skills for AI Coding Tools: A Practical Guide to Instruction-Layer Workflows
This article explains how custom Skills turn scattered team conventions into versioned, reviewable instruction assets for AI coding tools. It clarifies how Skills differ from plugins, how directory placement and rank-based priority control scope and overrides, and how to build a minimal working Skill with YAML frontmatter and a Markdown workflow. It also covers frontmatter and body writing practices, four ways to make a Skill reusable, and common pitfalls to avoid.
1. Why an “Instruction Layer” Matters
Teams using AI coding tools often run into a structural mismatch: model capabilities keep improving, but the standards for “how work should be done” remain scattered across chat history, personal habits, and ad hoc prompts. As a result, the same task produces noticeably different quality depending on who runs it, and review costs keep multiplying.
The value of a custom Skill is that it extracts “what steps a task should follow” out of the conversation and turns it into an instruction asset stored in a local directory—one that can be versioned and reviewed. A Skill describes its metadata in YAML frontmatter and defines its execution flow in a Markdown body. The official documentation positions it as an instruction layer independent of both the model and the tools, with three discovery sources: project-level, user-level, and custom directories. This means team standards, code review processes, and release note templates can all be captured as repeatable workflows.
This is a general engineering practice, not something unique to any single vendor. The same approach works in a R&D system built on Baidu AI Cloud or any other cloud environment: write the standards into the repository and let the toolchain load them automatically.
2. Skills vs. Plugins: Separate “What to Do” from “What It Can Do”
Most misuse comes from confusing the two concepts. One sentence captures the difference:
- A plugin adds capabilities at runtime. It typically involves tool registration and interface extension, and requires implementation code such as TypeScript.
- A Skill defines what steps a task should follow. It requires no implementation code and does not register tools.
Once loaded, a Skill enters the current agent context as instruction text. It adds no new capability; it orchestrates existing ones: file read/write, shell execution, code search, and external tools connected through protocols such as MCP. This distinction matters—if you need a capability that is missing, take the plugin route; if the capabilities are all there but the process is inconsistent, a Skill is the right tool.
The official repository currently divides the Skill lifecycle into three stages:
- Discovery: scan candidate directories and parse frontmatter.
- Catalog: the name and description enter the session catalog as a lightweight index.
- Loading: the full body is injected into context only when a task matches or the user explicitly invokes it.
This lazy-loading design matters for context budget. Everyday requests carry only a few dozen characters of catalog information, while long workflow instructions occupy the window only when actually needed, avoiding instruction bloat that squeezes out useful conversation space.
3. Placement and Priority: Put Governance Rules First
The directory you choose directly determines reuse scope. Common conventions:
.dsh/skillsin the project root: best for committing, reviewing, and versioning alongside the code..agents/skillsin the project root: convenient for sharing the same instruction assets with other agent tools.- User-level
~/.dsh/skillsor~/.agents/skills: for personal high-frequency Skills. - Additional directories specified via
customSkillDirs: for consistent team-wide distribution.
Default discovery order is ascending by rank: project .dsh/skills is 100, project .agents/skills is 200, custom directories are 300, user ~/.dsh/skills is 400, and user ~/.agents/skills is 500. Lower numbers mean higher priority, and when Skills share a name, the higher-priority source wins.
This yields a practical conclusion: a project-level Skill can override a user-level Skill with the same name. Teams can use this to design a “baseline plus override” strategy—individuals keep draft versions for experimentation, and once a draft stabilizes, promote it to the project level to override the old behavior. This avoids non-reproducible differences caused by personal configuration in CI or in a new team member’s environment.
4. Building a Minimal Viable Skill: Release Note Generation
Start by creating the directory and file:
mkdir -p .dsh/skills/release-notetouch .dsh/skills/release-note/SKILL.md
Use kebab-case for the directory name and keep it identical to the name in the frontmatter. This is the basic convention for ensuring discoverability and maintainability. Then write the content:
---name: release-notedescription: Generate user-facing Chinese release notes from code diffs, covering changes, impact, and upgrade noteswhenToUse: Use when the user asks to compile a changelog, release notes, or an announcement---# Release Note Workflow1. Read the code diff between the current branch and the previous release point.2. Group changes into four categories: new features / bug fixes / compatibility changes / upgrade actions.3. Remove internal implementation details, temporary branch names, and any credential information.4. Mark uncertain impact as "pending maintainer confirmation" instead of inferring.5. Output a Chinese note of no more than 300 characters, with a list of changed files.
This minimal version already forms a complete loop: the metadata makes it retrievable, the body constrains behavior, and the output constraint at the end ensures the result can be pasted directly into a release channel.
5. Writing Frontmatter and Body
Keep only the fields needed for retrieval in the frontmatter, and put only the process and decision criteria in the body. Do not mix the two responsibilities. Practical advice:
name: kebab-case, identical to the directory name; global uniqueness is handled by priority rather than duplicate names.description: state clearly “what it outputs.” This is the only information visible at the catalog stage and directly determines hit rate.whenToUse: state the trigger scenarios and counterexamples to reduce false triggers.- Body: use numbered steps, explicit deliverables, and explicit prohibitions. Writing decision criteria such as “do not infer on your own” into the body is more stable than putting them in the conversation.
The body does not need to be trimmed to the extreme, since it enters context only at the loading stage. But avoid duplicating existing system prompts—repeated instructions dilute attention weight.
6. From Usable to Reusable: Four Advanced Moves
- Parameterize: write version numbers, target branches, and output language as placeholders passed in at invocation, avoiding multiple near-duplicate Skills.
- Failure fallback: specify in the body that when information is insufficient, ask questions first, up to three rounds, to prevent the model from improvising without context.
- Observability: require the Skill to output a structured summary (such as change category counts and a list of pending items) so humans can verify quickly.
- Governance and distribution: include project-level Skills in code review; distribute team-level Skills through custom directories; periodically clean up duplicate user-level entries to prevent priority overrides from causing “works locally, fails for others” problems.
7. Common Pitfalls
- Treating a Skill as a plugin and trying to register tools inside it, which adds no capability.
- A directory name that does not match
name, causing unstable invocation. - Putting implementation details in
description, creating too much noise at the retrieval stage. - Relying on a user-level Skill with the same name to override project-level behavior, breaking reproducibility.
- Writing credentials or internal addresses into the body, which spread with the repository and create leakage risk.
8. Summary
The essence of a custom Skill is compiling team experience into executable instruction assets: the directory determines scope, rank determines override relationships, frontmatter determines discoverability, and the body determines behavioral consistency. Master these four points and you can upgrade scattered prompts into workflows that are reviewable, distributable, and continuously evolvable. The same method applies whether you run in a local development environment or on container platforms, log services, and monitoring and alerting systems on Baidu AI Cloud.
