pi-scenes 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -4
- package/assets/scene-prompts/learning/feynman.md +16 -0
- package/assets/scene-prompts/learning/flashcards.md +17 -0
- package/assets/scene-prompts/learning/socratic.md +14 -0
- package/assets/scene-skills/learning/eli5/SKILL.md +35 -0
- package/extensions/scenes.ts +14 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,17 +59,18 @@ Then `/reload` and `/scene` is live.
|
|
|
59
59
|
/scene evolve auto # toggle auto-apply at session end (opt-in)
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
First run of `/scene` offers to generate the template. It ships with **
|
|
62
|
+
First run of `/scene` offers to generate the template. It ships with **eight preset scenes + common** — a curated best-practice collection (all packages verified on npm/GitHub, 2026-09). v0.6.0 upgrades the presets with a full skill layer: git skill bundles install per scene with object-form resource filters, and research/writing ship vendored starter skills:
|
|
63
63
|
|
|
64
64
|
| Scene | Extensions | Skills | Prompt templates (v0.8) |
|
|
65
65
|
|---|---|---|---|
|
|
66
66
|
| `common` | `npm:pi-scenes`, `npm:pi-carryover` | — (your own dir) | — |
|
|
67
|
-
| `coding` | `npm:pi-lens`, `npm:pi-subagents`, `npm:pi-git-worktree`, `npm:pi-simplify` | `
|
|
67
|
+
| `coding` | `npm:pi-lens`, `npm:pi-subagents`, `npm:pi-git-worktree`, `npm:pi-simplify` | `anthropics/skills` → frontend-design, webapp-testing, mcp-builder | `/pre-commit` |
|
|
68
68
|
| `office` | `npm:pi-docparser` | `anthropics/skills` → docx, pptx, xlsx, pdf, internal-comms | `/doc-from-notes` |
|
|
69
69
|
| `pm` | `npm:pi-web-access`, `npm:pi-goal-x`, `npm:@juicesharp/rpiv-todo`, `npm:@juicesharp/rpiv-ask-user-question` | — | `/prd-skeleton` |
|
|
70
70
|
| `research` | `npm:pi-web-access`, `npm:pi-subagents` | 预置:arxiv-research, openalex-paper-search | `/deep-dive` |
|
|
71
71
|
| `writing` | `npm:pi-web-access` | `anthropics/skills` → doc-coauthoring;预置:humanizer | `/fact-check` |
|
|
72
72
|
| `data` | `npm:pi-docparser`, `npm:pi-mcp-adapter` | — | `/data-audit` |
|
|
73
|
+
| `learning` | `npm:pi-web-access`, `npm:pi-subagents` | 预置:eli5 | `/feynman`, `/socratic`, `/flashcards` |
|
|
73
74
|
|
|
74
75
|
Each preset template is a fixed procedure that forbids step-skipping (e.g. `/pre-commit` = build → test → diff review → commit message, each step ✅/❌ with evidence). After switching scenes, try the scene's template command directly; drop your own `.md` files into `~/.pi/agent/scenes/<name>/prompts/` to add more.
|
|
75
76
|
|
|
@@ -261,6 +262,22 @@ cp ~/.pi/agent/settings.json.scenes-bak ~/.pi/agent/settings.json # restore if
|
|
|
261
262
|
|
|
262
263
|
Before uninstalling, `/scene off` and prune entries you don't want to keep from `packages`/`skills`. `scenes.json` / `scenes-state.json` / the `scenes/` tree are inert leftovers — safe to keep or delete.
|
|
263
264
|
|
|
265
|
+
## Changelog
|
|
266
|
+
|
|
267
|
+
### v0.9.0 (2026-09-23)
|
|
268
|
+
|
|
269
|
+
- **New preset scene: `learning` 📚** (8th preset) — knowledge internalization, verification, and spaced review. Ships `pi-web-access` (learning materials) + `pi-subagents` (parallel multi-perspective study), three workflow templates (`/feynman` four-step internalization, `/socratic` question-only verification, `/flashcards` Q&A+cloze cards with a spaced-repetition schedule), and a vendored `eli5` skill (analogy-first, zero-jargon first pass, 5yo/12yo/adult three-tier explanations)
|
|
270
|
+
- **Preset fix: removed `openclaw/agent-skills` from coding** — verified as an OpenClaw-project-internal workflow library rather than general-purpose coding skills (autoreview hard-codes an OpenAI/Codex preference; handoff is a clipboard-prompt workflow). Its duties were already covered by `pi-simplify` / `pi-subagents`. Lesson recorded: existence verification ≠ positioning verification
|
|
271
|
+
- Full preset audit: 10 npm extensions, 9 anthropics/skills subsets, 3 vendored skills — all verified real and accurately described
|
|
272
|
+
|
|
273
|
+
### v0.8.0 (2026-09-23)
|
|
274
|
+
|
|
275
|
+
- **Scene-scoped prompt templates** — `prompts` field per scene: scene = tools + skills + workflow templates as one unit. Injected via pi's `resources_discover` event: **zero settings writes, templates vanish when you switch away** (unlike packages/skills which land in settings.json)
|
|
276
|
+
- Same-name resolution: your hand-written templates and package templates win over scene presets — user intent beats presets
|
|
277
|
+
- Six preset workflow templates (`/pre-commit`, `/deep-dive`, `/fact-check`, `/prd-skeleton`, `/doc-from-notes`, `/data-audit`), each an explicit step-by-step checklist the model cannot skip
|
|
278
|
+
- Scaffold creates `prompts/` directory skeletons and vendors preset templates idempotently (never overwrites your edits); `/scene status` shows effective templates; switch notification counts template dirs
|
|
279
|
+
- Backward compatible: existing scenes.json without `prompts` behaves exactly as v0.7
|
|
280
|
+
|
|
264
281
|
## Development
|
|
265
282
|
|
|
266
283
|
```bash
|
|
@@ -334,7 +351,7 @@ pi install git:github.com/Feng-H/pi-scenes
|
|
|
334
351
|
/scene evolve auto # 开关:会话结束自动应用(opt-in)
|
|
335
352
|
```
|
|
336
353
|
|
|
337
|
-
首次运行 `/scene` 会询问是否生成模板,生成后编辑场景定义。模板内置
|
|
354
|
+
首次运行 `/scene` 会询问是否生成模板,生成后编辑场景定义。模板内置 **八个预设场景 + 通用层**(包均在 npm 核验存在,2026-09):
|
|
338
355
|
|
|
339
356
|
| 层 | 预设 packages | 理由 |
|
|
340
357
|
|---|---|---|
|
|
@@ -345,8 +362,9 @@ pi install git:github.com/Feng-H/pi-scenes
|
|
|
345
362
|
| `research` | `npm:pi-web-access`、`npm:pi-subagents` | 多源搜索/抓取/PDF/视频,并行多角度深挖 |
|
|
346
363
|
| `writing` | `npm:pi-web-access` | 素材检索与事实核查(引用溯源) |
|
|
347
364
|
| `data` | `npm:pi-docparser`、`npm:pi-mcp-adapter` | 表格结构化抽取、接任意 MCP server(数据库/BI) |
|
|
365
|
+
| `learning` | `npm:pi-web-access`、`npm:pi-subagents` | 学习材料获取、并行多视角学习;预置 skill:eli5(大白话解释) |
|
|
348
366
|
|
|
349
|
-
v0.8
|
|
367
|
+
v0.8 起每个预设场景还携带流程模板(coding→`/pre-commit`、office→`/doc-from-notes`、pm→`/prd-skeleton`、research→`/deep-dive`、writing→`/fact-check`、data→`/data-audit`;v0.9 learning 场景→`/feynman` 费曼内化 + `/socratic` 苏格拉底检验 + `/flashcards` 闪卡复习,三件套),切换后直接可用;自己加模板只需往 `~/.pi/agent/scenes/<名>/prompts/` 丢 `.md` 文件。
|
|
350
368
|
|
|
351
369
|
每个场景同时生成 skill / prompts 目录骨架 `~/.pi/agent/scenes/<名>/{skills,prompts}/`,按需编辑:
|
|
352
370
|
|
|
@@ -529,6 +547,22 @@ cp ~/.pi/agent/settings.json.scenes-bak ~/.pi/agent/settings.json # 如需恢
|
|
|
529
547
|
|
|
530
548
|
managed 注入的条目在卸载前建议先 `/scene off` + 手工清理 `packages`/`skills` 里不想保留的条目;`scenes.json` / `scenes-state.json` / `scenes/` 目录留着不影响 pi 运行。
|
|
531
549
|
|
|
550
|
+
## 版本历史
|
|
551
|
+
|
|
552
|
+
### v0.9.0(2026-09-23)
|
|
553
|
+
|
|
554
|
+
- **新增预设场景 `learning` 📚**(第八个)——知识内化、检验、间隔复习。携带 `pi-web-access`(学习材料)+ `pi-subagents`(并行多视角学习)、三个流程模板(`/feynman` 费曼四步内化、`/socratic` 只问不讲的苏格拉底检验、`/flashcards` Q&A+填空双卡型配间隔复习排程)、vendored 技能 `eli5`(类比先行、零术语首过、5 岁/12 岁/成人三档递进)
|
|
555
|
+
- **预设修正:coding 场景移除 `openclaw/agent-skills`**(随本版发布)——核验其为 OpenClaw 项目内部工作流库而非通用编码技能(autoreview 硬编码 OpenAI/Codex 偏好;handoff 是剪贴板提示词流程),其职责已由 `pi-simplify` / `pi-subagents` 覆盖。教训:存在核验 ≠ 定位核验
|
|
556
|
+
- 全预设体检:npm 扩展×10、anthropics/skills 子集×9、vendored×3,全部真实存在且描述如述
|
|
557
|
+
|
|
558
|
+
### v0.8.0(2026-09-23)
|
|
559
|
+
|
|
560
|
+
- **场景化 prompt 模板**——场景新增 `prompts` 字段:场景成为工具+技能+流程模板三位一体。注入走 pi 的 `resources_discover` 事件:**零 settings 写入、切走模板自动消失**(与落 settings.json 的 packages/skills 不同路径)
|
|
561
|
+
- 同名解析:用户手写模板与包模板优先于场景预设——用户意图压过预设
|
|
562
|
+
- 六个预置流程模板(`/pre-commit` 提交自检、`/deep-dive` 深度调研、`/fact-check` 事实核查、`/prd-skeleton` 需求骨架、`/doc-from-notes` 笔记成文、`/data-audit` 数据审计),每个都是显式步骤清单、模型无法跳步
|
|
563
|
+
- scaffold 生成 `prompts/` 目录骨架 + 预置模板 vendored 幂等复制(不覆盖你的修改);`/scene status` 显示生效模板;切换通知带模板目录计数
|
|
564
|
+
- 向后兼容:存量 scenes.json 无 `prompts` 字段时行为与 v0.7 完全一致
|
|
565
|
+
|
|
532
566
|
## 开发
|
|
533
567
|
|
|
534
568
|
```bash
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 费曼学习法四步——用大白话讲出来,卡壳处即知识缺口
|
|
3
|
+
argument-hint: "<要学习的概念>"
|
|
4
|
+
---
|
|
5
|
+
用费曼学习法帮我内化以下概念:$@
|
|
6
|
+
|
|
7
|
+
**铁律:用大白话,禁止照搬术语解释术语;卡壳 = 找到了缺口,是收获不是失败。**
|
|
8
|
+
|
|
9
|
+
四步循环:
|
|
10
|
+
|
|
11
|
+
1. **选概念**:把「$@」拆成 2-4 个子概念,确认我的现有理解水平(先问我或让我先说)。
|
|
12
|
+
2. **讲解**:让我用自己的话解释每个子概念(或你先示范一段大白话讲解,再让我复述)。
|
|
13
|
+
3. **找卡点**:我讲不清、绕圈子、或你追问三连(为什么?举个例子?反过来会怎样?)答不上的地方,逐个标记为缺口。
|
|
14
|
+
4. **回源补漏**:每个缺口回到原始材料(文档/教程/代码)定向补学,然后**重新讲解验证**,直到全部子概念都能过三连追问。
|
|
15
|
+
|
|
16
|
+
输出:学习笔记 = 子概念清单(✅已内化/⚠️有缺口+缺口描述)+ 我的原话讲解中被纠正的表述对照。
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 生成复习闪卡——Q&A 卡 + 填空卡,附间隔复习排程
|
|
3
|
+
argument-hint: "<材料来源:文件/主题/近期会话>"
|
|
4
|
+
---
|
|
5
|
+
把以下材料做成复习闪卡:$@
|
|
6
|
+
|
|
7
|
+
规则:
|
|
8
|
+
|
|
9
|
+
1. **提取**:先通读材料,列出可考察的知识点(定义、机制、对比、数值、流程步骤),按重要性排序,数量 10-20 张。
|
|
10
|
+
2. **两种卡型**:
|
|
11
|
+
- Q&A 卡:问题正面,答案背面;问题要具体到能唯一作答(禁止「谈谈 XX」式开放题)
|
|
12
|
+
- 填空卡(cloze):挖掉关键词的陈述句,关键词放背面
|
|
13
|
+
3. **反直觉优先**:材料中违反直觉、容易混淆、我此前答错过的知识点,必须出卡且可出双卡(同一知识点 Q&A + cloze 各一)。
|
|
14
|
+
4. **输出格式**:Markdown 表格(| 正面 | 背面 | 类型 |),可直接导入 Anki(或存为 .txt 制卡)。
|
|
15
|
+
5. **排程**:按间隔重复(1 天 / 3 天 / 7 天 / 14 天 / 30 天)给出一轮复习计划表,注明每轮重点卡范围。
|
|
16
|
+
|
|
17
|
+
铁律:每张卡的答案必须能在原材料中找到出处;材料没有的内容不出卡。
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 苏格拉底式检验——你提问我作答,暴露理解的真实边界
|
|
3
|
+
argument-hint: "<检验主题>"
|
|
4
|
+
---
|
|
5
|
+
对我进行苏格拉底式提问,检验我对「$@」的理解深度。
|
|
6
|
+
|
|
7
|
+
规则:
|
|
8
|
+
|
|
9
|
+
1. **你只提问,不讲解**:每次只问一个问题,等我的回答后再决定下一问。
|
|
10
|
+
2. **提问路径**:从我的断言出发,沿「定义 → 边界 → 反例 → 与相邻概念的区分 → 应用后果」递进;我的每个回答里不严谨的用词都要被追问。
|
|
11
|
+
3. **标记**:我答对 → 简短确认并深入一层;我答错或含糊 → 不给答案,换个角度再问一次;连续两次答不出 → 停下,指出知识缺口的准确位置,问我是否要转入费曼式补漏。
|
|
12
|
+
4. **收尾**:十问之后(或我要求停止时)给总结——已稳固的理解 / 摇摆的理解(附典型错误说法)/ 空白区,以及建议的下一步。
|
|
13
|
+
|
|
14
|
+
禁止:一次列一堆问题让我书面作答;我答错时直接纠正(要引导我自己发现矛盾)。
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eli5
|
|
3
|
+
description: "ELI5 大白话解释:类比优先、零术语、三档深度递进。Use when the user asks to explain like I'm 5, 用大白话解释, 讲得通俗一点, 我是小白, or is confused by jargon-heavy explanations and needs a ground-up restart."
|
|
4
|
+
version: 1
|
|
5
|
+
license: MIT
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# ELI5 — Explain Like I'm 5
|
|
9
|
+
|
|
10
|
+
把任何概念讲到五岁小孩能懂。核心不是「简化」,是**换锚点**:从对方已有的生活经验出发重建理解,而不是从术语出发往下稀释。
|
|
11
|
+
|
|
12
|
+
## 何时触发
|
|
13
|
+
|
|
14
|
+
- 用户明确要求 ELI5 / 大白话 / 通俗讲
|
|
15
|
+
- 用户对先前解释回复「没懂」「太抽象」「说人话」
|
|
16
|
+
- 概念解释连续两轮失败后的强制降档
|
|
17
|
+
|
|
18
|
+
## 解释规则
|
|
19
|
+
|
|
20
|
+
1. **类比先行**:先用一个生活类比把直觉立起来,再谈概念本身。类比要选用户世界里的东西(做饭、寄快递、班级管理、打电话),不要选另一个技术概念当类比。
|
|
21
|
+
2. **零术语首过**:第一段解释不允许出现任何领域术语;必须引用术语时,先用大白话定义它再使用。
|
|
22
|
+
3. **三档递进**:默认输出三档——
|
|
23
|
+
- 🧒 **5 岁版**:一个类比 + 三句话
|
|
24
|
+
- 🧑 **12 岁版**:类比展开 + 工作机制 + 一个具体例子
|
|
25
|
+
- 🧑💻 **成人版**:完整机制 + 边界条件 + 与相邻概念的关系
|
|
26
|
+
用户没指定档位时三档都给,让用户自己选停留深度。
|
|
27
|
+
4. **一个例子一个反例**:正向例子说清「是什么」,反例划清「不是什么」(例如解释哈希表:正向是「按名字首字母归档的电话簿」,反例是「不是按存放顺序找的抽屉」)。
|
|
28
|
+
5. **检查理解**:结尾抛一个 One-shot 小问题(用刚讲的类比回答),答对才算过。
|
|
29
|
+
|
|
30
|
+
## 禁止
|
|
31
|
+
|
|
32
|
+
- 用术语解释术语(「指针是指向内存地址的变量」❌)
|
|
33
|
+
- 类比链超过一层(用 A 比 B,再用 B 比 C,用户会在第二层丢失)
|
|
34
|
+
- 省略反例(没有反例的类比必然过度泛化)
|
|
35
|
+
- 「就是这样,记住就行」——记不住的,能记住的只有锚点
|
package/extensions/scenes.ts
CHANGED
|
@@ -984,7 +984,9 @@ export function makeCore(baseDir: string, projectDir?: string) {
|
|
|
984
984
|
/**
|
|
985
985
|
* 生成模板 scenes.json + 场景 skill 目录骨架 + 预置精选技能。
|
|
986
986
|
* 预设均为真实存在的包(npm/git,2026-09 核验);git 技能包用 object form
|
|
987
|
-
* 按场景裁剪 skills 子集(anthropics/skills 16M
|
|
987
|
+
* 按场景裁剪 skills 子集(anthropics/skills 16M 全量)。曾用 openclaw/agent-skills
|
|
988
|
+
* (v0.8.1 移除:定位为 OpenClaw 项目专用工作流库而非通用编码技能;autoreview/handoff
|
|
989
|
+
* 的职责已由 pi-simplify / pi-subagents 覆盖)。
|
|
988
990
|
* 预置技能 vendored 自高质量开源技能(MIT,见各自 SKILL.md 尾部归属声明)。
|
|
989
991
|
*/
|
|
990
992
|
function scaffold(): string[] {
|
|
@@ -1008,10 +1010,6 @@ export function makeCore(baseDir: string, projectDir?: string) {
|
|
|
1008
1010
|
"npm:pi-subagents", // 单代理委派 + 脚本化多代理工作流
|
|
1009
1011
|
"npm:pi-git-worktree", // git worktree 并行开发
|
|
1010
1012
|
"npm:pi-simplify", // 近期变更代码审查(清晰度/一致性/可维护性)
|
|
1011
|
-
{
|
|
1012
|
-
source: "git:github.com/openclaw/agent-skills", // OpenClaw 官方编码工作流技能(1.9M)
|
|
1013
|
-
skills: ["skills/autoreview", "skills/handoff"], // 独立代码审查 / 跨代理任务交接
|
|
1014
|
-
},
|
|
1015
1013
|
{
|
|
1016
1014
|
source: "git:github.com/anthropics/skills", // Anthropic 官方技能库(16M),按需子集
|
|
1017
1015
|
skills: ["skills/frontend-design", "skills/webapp-testing", "skills/mcp-builder"],
|
|
@@ -1078,13 +1076,23 @@ export function makeCore(baseDir: string, projectDir?: string) {
|
|
|
1078
1076
|
skills: ["~/.pi/agent/scenes/data/skills"],
|
|
1079
1077
|
prompts: ["~/.pi/agent/scenes/data/prompts"], // scaffold 预置 data-audit 数据审计
|
|
1080
1078
|
},
|
|
1079
|
+
learning: {
|
|
1080
|
+
description: "学习:知识内化、费曼检验、闪卡复习",
|
|
1081
|
+
icon: "📚",
|
|
1082
|
+
packages: [
|
|
1083
|
+
"npm:pi-web-access", // 查教程/文档/视频理解(学习材料获取)
|
|
1084
|
+
"npm:pi-subagents", // 并行学习:子代理各读一种资料再汇总多视角笔记
|
|
1085
|
+
],
|
|
1086
|
+
skills: ["~/.pi/agent/scenes/learning/skills"],
|
|
1087
|
+
prompts: ["~/.pi/agent/scenes/learning/prompts"], // scaffold 预置 feynman / socratic / flashcards
|
|
1088
|
+
},
|
|
1081
1089
|
},
|
|
1082
1090
|
};
|
|
1083
1091
|
if (!fs.existsSync(paths.scenesFile)) {
|
|
1084
1092
|
writeJson(paths.scenesFile, template);
|
|
1085
1093
|
created.push(paths.scenesFile);
|
|
1086
1094
|
}
|
|
1087
|
-
for (const s of ["common", "coding", "office", "pm", "research", "writing", "data"]) {
|
|
1095
|
+
for (const s of ["common", "coding", "office", "pm", "research", "writing", "data", "learning"]) {
|
|
1088
1096
|
for (const kind of ["skills", "prompts"] as const) {
|
|
1089
1097
|
const dir = path.join(paths.scenesRoot, s, kind);
|
|
1090
1098
|
if (!fs.existsSync(dir)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-scenes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Scene switcher for pi: bundle extensions, skills, and prompt templates into a common layer + per-scene layers. /scene hot-switches with live reload (project-scoped, zero settings residue); scene-scoped workflow templates arrive via resources_discover with no config writes; scene definitions self-evolve from real usage (tool-call attribution + session-end LLM reflection).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|