1) Directory structure and naming
One directory per skill, with the directory name matching the frontmatter's name exactly the same:
nameConstraints:- Only lowercase letters/digits/hyphens allowed:
a-z、0-9、- - cannot start with
-or end with it - cannot contain consecutive
--
- Only lowercase letters/digits/hyphens allowed:
Recommended structure:
skills/<skill-name>/
SKILL.md
scripts/ # 可选:可执行工具
references/ # 可选:按需阅读的资料
assets/ # 可选:模板/静态文件
2) SKILL.md (required)
2.1 Frontmatter (required: name / description)
---
name: your-skill-name
description: 用一句话说明“做什么 + 何时使用(包含关键词)”。
---
Other fields can be added as needed; this repository does not mandate them, but keeping it concise is recommended.
description Requirements:
- Non-empty
- Must cover both "what it does" + "when to use it"
- Include as many keywords as possible that users would actually say (to improve trigger hit rate)
2.2 Body (write only the shortest usable workflow)
The body should only keep the information that lets the user (human or AI) start executing directly. Put lengthy background/materials in references/, and put templates/static files in assets/。
Recommended order (keep or omit as needed):
- One-sentence description (what this is / what it solves)
- Quick start (shortest copyable example)
- Common scenarios/commands (3-7 is appropriate)
- Output conventions (e.g. for machine-readable output, specify
--jsonand other conventions) - How to look up uncommon parameters (
--help+ reference pointers) - Resources (pointing to scripts/references/templates)
Minimal skeleton (copy and rename):
---
name: your-skill-name
description: 做什么;何时使用(关键词)。
---
一句话说明。
## Quick start
```bash
cd skills/your-skill-name && ./scripts/your_tool.py --help
```
## 常用场景
- `./scripts/your_tool.py ...`
## 冷门参数怎么查
- `./scripts/your_tool.py --help`
- 需要字段细节时读:见 [api.md](references/api.md)
## 资源
- [tool.py](scripts/tool.py)
3) scripts/ (optional)
If a workflow needs "deterministic execution" or is frequently repeated, prefer writing it as an executable script and placing it in scripts/, and provide copyable commands in SKILL.md .
This repository's conventions for Python scripts (must be stated clearly in SKILL.md):
- Uniformly execute directly via
./scripts/...(do not useuv run python .../python ...) - workdir convention: by default use the directory where the current
SKILL.mdis located as the workdir; if example commands needcd, state it clearly (usuallycd skills/<skill-name>) - When referencing scripts/resource files in
SKILL.md, prefer using Markdown URLs (the link text should be only the filename as much as possible)
Key points of the Python script specification:
- Run mode: must use uv script mode (shebang is
#!/usr/bin/env -S uv run --script)。 - Initialization: for new scripts use
uv init --script scripts/foo.py(generates the shebang and an empty/// scriptmetadata block). - Dependency declaration (strong constraint):
- The script header's
/// scriptmetadata block is the only place for dependency declarations. - Manually editing the dependency block is prohibited; adding/removing dependencies must be done via
uv add --script .../uv remove --script .... - After removing a dependency reference, if it is confirmed no longer used, that dependency should also be removed.
- The script header's
- CLI form:
- For command-line arguments, prefer Typer.
- For discrete optional values (such as
format、view、profile、column, etc.), prefer usingEnumorLiteralfor type annotation, rather than describing the optional values only in the help text; this way Typer can automatically in--helpdisplays candidate values, improving readability and discoverability. - Trade-off recommendation: for a small number of one-off enum values, prefer using
Literal; when reuse, centralized management, or a larger number of values is needed, prefer usingEnum。 - For output prompts/tables, prefer rich (improves readability).
- For data models and parameter validation, prefer pydantic (failure messages are clear and easy to locate).
- Use lowercase for the Typer application instance variable name
app。 - If there is only one command, prefer using
typer.run(main), avoidingtool.py foo <arg>which adds an extra layer of subcommands.
- Maintainability: Every module, function, and type should include a brief Chinese docstring.
- Quality checks: After completion, it is recommended to run:
uv run ruff check <path>uv run ruff format <path>
Common uv --script workflows (used to create/maintain script dependencies):
# 在 skill 目录内新建脚本(会生成 shebang 与 /// script 依赖块)
uv init --script scripts/foo.py
# 给脚本添加依赖(会更新脚本头部 dependencies;不要手工改依赖块)
uv add --script scripts/foo.py typer rich
# 从脚本移除依赖
uv remove --script scripts/foo.py rich
# 赋予可执行权限并运行
chmod +x scripts/foo.py
./scripts/foo.py --help
4) references/ and assets/ (optional)
references/: Store long materials to be read on demand (protocols/API fields/glossaries). InSKILL.md, clearly state "when you need to read which file".assets/: Store templates/static files. InSKILL.md, give the shortest explanation of "how to use this file".
Reference rules (recommended):
- Use relative paths for links or paths (relative to
skills/<skill-name>/) - Aim for "one hop away":
SKILL.mdpoints directly to the target file, avoiding multi-level chained references - For link text, write only the file name as much as possible (put the path in the link target)
Example (Markdown link syntax):
见 [api.md](references/api.md)
运行 [tool.py](scripts/tool.py)
5) Content length (tokens)
SKILL.mdRecommended body text < 5000 tokens- You can use token_count.py to count tokens (scripts and parameters do not depend on workdir, as long as paths are written correctly):
cd skills/<skill-name>
../../scripts/token_count.py SKILL.md
6) Pre-submission self-check list
- Directory name ==
SKILL.md'sname - frontmatter contains at least
name/description, anddescriptionclearly states "what it does + when to use it (keywords)" SKILL.mdhas a copyable Quick start (if it depends on the working directory or environment variables, this must be clearly stated in the example)- If there are scripts: the example uses
./scripts/...directly (do not useuv run python/python) - If there are scripts: dependencies are declared only in
/// script(do not manually edit the dependency block); modules/functions/types have brief Chinese docstrings - If there are scripts: it is recommended to run ruff (
uv run ruff check .../uv run ruff format ...) references//assets/references are clear, andSKILL.mdcan reach the target file in one hopSKILL.mdtoken count is within the recommended range