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 ryanzhao1011/workframe --skill librariangit clone --depth 1 https://github.com/ryanzhao1011/workframeWrote 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/ryanzhao1011/workframe/librarian)<a href="https://agentmods.dev/skills/ryanzhao1011/workframe/librarian"><img src="https://agentmods.dev/badge/skills/ryanzhao1011/workframe/librarian/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/ryanzhao1011/workframe/librarian"><img src="https://agentmods.dev/badge/skills/ryanzhao1011/workframe/librarian.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.00176 | $0.09530 |
| Opus 5.5 | $0.00070 | $0.03812 |
| Sonnet 5.5 | $0.00035 | $0.01906 |
| Haiku 4.5 | $0.00018 | $0.00953 |
Grade A, and why
librarian 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 26d 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 — 338 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Librarian 记忆整理技能
6 步整理流程
第 1 步:读取状态(动态角色发现 + shared 特殊角色)
先处理 shared/(第 0 号"特殊角色"):
Read .workframe/agent-memory/shared/MEMORY.md(跨角色权威事实;不存在则跳过)
Read .workframe/agent-memory/shared/notes.md(共享缓冲;不存在则跳过)
shared 层的整理规则与 role 层一致(D/U/R/A 评估、容量管理、快照保存),但写入条件更严:
- 提升到
shared/MEMORY.md必须满足"影响 ≥2 个角色" + D/U/R/A ≥2 项(主 Claude 不计入角色数,理由见 2b 三问第 3 问) - 单条压缩到 ≤200 字符。shared 是各 subagent 启动时全量注入的——每加一句,此后每次委派都要付一次 token;判据是「这句删掉,另一个域的人会不会做错事」,答否就删。展开论证留在
shared/notes.md或权威文档,MEMORY 只留结论 - shared 变更在整理日志中单列(与 role 层变更分开列,标明「本轮 shared 新增/修改 N 条」+ 逐条一行摘要),供用户事后复核。不逐条弹确认——已有「≥2 消费域 + D/U/R/A ≥2 + ≤200 字符」三道门槛,再加人工确认属于冗余打扰
- 冲突以
shared/MEMORY.md为权威,role MEMORY 中的同类条目降级为 notes
再动态发现项目中其他角色:
用 Glob 扫描 .workframe/agent-memory/*/ 得到所有子目录,排除 shared
例如返回:[pm, dev, qa, prompt-eng](core 默认)
[pm, dev, qa, prompt-eng, ceo, designer, ...](项目级扩展)
对发现的每个角色 <role>,读取其记忆文件:
.workframe/agent-memory/<role>/MEMORY.md
.workframe/agent-memory/<role>/notes.md
统计每个 MEMORY.md 的当前字符数(预算:role ≤8000 字符 / shared ≤4000 字符——字符才反映注入开销,行数可被单行超长钻空)。
为什么动态发现:core plugin 提供 4 通用角色(pm/dev/qa/prompt-eng),项目可手动在 .claude/agents/ 和 .workframe/agent-memory/ 下新增项目级角色(如 ceo、designer、content-operator 等)。Librarian 必须覆盖所有角色,因此不能硬编码列表。
第 2 步:评估 notes.md + 决定落点
2a. D/U/R/A 准入评估
遍历每个角色的 notes.md 中的微反思条目,跳过下列两类已结案条目:
- 标注
→ 已提升至 X的(本 SOP 自己提升过的) - 标注
→ 已被 {日期} 纠正取代的(correction-detection第 3 步 supersede 时移进来的 历史留档)——它们是被推翻的旧口径,重新提升等于把用户纠正过的错误再送回高置信区 - Durability:30 天后还重要?
- Uniqueness:目标落点中尚未记录?
- Retrievable:未来需要回忆?
- Authority:来源可靠?
满足 ≥2 项 → 标记为"待提升"。
单人/小团队项目的判定口径:用户当面拍板的偏好,Authority 已满分,不要因为"是否对所有人普适"而压低评分——这类知识库只服务当前用户,普适性不是准入条件。历史上大量高价值偏好因这条误判滞留在 notes(实测某项目 181 行 notes 里全是可执行规则,却因自设"需多次验证"门槛从未提升)。
2b. 落点分层决策
MEMORY.md 不是唯一落点。按知识性质选:
| 落点 | 判据 | 加载时机 | 预算 | 权限 |
|---|---|---|---|---|
| 机器闸(断言 / 校验脚本 / hook) | 判定是确定性的、能从文件系统或代码现算出来 | 运行时触发 | 不占上下文 | L2 用户审批(代码变更) |
context/both/ |
每次会话必须遵守,主会话与 subagent 都要 | 两个 hook 各注一次 | 每个字符付两遍;实际上限由 sub 片决定 | L2 用户审批 |
context/main/ |
每次会话必须遵守,只有主会话要(假定能问用户 / 能派发) | SessionStart | 主片余量 | L2 用户审批 |
context/sub/ |
每次会话必须遵守,只有 subagent 要 | SubagentStart | 余量最紧 | L2 用户审批 |
AGENTS.md |
项目自有判据,两个 harness 都读 | Codex 原生 / CC 经桥接 | 无硬闸、但单位成本最高:没有那种静默截断(项目可覆盖文档大小上限),但 Codex 侧每个字符付两遍(上下文里出现两次)。别把「无硬上限」读成「免费」 | L2 用户审批 |
项目 skill(.claude/skills/<name>/) |
场景触发且成套的操作方法——特定场景才需要、一到场景就要整套用(SOP / 口径集 / 模板 / 清单) | 场景命中按需加载 | 无硬上限(不占每会话预算) | L2 用户审批(core plugin skill 不直接改,走 self-iteration 提案) |
<role>/MEMORY.md |
角色特有的高置信事实 | 该 subagent 被调度时 | 见 doctor 的 memory_capacity 检查 |
L1 自主 |
shared/MEMORY.md |
影响 ≥2 角色的权威事实 | 各 subagent 启动时 | 见 doctor 的 memory_capacity 检查 |
L1 自主(写入条件更严);agent / 主 Claude 不直写——它们写 shared/notes.md,由本 skill 评估提升(对比上一行:role MEMORY 满足 D/U/R/A ≥2 可由角色直写,两行的「L1 自主」含义不同) |
| auto-memory(CC 官方主 Claude 记忆目录) | 主 Claude 层内容:用户偏好 / 协作习惯 / 项目状态指针——消费者是主 Claude 而非某个角色 | 主会话启动(官方注入,subagent 不注入) | 见 doctor 的 auto_memory 检查 |
主 Claude 自维护;librarian 不写——识别到此类条目时在结果中建议归 auto-memory |
| 保留 notes | 未定型 / 场景太具体 / 待验证 | 不加载 | — | — |
| 移出记忆体系 | 属业务知识(竞品分析、方案论证、领域事实)→ 应进需求文档 / spec,不是记忆 | — | — | L2 |
What ships with it
3 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.
- 26d ago Changed · +19 lines · +121 tokens per session scan B → A aab0847693cb
- 1mo ago First seen · 319 lines · 55 tokens per session scan B d78ab59b5e31
librarian is a skill published in the GitHub repository ryanzhao1011/workframe (7 stars, last pushed 28d ago), licensed MIT. It adds 176 tokens to every session and 9,530 once invoked, about $0.0007 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-08-31.
Other skills, from other repositories
decision-ledger
Maintain an append-only decision ledger (DECISIONS.md). Use when the user confirms a decision, reverses or changes a past decision, asks what was decided and why, or at session start to load standing decisions.
pin
Turn a correction or working preference the user just expressed into a permanent ballast rule. Use when the user corrects your behavior, says "don't do X" / "always do Y" / "I told you before", or asks you to remember how they want things done.
knowledge-base
Keep verified findings in memory/knowledge/ so the same research is never done twice. Use before researching any topic, when a finding passes the verify gate, or when about to answer from something learned in an earlier session.
catchup
Restore context after /clear by summarizing recent work and project state.
setup
Scaffold the handoff project-memory system into THIS repository (new or existing) — copies the template tree into .handoff/, then runs a guided discovery pass that drafts a real STATUS, MAP, TECHSTACK, and PRODUCT from the actual codebase and confirms with the user before saving. Use when the user says "set up…
recall
Sweep everything the project already holds before answering — at the first message of a session, and again whenever the subject shifts to something the current thread was not about. Use before replying, not only before researching.