Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/smallnest/goal-workflow/understandnpx skills add smallnest/goal-workflow --skill understandgit clone --depth 1 https://github.com/smallnest/goal-workflowWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/smallnest/goal-workflow/understand)<a href="https://agentmods.dev/skills/smallnest/goal-workflow/understand"><img src="https://agentmods.dev/badge/skills/smallnest/goal-workflow/understand.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00125 | $0.01778 |
| Opus 5 | $0.00063 | $0.00889 |
| Sonnet 5 | $0.00025 | $0.00356 |
| Haiku 4.5 | $0.00013 | $0.00178 |
Grade A, and why
understand scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
understand
把「本次(AI)新生成的代码变更」变成一个可交互的审阅网页:左侧按真实项目布局列出变更文件树,右侧显示所选文件的 diff(高亮、增删与未变更代码明显区分),并在右侧边栏逐段给出相关单位需求与代码解释。
始终用中文产出解释与需求。
何时用
- 用户说
/understand、"review 这次改动"、"解释下新写的代码"、"看看这次变更做了啥"。 - 目标是理解 + 审阅当前工作区里尚未吃透的改动(通常是 AI 刚生成的),不是重构或修 bug。
组成
skill 目录下三件套(都在 ~/.claude/skills/understand/):
understand.py— 纯标准库生成器,两个子命令:scan(解析 git diff →data.json+annotations.json骨架)、render(合并注释 →report.html)。template.html— Claude light 主题两栏页面(占位符__UNDERSTAND_PAYLOAD__注入数据),Prism.js 走 CDN 做语法高亮。- 本文件 — 流程说明。
执行流程
在**用户当前工作目录(仓库内)**执行以下步骤。全程把 SKILL_DIR 当作本 skill 目录的绝对路径(即本文件所在目录)。
1. 扫描变更
python3 "$SKILL_DIR/understand.py" scan
- 默认基线 = 当前分支与主分支(origin/main→main→master)的 merge-base;如用户指定范围可加
--base <ref>(例如只看最后一次提交用--base HEAD~1)。 - 默认输出目录
.understand/(相对 CWD)。可用--out <dir>改。 - 它覆盖:已提交(base..HEAD) + 已暂存 + 未暂存 + 未跟踪新文件。
- 命令会打印 JSON:文件数、增删行数、
data.json/annotations.json路径、以及paths(变更文件列表)。读这个输出了解改了哪些文件。
2. 通读改动并撰写注释
先把改动读懂,再落注释。建议:
Read每个变更文件(结合data.json里的 hunks 看具体增删行号),必要时读周边未改代码补足上下文。- 判断每处改动对应的单位需求:优先从仓库线索找真实依据——commit message、
docs/需求文档、代码注释里写的需求编号/背景、相关 issue。找到真实需求就照写;确实找不到,就基于代码逻辑写「推测意图」并在注释里把inferred置为true(前端会标成灰色「推测意图」而非「需求」,避免把猜测伪装成事实)。
然后编辑 .understand/annotations.json(scan 已生成骨架,保留其 files[].path 顺序,逐个填充)。结构:
{
"title": "本次变更的一句话主题",
"summary": "整体在做什么、为什么(2~4 句,可用 **加粗** 与 `代码`)",
"files": [
{
"path": "src/main/java/.../PwaTierInvitationService.java",
"summary": "这个文件这次改了什么、为何改(1~3 句)",
"annotations": [
{
"side": "new",
"start": 52,
"end": 53,
"requirement": "expires_at 为 timestamptz,需正确编码",
"explanation": "Vert.x PG 客户端不支持 `java.time.Instant`,改绑 `OffsetDateTime`(`atOffset(UTC)`),否则运行期报 coercion 错误。",
"inferred": false
}
]
}
]
}
注释字段:
side—"new"锚定新版本行号(增行/上下文),"old"锚定旧版本行号(删行)。绝大多数解释用"new"。start/end— 该段代码的行号区间(data.json里对应 side 的newNo/oldNo;单行时end可省或等于start)。行号是文件真实行号,不是 diff 里的序号。requirement— 该段对应的单位需求(简短一句,作为标签展示)。可留空。explanation— 代码解释:讲清这段在干嘛、为什么这么写、有何风险/前提。可用`code`和**bold**。inferred— 需求为推测时置true。
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 102 lines · 125 tokens per session scan A 878dde837fcb
understand is a skill published in the GitHub repository smallnest/goal-workflow (268 stars, last pushed 7d ago), licensed MIT. It adds 125 tokens to every session and 1,778 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
mass-line
触发:当你需要收集多方意见、把零散反馈整合成可执行方案,或把方案带回真实使用者/执行者验证时调用;常见信号包括 stakeholder input、user feedback、意见汇总、对齐与验证。 English: Trigger when input must be gathered from many people, synthesized into a clearer plan, and returned to the affected users or executors for validation. Use this skill for a collect-synthesize-validate loop.
workflows
触发:当你面临的任务明显需要多个思想武器协作时调用;常见信号包括:从零启动新项目、攻坚复杂疑难问题、对已有方案进行迭代优化。此 skill 提供标准化的跨 skill 工作流组合,解决"应该先用哪个 skill、怎么衔接"的问题。 English: Trigger when a task clearly requires multiple skills in sequence. Use this skill to select a standard workflow that chains skills together, defines data handoff between steps, and specifies…
concentrate-forces
触发:当多个任务同时争夺时间、注意力、算力或预算,必须确定主攻方向并停止分散用力时调用;常见信号包括优先级过多、资源紧张、推进分散、需要决定先做什么。 English: Trigger when limited resources are being split across too many tasks and one main target must be chosen. Use this skill to concentrate effort, sequence work decisively, and finish a meaningful breakthrough before expanding.
protracted-strategy
触发:当目标长期、任务复杂、资源暂时处于劣势,或短期无法速胜但又不能放弃时调用;常见信号包括 long-term effort、phased plan、endurance、战略耐心、需要分阶段推进。 English: Trigger when the work is long-horizon, difficult, and unlikely to be won quickly. Use this skill to divide the effort into stages, keep strategic confidence, and accumulate small wins into overall victory.
practice-cognition
触发:当你提出了方案、假设或判断,需要通过实践验证、试错迭代或复盘升级认知时调用;常见信号包括 experiment、prototype、validate、iterate、feedback loop。 English: Trigger when an idea, hypothesis, or plan must be tested in practice and improved through iteration. Use this skill to move from action to understanding and back to action in a spiral learning loop.
contradiction-analysis
触发:当问题复杂、存在多个冲突因素、优先级不清,或你不知道应该先解决什么时调用;常见信号包括 trade-off、瓶颈、根因不明、主次不清、多个问题互相牵制。 English: Trigger when a problem contains competing forces, unclear priorities, or no obvious entry point. Use this skill to identify contradictions, isolate the principal contradiction, classify its nature, and choose the right response.