Customizing AI Assistant Workflows: From Skill Instructions to Reusable Agent Practices
This article explains how to use skill instructions to turn team review, release, and security practices into steps that AI coding agents can follow consistently. It compares skills with plugins, describes a three-stage lazy-loading approach that keeps context small, outlines project, user, and custom skill directories with rank-based priority, and walks through a minimal example that generates release notes. It also covers defensive design for skill instructions.
As large language model (LLM)-powered AI coding assistants become standard tools for engineering teams, simple code completion and single-turn Q&A no longer meet the needs of complex engineering work. In real projects, teams often have specific code review processes, release standards, and security audit requirements. How can an AI agent follow these standards reliably and repeatedly? Custom workflows, also called skill instructions or “Skills,” offer a practical solution. They turn a team’s implicit experience and business logic into explicit instructions, so an agent can carry out complex tasks step by step.
1. Core Concepts: Skill Instructions vs. Plugin Systems
When building an agent ecosystem, developers often confuse skill instructions with plugins. Understanding the boundary between them is a prerequisite for designing high-quality agent workflows.
Plugin systems: defining what the runtime can do
A plugin extends the underlying capabilities of an agent. It registers a set of tools, such as database queries, third-party API calls, and system-level file operations, which give the agent atomic operations. Plugins usually require backend code, such as TypeScript or Python, to handle authentication, parameter validation, error retries, and other low-level logic.
Skill instructions: defining how a task should be done
A skill instruction is a file of task orchestration instructions placed in a local or project directory. It does not involve writing underlying code, and it does not register tools. When a skill is triggered, its body is injected into the current agent conversation as context. The skill’s role is scheduling. It can direct the agent to use existing capabilities, such as file system access, shell execution, or plugin tools, to complete work according to specific business steps. In short, a skill is a “tactical manual” that tells the agent how to use its tools.
2. Smart Scheduling: Lazy Loading and Context Management
In large engineering projects, a team may define dozens or even hundreds of skill instructions. If all of them stay resident in the agent’s context, they quickly consume the token quota. They can also conflict with one another and reduce the model’s accuracy in understanding them.
To address this, the industry commonly uses a three-stage lazy-loading strategy: discovery, cataloging, and on-demand loading.
- Discovery: When the assistant framework starts, it scans the configured skill directories, parses the YAML frontmatter (the metadata at the top of each instruction file), and extracts each skill’s name, description, and trigger conditions.
- Cataloging: The metadata is combined into a lightweight session catalog that enters the agent’s context during initialization. This stage does not load the detailed execution steps of each instruction, which greatly reduces the context load.
- On-demand loading: When the user’s request matches the description of an entry in the session catalog, or when the user explicitly invokes a specific skill, the framework reads the full Markdown body of that skill and injects it into the current conversation. This keeps everyday requests efficient while preserving the depth needed for complex tasks.
3. Directory Structure and Priority-Based Discovery
To let skill instructions meet a project’s specific needs while also respecting a developer’s personal habits, modern assistant frameworks usually support discovery across multiple directory levels.
Storage paths
- Project-level skills: Place these in a hidden folder at the project root, such as
.skills/or.agents/skills. This content should be version-controlled with the codebase so that every team member shares the same standards. - User-level skills: Place these in the user’s home directory, such as
~/.skills/. They store personal helper instructions, such as a preferred code formatting style. - Custom directories: The framework can load additional paths through a configuration file, which makes it easier to reuse common skills across projects or teams.
Rank-based priority override
When skills with the same name exist in different directories, the system resolves the conflict using preset Rank values. The default order is: project-level directory (Rank 100) > shared project-level directory (Rank 200) > custom directory (Rank 300) > user-level directory (Rank 400). A lower value means higher priority. A project-level skill can therefore always override a user-level skill with the same name. This follows the “closest wins” principle: a specific project’s requirements always take precedence over a developer’s global habits.
4. Hands-On Example: Building an Automated Release Note Generator
The following example shows how to create a minimal, usable skill instruction from scratch. It builds a workflow that generates release notes in Chinese.
Step 1: Create the directory structure
From the project root, run the following commands to create a skill directory named in kebab-case:
mkdir -p .skills/release-notetouch .skills/release-note/INSTRUCTION.md
Step 2: Write the metadata and instruction body
In INSTRUCTION.md, declare the skill’s basic information in the YAML frontmatter, then write the specific execution steps in Markdown.
---name: release-notedescription: Generate user-facing release notes in Chinese from Git diffs, covering changes, impact, and upgrade guidancewhenToUse: Use when the user asks to compile a changelog, release notes, or a release announcement---# Automated Release Note WorkflowAs a development assistant, follow these strict steps to generate standard release notes for the current codebase:1. **Get the code diff:** Call the shell tool to read the Git diff of the current branch against the last official release.2. **Organize the changes:** Group the changes into four categories: "New Features," "Bug Fixes," "Compatibility Changes," and "Upgrade Actions."3. **Sanitize:** Remove internal implementation details, temporary branch names, debugging code, and any sensitive credentials from the diff.4. **Apply defensive tagging:** For any change whose business impact cannot be clearly determined, mark it "待维护者确认" (pending maintainer confirmation). Never infer or invent possible impact.5. **Format the output:** Write a concise Chinese release note of no more than 300 characters. At the end, append a list of the specific files involved in this release.
5. Defensive Design and Best Practices
In the example above, defensive tagging is the key design element. LLMs have a strong tendency to fill gaps, and when information is uncertain, they may hallucinate. Writing an explicit rule such as “never infer” into the workflow helps constrain the agent’s behavior.
Good skill instructions should also follow the single responsibility principle. If a workflow becomes too large, for example by combining code review and release note generation, split it into two separate skills. This improves the accuracy of whenToUse matching and reduces the cost of maintenance and debugging. By using this instruction-layer structure, engineering teams can turn routine processes into reusable knowledge assets and make AI assistants reliable executors of team standards.
