project-knowledge-harness
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseproject-knowledge-harness
项目知识管理工具
A lightweight, file-based memory harness for any software project.
Three surfaces, sharply separated by time direction and access pattern:
| Surface | Time | Question it answers | Access pattern |
|---|---|---|---|
| Future | "What might we do later?" | Read top to bottom (priority lanes) |
| Future | "What was the analysis behind this idea?" | Indexed from |
| Past | "I see error X — has this happened before?" | Grep symptom keywords |
Plus, in projects that already have agent contracts, Hard
invariants answer "What rules MUST agents follow?". Pitfalls graduate to
Hard invariants when serious enough — see
.
AGENTS.mdreferences/when-to-add-docs.md一个适用于任意软件项目的轻量级、基于文件的记忆管理体系。
三个核心模块,按时间维度和访问模式明确区分:
| 模块 | 时间维度 | 解决的问题 | 访问模式 |
|---|---|---|---|
| 未来 | "我们之后可能要做什么?" | 从上到下阅读(按优先级分区) |
| 未来 | "这个想法背后的分析依据是什么?" | 从 |
| 过去 | "我遇到了错误X——之前发生过吗?" | 通过症状关键词grep检索 |
此外,对于已存在Agent契约的项目,中的硬规则用于回答"Agent必须遵循哪些规则?"。当问题陷阱足够严重时,会升级为硬规则——详见。
AGENTS.mdreferences/when-to-add-docs.mdWhen to use this skill
何时使用该工具
Use this skill when the user surfaces any of:
- A long-term TODO list with no home, or a messy that needs structure (signals: "where should ideas go?", "maybe later", "工程量太大需要再評估")
TODO.md - A debugging session worth saving (signals: "keep solving the same problem twice", "save this troubleshooting", "踩過的坑", "TROUBLESHOOTING.md scattered across docs/")
- A request to consolidate /
IDEAS.md/ROADMAP.md/WISHLIST.mdfilesLESSONS.md
Do NOT use this skill for active sprint planning (use issue trackers),
ephemeral agent scratchpads (use ), or current feature
documentation (use ).
.claude/plans/docs/当用户出现以下任一需求时,即可使用该工具:
- 长期待办事项列表无合适存储位置,或杂乱无章需要结构化整理(信号:"想法应该存在哪里?"、"以后再考虑"、"工程量太大需要再评估")
TODO.md - 值得留存的调试会话(信号:"重复解决同一问题"、"保存本次故障排查记录"、"踩过的坑"、"TROUBLESHOOTING.md分散在docs/目录下")
- 需要合并/
IDEAS.md/ROADMAP.md/WISHLIST.md等文件的请求LESSONS.md
请勿将该工具用于:活跃的迭代规划(使用问题追踪器)、Agent临时草稿(使用)、当前功能文档(使用)。
.claude/plans/docs/How to apply this skill (default workflow)
如何使用该工具(默认工作流)
The skill bundles five scripts and several templates. Default to the
init script for setup, and default to /
for capture rather than asking the agent to edit by hand.
add-todo.shsweep-inbox.shTODO.mdscripts/
init.sh # one-shot setup of TODO.md + backlog/ + pitfalls/
# + agent guidance + README snippet
todo-kanban.sh # validate TODO.md format and render kanban-style board
add-todo.sh # insert a structured entry into the right ## P* lane
promote-todo.sh # move an active TODO item to ## Done with the right syntax
sweep-inbox.sh # triage backlog/inbox.md into TODO.md via add-todo.sh该工具包含5个脚本和多个模板。默认使用init脚本完成初始化,默认使用 / 记录内容,而非手动编辑。
add-todo.shsweep-inbox.shTODO.mdscripts/
init.sh # 一键搭建 TODO.md + backlog/ + pitfalls/
# + Agent指引 + README片段
todo-kanban.sh # 验证TODO.md格式并渲染看板样式视图
add-todo.sh # 将结构化条目插入对应的## P*分区
promote-todo.sh # 将活跃的TODO项移动到## Done分区,使用正确语法
sweep-inbox.sh # 通过add-todo.sh将backlog/inbox.md中的内容分类整理到TODO.md1. Run scripts/init.sh
against the target repo
scripts/init.sh1. 针对目标仓库运行scripts/init.sh
scripts/init.shsh
scripts/init.sh \
--target /path/to/project \
--project-name "My Project" \
--deployment chezmoi # or npm | pip | docker | noneThe script:
- Creates ,
TODO.md,backlog/README.mdfrompitfalls/README.md, substituting placeholders.assets/*.template - Appends an agent-guidance snippet to /
AGENTS.md(auto-detected, override withCLAUDE.md).--agent-contract - Appends a "Roadmap & lessons learned" section to .
README.md - Runs so any drift is caught immediately.
scripts/todo-kanban.sh --validate-only TODO.md - Prints the deployment-exclusion lines you should add manually (it does
not edit ignore files — see
).
references/deployment-exclusion.md
init.sh--forcesh
scripts/init.sh \
--target /path/to/project \
--project-name "My Project" \
--deployment chezmoi # 或 npm | pip | docker | none该脚本会执行以下操作:
- 从创建
assets/*.template、TODO.md、backlog/README.md,替换占位符内容。pitfalls/README.md - 将Agent指引片段追加到/
AGENTS.md(自动检测,可通过CLAUDE.md覆盖)。--agent-contract - 将"路线图与经验总结"部分追加到。
README.md - 运行,立即捕获任何格式偏差。
scripts/todo-kanban.sh --validate-only TODO.md - 打印需手动添加的部署排除规则(不会自动编辑忽略文件——详见)。
references/deployment-exclusion.md
init.sh--force2. Mid-conversation, when the user surfaces a "maybe later" idea
2. 对话过程中,当用户提出「以后再考虑」的想法时
Signals: "maybe later", "nice to have", "if I'm interested",
"工程量太大需要再評估", "先記下來", "not now but…".
-
Ifdoesn't exist yet, run
TODO.mdfirst.scripts/init.sh -
Default path — callwith the priority, effort, title, and description. This inserts the canonical line into the right
scripts/add-todo.shlane and re-validates. Add## P*if the conversation produced enough investigation that a--backlogdoc is worth scaffolding.backlog/<slug>.mdshscripts/add-todo.sh --priority "P?" --effort M \ --title "Try Rspress for docs" \ --description "Evaluate AI-native docs framework alternative" -
Quick-capture path — append towhen the user isn't sure of priority/effort yet, or is mid-thought:
backlog/inbox.mdshecho "- $UNSTRUCTURED_THOUGHT" >> backlog/inbox.mdLater (this session or next), runto formalize the loose lines intoscripts/sweep-inbox.shone at a time. The sweeper prompts for missing fields per line; inTODO.mdmode it only processes lines that already have--batchpairs and leaves ambiguous ones in place.priority=… effort=… title="…" description="…" -
Manual edit path — only when scripts can't help. Use the syntax fromand run
references/tag-schema.mdafterwards.scripts/todo-kanban.sh --validate-only -
If you wrote a(either via
backlog/<slug>.mdor by hand), make sure the TODO line ends with--backlogso the index points to the doc.→ [research](backlog/<slug>.md)
信号:"以后再考虑"、"锦上添花的功能"、"如果我感兴趣的话"、"工程量太大需要再评估"、"先记下来"、"现在不做但…"。
-
如果尚未存在,先运行
TODO.md。scripts/init.sh -
默认流程——调用,传入优先级、工作量、标题和描述。该脚本会将标准条目插入对应的
scripts/add-todo.sh分区并重新验证格式。如果对话中产生了足够多的调研内容,值得生成## P*文档,则添加backlog/<slug>.md参数。--backlogshscripts/add-todo.sh --priority "P?" --effort M \ --title "Try Rspress for docs" \ --description "Evaluate AI-native docs framework alternative" -
快速记录流程——追加到,当用户不确定优先级/工作量,或正处于思考过程中时使用:
backlog/inbox.mdshecho "- $UNSTRUCTURED_THOUGHT" >> backlog/inbox.md之后(本次会话或下次会话),运行将零散的条目逐一整理到scripts/sweep-inbox.sh中。整理工具会逐行提示补充缺失的字段;在TODO.md模式下,仅处理已包含--batch的条目,将模糊的条目保留在原文件中。priority=… effort=… title="…" description="…" -
手动编辑流程——仅在脚本无法处理时使用。使用中的语法,之后运行
references/tag-schema.md验证格式。scripts/todo-kanban.sh --validate-only -
如果生成了(通过
backlog/<slug>.md参数或手动创建),确保TODO条目末尾包含--backlog,以便索引指向该文档。→ [research](backlog/<slug>.md)
3. Mid-conversation, when you finish debugging something tricky
3. 对话过程中,当完成复杂的故障排查时
Signals: "phew, that took a while", "weird, the error didn't say anything
about X", "this is the third time we've hit this", or you find yourself
reconstructing context that isn't in any doc.
- Create immediately from
pitfalls/<symptom-slug>.md, while the trace is fresh. Title the doc by the symptom, not the root cause — you'll search by what you're seeing, not by what you eventually learned.assets/pitfall-doc.md.template - Copy verbatim error messages — never paraphrase, it kills grep-ability.
- If the trap is severe (silent corruption / cross-machine recurrence /
non-obvious workaround), surface it: "should this graduate to a Hard
invariant in AGENTS.md?" — see
.
references/when-to-add-docs.md
信号:"呼,终于搞定了"、"奇怪,错误信息完全没提到X"、"这是第三次遇到这个问题了",或是你发现自己正在重构文档中未记录的上下文。
- 立即从创建
assets/pitfall-doc.md.template,趁记忆清晰时记录。文档标题应以症状命名,而非根本原因——你会根据当前看到的现象搜索,而非最终发现的原因。pitfalls/<symptom-slug>.md - 直接复制错误信息——切勿改写,否则会破坏grep检索能力。
- 如果问题陷阱非常严重(静默数据损坏/跨机器复现/非直观的解决方案),请提出:"是否应将其升级为AGENTS.md中的硬规则?"——详见。
references/when-to-add-docs.md
4. When implementing a TODO.md
item
TODO.md4. 当实现TODO.md
中的条目时
TODO.mdIn the same commit:
- Run . It removes the active line and inserts the dated
scripts/promote-todo.sh --title "<substring>" --summary "<what shipped>"entry, then re-validates. It refuses to run if the substring matches zero or more than one active item.Done - If a exists, set its
backlog/<slug>.md(don't delete — historical record may inform adjacent decisions).Status: shipped - If shipping uncovered a trap, write a for it.
pitfalls/<slug>.md
在同一个提交中:
- 运行。该脚本会移除活跃条目并插入带日期的
scripts/promote-todo.sh --title "<substring>" --summary "<what shipped>"条目,然后重新验证格式。如果子字符串匹配0个或多个活跃条目,脚本会拒绝执行。Done - 如果存在,将其
backlog/<slug>.md设置为Status(请勿删除——历史记录可能为相关决策提供参考)。shipped - 如果发布过程中发现新的问题陷阱,编写对应的。
pitfalls/<slug>.md
When a TODO entry needs a backlog/
doc, when a debug needs a pitfalls/
doc
backlog/pitfalls/何时为TODO条目创建backlog/
文档,何时为调试记录创建pitfalls/
文档
backlog/pitfalls/Decision rules and the upgrade path to invariants live in
. Read it
the first time you set up the harness; consult it again whenever you're
unsure which surface a piece of knowledge belongs in.
AGENTS.mdreferences/when-to-add-docs.md决策规则以及升级为硬规则的路径详见。首次搭建该管理体系时请阅读;每当不确定某条知识应归属哪个模块时,可再次查阅。
AGENTS.mdreferences/when-to-add-docs.mdTag schema
标签 schema
Two orthogonal axes, validated by . See
for the full schema,
useful tag combinations, and the exact validator-checked syntax.
scripts/todo-kanban.shreferences/tag-schema.md两个正交维度,由验证。完整schema、实用标签组合以及验证器检查的精确语法详见。
scripts/todo-kanban.shreferences/tag-schema.mdAnti-patterns
反模式
Common mistakes to avoid (e.g., spawning alongside ,
titling pitfalls by root cause, paraphrasing errors). Full list in
.
IDEAS.mdTODO.mdreferences/anti-patterns.md需避免的常见错误(例如:在之外创建、以根本原因命名问题陷阱文档、改写错误信息)。完整列表详见。
TODO.mdIDEAS.mdreferences/anti-patterns.mdDeployment exclusion
部署排除规则
TODO.mdbacklog/pitfalls/references/deployment-exclusion.mdscripts/init.sh --deployment ...TODO.mdbacklog/pitfalls/references/deployment-exclusion.mdscripts/init.sh --deployment ...Templates and bundled assets
模板与内置资源
- —
assets/TODO.md.templateskeleton with example items per laneTODO.md - —
assets/backlog-README.md.templateindex + when-to-add rulesbacklog/ - — single backlog doc (context-first)
assets/backlog-doc.md.template - —
assets/pitfalls-README.md.templateindex + cross-reference table for traps documented elsewherepitfalls/ - — single pitfall doc (symptom-first)
assets/pitfall-doc.md.template - — snippet for
assets/agent-guidance.md.template/AGENTS.mdCLAUDE.md - — snippet for project
assets/readme-roadmap.md.templateREADME.md - — one-shot setup
scripts/init.sh - — validator + Markdown kanban renderer (also supports
scripts/todo-kanban.shand--json)--validate-only - — structured insert into
scripts/add-todo.shlane;## P*also scaffolds--backlogbacklog/<slug>.md - — atomic active-→-Done move with re-validation
scripts/promote-todo.sh - — triage
scripts/sweep-inbox.sh→backlog/inbox.mdadd-todo.sh
- —
assets/TODO.md.template框架,包含各分区的示例条目TODO.md - —
assets/backlog-README.md.template索引 + 创建规则backlog/ - — 单个待办分析文档(上下文优先)
assets/backlog-doc.md.template - —
assets/pitfalls-README.md.template索引 + 其他文档中记录的问题陷阱交叉引用表pitfalls/ - — 单个问题陷阱文档(症状优先)
assets/pitfall-doc.md.template - — 用于
assets/agent-guidance.md.template/AGENTS.md的片段CLAUDE.md - — 用于项目
assets/readme-roadmap.md.template的片段README.md - — 一键初始化脚本
scripts/init.sh - — 格式验证器 + Markdown看板渲染工具(支持
scripts/todo-kanban.sh和--json参数)--validate-only - — 向
scripts/add-todo.sh分区插入结构化条目;## P*参数可同时生成--backlog框架backlog/<slug>.md - — 将活跃条目原子性地移动到Done分区并重新验证格式
scripts/promote-todo.sh - — 将
scripts/sweep-inbox.sh中的内容分类整理到backlog/inbox.mdadd-todo.sh
Reference implementation
参考实现
A live example of this harness is at
:
daviddwlee84/dotfiles- ,
TODO.md,backlog/directories at repo rootpitfalls/ AGENTS.mdand### Long-term backlog → TODO.md + backlog/sections### Past pitfalls → pitfalls/README.mdsection## Roadmap & lessons learned
该管理体系的实际示例位于:
daviddwlee84/dotfiles- 仓库根目录下的、
TODO.md、backlog/目录pitfalls/ - 中的
AGENTS.md和### Long-term backlog → TODO.md + backlog/章节### Past pitfalls → pitfalls/ - 中的
README.md章节## Roadmap & lessons learned