pi-scenes 0.14.0 → 0.15.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 CHANGED
@@ -18,7 +18,7 @@ active resources = common layer ∪ current scene
18
18
  ```
19
19
 
20
20
  - **Common layer** — extensions + skills that stay loaded in *every* scenario (quota display, session carryover…)
21
- - **Scene layers** — per-scenario bundles (coding / office / writing…), loaded only while active
21
+ - **Scene layers** — per-scenario bundles (code-matt-pocock / code-poteto / office / writing…), loaded only while active
22
22
  - **Project-scoped by default (v0.7)** — `/scene office` writes activation entries to `<cwd>/.pi/settings.json`, so a scene belongs to *this* directory only; opening a fresh directory starts clean. `--global` keeps the ≤0.6 all-projects behavior
23
23
  - **Asset/activation split (v0.7)** — packages are installed once globally and shared across projects; git skill bundles are pinned as zero-exposure *anchors* (`{source, autoload:false, skills:[]}`) in user settings, while the project layer writes a *delta* (`{source, autoload:false, skills:[...]}`) that enables just the scene's whitelist — one clone, per-project curation, via pi's native delta mechanism
24
24
  - **Full spatial isolation for scene packages (v0.11)** — *every* scene package (plain `npm:` specs included, not just filtered git bundles) now lands in the project layer as a universal delta (`{source, autoload:false, skills:["**"], extensions:["**"], ...}`) with a zero-exposure global anchor — one shared install, zero disk duplication, and a fresh directory loads **only the common layer**. Fixes the v0.7-v0.10 behavior where plain npm scene packages leaked into global settings and loaded in every project while the scene was active. Re-activating an existing scene migrates the leaked entries automatically (borrow semantics for user-configured globals is preserved)
@@ -26,8 +26,8 @@ active resources = common layer ∪ current scene
26
26
  - Switching rewrites `packages`/`skills` in `settings.json`, then `ctx.reload()` hot-reloads — **no pi restart, session untouched**; prompt templates take a different path: injected via pi's `resources_discover` event with **zero settings writes**
27
27
  - **Scene-scoped MCP servers (v0.13)** — each scene can declare its own `mcpServers`. Switching injects the scene's MCP tools into settings, and cleanly unmounts them when switching away. User-configured MCP servers are protected via borrow semantics
28
28
  - **Claude Plugin interoperability (v0.13)** — `/scene import <dir>` imports any Claude Code / Cowork plugin (from `anthropics/knowledge-work-plugins` or local) as a native scene, transpiling `plugin.json`, `skills/`, `commands/` (to prompts), and `.mcp.json` automatically
29
- - Every switch stamps a persistent **status-bar badge** (`◆ coding`, or a per-scene `icon` like `💻 coding`) so the bar always answers *"which scene am I in"* — restored at session start, cleared by `/scene off`
30
- - **Zero-memory discoverability (v0.4.1)** — the command hint lists your scene names, and Tab completion shows every scene (icon + description + current marker) plus subcommands: type `/scene c` + Tab → `/scene coding`
29
+ - Every switch stamps a persistent **status-bar badge** (`◆ code-matt-pocock`, or a per-scene `icon` like `💻 code-matt-pocock`) so the bar always answers *"which scene am I in"* — restored at session start, cleared by `/scene off`
30
+ - **Zero-memory discoverability (v0.4.1)** — the command hint lists your scene names, and Tab completion shows every scene (icon + description + current marker) plus subcommands: type `/scene c` + Tab → `/scene code-matt-pocock`
31
31
  - The data model reserves an `extends` chain (with cycle detection) for future **parent → child scene** hierarchies
32
32
 
33
33
  ## Install
@@ -49,9 +49,9 @@ Then `/reload` and `/scene` is live.
49
49
  ```
50
50
  /scene # picker: all scenes, ● current project scene, ◐ global, ○ inactive
51
51
  /scene <Tab> # tab-complete: lists all scenes (icon + description) and subcommands
52
- /scene c<Tab> # completes to /scene coding — no scene names to memorize
53
- /scene coding # switch to the coding scene (project-scoped: <cwd>/.pi only)
54
- /scene coding --global # switch as a global scene (every project, ≤0.6 behavior)
52
+ /scene c<Tab> # completes to /scene code-matt-pocock — no scene names to memorize
53
+ /scene code-matt-pocock # switch to the Matt-Pocock coding scene (project-scoped: <cwd>/.pi only)
54
+ /scene code-matt-pocock --global # switch as a global scene (every project, ≤0.6 behavior)
55
55
  /scene office # switch to the office scene
56
56
  /scene off # common layer only (clears both layers; anchors kept)
57
57
  /scene status # show project/global scenes + effective packages/skills
@@ -64,12 +64,13 @@ Then `/reload` and `/scene` is live.
64
64
  /scene suggest # scene-suggestion hints on/off (non-blocking; fires only when no scene is active)
