Skill Learning

retro

1. Bilingual SKILL.md

左右滑动可直接切换英文版与中文版;两种语言按段落自动对齐。英文中的蓝色虚线词语可点击查看解释。共标记 14 处。

入口 skill:retro左右滑动切换语言 · 段落位置自动对齐
The user has asked for a **retrospective**. You are suggesting improvements to the coding agent's **environment** to improve future runs.
## Steps
1. Call the Skill tool with `writing-for-agents` for the writing style guide.
2. Read the for the session the user specifies. This may mean searching through session logs on this machine. If the user doesn't specify a session, default to the current one.
3. Look for candidates for improvement in these categories.
- **Navigation**: how easy was it for the agent to find the right files? Are there between files? Would a **navigation pointer** make it easier? _Use when_ the session took a long time to find a piece of information.
- **Automated checks**: are there automated checks that could catch errors the agent made? Linting, typing, tests, filesystem linters? Read the repo's own check command first (its `package.json`/build-tool `lint`/`check` scripts, its CI workflow), so a check that already exists but is the finding, . A repo with no **guardrail** (no pre-commit hook and no CI job running its lint/typecheck/test command) is itself a finding: an un-linted repo is , . _Use when_ the agent made a mistake an automated check could have caught, or the repo has no guardrail at all.
- **Coding standards**: should the **reviewer agent** be given a new rule to enforce? Should an existing rule be removed or clarified? : a **mechanical** one (a fixed syntactic pattern, a banned API, an import shape, a file-location rule) : a custom rule in the repo's own linter, a new pre-commit hook, or a new CI job, . Default to building the check over writing the rule. Reserve `CODING_STANDARDS.md` for (cross-file consistency, "matches the surrounding style," anything no guardrail could ever substitute for). _Use when_ the reviewer agent failed to catch a mistake.
- **Global AGENTS.md**: are there any steering instructions that should be moved to coding standards (or automated checks) instead? _Use when_ the AGENTS.md file is particularly large - in the repo OR the user's global scope.
- **Tool economy**: did the agent make expensive tool calls that could be streamlined? Is there any custom tooling (CLI's, MCP's) that is particularly token-inefficient? _Use when_ the agent made an expensive tool call.
- **No-ops**: look for instructions in steering files that don't modify the agent's behavior. _Use when_ the steering files are large and unwieldy.
- **Information access**: look for opportunities to increase the agent's access to information. Teeing dev server logs, readonly access to third-party services. _Use when_ a crucial piece of information was not available to the agent.
4. Present these candidates to the user, .
## Reference
### Implementation vs Review
Remember that all work goes through two stages: implementation and review. The implementation agent has the most ****. They are responsible for exploration, writing code, and debugging failures.
The review agent has the least - it receives a diff, so no exploration needed. It often does not need to write code or debug.
This means that the review agent should be responsible for imposing coding standards, not the implementation agent.
### Files
You have access to several files in the repo:
- `CLAUDE.md`/`AGENTS.md`: these files are pushed to the context window of any agent working in this repo. They should be , usually only for **navigation pointers** to other files.
- `CODING_STANDARDS.md`: this file is read during review, not implementation. Add **navigation pointers** to docs folders if the standards file gets more than 1,000 lines long.
- Docs: use docs as references files, pointed to by other files. Look for existing docs before writing new ones.
- Skills: use skills for docs (since their description goes into the agent's context window), or for user-invoked commands. Follow the advice in the `writing-for-agents` skill.
用户已要求进行一次**复盘**。你要提出对编码 agent **环境**的改进建议,以改善未来的运行。
## 步骤
1. 调用 Skill 工具加载 `writing-for-agents`,作为写作风格指南。
2. 阅读用户指定会话的一手资料。这可能意味着搜索本机上的会话日志。如果用户没有指定会话,默认使用当前会话。
3. 在以下类别中寻找改进候选项。
- **导航**:agent 找到正确文件有多容易?文件之间是否存在隐藏依赖?增加**导航指针**是否会更容易?_适用情形_:该会话花了很长时间才找到某项信息。
- **自动化检查**:是否有自动化检查能够捕获 agent 犯下的错误?例如 lint、类型检查、测试、文件系统 lint?先阅读仓库自己的检查命令(`package.json`/构建工具中的 `lint`/`check` 脚本及其 CI 工作流),这样,如果已有检查却未接线或悄然失效,那么发现点应是这个缺口,而不是重新发明一套检查。仓库若没有**防护栏**(没有 pre-commit hook,也没有在 CI 中运行 lint/typecheck/test 命令的 job),其本身就是一个发现点:未经 lint 的仓库是一个持续存在的改进机会,不是中性默认状态。_适用情形_:agent 犯了本可由自动化检查发现的错误,或者仓库根本没有防护栏。
- **编码标准**:是否应该给**评审 agent**一条要执行的新规则?是否应删除或澄清现有规则?先对违规行为分类:**机械性**违规(固定语法模式、禁用 API、导入形式、文件位置规则)应直接配确定性检查,毫不含糊:可以是仓库自有 linter 的定制规则、新的 pre-commit hook 或新的 CI job,具体选择取决于仓库语言和现有防护栏哪一种成本最低。默认优先构建检查,而不是编写文字规则。把 `CODING_STANDARDS.md` 留给真正需要**判断**的事项(跨文件一致性、“与周围风格一致”、任何防护栏永远无法替代的判断)。_适用情形_:评审 agent 没有发现错误。
- **全局 AGENTS.md**:是否有任何引导指令应移到编码标准(或自动化检查)中?_适用情形_:仓库范围或用户全局范围内的 AGENTS.md 文件特别庞大。
- **工具经济性**:agent 是否进行了可以精简的高成本工具调用?是否有某些自定义工具(CLI、MCP)尤其浪费 token?_适用情形_:agent 进行过高成本工具调用。
- **无效指令**:在引导文件中寻找不会改变 agent 行为的指令。_适用情形_:引导文件庞大而难以维护。
- **信息访问**:寻找扩大 agent 信息访问能力的机会,例如复制保存开发服务器日志、提供第三方服务的只读访问。_适用情形_:agent 无法取得某项关键信息。
4. 按严重程度从高到低,把这些候选项呈现给用户。
## 参考
### 实现与评审
记住,所有工作都经过两个阶段:实现与评审。实现 agent 承受最大的**上下文压力**。它负责探索、编写代码和调试故障。
评审 agent 承受的上下文压力最小,因为它收到的是 diff,无需探索。它通常也不需要编写代码或调试。
这意味着应由评审 agent 负责实施编码标准,而不是实现 agent。
### 文件
你可以访问仓库中的若干文件:
- `CLAUDE.md`/`AGENTS.md`:这些文件会被推入任何在该仓库工作的 agent 的上下文窗口。应极其克制地使用它们,通常只用于指向其他文件的**导航指针**。
- `CODING_STANDARDS.md`:该文件在评审阶段读取,而非实现阶段。如果标准文件超过 1,000 行,请增加指向 docs 文件夹的**导航指针**。
- Docs:将文档用作参考文件,并由其他文件指向它们。编写新文档前先寻找已有文档。
- Skills:将 skill 用作文档(因为其 description 会进入 agent 的上下文窗口),或用作用户调用的命令。遵循 `writing-for-agents` skill 中的建议。

Entry SHA-256: 33fbc28568e3146f20fd908b12998bc0ab30aa4f4c87288199a40793efa94696

2. Why This Skill Is Clever

一句话核心机制

retro 把一次编码会话当作可取证的系统故障样本:先读一手资料,再按环境改进类别寻找候选项,并用“机械问题自动化、判断问题交给评审”的分流规则,按严重程度输出可复用的改进。

触发与边界

直接来源: disable-model-invocation: true 表明该 skill 只能由用户显式启动。它面向编码会话复盘,不是泛泛总结;如果用户未指定会话,才默认当前会话。输出是环境改进候选项,而不是自动修改仓库。

支持性上下文: writing-for-agents 被第一步显式调用,它提供导航指针、信息层级、完成标准、no-op 与单一事实源等写作原则;这些内容帮助解释 retro 为什么检查 steering files,但不属于所选 retro 原文。

解释: 这是一个“从单次失误提炼长期护栏”的诊断 skill。它关注未来运行的系统性收益,而不是把复盘变成对本次 agent 的叙事评价。

信息架构与执行顺序

  1. 加载 writing-for-agents,统一如何评价 agent 消费的文档。
  2. 确定目标会话并读取日志、diff 等一手资料。
  3. 按七类环境杠杆搜集候选项:导航、自动化检查、编码标准、全局指令、工具经济性、no-op、信息访问。
  4. 对检查与标准相关的问题先分类:机械性违规进入确定性检查,真正的判断事项才进入评审标准。
  5. 结合实现与评审的上下文压力,决定规则应在哪个阶段执行。
  6. 按严重程度呈现候选项,让用户决定后续动作。

最巧妙的设计点

1. 复盘从一手证据开始

Read the primary sources for the session

直接来源: skill 要求读取指定会话的一手资料。解释: 它阻止 agent 只凭最终摘要猜测过程,把建议锚定在真实工具调用、文件探索和失败记录上。

2. 分类表不是清单,而是触发条件

_Use when_ ...

直接来源: 每个类别都附适用情形。解释: 同一复盘无需机械填满所有类别;条件化触发既减少凑数,也让分类成为可复用的诊断索引。

3. 先查已有检查是否真正接线

sits unwired or silently broken

直接来源: 新版本要求先读仓库自己的检查命令与 CI。解释: 这把“缺能力”和“能力存在但未执行”分开,避免重复建设,也能发现最危险的假安全感。

4. 把没有防护栏定义为持续风险

not a neutral default

直接来源: 没有 pre-commit 或 CI 检查本身就是发现点。解释: skill 不再等待一次具体错误证明护栏有价值,而是把缺失的自动化视为每次变更都会重复暴露的系统风险。

5. 机械问题与判断问题严格分流

gets a deterministic check, full stop

直接来源: 固定语法、禁用 API、导入形式和文件位置规则必须自动化。解释: 机器擅长零歧义重复执行,评审注意力则保留给跨文件一致性等真正需要上下文的判断,从而降低规则漂移和漏检。

6. 治理责任按上下文压力分配

the review agent should be responsible for imposing coding standards

直接来源: 实现 agent 需要探索、编码、调试,而评审 agent 直接接收 diff。解释: 规则不是离工作越近越好;应放到拥有足够注意力且证据最集中的阶段执行。

本次更新为什么重要

直接来源: 与上次学习版本相比,Automated checks 和 Coding standards 两项被显著强化。新增规则要求先检查仓库已有命令与 CI 接线状态,把“无 guardrail”明确判为问题,并要求机械性违规默认落到 linter、pre-commit 或 CI,而非继续堆入文字标准。

解释: 更新把复盘从“建议可以加检查”升级为明确的治理路由:先复用现有能力,再修接线;没有能力则补最便宜的确定性护栏;只有不可机械化的问题才消耗评审判断。

防失败机制与 trade-off

源中明确的不变量: 用户显式触发;先读一手资料;未指定时才默认当前会话;已有检查先查命令和 CI;机械违规必须确定性检查;候选项按严重程度输出;编码标准由评审阶段执行。

权衡: 一手日志可能包含大量噪声,严重程度排序仍依赖判断;把所有可机械化规则做成检查会增加工具维护成本;某些小仓库配置 CI 的固定成本可能高于短期收益,因此原文保留“选择现有语言与防护栏下最便宜方案”的适配空间。

可移植性风险: Skill tool、disable-model-invocation 以及实现/评审双 agent 分工属于特定 harness 假设。迁移时应保留“用户授权复盘、证据优先、确定性规则自动化、判断规则后移”的语义,而不是照搬字段名。

可迁移原则

今日实践题

回想最近一次代码评审漏掉的问题:它是机械性违规还是判断事项?如果是机械性的,现有 linter、pre-commit、CI 三个位置中,哪一个是成本最低且最可靠的护栏?

Evidence note

触发边界、四步流程、七类候选项、机械/判断分流、实现与评审的上下文压力以及文件职责均来自所选 retro 原文;writing-for-agents 仅作为支持性上下文说明导航指针与 no-op 的设计背景;关于“从单次失误提炼长期护栏”和治理路由的表述属于设计解释。

Source & provenance
Repository path
skills/in-progress/retro/SKILL.md
Generated
2026-09-17 08:23 Asia/Shanghai
Upstream commit
959a8e9f1edc3adbe2f7e3054bb6fbefa6696260
Source
View on GitHub