| name | tree-node |
| version | 0.1.0 |
| description | 将当前对话轮次提炼为一个节点,追加到对话树 tree.json。用于记录对话中站住脚的结论。 |
| allowed-tools | Read, Write |
将当前对话轮次提炼为一个节点,追加到当前目录的 tree.json。
步骤
- 尝试 Read
./tree.json
- 如果文件不存在,自动创建初始结构:
{
"meta": { "created": "<当前ISO时间>", "current": "root" },
"nodes": [{ "id": "root", "parent": null, "label": "起点", "conclusion": "", "timestamp": "<当前ISO时间>", "context": "" }]
}
- 回顾当前对话最近 5-10 轮,提炼核心结论:
label:不超过 10 个汉字(或 20 个英文字符),准确优先于简洁
conclusion:完整表达结论,不限长度,用于喂给 AI 恢复上下文
context(可选):该结论产生的背景,一句话即可
- 父节点 ID =
meta.current
- 新节点 ID =
n + nodes 数组当前长度(例如数组有 3 个元素则新 ID 为 n3)
- 追加新节点到
nodes 数组,更新 meta.current 为新节点 ID
- Write 写回
./tree.json(2 空格缩进)
- 输出确认:
✓ 节点已记录
标签:{label}
结论:{conclusion}
挂载:{parent.label} ({parent.id})
注意
- 如果当前对话没有可提炼的明确结论,告知用户并询问是否继续
- 不要修改已有节点的任何字段
- timestamp 使用当前 ISO 8601 时间