65
65
  ```
66
66
 
67
- 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:
67
+ First run of `/scene` offers to generate the template. It ships with **nine 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. Since v0.15 coding ships as two scenes: `code-matt-pocock` (Matt's grill→spec→tickets workflow) and `code-poteto` (pstack rigor engineering, poteto-mode + 22 principles):
68
68
 
69
69
  | Scene | Extensions | Skills | Prompt templates (v0.8) |
70
70
  |---|---|---|---|
71
71
  | `common` | `npm:pi-scenes`, `npm:pi-carryover` | — (your own dir) | — |
72
- | `coding` | `npm:pi-lens`, `npm:pi-subagents` | `mattpocock/skills` → engineering/** (20 skills) + productivity/grilling | `/pre-commit` |
72
+ | `code-matt-pocock` | `npm:pi-lens`, `npm:pi-subagents` | `mattpocock/skills` → engineering/** (20 skills) + productivity/grilling | `/pre-commit` |
73
+ | `code-poteto` | `npm:pi-lens`, `npm:pi-subagents` | `backnotprop/pstack` → poteto-mode + principle-* (22) + tdd/how/why/architect/arena/swarm/interrogate/blast-radius/unslop/no-comments/correct/reflect/statechart/ts-best-practices/figure-it-out/show-me-your-work/technical-writing | — |
73
74
  | `office` | `npm:pi-docparser` | `anthropics/skills` → docx, pptx, xlsx, pdf, internal-comms | `/doc-from-notes` |
74
75
  | `pm` | `npm:pi-web-access`, `npm:pi-goal-x`, `npm:@juicesharp/rpiv-todo`, `npm:@juicesharp/rpiv-ask-user-question` | — | `/prd-skeleton` |
75
76
  | `research` | `npm:pi-web-access`, `npm:pi-subagents` | 预置:arxiv-research, openalex-paper-search | `/deep-dive` |
@@ -97,11 +98,11 @@ Edit it to fit your setup (each scene also gets a skill dir scaffold at `~/.pi/a
97
98
  "skills": ["~/.pi/agent/scenes/common/skills"]
98
99
  },
