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/rainmanjam/poka-yoke/clean-codenpx skills add rainmanjam/poka-yoke --skill clean-codegit clone --depth 1 https://github.com/rainmanjam/poka-yokeWrote 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/rainmanjam/poka-yoke/clean-code)<a href="https://agentmods.dev/skills/rainmanjam/poka-yoke/clean-code"><img src="https://agentmods.dev/badge/skills/rainmanjam/poka-yoke/clean-code.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.00068 | $0.02161 |
| Opus 5 | $0.00034 | $0.01081 |
| Sonnet 5 | $0.00014 | $0.00432 |
| Haiku 4.5 | $0.00007 | $0.00216 |
Grade A, and why
clean-code 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 — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean Code: Structure, Naming and Cohesion
Most defects are not clever. They are the ordinary consequence of code that is harder to read than it needed to be. A function that does three things hides which one broke. A name that lies sends the next reader to the wrong file. A module that depends on everything cannot be changed without changing everything.
So the work is not cleverness. It is applying a small number of well-established structural disciplines consistently, and being willing to keep applying them after the code already works.
The line that does most of the work:
Code is read far more often than it is written, and almost always by someone with less context than the author had. Optimise for the reader who arrives in six months knowing nothing. If your change makes sense only because you remember why, it is not finished.
The five disciplines
Every recommendation below reduces to one of these. Naming them keeps a review from collapsing into taste.
Single responsibility. A unit should have one reason to change. When you cannot describe a function without "and", it is doing two things, and the two things will need to change on different schedules. Split along the seam where the reasons differ, not where the line count is convenient.
Cohesion over proximity. Things that change together belong together. Code grouped by technical layer (all the controllers here, all the models there) scatters a single feature across the tree, so every change touches five directories. Group by what the code is about.
Explicit dependencies. A unit should declare what it needs rather than reach for it. Constructor parameters and function arguments are declarations; module-level singletons, global config and ambient state are not. The test for this is whether the unit can be exercised without standing up its whole world.
Names that survive being read alone. A name is the only documentation that cannot go
stale, because changing the code without changing the name is visible. Prefer a longer name
that is accurate to a short one that is approximately right. elapsed_ms beats t.
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 First seen · 192 lines · 68 tokens per session scan A b76477aed764
clean-code is a skill published in the GitHub repository rainmanjam/poka-yoke (21 stars, last pushed 8d ago), licensed MIT. It adds 68 tokens to every session and 2,161 once invoked, about $0.0003 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
anchor.noise
噪声卡管理——运行时失败积累为结构化知识:创建(唯一代码内钩子)/列出/搜索/解决转回归测试.
anchor-noise
噪声卡管理——运行时失败积累为结构化知识:创建(唯一代码内钩子)/列出/搜索/解决转回归测试.
anchor.judge
执行角色——审查(§15/§16 参考实现):检查产物证据/置信度/完整性,只出审查意见不改 status,confirmed 留给宿主人类.
anchor.scan
静态审查——跑 scanner 找 P1-P6 防御性模式,按 ERR/WARN/INFO 分级处理 findings(§6),疑似误报转 anchor.challenge.
anchor-worker
执行角色——模块实施(§15.1 参考实现):按批准规范与计划实现单个模块(代码 + @anchor 标注 + 自测),产物落盘并提交并入申请给 Judge.
anchor.degrade
降级验证(§9)——代码不可独立编译时分类 Full/Partial/Degraded,登记 uncompilablefunctions,遵守证据饱和 retry cap(3 轮无新数据层证据).