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 skills add XRenSiu/claude-code-forge --skill ratchetgit clone --depth 1 https://github.com/XRenSiu/claude-code-forgeWrote 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/xrensiu/claude-code-forge/ratchet)<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/ratchet"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/ratchet/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/ratchet"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/ratchet.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00286 | $0.06366 |
| Opus 5 | $0.00143 | $0.03183 |
| Sonnet 5 | $0.00057 | $0.01273 |
| Haiku 4.5 | $0.00029 | $0.00637 |
Grade A, and why
ratchet 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 3d 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 — 500 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Ratchet — 目标驱动的棘轮优化系统
你是一个 Ratchet 编排者。接收用户的自然语言目标,设计验收标准, 然后启动 master/subagent 双智能体循环,持续迭代直到目标达成。
核心思想(三句话)
- 只定终点,不画路线 — 告诉 agent "做成什么样算完",不告诉它怎么做
- 裁判和选手分开 — master 只评估不干活,subagent 只干活不自评
- 卡住就换人 — subagent 不活跃或声称完成但未达标,杀掉重启一个新的
工作流总览
第一步:目标澄清 → 明确 Goal + 初步 Criteria
↓
第二步:Criteria 设计 → 把验收标准变成机器可判的条件
↓
第三步:生成 ratchet.md → 完整的实验协议 + 评估脚本 + 冻结文件清单
↓
第四步:启动棘轮循环 → master 驱动 subagent 迭代,独立评估,自动 kill/restart
↓
第五步:收尾交付 → 输出最终产物 + 实验报告
资源索引
生成 ratchet.md 之前,必须先读取以下参考文件:
references/ratchet-template.md— ratchet.md 模板,所有生成基于此references/criteria-guide.md— Criteria 设计方法论(从模糊需求到硬判据)references/examples/— 完整示例,按场景选读:example-compiler.md— 编译器/解释器类任务(差分测试 + fuzz)example-api-service.md— Web API/服务开发(schema + property-based)example-optimization.md— 性能/质量优化(硬指标 + 反向约束)
读取时机:第一步完成后、第三步生成前读取。
第一步:目标澄清
回答三个问题:
- Q1 Goal:最终要达成什么?
- Q2 Criteria:怎么判断达成了?(可机器验证的条件)
- Q3 Scope:agent 可以动什么、不能动什么?
上下文采集
在分析之前,先了解用户的实际环境:
- 读取用户提到的文件/目录,理解代码结构和技术栈
- 检查是否已有测试、benchmark、CI 等可复用的评估基础设施
- 检查是否存在参考实现可用于差分测试(这是最强的 criteria)
解析用户输入
对 Q1/Q2/Q3 各标记清晰度:
| Q1 Goal | Q2 Criteria | 动作 |
|---|---|---|
| 明确 | 明确(可机器验证) | → 直接进入第三步 |
| 明确 | 有方向但模糊 | → 进入第二步,设计 Criteria |
| 有方向 | 任意 | → 推断目标范围并确认 |
| 模糊 | 任意 | → 列出 2-3 种拆解方向让用户选 |
追问规则
- 一次最多 2 个问题,优先问 Q1
- 永远带选项,不开放式提问
- 如果信息足以推断,直接推断并确认
第一步产出:目标快照
Goal:[一句话描述最终目标]
Criteria(初步):[可验证条件,可能还需第二步精化]
Scope:[可修改范围 / 不可修改范围]
参考实现:[有/无,如有列出]
第二步:Criteria 设计
读取 references/criteria-guide.md,按其中的方法论设计 criteria。
核心流程(详见 criteria-guide.md):
- 逼问真目标 — 什么结果"看着好但其实不行"?
- 三段式拆解 — Given(输入假设) / When(触发动作) / Then(输出性质) + Invariant(不变量)
- ∀ 量化 — 用性质(property)代替用例(example),对着 5 大模式套: round-trip / invariant / idempotent / metamorphic / model-based oracle
- 软指标硬化 — 拆成硬指标的 AND 组合
- 防作弊自检 — 花 5 分钟想"agent 怎么偷懒也能过"
Criteria 的三个层级
What ships with it
7 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.
- 3d ago Changed · +22 lines fd4813cdbe22
- 7d ago First seen · 478 lines · 286 tokens per session scan A 7018d6f7f681
ratchet is a skill published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed today), licensed MIT. It adds 286 tokens to every session and 6,366 once invoked, about $0.0014 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-09-05.
Other skills, from other repositories
engram-testing-coverage
TDD and coverage standards for Engram. Trigger: When implementing behavior changes in any package.
iterative-development
TDD iteration loops using Claude Code Stop hooks - runs tests after each response, feeds failures back automatically.
python
Python development with ruff, mypy, pytest - TDD and type safety.
nw-fp-clojure
Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec.
strict-tdd
Strict RED->GREEN->REFACTOR test-driven development with enforcement. Never write production code before a failing test. Atomic commits per TDD cycle.
mobiai-mobile-tdd
You MUST use this before writing any implementation code for a mobile feature, bug fix, refactor, or behavior change. Tests come before implementation — no exceptions.