codet-pi-note-sync
Pi Coding Agent 扩展:统一笔记沉淀。① /note-sync list 列出 session;② /note-sync export <key> 把 1 个或多个 session 整理成结构化 Markdown 草稿落到临时目录;③ /note-sync(无参)路由到 note-sync skill,由 AI 判断该沉淀什么、提示落盘位置。与 notes/项目管理 git 笔记目录协作:正式内容落 git 笔记(正本),插件只提供机制,行为规则全在 skill。
Package details
Install codet-pi-note-sync from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:codet-pi-note-sync- Package
codet-pi-note-sync- Version
1.0.2- Published
- Aug 20, 2026
- Downloads
- 476/mo · 6/wk
- Author
- zhaozhiwei1992
- License
- MIT
- Types
- extension, skill
- Size
- 23.8 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions"
],
"skills": [
"./skills"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
codet-pi-note-sync
Pi Coding Agent 扩展:统一笔记沉淀。让"AI 的记忆/记录"与用户自己的 git 笔记目录(~/workspace/notes 与 ~/workspace/项目管理)协作——正本落在 git 笔记,插件只提供机制(读 session、生成整理草稿、路由 skill)。
定位
- 正本在 git 笔记:项目方案/踩坑/决策 →
~/workspace/项目管理/开发文档/<项目>/;通用技术 →~/workspace/notes/编程/<分类>/。 - 插件只当机制:负责从 session 提素材(
export)、列清单(list)、把"该沉淀什么"的判断交给 note-sync skill。 - pi 记忆只留指针:AI 偏好 +
结论见 <路径>一行指针即可,不塞正式内容。
命令
| 命令 | 作用 |
|---|---|
/note-sync |
无参 → 路由到 note-sync skill,让 AI 判断当前会话该沉淀什么、提示落盘位置 |
/note-sync list |
列出当前工作目录下的 session(含当前会话),供挑选导出 |
/note-sync export <key> |
把 1 个或多个 session 整理成结构化 Markdown 草稿,写到 ~/.config/pi/agent/note-sync-exports/ |
export 的 key:
current— 当前会话<序号>— 按list展示的序号(1..n)<sessionId 前缀>— 按 id 前缀匹配all— 当前目录全部会话
注意:export 只生成"归纳素材"草稿,不是最终笔记。最终整理由 note-sync skill / 用户完成,之后落到 git 笔记并删除草稿。
设计原则(同 codet-pi-plan)
- 扩展只管机制,行为规则(什么值得记、落到哪个目录、org 模板、主动提示落盘)全在
skills/note-sync/SKILL.md。 - 非触发状态不干预:不拦截工具、不改 systemPrompt。
- 只读 session,绝不修改/清理用户会话。
安装
- 克隆到本地,
npm install。 - 在
~/.config/pi/agent/settings.json的packages里加入路径(依赖内部 Nexus registry 解析 peer 依赖)。 - 重启 pi,测试
/note-sync list。
开发
npm run typecheck— 类型门禁(与 codet-pi-plan 一致:纯插件无 bin,不需 build,pi 自带 TS loader)。
目录结构
codet-pi-note-sync/
├── extensions/note-sync.ts # 三条命令:list / export / 无参路由 skill
├── extensions/index.ts # 目录型扩展入口
├── skills/note-sync/SKILL.md # 行为规则:资料库定位、触发、流程、决策表
├── templates/note.org.template # 新建笔记的 org 模板
└── PLAN-note-sync.md # 本项目的实施计划