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 jtsang4/efficient-coding --skill diffusion-mapgit clone --depth 1 https://github.com/jtsang4/efficient-codingWrote 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/jtsang4/efficient-coding/diffusion-map)<a href="https://agentmods.dev/skills/jtsang4/efficient-coding/diffusion-map"><img src="https://agentmods.dev/badge/skills/jtsang4/efficient-coding/diffusion-map/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/jtsang4/efficient-coding/diffusion-map"><img src="https://agentmods.dev/badge/skills/jtsang4/efficient-coding/diffusion-map.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.00101 | $0.01638 |
| Opus 5.5 | $0.00040 | $0.00655 |
| Sonnet 5.5 | $0.00020 | $0.00328 |
| Haiku 4.5 | $0.00010 | $0.00164 |
Grade A, and why
diffusion-map 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 7d 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 — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
扩散图谱
进入这个模式后,你同时做两件事:
- 和用户正常对话:讲解、讨论、追问。这仍然是主要工作,质量不能因为维护图谱而打折。
- 维护一张扩散图谱:从几个支柱出发,随着对话把信息结构向外生长、重组。图谱是对话的副产品,由你主动判断何时增长、怎么调整,不需要等用户下指令。
图谱存放在 ~/.efficient-coding/diffusion/maps/<slug>/,跨会话、跨 Agent 都能继续。用户在本地网页上看它实时生长,点开节点可以回看当时的对话。
准备
- 这个 skill 目录记为
SKILL_DIR。只需要 Bun:不用bun install,也没有任何构建步骤。网页的界面库和字体由浏览器从 CDN 加载。 - 下文的
dm都指bun "$SKILL_DIR/scripts/dm.ts"。不要 cd 到 skill 目录再执行,保持在当前工作目录直接调用,这样会话的 cwd 才会记录正确。 - 当前会话(Claude Code 或 Codex)由 CLI 从环境变量中自动识别。所有改动图谱的命令都会自动把当前会话关联到受影响的节点,不需要你手动处理 session id。
开场
- 执行
dm maps,看有没有与本次主题相符的图谱。 - 继续已有图谱:执行
dm show -m <slug>读取大纲。用两三句话说明目前的进展(支柱有哪些、哪些已经稳定、frontier 还有哪些),给出 2–3 个可以继续的方向,然后顺着用户的选择往下聊。 - 新建图谱:
- 弄清用户的意图。意图清楚就不要追问;不清楚最多问一个问题。
- 设计这张图的 lens:支柱代表什么、有哪些节点类型、状态用哪些词、节点之间有哪几种关系。lens 没有固定模板,按这次的意图来定。设计方法和示例见 references/protocol.md。
- 提议 3–7 个支柱,每个用一句话说明为什么它是支柱。和 lens 一起交给用户确认,按用户的调整修改。
- 确认后执行
dm new,再用一次dm apply写入支柱。
- 执行
dm serve -m <slug>,把网址告诉用户(本机地址,以及同一网络下其他设备可用的地址)。服务已经在运行时,这条命令只打印网址;服务连续 30 分钟没有被访问会自动退出,下次调用再启动即可。用户只想本机访问时,加--host 127.0.0.1。
每一轮对话
先把这一轮的对话做好,然后问自己:这一轮之后,信息结构应该变成什么样?
- 生长:某个点被实质性地讲清楚了,就作为节点挂到最合适的父节点下。只是提到、还没有展开的点,用 lens 里
open语气的状态加进来,作为后续可以扩散的方向。 - 调整:发现两个节点其实是同一件事,就合并;层级放错了,就移动;之前的理解有误,就修改摘要或状态;不同分支之间存在关系,就连一条边。
- 状态推进:用户表现出已经理解、已经拍板,或者已经否决,就更新状态。
- 登记讨论:这一轮讨论到了已有节点,但结构没有变化,就用
touch记录,这样网页上能从这些节点找到这次对话。
一轮里的所有变化,用一次 dm apply 提交,格式见 references/cli.md。不需要每轮都改:纯闲聊,或者只是在复述已有内容时,什么都不做。
在对话里,图谱的更新最多用一句话带过,比如"图谱:新增『借用检查』,并入『生命周期』"。不要把记账过程展开给用户看。
什么时候先和用户确认
大多数调整直接做。下面这些影响大的改动,先说明再动手:
- 增加、删除或更换支柱;
- 删除一棵子树,或者删除已经关联了会话的节点(
remove --cascade); - 修改 lens(
dm lens),比如新增或删除节点类型、修改状态体系。
拿不准结构该怎么组织时,也可以直接问用户,比如"这个更像 A 的一部分,还是一个独立的支柱?"
用户主动要求时
用户说"展开这个""把 X 拆开""这两个合并""删掉这块"时,照做。展开节点就是围绕它讲解,然后把讲到的内容按上面的规则长进图谱。
删除图谱
用户可以自己在网页的图谱列表页删除(卡片上的删除按钮,带确认)。在对话里,只有用户明确要求时才删除整张图谱(例如快照占用空间太大,或者主题已经不需要了):
- 先执行
dm delete -m <slug>预览,它会列出节点数、关联对话数和占用空间,但不会删除任何东西; - 把预览结果告诉用户,确认后再执行
dm delete -m <slug> --yes。
What ships with it
42 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.
- .gitignore 32 B
- agents/openai.yaml 281 B
- bun.lock 1.8 KB
- evals/evals.json 3.3 KB
- evals/visual/capture.ts 13 KB runs code
- evals/visual/fixture-kit.ts 3.5 KB runs code
- evals/visual/fixtures-en.ts 20 KB runs code
- evals/visual/fixtures.ts 30 KB runs code
- evals/visual/readme-shots.ts 3.6 KB runs code
- evals/visual/rubric.md 2.0 KB
- package.json 403 B
- references/cli.md 3.3 KB
- references/data-model.md 3.1 KB
- references/protocol.md 5.5 KB
- scripts/dm.ts 15 KB runs code
- scripts/lib/model.ts 8.3 KB runs code
- scripts/lib/outline.ts 2.8 KB runs code
- scripts/lib/server-info.ts 2.0 KB runs code
- scripts/lib/session.ts 3.9 KB runs code
- scripts/lib/store.test.ts 6.0 KB runs code
- scripts/lib/store.ts 16 KB runs code
- scripts/lib/transcripts.test.ts 8.5 KB runs code
- scripts/lib/transcripts/parse.ts 5.7 KB runs code
- scripts/lib/transcripts/sync.ts 3.2 KB runs code
- scripts/server.test.ts 5.1 KB runs code
- scripts/server.ts 10 KB runs code
- tsconfig.json 344 B
- web/index.html 2.5 KB
- web/js/api.js 2.2 KB runs code
- web/js/format.js 1.3 KB runs code
- web/js/home.js 4.7 KB runs code
- web/js/i18n.js 8.4 KB runs code
- web/js/icons.js 2.3 KB runs code
- web/js/layout.js 9.9 KB runs code
- web/js/main.js 1.7 KB runs code
- web/js/map-view.js 21 KB runs code
- web/js/markdown.js 707 B runs code
- web/js/palette.js 2.9 KB runs code
- web/js/panel.js 11 KB runs code
- web/js/renderer.js 60 KB runs code
- web/js/shell.js 3.3 KB runs code
- web/styles.css 31 KB
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.
- 7d ago Changed 8831c545c2c2
- 9d ago First seen · 83 lines · 101 tokens per session scan A f7a5cc7b9dd1
diffusion-map is a skill published in the GitHub repository jtsang4/efficient-coding (2 stars, last pushed 8d ago), licensed MIT. It adds 101 tokens to every session and 1,638 once invoked, about $0.0004 per session on Opus 5.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-10-11.
Other skills, from other repositories
plugin-creator
Create and scaffold plugin directories for Codex with a required .codex-plugin/plugin.json, optional plugin folders/files, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries…
cw-gates
Use before claiming any Codewhale change is done, green, or ready to land: the focused-to-broad verification ladder, the budget checks CI enforces, and the rules for what counts as a passing test.
eval-dataset-design
A guide to creating reliable test sets for AI agents. Each evaluation task includes the request, the simulated user's behaviour, a reset starting state, and a success check that can be independently verified.
memory-system
A guide to giving an AI agent persistent, user-specific memory across conversations. It covers what to remember, how to store it, how to update or compress it, and when to use memory instead of a shared knowledge base.
feishu
Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.
interview
Ask one useful structured question at a time only when material product/implementation choices are genuinely missing; remember answers and produce a brief/spec. Discoverable facts should be investigated instead of asked.