99
100
  "scenes": { // ── scene layers: stacked when active
100
- "coding": {
101
- "description": "coding",
101
+ "code-matt-pocock": {
102
+ "description": "coding (Matt Pocock workflow)",
102
103
  "icon": "💻",
103
104
  "packages": ["npm:pi-carryover"],
104
- "skills": ["~/.pi/agent/scenes/coding/skills"]
105
+ "skills": ["~/.pi/agent/scenes/code-matt-pocock/skills"]
105
106
  },
106
107
  "office": {
107
108
  "description": "office work",
@@ -114,7 +115,7 @@ Edit it to fit your setup (each scene also gets a skill dir scaffold at `~/.pi/a
114
115
  }
115
116
  ```
116
117
 
117
- Drop `SKILL.md` folders (or `.md` files) into a scene's skill directory; the whole directory toggles with the scene. `/scene init` scaffolds `~/.pi/agent/scenes/{common,coding,office,pm,research,writing,data}/skills/`.
118
+ Drop `SKILL.md` folders (or `.md` files) into a scene's skill directory; the whole directory toggles with the scene. `/scene init` scaffolds `~/.pi/agent/scenes/{common,code-matt-pocock,code-poteto,office,pm,research,writing,data}/skills/`.
118
119
 
119
120
  ### Project vs global scopes (v0.7)
120
121
 
@@ -143,20 +144,20 @@ What actually lands on disk when you switch scenes:
143
144
 
144
145
  Two consequences worth internalizing:
145
146
 
146
- - **Loaded ≠ present.** Switching scenes swaps the *declarations*; disks keep whatever was copied before. After office→coding, the office skill dir still sits in `<cwd>/.pi/scenes/office/` but has no settings entry pointing at it — never scanned, never loaded, zero prompt cost. It only means switching back is instant.
147
+ - **Loaded ≠ present.** Switching scenes swaps the *declarations*; disks keep whatever was copied before. After office→code-matt-pocock, the office skill dir still sits in `<cwd>/.pi/scenes/office/` but has no settings entry pointing at it — never scanned, never loaded, zero prompt cost. It only means switching back is instant.
147
148
  - **Copies are yours.** A vendored skill copied into the project can be edited or deleted freely; upgrading pi-scenes never touches it. Want your improvement everywhere? Edit the global source (`~/.pi/agent/scenes/<name>/skills/`) and let other projects copy it on their first switch.
148
149
 
149
150
  ### Known limitation: cross-scene npm extensions are a global singleton
150
151
 
151
- Skill exposure (the main point of scenes) is fully project-scoped via deltas. npm *extensions*, however, register their activation entries in the global layer — one slot per package. Running two pi instances in different projects with different scenes (A on `coding`, B on `office`): whichever switches last removes the other's npm entries from global settings on its next reload (skills stay fine; extensions like pi-lens/pi-docparser swap). Single-project workflows never hit this. If you need concurrent per-project extension sets, tell me — a future version can project-scope npm extensions at the cost of per-project `node_modules`.
152
+ Skill exposure (the main point of scenes) is fully project-scoped via deltas. npm *extensions*, however, register their activation entries in the global layer — one slot per package. Running two pi instances in different projects with different scenes (A on `code-matt-pocock`, B on `office`): whichever switches last removes the other's npm entries from global settings on its next reload (skills stay fine; extensions like pi-lens/pi-docparser swap). Single-project workflows never hit this. If you need concurrent per-project extension sets, tell me — a future version can project-scope npm extensions at the cost of per-project `node_modules`.
152
153
 
153
154
  ### Status-bar scene badge
154
155
 
155
- A successful switch sets a persistent footer badge (`◆ coding`), restored automatically at every session start and cleared by `/scene off`. The status bar should answer *"which scene am I in"* — not display tool internals.
156
+ A successful switch sets a persistent footer badge (`◆ code-matt-pocock`), restored automatically at every session start and cleared by `/scene off`. The status bar should answer *"which scene am I in"* — not display tool internals.
156
157
 
157
- The prefix is customizable per scene via the `icon` field — emoji works great (`💻 coding`). The scaffolded presets ship with `💻 📄 🎯 🔍 📝 📊`, and the picker plus `/scene status` display the same icon; unset scenes fall back to `◆`.
158
+ The prefix is customizable per scene via the `icon` field — emoji works great (`💻 code-matt-pocock`, `👑 code-poteto`). The scaffolded presets ship with `💻 👑 📄 🎯 🔍 📝 📊`, and the picker plus `/scene status` display the same icon; unset scenes fall back to `◆`.
158
159
 
159
- Scenes often bundle tool-heavy extensions whose own footer output crowds the bar. If you use the preset `coding` scene, pi-lens's diagnostics widget and `LSP Inactive` status can be silenced **without losing any AI-side value** (turn-end error injection, `lens_diagnostics`, symbol navigation) via `~/.pi-lens/config.json`:
160
+ Scenes often bundle tool-heavy extensions whose own footer output crowds the bar. If you use either coding preset (`code-matt-pocock` / `code-poteto`), pi-lens's diagnostics widget and `LSP Inactive` status can be silenced **without losing any AI-side value** (turn-end error injection, `lens_diagnostics`, symbol navigation) via `~/.pi-lens/config.json`:
160
161
 
161
162
  ```json
162
163
  { "ui": { "hideLspStatus": true }, "widget": { "visible": false } }
@@ -209,7 +210,7 @@ In short: **installed forever, loaded per scene**. One caveat: extensions you in
209
210
 
210
211
  You don't always remember to switch scenes before diving in. pi-scenes can notice and hint — **non-blocking toast, once per session, never auto-switches**:
211
212
 
212
- - **History line** (session start): if this project last used a scene (recorded on every project-scoped switch, 30-day window), a toast suggests restoring it: `💻 上次此项目用的是「coding」场景 → /scene coding`
213
+ - **History line** (session start): if this project last used a scene (recorded on every project-scoped switch, 30-day window), a toast suggests restoring it: `💻 上次此项目用的是「code-matt-pocock」场景 → /scene code-matt-pocock`
213
214
  - **Intent line** (first message): pure keyword heuristics (no LLM, zero cost). Each preset scene carries built-in strong (weight 2) / weak (weight 1) keyword lists; a scene can also declare `keywords` (weight 2). A hint fires only when the best scene scores ≥ 2 AND strictly beats the runner-up (ties stay silent); inputs starting with `/` are never matched
214
215
 
215
216
  Guardrails: one hint per session max (both lines share the budget); silent while any scene is active; after 3 consecutive ignored hints the project cools down until you actually switch (which resets the counter). `/scene suggest on|off` is the master switch (default on). Everything is a `ctx.ui.notify` toast — your typing flow is never interrupted.
@@ -217,9 +218,9 @@ Guardrails: one hint per session max (both lines share the budget); silent while
217
218
  ## How it works
218
219
 
219
220
  ```
220
- /scene coding
221
+ /scene code-matt-pocock
221
222
  │
222
- ├─ read scenes.json → target set = common ∪ coding (extends chains resolved)
223
+ ├─ read scenes.json → target set = common ∪ code-matt-pocock (extends chains resolved)
223
224
  ├─ missing packages → confirm → `pi install` each (global scope isn't auto-installed)
224
225
  ├─ rewrite settings.json (see "Injection & reclamation")
225
226
  └─ await ctx.reload() → extensions/skills hot-reload, session uninterrupted
@@ -265,7 +266,7 @@ Fixed workflows (release checklists, review procedures, research protocols) belo
265
266
 
266
267
  **How it's wired — zero settings pollution.** The extension listens to pi's `resources_discover` event: on every startup/reload pi asks which extra resource paths to load, and pi-scenes answers with the active scene's `promptPaths`. Switching away simply stops returning them — templates vanish with **no settings writes, no cleanup, no residue** (unlike packages/skills, which land in settings.json).
267
268
 
268
- - Scaffold preseeds one workflow template per preset scene (`/pre-commit` for coding, `/deep-dive` for research, `/fact-check` for writing, `/prd-skeleton` for pm, `/doc-from-notes` for office, `/data-audit` for data), vendored into `~/.pi/agent/scenes/<scene>/prompts/` (idempotent copy, yours to edit)
269
+ - Scaffold preseeds one workflow template per preset scene (`/pre-commit` for code-matt-pocock, `/deep-dive` for research, `/fact-check` for writing, `/prd-skeleton` for pm, `/doc-from-notes` for office, `/data-audit` for data), vendored into `~/.pi/agent/scenes/<scene>/prompts/` (idempotent copy, yours to edit)
269
270
  - Same-name resolution: your hand-written templates (`~/.pi/agent/prompts/`, project `.pi/prompts/`) and package templates **win over** scene templates — user intent beats presets
270
271
  - Why templates at all: they pin down step-by-step procedures so the model can't take shortcuts; human remembers the command name, the template carries the checklist
271
272
 
@@ -280,6 +281,12 @@ Before uninstalling, `/scene off` and prune entries you don't want to keep from
280
281
 
281
282
  ## Changelog
282
283
 
284
+ ### v0.15.0 (2026-11-28)
285
+
286
+ - **Coding ships as two scenes** — `coding` renamed to `code-matt-pocock` (Matt Pocock's grill→spec→tickets→implement→review→pr workflow, unchanged bundle), and a new **`code-poteto`** preset: pstack by Lauren Tan (poteto, React core team; MIT, via the `backnotprop/pstack` standalone mirror that officially supports pi). Whitelist groups skills by dependency: `poteto-mode` (22 playbooks: bug-fix/feature/refactoring/perf/shipping/overnight…) + all 22 `principle-*` (its hard dependencies) + the rigor core (tdd/how/why/architect/arena/swarm/interrogate/blast-radius/unslop/no-comments/correct/reflect/statechart/typescript-best-practices/figure-it-out/show-me-your-work/technical-writing). Excluded on purpose: setup-pstack (Cursor model picker), ketchup-video/make-bot-ui/bro (non-coding), automate-me & verification-skill authoring (meta; re-add per taste)
287
+ - Vendored prompt dir `assets/scene-prompts/coding` → `code-matt-pocock`; users upgrading keep their on-disk copies (manifest reports the old key as removed, new key re-seeded on next `/scene init` or `/scene update-assets`)
288
+ - Intent-suggestion tables follow the rename: `code-matt-pocock` keeps the former coding keyword table; `code-poteto` gets a differentiated table (playbook/poteto/pstack/swarm/hillclimb/autopilot…). Overlapping hits tie → no toast (conservative by design); declare your own `keywords` in scenes.json to steer
289
+
283
290
  ### v0.14.0 (2026-11-28)
284
291
 
285
292
  - **Scene suggestions** — when no scene is active, pi-scenes hints (non-blocking toast, once per session, never auto-switches): a **history line** at session start suggests restoring the scene this project last used (30-day window), and an **intent line** matches your first message against per-scene keyword tables (pure heuristics, no LLM; fires only when the best scene scores ≥ 2 and strictly beats the runner-up). Guardrails: silent while a scene is active, 3 consecutive ignores cool the project down (reset on switch), `/scene suggest on|off` master switch. Scenes accept a new `keywords` field (weight 2) to extend/override the built-in tables
@@ -344,7 +351,7 @@ MIT
344
351
  # 中文说明
345
352
 
346
353
  > [pi](https://pi.dev) 场景切换器:**通用层 + 分场景层**的 extension / skill / prompt 模板打包切换。
347
- > 写代码时 `/scene coding`,办公时 `/scene office`——一键换装,热重载生效;v0.8 起场景还携带流程模板(`/pre-commit`、`/deep-dive`…),步骤清单固化、AI 无法跳步。
354
+ > 写代码时 `/scene code-matt-pocock`(Matt 工程流)或 `/scene code-poteto`(pstack 严谨流),办公时 `/scene office`——一键换装,热重载生效;v0.8 起场景还携带流程模板(`/pre-commit`、`/deep-dive`…),步骤清单固化、AI 无法跳步。
348
355
 
349
356
  ## 这是什么
350
357
 
@@ -366,8 +373,8 @@ pi 的 `packages` / `skills` 是全局平铺的:所有已安装扩展、所有
366
373
  - **场景级 MCP 动态调度(v0.13)**——每个场景可声明专属 `mcpServers`。切换时动态挂载对应工具,切走时精确卸载;用户预配的 MCP 走借用保护不篡改
367
374
  - **Claude Plugin 原生协议互通(v0.13)**——`/scene import <dir>` 一键将 Claude Code / Cowork 插件(如 Anthropic 官方知识工作流插件或社区生态)转换为原生场景,自动转译 `plugin.json`、`skills/`、`commands/`(转为 prompt 模板)及 `.mcp.json`
368
375
  - 切换 = 改写 `settings.json` 的 `packages`/`skills` → `ctx.reload()` 热重载,**无需重启 pi**;prompt 模板走另一条路:经 pi 的 `resources_discover` 事件动态注入,**零 settings 写入**
369
- - 每次切换成功后状态栏常驻**场景徽标**(`◆ coding`,或每场景自定义 `icon` 如 `💻 coding`),状态栏随时回答「我现在在哪个场景」——会话启动自动恢复,`/scene off` 清除
370
- - **零记忆可发现性(v0.4.1)**——命令提示行直接拼入场景名清单;Tab 补全列出全部场景(icon + 描述 + 当前标记)与子命令:`/scene c` + Tab → `/scene coding`
376
+ - 每次切换成功后状态栏常驻**场景徽标**(`◆ code-matt-pocock`,或每场景自定义 `icon` 如 `💻 code-matt-pocock`),状态栏随时回答「我现在在哪个场景」——会话启动自动恢复,`/scene off` 清除
377
+ - **零记忆可发现性(v0.4.1)**——命令提示行直接拼入场景名清单;Tab 补全列出全部场景(icon + 描述 + 当前标记)与子命令:`/scene c` + Tab → `/scene code-matt-pocock`
371
378
  - 数据模型预留 `extends` 继承链(带环检测),为将来「主场景 → 子场景」层级铺路
372
379
 
373
380
  ## 安装
@@ -389,9 +396,9 @@ pi install git:github.com/Feng-H/pi-scenes
389
396
  ```
390
397
  /scene # 弹出选择器:● 当前项目场景,◐ 当前全局场景,○ 可切
391
398
  /scene <Tab> # Tab 补全:列出全部场景(icon + 描述)与子命令
392
- /scene c<Tab> # 补齐为 /scene coding —— 无需记忆任何场景名
393
- /scene coding # 切到 coding 场景(项目级:只写入 <cwd>/.pi)
394
- /scene coding --global # 切为全局场景(所有目录生效,≤0.6 语义)
399
+ /scene c<Tab> # 补齐为 /scene code-matt-pocock —— 无需记忆任何场景名
400
+ /scene code-matt-pocock # 切到 code-matt-pocock 场景(项目级:只写入 <cwd>/.pi)
401
+ /scene code-matt-pocock --global # 切为全局场景(所有目录生效,≤0.6 语义)
395
402
  /scene office # 切到办公场景
396
403
  /scene off # 仅保留通用层(摘两层;资产锚点保留)
397
404
  /scene status # 查看项目/全局两级场景 + 生效 packages/skills
@@ -404,12 +411,13 @@ pi install git:github.com/Feng-H/pi-scenes
404
411
  /scene suggest # 场景意图提示开关(无场景激活时非阻塞建议切换)
405
412
  ```
406
413
 
407
- 首次运行 `/scene` 会询问是否生成模板,生成后编辑场景定义。模板内置 **八个预设场景 + 通用层**(包均在 npm 核验存在,2026-09):
414
+ 首次运行 `/scene` 会询问是否生成模板,生成后编辑场景定义。模板内置 **九个预设场景 + 通用层**(包均在 npm 核验存在,2026-09;v0.15 起编码拆为双场景 `code-matt-pocock` / `code-poteto`):
408
415
 
409
416
  | 层 | 预设 packages | 理由 |
410
417
  |---|---|---|
411
418
  | `common` | `npm:pi-scenes`、`npm:pi-carryover` | 切换器自身 + 跨会话承接,恒需 |
412
- | `coding` | `npm:pi-lens`、`npm:pi-subagents`、`mattpocock/skills`(engineering/** + grilling) | LSP/lint 实时反馈、子代理委派、Matt Pocock 工程流(grill→spec→tickets→implement→review→pr) |
419
+ | `code-matt-pocock` | `npm:pi-lens`、`npm:pi-subagents`、`mattpocock/skills`(engineering/** + grilling) | LSP/lint 实时反馈、子代理委派、Matt Pocock 工程流(grill→spec→tickets→implement→review→pr) |
420
+ | `code-poteto` | `npm:pi-lens`、`npm:pi-subagents`、`backnotprop/pstack`(poteto-mode + principle-*×22 + tdd/how/why/architect/arena/swarm/interrogate/blast-radius/unslop/no-comments/correct/reflect/statechart/ts-best-practices/figure-it-out/show-me-your-work/technical-writing) | LSP/lint 实时反馈、子代理委派、pstack 严谨工程流(poteto-mode 22 playbook 路由:bug 修复/特性/重构/性能/过夜跑…+ 22 条 principle 原则) |
413
421
  | `office` | `npm:pi-docparser` | PDF/Office 文档解析 |
414
422
  | `pm` | `npm:pi-web-access`、`npm:pi-goal-x`、`npm:@juicesharp/rpiv-todo` | 竞品/市场调研、目标规划与完成度审计、需求/任务清单 overlay |
415
423
  | `research` | `npm:pi-web-access`、`npm:pi-subagents` | 多源搜索/抓取/PDF/视频,并行多角度深挖 |
@@ -418,7 +426,7 @@ pi install git:github.com/Feng-H/pi-scenes
418
426
  | `learning` | `npm:pi-web-access`、`npm:pi-subagents` | 学习材料获取、并行多视角学习;预置 skill:eli5(大白话解释) |
419
427
  | `productivity` | `npm:pi-carryover` | 个人生产力:任务清单驱动工作流与重要上下文沉淀(基于 Anthropic 知识插件规范) |
420
428
 
421
- 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` 文件。
429
+ v0.8 起每个预设场景还携带流程模板(code-matt-pocock→`/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` 文件。
422
430
 
423
431
  每个场景同时生成 skill / prompts 目录骨架 `~/.pi/agent/scenes/<名>/{skills,prompts}/`,按需编辑:
424
432
 
@@ -431,11 +439,11 @@ v0.8 起每个预设场景还携带流程模板(coding→`/pre-commit`、offic
431
439
  "skills": ["~/.pi/agent/scenes/common/skills"]
432
440
  },
433
441
  "scenes": { // ── 场景层:激活才叠加
434
- "coding": {
442
+ "code-matt-pocock": {
435
443
  "description": "写代码",
436
444
  "icon": "💻",
437
445
  "packages": ["npm:pi-carryover"],
438
- "skills": ["~/.pi/agent/scenes/coding/skills"]
446
+ "skills": ["~/.pi/agent/scenes/code-matt-pocock/skills"]
439
447
  },
440
448
  "office": {
441
449
  "description": "办公",
@@ -449,7 +457,7 @@ v0.8 起每个预设场景还携带流程模板(coding→`/pre-commit`、offic
449
457
  ```
450
458
 
451
459
  场景 skill 目录里放 `SKILL.md` 文件夹(或 `.md` 文件)即可,切换场景时整目录启停。
452
- `/scene init` 会创建 `~/.pi/agent/scenes/{common,coding,office,pm,research,writing,data}/skills/` 骨架。
460
+ `/scene init` 会创建 `~/.pi/agent/scenes/{common,code-matt-pocock,code-poteto,office,pm,research,writing,data}/skills/` 骨架。
453
461
 
454
462
  ### 资源加载方式:大件共享、小件复制、全程无软链接
455
463
 
@@ -463,20 +471,20 @@ v0.8 起每个预设场景还携带流程模板(coding→`/pre-commit`、offic
463
471
 
464
472
  两个值得记住的推论:
465
473
 
466
- - **「存在」≠「加载」。** 切换换的是声明,磁盘留着切过的所有副本。office→coding 后,office 技能目录仍在 `<cwd>/.pi/scenes/office/`,但没有任何 settings 条目指向它——不被扫描、不被加载、零提示成本;意义仅是切回时秒级。
474
+ - **「存在」≠「加载」。** 切换换的是声明,磁盘留着切过的所有副本。office→code-matt-pocock 后,office 技能目录仍在 `<cwd>/.pi/scenes/office/`,但没有任何 settings 条目指向它——不被扫描、不被加载、零提示成本;意义仅是切回时秒级。
467
475
  - **复制即所有。** 复制进项目的技能随意改删,升级 pi-scenes 永远不会碰它;想让改进全局生效,改全局源(`~/.pi/agent/scenes/<名>/skills/`),其他项目首切时自然复制到。
468
476
 
469
477
  ### 已知限制:跨场景 npm 扩展是全局单例
470
478
 
471
- 技能暴露(场景的核心差异)已通过 delta 完全项目级隔离;但 npm 扩展的激活条目在全局层——每包一个坑位。两个 pi 实例在不同项目跑不同场景(A 用 coding、B 用 office)时,后切换的一方会把先切换方的 npm 条目从全局 settings 摘掉(技能不受影响;pi-lens/pi-docparser 这类扩展会互换)。单项目工作流永远碰不到这个问题;确实需要多项目并行各自扩展集的,可以做到(代价:每项目重复装 node_modules),需要请在 issue 里说一声。
479
+ 技能暴露(场景的核心差异)已通过 delta 完全项目级隔离;但 npm 扩展的激活条目在全局层——每包一个坑位。两个 pi 实例在不同项目跑不同场景(A 用 code-matt-pocock、B 用 office)时,后切换的一方会把先切换方的 npm 条目从全局 settings 摘掉(技能不受影响;pi-lens/pi-docparser 这类扩展会互换)。单项目工作流永远碰不到这个问题;确实需要多项目并行各自扩展集的,可以做到(代价:每项目重复装 node_modules),需要请在 issue 里说一声。
472
480
 
473
481
  ### 状态栏场景徽标
474
482
 
475
- 切换成功后状态栏常驻徽标(项目场景 `◆ coding`,全局场景 `◇ coding ⌘`),每次会话启动自动恢复,`/scene off` 清除。状态栏应该回答「我现在在哪个场景、哪一层」——而不是展示工具的内部状态。
483
+ 切换成功后状态栏常驻徽标(项目场景 `◆ code-matt-pocock`,全局场景 `◇ code-matt-pocock ⌘`),每次会话启动自动恢复,`/scene off` 清除。状态栏应该回答「我现在在哪个场景、哪一层」——而不是展示工具的内部状态。
476
484
 
477
- 徽标前缀可按场景用 `icon` 字段定制——emoji 完全可用(`💻 coding`)。脚手架预设自带 `💻 📄 🎯 🔍 📝 📊`,选择器与 `/scene status` 同步显示同一 icon;未配置的场景回退 `◆`。
485
+ 徽标前缀可按场景用 `icon` 字段定制——emoji 完全可用(`💻 code-matt-pocock`、`👑 code-poteto`)。脚手架预设自带 `💻 👑 📄 🎯 🔍 📝 📊`,选择器与 `/scene status` 同步显示同一 icon;未配置的场景回退 `◆`。
478
486
 
479
- 场景常打包工具型扩展,它们自己的 footer 输出会把状态栏拼得很吵。若使用预设 `coding` 场景,pi-lens 的诊断 widget 与 `LSP Inactive` 状态可在**不损失任何 AI 侧价值**(turn-end 错误注入、`lens_diagnostics`、符号导航)的前提下静音,写入 `~/.pi-lens/config.json`:
487
+ 场景常打包工具型扩展,它们自己的 footer 输出会把状态栏拼得很吵。若使用任一编码预设(`code-matt-pocock` / `code-poteto`),pi-lens 的诊断 widget 与 `LSP Inactive` 状态可在**不损失任何 AI 侧价值**(turn-end 错误注入、`lens_diagnostics`、符号导航)的前提下静音,写入 `~/.pi-lens/config.json`:
480
488
 
481
489
  ```json
482
490
  { "ui": { "hideLspStatus": true }, "widget": { "visible": false } }
@@ -544,7 +552,7 @@ pi-scenes 绝不改第三方包的全局配置——徽标是它放到状态栏
544
552
 
545
553
  不是每次都会记得先切场景再干活。pi-scenes 可以察觉并提示 —— **非阻塞 toast、每会话至多一次、永不自动切换**:
546
554
 
547
- - **历史线**(会话启动):本项目上次用过某场景(每次项目级切换都会记录,30 天有效),启动时提示恢复:`💻 上次此项目用的是「coding」场景 → /scene coding`
555
+ - **历史线**(会话启动):本项目上次用过某场景(每次项目级切换都会记录,30 天有效),启动时提示恢复:`💻 上次此项目用的是「code-matt-pocock」场景 → /scene code-matt-pocock`
548
556
  - **意图线**(首条消息):纯关键词启发式(无 LLM、零成本)。每个预置场景有内置词表(强词权重 2 / 弱词权重 1),场景还可用 `keywords` 字段自定义(权重 2)。best 得分 ≥ 2 且严格高于次名才出手(平手静默);以 `/` 开头的命令输入永不参与匹配
549
557
 
550
558
  防打扰:每会话最多提示一次(两线共享预算);任何场景已激活时静默;连续忽略 3 次项目级冷却,直到你真正切换场景才重置。`/scene suggest on|off` 总开关(缺省开)。全程只是 `ctx.ui.notify` 一行提示,不打断输入流。
@@ -552,9 +560,9 @@ pi-scenes 绝不改第三方包的全局配置——徽标是它放到状态栏
552
560
  ## 工作原理
553
561
 
554
562
  ```
555
- /scene coding
563
+ /scene code-matt-pocock
556
564
  │
557
- ├─ 读 scenes.json → 生效集合 = common ∪ coding(extends 链自动展开)
565
+ ├─ 读 scenes.json → 生效集合 = common ∪ code-matt-pocock(extends 链自动展开)
558
566
  ├─ 缺失的包 → confirm 后逐个 `pi install`(全局 scope pi 不自动装)
559
567
  ├─ 改写 settings.json(见「注入与回收」)
560
568
  └─ await ctx.reload() → 扩展/skill 热重载,会话不中断
@@ -599,7 +607,7 @@ pi-scenes 绝不改第三方包的全局配置——徽标是它放到状态栏
599
607
 
600
608
  **接线方式——零 settings 污染。** 与 packages/skills 落 settings.json 不同,模板走 pi 的 `resources_discover` 事件:每次启动/重载 pi 会询问各扩展需要加载哪些额外资源,pi-scenes 按当前激活场景返回模板路径。切走场景后不再返回——模板自动消失,**不写 settings、无需清理、零残留**。
601
609
 
602
- - scaffold 为每个预设场景预置一个流程模板(coding→`/pre-commit`、research→`/deep-dive`、writing→`/fact-check`、pm→`/prd-skeleton`、office→`/doc-from-notes`、data→`/data-audit`),vendored 复制到 `~/.pi/agent/scenes/<场景>/prompts/`(幂等,复制后归你所有,可改可删)
610
+ - scaffold 为每个预设场景预置一个流程模板(code-matt-pocock→`/pre-commit`、research→`/deep-dive`、writing→`/fact-check`、pm→`/prd-skeleton`、office→`/doc-from-notes`、data→`/data-audit`),vendored 复制到 `~/.pi/agent/scenes/<场景>/prompts/`(幂等,复制后归你所有,可改可删)
603
611
  - 同名解析:你手写的模板(`~/.pi/agent/prompts/`、项目 `.pi/prompts/`)与包模板**优先于**场景模板——用户意图压过预设
604
612
  - 为什么需要模板:把步骤清单固化成模板,模型就无法挑最快路径跳步;人只记命令名,清单由模板携带
605
613
 
@@ -614,6 +622,12 @@ managed 注入的条目在卸载前建议先 `/scene off` + 手工清理 `packag
614
622
 
615
623
  ## 版本历史
616
624
 
625
+ ### v0.15.0(2026-11-28)
626
+
627
+ - **编码拆为双场景**——`coding` 更名 `code-matt-pocock`(Matt Pocock 工程流 grill→spec→tickets→implement→review→pr,组合不变),新增 **`code-poteto`** 预设:Lauren Tan(poteto,React 核心团队)的 pstack(MIT,经官方支持 pi 的 standalone 镜像 `backnotprop/pstack`)。白名单按技能依赖成组:`poteto-mode`(22 个 playbook:bug 修复/特性/重构/性能/发布/过夜跑…)+ 全部 22 条 `principle-*`(其硬依赖)+ 严谨核心(tdd/how/why/architect/arena/swarm/interrogate/blast-radius/unslop/no-comments/correct/reflect/statechart/typescript-best-practices/figure-it-out/show-me-your-work/technical-writing)。有意排除:setup-pstack(Cursor 模型选择器)、ketchup-video/make-bot-ui/bro(非编码)、automate-me 与验证技能创作类(meta;按需自加)
628
+ - vendored 模板目录 `assets/scene-prompts/coding` → `code-matt-pocock`;升级用户落盘副本保留(manifest 报告旧 key 为 removed,下次 `/scene init` 或 `/scene update-assets` 补种新 key)
629
+ - 意图提示词表随更名:`code-matt-pocock` 沿用原 coding 词表;`code-poteto` 用差异化词表(playbook/poteto/pstack/swarm/hillclimb/autopilot…)。重叠词双方命中 → 平手不出手(保守设计);可在 scenes.json 用 `keywords` 自定义偏好
630
+
617
631
  ### v0.14.0(2026-11-28)
618
632
 
619
633
  - **场景意图提示**——无激活场景时非阻塞提示(toast、每会话至多一次、永不自动切换):**历史线**在会话启动时建议恢复本项目上次用的场景(30 天有效);**意图线**把首条消息与各场景关键词表匹配(纯启发式、无 LLM;best ≥ 2 且严格高于次名才出手,平手静默)。防打扰:场景已激活即静默、连续忽略 3 次项目冷却(切换重置)、`/scene suggest on|off` 总开关。场景新增 `keywords` 字段(权重 2)可扩展/覆盖内置词表
@@ -37,7 +37,7 @@
37
37
  *
38
38
  * 命令:
39
39
  * /scene 弹出选择器(当前场景高亮 ●)
40
- * /scene <name> 切换到指定场景(默认项目级;参数 Tab 补全:/scene c<Tab> → /scene coding)
40
+ * /scene <name> 切换到指定场景(默认项目级;参数 Tab 补全:/scene c<Tab> → /scene code-matt-pocock)
41
41
  * /scene <name> --global 切换为全局场景(所有项目生效,≤0.6 语义)
42
42
  * /scene off|none 关闭场景(摘两层,仅保留通用层;资产锚点保留)
43
43
  * /scene status 显示当前激活与生效资源(项目/全局两级)
@@ -1246,6 +1246,8 @@ export function makeCore(baseDir: string, projectDir?: string) {
1246
1246
  * 按场景裁剪 skills 子集(anthropics/skills 16M 全量)。曾用 openclaw/agent-skills
1247
1247
  * (v0.8.1 移除:定位为 OpenClaw 项目专用工作流库而非通用编码技能;autoreview/handoff
1248
1248
  * 的职责已由 pi-simplify / pi-subagents 覆盖)。
1249
+ * v0.15:编码拆为双场景 code-matt-pocock(Matt 工程流)/ code-poteto(pstack 严谨流),
1250
+ * 白名单按技能依赖成组裁剪(poteto-mode 需全部 principle-*)。
1249
1251
  * 预置技能 vendored 自高质量开源技能(MIT,见各自 SKILL.md 尾部归属声明)。
1250
1252
  */
1251
1253
  function scaffold(): string[] {
@@ -1261,7 +1263,7 @@ export function makeCore(baseDir: string, projectDir?: string) {
1261
1263
  prompts: ["~/.pi/agent/scenes/common/prompts"],
1262
1264
  },
1263
1265
  scenes: {
1264
- coding: {
1266
+ "code-matt-pocock": {
1265
1267
  description: "写代码:实时代码反馈(pi-lens)、子代理委派 + Matt Pocock 工程流(grill→spec→tickets→implement→review→pr)",
1266
1268
  icon: "💻",
1267
1269
  packages: [
@@ -1272,8 +1274,48 @@ export function makeCore(baseDir: string, projectDir?: string) {
1272
1274
  skills: ["skills/engineering/**", "skills/productivity/grilling/**"],
1273
1275
  },
1274
1276
  ],
1275
- skills: ["~/.pi/agent/scenes/coding/skills"],
1276
- prompts: ["~/.pi/agent/scenes/coding/prompts"], // scaffold 预置 pre-commit 提交前自检
1277
+ skills: ["~/.pi/agent/scenes/code-matt-pocock/skills"],
1278
+ prompts: ["~/.pi/agent/scenes/code-matt-pocock/prompts"], // scaffold 预置 pre-commit 提交前自检
1279
+ },
1280
+ "code-poteto": {
1281
+ description: "写代码:pstack 严谨工程流(poteto-mode 22 playbook 路由 + 22 条 principle 原则,Lauren Tan 出品)",
1282
+ icon: "👑",
1283
+ packages: [
1284
+ "npm:pi-lens", // LSP/linter/格式化实时代码反馈
1285
+ "npm:pi-subagents", // 子代理委派(swarm/arena/interrogate 的并行多代理落地)
1286
+ {
1287
+ source: "git:github.com/backnotprop/pstack", // Poteto (Lauren Tan) pstack(MIT;standalone 镜像与上游 cursor/plugins/pstack 同步,README 明确支持 pi)
1288
+ skills: [
1289
+ // 主入口 + 硬依赖:poteto-mode 的 22 playbook 引用全部 principle-*
1290
+ "skills/poteto-mode/**",
1291
+ "skills/principle-*/**",
1292
+ // 严谨编码核心(白名单按依赖成组;组合技能的依赖已齐:
1293
+ // architect→arena;blast-radius→arena/how/why/unslop;technical-writing→unslop)
1294
+ "skills/tdd/**",
1295
+ "skills/how/**",
1296
+ "skills/why/**",
1297
+ "skills/architect/**",
1298
+ "skills/arena/**",
1299
+ "skills/swarm/**",
1300
+ "skills/interrogate/**",
1301
+ "skills/blast-radius/**",
1302
+ "skills/unslop/**",
1303
+ "skills/no-comments/**",
1304
+ "skills/correct/**",
1305
+ "skills/reflect/**",
1306
+ "skills/statechart/**",
1307
+ "skills/typescript-best-practices/**",
1308
+ "skills/figure-it-out/**",
1309
+ "skills/show-me-your-work/**",
1310
+ "skills/technical-writing/**",
1311
+ ],
1312
+ // 排除(按需自加):ketchup-video、make-bot-ui、bro(非编码)、
1313
+ // setup-pstack(Cursor 模型选择器,pi 不适用)、automate-me、
1314
+ // create-verification-skill 系列(meta 类,用时再加)
1315
+ },
1316
+ ],
1317
+ skills: ["~/.pi/agent/scenes/code-poteto/skills"],
1318
+ prompts: ["~/.pi/agent/scenes/code-poteto/prompts"],
1277
1319
  },
1278
1320
  office: {
1279
1321
  description: "办公:文档解析与生成、内部沟通",
@@ -1358,7 +1400,7 @@ export function makeCore(baseDir: string, projectDir?: string) {
1358
1400
  writeJson(paths.scenesFile, template);
1359
1401
  created.push(paths.scenesFile);
1360
1402
  }
1361
- for (const s of ["common", "coding", "office", "pm", "research", "writing", "data", "learning", "productivity"]) {
1403
+ for (const s of ["common", "code-matt-pocock", "code-poteto", "office", "pm", "research", "writing", "data", "learning", "productivity"]) {
1362
1404
  for (const kind of ["skills", "prompts"] as const) {
1363
1405
  const dir = path.join(paths.scenesRoot, s, kind);
1364
1406
  if (!fs.existsSync(dir)) {
@@ -1610,10 +1652,16 @@ const PICKER_CANCEL = "—— 取消";
1610
1652
 
1611
1653
  /** v0.14 预置场景内置意图词表:strong 权重 2 / weak 权重 1;用户 scenes.json 可用 keywords 覆盖/叠加 */
1612
1654
  const PRESET_KEYWORDS: Record<string, { strong: string[]; weak: string[] }> = {
1613
- coding: {
1655
+ "code-matt-pocock": {
1614
1656
  strong: ["重构", "refactor", "报错", "调试", "debug", "bug", "单元测试", "单测", "tdd", "类型错误", "编译错误", "报异常", "实现一个", "写个脚本"],
1615
1657
  weak: ["代码", "函数", "测试", "提交", "commit", "部署", "npm", "git", "脚本", "性能", "代码审查", "依赖"],
1616
1658
  },
1659
+ "code-poteto": {
1660
+ // 差异化词表:只用 pstack 特色工作流词,避免与 code-matt-pocock 重叠
1661
+ // (重叠词双方命中 → 平手不出手,意图提示保守正确;偏好可经 scenes.json keywords 覆盖)
1662
+ strong: ["playbook", "poteto", "pstack", "swarm", "hillclimb", "autopilot", "过夜跑", "多阶段计划", "正式验证", "statechart"],
1663
+ weak: ["严谨", "并行多代理", "验证链", "爆炸半径", "blast radius"],
1664
+ },
1617
1665
  office: {
1618
1666
  strong: ["ppt", "docx", "xlsx", "excel", "幻灯片", "会议纪要", "周报", "写邮件", "邮件草稿", "word文档", "pdf转"],
1619
1667
  weak: ["文档", "表格", "通知", "公告", "简历", "排版"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-scenes",
3
- "version": "0.14.0",
3
+ "version": "0.15.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"