Skill Overview
Introduction
A skill can be viewed as a set of "professional capability instructions" (similar to a user manual or operation guide) provided to an agent. When executing tasks, the agent can load the corresponding skills on demand, thereby enhancing its understanding and execution capabilities. For example: asking the agent to help you review how a function is written, or to review some code. As long as you customize how the skill should operate, the agent will execute it according to the skill's instructions.
Key Features
Structured
A skill corresponds to a skill.md file. The file describes the information required to complete a specific category of tasks in a structured manner, such as: task description, usage scenarios, instructions, key constraints and considerations, templates, or examples.
On-demand Loading
The agent does not read the full content of all skills at the start of a task. Before executing a task, the agent first scans the brief descriptions of all skills and only loads the detailed content of a skill when it determines that the current task is highly relevant to that skill. This on-demand loading mechanism effectively reduces Token consumption in the context and prevents irrelevant information from interfering with the agent's decision-making.
Usage Scenarios
Ensuring Consistency and Standardization of Output
Requires the agent to always output results according to established standards across different times and tasks. For example, encapsulating requirements such as unified design specifications, team standards, brand consistency, or ensuring code complies with project conventions into skills. This transforms implicit personal or team standards into explicit, reusable professional capabilities, ultimately making output results more stable and controllable.
Automating Repetitive Workflows
Requires frequent execution of identical or highly similar multi-step tasks. For example, for unavoidable daily work such as testing processes, code style checks, and routine data analysis, existing SOPs (Standard Operating Procedures) can be encapsulated as skills. Once a relevant task is triggered, the agent can automatically execute it according to the defined process, thereby reducing repetitive instruction input and improving efficiency.
Summarizing and Sharing Professional Capabilities
Summarizing personal experience or team norms and reusing them on a larger scale. For example, sharing skills on public platforms such as communities and communication groups, thereby reusing the same skills across different agents, projects, and teams.
Skills vs Other Features
Skills vs Rules
Rules use a full-loading mechanism; once a conversation starts, all rules are injected and continuously occupy the context window. Skills use an on-demand loading mechanism, loading into the context only when they actually need to be called, thereby significantly reducing Token consumption.
Skills vs MCP Services
Skills are used to describe to the model how to complete a task, while MCP services are responsible for providing the model with tools that can be called.
Supported Skill Types
Global Skills
- Skills that take effect globally across projects, used for:
- Unifying general development paradigms for individuals/teams, such as unified code style, naming conventions, and commenting habits;
- Providing engineering capabilities reusable across projects, such as the use of general toolchains (Git, CI/CD, Playwright, etc.);
- Solidifying long-term preferences of individuals or organizations, such as output structure (whether to give conclusions first, list steps, or provide examples).
Project Skills
- Skills that take effect only within the current project, used for:
- Injecting project-specific business knowledge and rules, such as non-negotiable business constraints and boundary conditions, internal project terminology, and concept mapping;
- Constraining the AI to work according to the project's established technical solutions, such as tech stack, framework versions, and architectural constraints;
- Enabling the AI to deeply participate in the development and maintenance of the current project, such as generating tests, Mocks, and scaffold code for the project; collaborating with MCP services or internal tools used by the project.
Skill Priority
- Both global skills and project skills will provide enabled skills to the model. The model matches them based on skill descriptions and task requirements, selecting skills with higher similarity for use.
- If both global skills and project skills have high similarity and the skill names are identical, Project Skills > Global Skills take priority.
Skill Structure
A skill must contain a SKILL.md file, and other files can be added according to actual needs, such as executable scripts, reference templates, and style guides. For example:
skill-name/
├── SKILL.md # (Required) Core instructions for the agent
├── examples/ # (Optional) Input/output examples
├── input.md
└── output.md
├── templates/ # (Optional) Reusable templates
└── component.tsx
└── resources/ # (Optional) Reference files, run scripts, or assets
└── style-guide.mdSkill Directory Location
Project Skills: The .feisuan/skills/ directory under the project path. Global Skills: The Local Main Disk/Username/.feisuan/skills/ directory.
SKILL.md File Format
The format of the SKILL.md file is as follows:
---
name: Skill Name
description: Briefly describe the function and usage scenarios of this skill
---
# Skill Name
## Description
Describe the purpose of this skill.
## Usage Scenarios
Describe the conditions that trigger this skill.
## Instructions
Clear step-by-step instructions telling the agent exactly what to do.
## Examples (Optional)
Input/output examples showing the expected outcome.Skill Example
The following uses a Code Review skill as an example to demonstrate how to write a skill file for code review.
---
name: code-review
description: Act as a senior code inspection expert to conduct a systematic review of code changes across multiple dimensions (security, logic, performance, style) and output a structured report. Suitable for scenarios such as pre-commit checks and MR/PR reviews.
---
# Code Review Expert
## Description
This skill enables the agent to act as an experienced and rigorous code review expert. Its core responsibility is to conduct a systematic, multi-dimensional review of submitted code, aiming to improve code quality, ensure system security, optimize performance, and ensure code maintainability. The agent will follow a standardized review process and provide clear, structured, and constructive feedback reports.
## Usage Scenarios
- Self-check before code commit.
- Formal review of Merge Requests (MR) or Pull Requests (PR).
- Quality assessment of existing codebases or analysis before refactoring.
- Learning best practices and improving one's own programming level by reviewing others' code.
- When the user directly requests "Help me review this code", "Perform code inspection", or "Code Review".
## Instructions
Please strictly follow the steps and standards below to execute the code review:
1. **Understand the Context**
First, try to understand the business goals or functional requirements of the code changes. If an MR/PR description or relevant issue link is provided, please read it carefully to ensure the review does not deviate from the original intent.
2. **Multi-dimensional Review**
Review the code line-by-line or module-by-module in the following priority order:
- **Security (Highest Priority):** Focus on checking for injection risks (such as SQL injection, XSS), sensitive information leakage (such as hard-coded keys), missing permission validation, or the use of dependencies with known vulnerabilities.
- **Logic Correctness:** Ensure the code correctly implements the expected functionality. Check for null pointer/undefined risks, boundary condition errors, concurrency safety issues, and unreasonable exception handling.
- **Performance:** Identify potential performance bottlenecks. Focus on inefficient algorithms/data structures, N+1 query problems, resource leaks (such as unclosed file streams or database connections), and redundant calculations.
- **Code Quality & Standards:** Improve code readability and maintainability. Check if naming is clear and meaningful, if there is code duplication, if functions are overly complex (e.g., too long or having too many responsibilities), and if key logic is explained with comments.
3. **Consolidation & Reporting**
Organize and output all discovered issues and suggestions strictly according to the "Output Specification" below. Ensure the feedback is structured and constructive.
### Output Specification
You must output the review report strictly in the following format:
#### Critical Issues (P0 - Must Fix)
This section lists all security vulnerabilities and critical logic errors. These issues could cause production failures and must be fixed before merging.
- **[Filename:Line Number] Issue Description**
- **Reason:** Briefly explain why this is an issue.
- **Suggestion:** Provide a specific fix or example code.
#### ️ Important Issues (P1 - Recommended to Fix)
This section lists performance hazards, maintainability issues, and code smells. It is strongly recommended to fix these before merging.
- **[Filename:Line Number] Issue Description**
- **Reason:** Explain the impact on performance or maintainability.
- **Suggestion:** Provide an optimization plan.
#### Suggestions (P2 - Optional)
This section lists nice-to-have optimization suggestions or references to best practices.
- **[Filename:Line Number] Issue Description**
- **Suggestion:** Provide an optional direction for improvement.
#### Highlights
This section lists positive aspects of the code, such as elegant design, clear naming, or clever implementation.
- **[Filename:Line Number] Highlight Description**
- **Comment:** Explain why this implementation is good.
### Constraints
- **Evidence-based:** All comments must cite specific code line numbers; avoid vague statements.
- **Quality over Quantity:** Avoid trivial or subjective opinions.
- **Provide Solutions:** For each issue, try to provide a specific fix suggestion.
- **Stay Professional:** The communication tone should remain professional, friendly, and constructive.
## Examples (Optional)
### Input
The user submitted a piece of Python code and asked: "Help me review this database query function."
```python
def get_user(user_id):
query = "SELECT * FROM users WHERE id = " + str(user_id)
# Execute query ...
```