agentleFS
rui66648rui66648/agents-dev-rules/skills/writing-skills/SKILL.md

writing-skills

Skill0 starsChanged 14 days agoApache-2.0View on GitHub

创建新工作流技能或修改现有技能时使用的元技能。遵循 SKILL.md 标准格式(含渐进披露结构),强制实测验证。触发词: 创建技能、写 skill、修改技能、新建工作流、定义规范。

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • obraSkill

    diagnosing-superpowers

    Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

    Also in 22 projects that use this

  • aaddrickSkill

    writing-agents

    Use when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool

    Also in 3 projects that use this

  • AWSSkill

    condition-based-waiting

    Replace arbitrary sleeps in tests with polling for the ACTUAL condition — a waitFor(() => predicate, description, timeoutMs) helper that polls every 10 ms, calls the getter inside the loop (no stale cache), and throws a clear error on timeout. Use when a test uses setTimeout / sleep / time.sleep, is flaky (passes on fast machines, fails under load or in CI), times out when run in parallel, or waits for an async operation, event, state, count, or file to appear. Do NOT use when the test genuinely exercises timing behavior (debounce / throttle) — then wait for the triggering condition FIRST and comment WHY the timed wait is justified. Trigger on "flaky test", "race condition in tests", "why does this pass locally and fail in CI", or any `await new Promise(r => setTimeout(r, N))` in a test.

    Also in 3 projects that use this

  • MicrosoftSkill

    using-skills

    Describes how to use abilities. Read before any conversation.

    Also in 4 projects that use this

  • +3 more from Leodorareluctant259

The file

Files
SKILL.md

Writing Skills (元技能)

负责代理

architect — 技能编写由架构师代理负责,确保技能定义符合 SKILL.md 标准格式。

何时使用

  • 需要创建新的工作流技能时
  • 需要修改或升级现有技能时
  • 用户明确要求"创建技能"、"写个 skill"、"修改技能"时
  • 发现工作流程中有重复的模式需要固化时

触发关键词: "创建技能"、"写 skill"、"新建工作流"、"定义规范"

执行流程

1. 技能需求分析

在编写前,明确:

  • 这个技能解决什么问题?在什么场景下触发?
  • 与现有技能的关系?是否有重叠或依赖?
  • 技能的边界是什么?哪些不在范围内?

2. 遵循 SKILL.md 标准格式

每个技能文件必须遵循以下结构:

---
name: <技能名称,kebab-case>
description: <做什么>。<何时触发>。触发词: <关键词列表>
---

# <技能显示名称>

## 何时使用

- 触发场景列表
- 触发关键词列表

## 执行流程

### 步骤 1: <步骤名称>
- 具体操作说明
- 示例 (如适用)

### 步骤 2: <步骤名称>
...

## 硬性规则

- ✅ 必须遵守的规则
- ❌ 禁止的行为

## 反模式

- ❌ 典型的错误做法和原因

2b. 渐进披露结构(渐进式加载)

上下文窗口是公共资源。SKILL.md 正文是触发后整体加载的,超长正文与对话历史竞争 token。遵循三层结构:

层级内容加载时机
第 1 层YAML frontmatter(name + description)常驻(路由索引用)
第 2 层SKILL.md 正文技能被触发时
第 3 层references/*.md、scripts/*按需读取 / 执行
  • 正文红线:< 300 行;接近 300 行时必须把细节拆到 references/
  • 拆分模式:SKILL.md 保留流程骨架 + 关键规则 + 到参考文档的链接;阶段细节、模板全文、长示例移入 references/*.md
  • 引用必须一层深:SKILL.md → references/xxx.md,禁止 references 再嵌套引用 references(避免只读到部分内容)
  • 确定性、重复性命令序列可放 scripts/(脚本被执行而非加载,不占 token);需要判断力的步骤必须留给模型,不要脚本化
  • references/ 与 scripts/ 可选,小型技能保持单文件即可
skills/<技能名称>/
├── SKILL.md          # 必需:流程骨架 + 硬性规则 + 反模式 + 参考文档链接
├── references/       # 可选:按阶段/领域拆分的详细内容(一层深引用)
│   └── <topic>.md
└── scripts/          # 可选:确定性命令序列(被执行,不加载进上下文)
    └── <task>.ps1

3. 编写规范

YAML Frontmatter

---
name: 技能名称 (kebab-case)
description: <做什么>。<何时触发>。触发词: <关键词列表>
---
  • name: 使用 kebab-case,简短明确
  • description: 承担触发发现职责,模板 = 做什么 + 何时触发 + 触发词。中文描述,技术术语保留英文,建议 ≤ 300 字符。禁止只写"做什么"不写"何时用"

正文结构

章节必需内容
何时使用是场景列表 + 触发关键词
执行流程是分步骤,有编号,有示例
硬性规则是使用 ✅ 和 ❌ 标记
反模式是典型错误做法

自由度分级(写执行流程前先定级)

脆弱操作走"独木桥"——给精确命令和固定顺序;开放任务走"旷野"——给启发式和判断标准。禁止反向错配。

自由度适用场景写法
低脆弱、易错、顺序敏感(迁移、发布、提交)精确命令 + "禁止修改/增删参数"
中有首选模式但允许变化带参数的模板/伪代码
高多路径皆可、依赖上下文(构思、评审、研究)启发式指导 + 判断标准,禁止写死固定次数/固定模板

语言规范

  • 正文使用中文,技术术语保留英文
  • 规则使用 ✅ (必须) 和 ❌ (禁止) 标记
  • 代码示例必须有注释说明
  • 步骤编号清晰,层级不超过 3 级

4. 文件位置

skills/<技能名称>/SKILL.md
  • 每个技能一个独立子目录
  • 目录名与 name 字段一致
  • 文件名固定为 SKILL.md (大写)
  • 超过 300 行的正文拆分 references/(见 2b 节)

5. 审核与注册

  • 检查是否与现有技能重叠
  • 确认触发条件不冲突
  • 确认符合 SKILL.md 标准格式
  • 在 AGENTS.md 中注册新技能 (如适用)

6. 实测与迭代(强制,禁止跳过)

新技能不经实测 = 只做了静态检查。官方经验:gotchas(实际踩坑)是技能中信号量最高的内容,必须从使用中持续回写。

实测要求(新技能或重大修改后执行):

  1. 构造 2-3 个真实触发 prompt(模拟用户自然说法,覆盖主要触发场景 + 1 个易混淆场景)
  2. 逐个运行,验证:技能被正确触发、流程可执行、输出符合预期
  3. 易混淆场景若误触发其他技能 → 收紧 description 的触发词;若不触发 → 补充触发词
  4. 实测记录(prompt + 结论)附在交付说明中

迭代约定(持续):

  • 实际使用中发现技能"没触发 / 触发错了 / 步骤走不通"→ 当次修复 description 或流程,版本号 +patch
  • 新踩的坑 → 回写"反模式"章节,具体到现象和原因,禁止只写"不要做坏事"
  • 补丁式追加("新增能力"、"新增触发关键词"段落)禁止累积超过 2 次,超过时必须整体重构整合该技能

硬性规则

  • ✅ 每个技能必须有 YAML frontmatter
  • ✅ 每个技能必须包含所有 4 个章节
  • ✅ name 使用 kebab-case
  • ✅ 文件名固定为 SKILL.md (大写)
  • ✅ 每个技能必须有硬性规则和反模式
  • ✅ description 必须按模板包含做什么 + 何时触发 + 触发词
  • ✅ 正文超过 300 行必须拆分 references/(引用一层深)
  • ✅ 新技能/重大修改必须实测(见第 6 步)
  • ✅ 脆弱操作给精确命令(低自由度),开放任务给启发式(高自由度),禁止错配
  • ❌ 禁止创建过于宽泛的技能 ("写代码" — 太宽泛)
  • ❌ 禁止与现有技能大量重叠
  • ❌ 禁止缺少反模式章节
  • ❌ 禁止使用模糊的触发条件
  • ❌ 禁止高自由度任务写死固定次数/固定模板(如"最多搜 4 次")

反模式

  • ❌ 创建"万能技能"涵盖所有场景 — 技能应有明确边界
  • ❌ 技能之间互相矛盾 — 规则必须一致
  • ❌ 反模式只写"不要做坏事" — 必须具体化
  • ❌ 没有"何时使用"章节 — AI 无法知道何时触发
  • ❌ 硬性规则全是 ✅ 没有 ❌ — 约束不完整
  • ❌ 单文件堆到 500+ 行 — 触发即全量加载,token 与对话历史竞争(应拆 references/)
  • ❌ description 只写"做什么" — 触发发现需要 when + 触发词
  • ❌ 把需要判断力的步骤脚本化、把确定性步骤留给模型自由发挥 — 双向错配
  • ❌ 补丁式累积追加("新增XX"段落)不整合 — 6 个月后无人能读懂技能全貌

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.