@leing2021/super-pi 0.21.0 → 0.22.1

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.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +157 -357
  3. package/THIRD-PARTY-NOTICES.md +35 -0
  4. package/extensions/subagent/__tests__/async-job-tracker.test.ts +21 -0
  5. package/extensions/subagent/__tests__/execution-activity.test.ts +15 -0
  6. package/extensions/subagent/__tests__/parallel-render-stress.test.ts +82 -0
  7. package/extensions/subagent/__tests__/render-dedup.test.ts +98 -0
  8. package/extensions/subagent/__tests__/render-widget.test.ts +28 -0
  9. package/extensions/subagent/__tests__/throttle.test.ts +90 -0
  10. package/extensions/subagent/agent-management.ts +596 -0
  11. package/extensions/subagent/agent-manager-chain-detail.ts +163 -0
  12. package/extensions/subagent/agent-manager-detail.ts +232 -0
  13. package/extensions/subagent/agent-manager-edit.ts +391 -0
  14. package/extensions/subagent/agent-manager-list.ts +279 -0
  15. package/extensions/subagent/agent-manager-parallel.ts +305 -0
  16. package/extensions/subagent/agent-manager.ts +706 -0
  17. package/extensions/subagent/agent-scope.ts +9 -0
  18. package/extensions/subagent/agent-selection.ts +26 -0
  19. package/extensions/subagent/agent-serializer.ts +124 -0
  20. package/extensions/subagent/agent-templates.ts +63 -0
  21. package/extensions/subagent/agents/context-builder.md +37 -0
  22. package/extensions/subagent/agents/delegate.md +9 -0
  23. package/extensions/subagent/agents/oracle.md +73 -0
  24. package/extensions/subagent/agents/planner.md +52 -0
  25. package/extensions/subagent/agents/researcher.md +50 -0
  26. package/extensions/subagent/agents/reviewer.md +38 -0
  27. package/extensions/subagent/agents/scout.md +48 -0
  28. package/extensions/subagent/agents/worker.md +52 -0
  29. package/extensions/subagent/agents.ts +762 -0
  30. package/extensions/subagent/artifacts.ts +101 -0
  31. package/extensions/subagent/async-execution.ts +521 -0
  32. package/extensions/subagent/async-job-tracker.ts +240 -0
  33. package/extensions/subagent/async-status.ts +242 -0
  34. package/extensions/subagent/chain-clarify.ts +1365 -0
  35. package/extensions/subagent/chain-execution.ts +854 -0
  36. package/extensions/subagent/chain-serializer.ts +127 -0
  37. package/extensions/subagent/completion-dedupe.ts +66 -0
  38. package/extensions/subagent/doctor.ts +201 -0
  39. package/extensions/subagent/execution.ts +748 -0
  40. package/extensions/subagent/file-coalescer.ts +43 -0
  41. package/extensions/subagent/fork-context.ts +64 -0
  42. package/extensions/subagent/formatters.ts +123 -0
  43. package/extensions/subagent/frontmatter.ts +32 -0
  44. package/extensions/subagent/index.ts +586 -0
  45. package/extensions/subagent/intercom-bridge.ts +241 -0
  46. package/extensions/subagent/jsonl-writer.ts +84 -0
  47. package/extensions/subagent/model-fallback.ts +109 -0
  48. package/extensions/subagent/notify.ts +111 -0
  49. package/extensions/subagent/parallel-utils.ts +109 -0
  50. package/extensions/subagent/pi-args.ts +139 -0
  51. package/extensions/subagent/pi-spawn.ts +101 -0
  52. package/extensions/subagent/post-exit-stdio-guard.ts +88 -0
  53. package/extensions/subagent/prompt-template-bridge.ts +400 -0
  54. package/extensions/subagent/prompts/gather-context-and-clarify.md +13 -0
  55. package/extensions/subagent/prompts/parallel-cleanup.md +42 -0
  56. package/extensions/subagent/prompts/parallel-research.md +50 -0
  57. package/extensions/subagent/prompts/parallel-review.md +40 -0
  58. package/extensions/subagent/render-helpers.ts +83 -0
  59. package/extensions/subagent/render.ts +908 -0
  60. package/extensions/subagent/result-intercom.ts +238 -0
  61. package/extensions/subagent/result-watcher.ts +172 -0
  62. package/extensions/subagent/run-history.ts +58 -0
  63. package/extensions/subagent/run-status.ts +137 -0
  64. package/extensions/subagent/schemas.ts +165 -0
  65. package/extensions/subagent/session-tokens.ts +51 -0
  66. package/extensions/subagent/settings.ts +368 -0
  67. package/extensions/subagent/single-output.ts +98 -0
  68. package/extensions/subagent/skills.ts +627 -0
  69. package/extensions/subagent/slash-bridge.ts +177 -0
  70. package/extensions/subagent/slash-commands.ts +304 -0
  71. package/extensions/subagent/slash-live-state.ts +295 -0
  72. package/extensions/subagent/subagent-control.ts +151 -0
  73. package/extensions/subagent/subagent-executor.ts +1915 -0
  74. package/extensions/subagent/subagent-prompt-runtime.ts +76 -0
  75. package/extensions/subagent/subagent-runner.ts +1471 -0
  76. package/extensions/subagent/subagents-status.ts +473 -0
  77. package/extensions/subagent/text-editor.ts +273 -0
  78. package/extensions/subagent/throttle.ts +77 -0
  79. package/extensions/subagent/top-level-async.ts +16 -0
  80. package/extensions/subagent/types.ts +624 -0
  81. package/extensions/subagent/utils.ts +457 -0
  82. package/extensions/subagent/worktree.ts +580 -0
  83. package/extensions/super-pi-extension/index.ts +2 -55
  84. package/package.json +14 -6
  85. package/skills/pi-subagents/SKILL.md +566 -0
package/README.md CHANGED
@@ -8,6 +8,8 @@ Install it, tell Pi what you want to build, then keep saying "continue" — it w
8
8
  pi install npm:@leing2021/super-pi
9
9
  ```
10
10
 
11
+ > **Upgrading from v0.21.0 or earlier?** Run `pi uninstall npm:pi-subagents` first, then `pi update`. Since v0.22.0, subagent capabilities are built-in — no separate package needed.
12
+
11
13
  ---
12
14
 
13
15
  ## Why Super Pi
@@ -26,121 +28,123 @@ Super Pi's answers:
26
28
 
27
29
  ---
28
30
 
29
- ## The Five-Step Loop
31
+ ## Quick Start
32
+
33
+ ### New idea
30
34
 
31
35
  ```
32
- 01-brainstorm 02-plan 03-work 04-review 05-learn
33
- think plan build review learn
36
+ You: I want to build a tool that helps indie devs find users
37
+
38
+ → Auto-enters 01-brainstorm, YC-style interrogation
39
+ → Generates docs/brainstorms/2026-04-18-find-users-requirements.md
40
+ → Recommends next: 02-plan
41
+
42
+ You: continue
43
+
44
+ → 02-plan breaks into units, optional CEO Review
45
+ → 03-work parallel execution, checkpoint resume
46
+ → 04-review code review + optional browser QA
47
+ → 05-learn knowledge compounding
34
48
  ```
35
49
 
36
- Each step has a dedicated skill + tool pair. Not just prompts — structured toolchains.
50
+ ### Adding a feature
37
51
 
38
- ### New: Stage model routing
52
+ ```
53
+ You: I want to add user authentication to the project
39
54
 
40
- Configure once in `.pi/settings.json`:
55
+ 01-brainstorm CE mode: OAuth2? JWT? MFA?
56
+ → Requirements doc → 02-plan → 03-work → 04-review → 05-learn
57
+ ```
58
+
59
+ ### Resume after interruption
41
60
 
42
- ```json
43
- {
44
- "modelStrategy": {
45
- "01-brainstorm": "claude-sonnet-4-20250514",
46
- "02-plan": "claude-opus-4-20250115",
47
- "03-work": "claude-sonnet-4-20250514",
48
- "04-review": "claude-sonnet-4-20250514",
49
- "05-learn": "claude-haiku-4-20250414",
50
- "default": "claude-sonnet-4-20250514"
51
- }
52
- }
53
61
  ```
62
+ You: /skill:03-work docs/plans/auth-plan.md
54
63
 
55
- How it works:
56
- - Model switching is handled automatically by the ce-core extension `input` hook — no manual `/model` needed.
57
- - When you type `/skill:01-brainstorm` through `/skill:05-learn`, the extension reads `modelStrategy[stage]` (or `modelStrategy.default`) and switches before the skill runs.
58
- - Supported formats: full reference (`"anthropic/claude-opus-4-1"`) or bare model id (`"claude-opus-4-1"`, reuses current provider).
59
- - Every stage prints a `📊 Pipeline Status` block with `Current / Output / Next`.
60
- - A `Switched model for <stage>: <provider>/<model>` notification appears when the model changes.
64
+ Auto-loads checkpoint, skips completed units, resumes from breakpoint
65
+ ```
61
66
 
62
- Quick example:
63
- 1. Run `/skill:01-brainstorm` — model auto-switches to the configured brainstorm model
64
- 2. Approve the design
65
- 3. Run `/skill:02-plan` model auto-switches to the configured plan model
66
- 4. Continue through each stage — model switches automatically at each step
67
+ ### Requirements changed
68
+
69
+ ```
70
+ You: Requirements changed, need to add SSO support
71
+
72
+ → 02-plan uses plan_diff to detect changes, patches incrementally
73
+ ```
67
74
 
68
75
  ---
69
76
 
70
- ## What Each Step Does
77
+ ## The Five-Step Loop
78
+
79
+ ```
80
+ 01-brainstorm → 02-plan → 03-work → 04-review → 05-learn
81
+ think plan build review learn
82
+ ```
83
+
84
+ Each step has a dedicated skill + tool pair. Not just prompts — structured toolchains.
71
85
 
72
86
  ### 01-brainstorm: Think First
73
87
 
74
- Not "describe your requirements." Three modes for three scenarios:
88
+ Three modes for three scenarios:
75
89
 
76
90
  | Mode | For | What it does |
77
91
  |------|-----|-------------|
78
- | **Startup Diagnostic** | Startup ideas, new products | Six YC-style forcing questions, pushed until you produce specific evidence (not "people are interested" — "who would freak out if this disappeared tomorrow?") |
79
- | **Builder Mode** | Side projects, hackathons | Only focused on building the coolest thing. If you accidentally mention revenue, it auto-upgrades to Startup Diagnostic |
80
- | **CE Brainstorm** | Adding features to existing projects | Multi-round dialog to clarify scope boundaries, generates a structured requirements doc |
92
+ | **Startup Diagnostic** | Startup ideas, new products | Six YC-style forcing questions, pushed until you produce specific evidence |
93
+ | **Builder Mode** | Side projects, hackathons | Focused on building. Accidentally mention revenue? Auto-upgrades to Startup Diagnostic |
94
+ | **CE Brainstorm** | Adding features to existing projects | Multi-round dialog to clarify scope, generates structured requirements doc |
81
95
 
82
- All three modes run a **premise challenge** (are your assumptions valid?) and **alternatives generation** (at least one minimal + one ideal approach) before you're allowed to move on.
96
+ All three run a **premise challenge** (are your assumptions valid?) and **alternatives generation** before you move on.
83
97
 
84
98
  ### 02-plan: Plan Well
85
99
 
86
- Breaks requirements into implementation units, each following strict **RED → GREEN → REFACTOR** (no production code without a failing test first).
87
-
88
- **Incremental updates**: Requirements changed? `plan_diff` detects added/removed/modified units and patches the plan instead of rewriting it.
100
+ Breaks requirements into implementation units with strict **RED → GREEN → REFACTOR**. Requirements changed? `plan_diff` patches incrementally instead of rewriting.
89
101
 
90
- **CEO Review (optional)**: After planning, you can request a CEO Review. It challenges your plan using Bezos reversible-decision frameworks, Munger inversion, Jobs subtraction, forces alternative approaches, and draws error maps. Like having a demanding CTO review your proposal for free.
102
+ **CEO Review (optional)**: Challenges your plan using Bezos reversible-decision frameworks, Munger inversion, Jobs subtraction. Like having a demanding CTO review for free.
91
103
 
92
104
  ### 03-work: Build Right
93
105
 
94
- **Parallel execution**: `task_splitter` uses a Union-Find algorithm to analyze file dependencies, feeds conflict-free units to `subagent` (parallel mode, via pi-subagents) for concurrent execution.
95
-
96
- **Checkpoint resume**: After each unit, a checkpoint is saved. Interrupted? Next startup auto-loads, skips completed work, continues from the breakpoint. Failed? `fail` records the error `retry` suggests a recovery strategy (timeout? extend timeout. Permission issue? check permissions first. Code error? fix then retry).
97
-
98
- **Strict TDD**: Run failing test → write minimal implementation → test passes → refactor. Every step requires command output as evidence. No skipping.
106
+ - **Parallel execution**: `task_splitter` analyzes file dependencies, feeds conflict-free units to `subagent` for concurrent execution
107
+ - **Checkpoint resume**: Interrupted? Next startup auto-loads, skips completed work, continues from breakpoint
108
+ - **Strict TDD**: Failing test minimal implementation test passesrefactor. Every step requires command output as evidence
99
109
 
100
110
  ### 04-review: Review Thoroughly
101
111
 
102
- **Structured code review**: `review_router` auto-assigns reviewer personas based on diff metadata (changed payment code? bring in the security reviewer). Review discipline is technical evaluation, not theater — every finding must cite specific code, YAGNI checks, no performative agreement.
112
+ `review_router` auto-assigns reviewer personas based on diff metadata. Every finding must cite specific code no performative agreement.
103
113
 
104
- **Browser QA (optional)**: Uses `agent-browser` to open your app, click through pages, screenshot bugs, fix by severity, up to 3 auto-fix iterations. Can auto-generate regression tests. Like having a QA engineer run acceptance tests.
114
+ **Browser QA (optional)**: Opens your app, clicks through pages, screenshots bugs, fixes by severity, up to 3 auto-fix iterations.
105
115
 
106
116
  ### 05-learn: Compound Learnings
107
117
 
108
- `pattern_extractor` scans existing artifacts, extracts and categorizes patterns. Turns "the pitfall we hit this time" into a YAML-tagged solution card in `docs/solutions/`.
109
-
110
- Two-level storage: project-specific → inside the project; cross-project → `~/.pi/agent/docs/solutions/` globally searchable.
118
+ Turns "the pitfall we hit this time" into a YAML-tagged solution card in `docs/solutions/`. Two-level storage: project-specific and global (`~/.pi/agent/docs/solutions/`).
111
119
 
112
- Next time `02-plan` or `04-review` runs, a grep-first search strategy automatically retrieves relevant past experience.
120
+ Next time `02-plan` or `04-review` runs, relevant past experience is automatically retrieved.
113
121
 
114
122
  ---
115
123
 
116
- ## Optional: pi-subagents Integration
124
+ ## Built-in Capabilities
117
125
 
118
- For enhanced workflow capabilities, install pi-subagents:
119
-
120
- ```bash
121
- pi install npm:pi-subagents
122
- ```
126
+ One package includes everything:
123
127
 
124
- This enables:
128
+ | What | How to Access |
129
+ |------|--------------|
130
+ | **Agent Manager TUI** | `/agents` or `Ctrl+Shift+A` |
131
+ | **CE Agents** (ce-scout, ce-planner, etc.) | Via subagent tool |
132
+ | **CE Chains** (scout → planner → worker → reviewer) | Via subagent tool |
133
+ | **Parallel execution** | Via subagent tool |
134
+ | **Stage Model Sync** | Automatic — set `modelStrategy` / `thinkingStrategy` in `.pi/settings.json` |
135
+ | **Diagnostics** | `/subagents-status`, `/subagents-doctor` |
125
136
 
126
- | Feature | Command | Description |
127
- |---------|---------|-------------|
128
- | **CE Agents** | `/run ce-worker "execute plan"` | Pre-configured agents aligned with stages |
129
- | **CE Chains** | `/run-chain ce-standard -- implement feature` | Scout → Planner → Worker → Reviewer |
130
- | **Parallel Review** | `/run-chain ce-parallel-review --` | 3-way review: correctness + tests + complexity |
131
- | **Stage Model Sync** | Automatic | `modelStrategy` + `thinkingStrategy` synced to agent configs |
137
+ ### Stage model routing
132
138
 
133
- Without it, super-pi works normally but CE Agent/Chain features are unavailable.
134
-
135
- ### How Model/Thinking Sync Works
136
-
137
- The extension reads `modelStrategy` and `thinkingStrategy` from `.pi/settings.json` and automatically syncs them to pi-subagents agent overrides:
139
+ Configure once in `.pi/settings.json`:
138
140
 
139
141
  ```json
140
142
  {
141
143
  "modelStrategy": {
142
- "02-plan": "gpt-5.5",
143
- "03-work": "glm-5.1"
144
+ "01-brainstorm": "claude-sonnet-4-20250514",
145
+ "02-plan": "claude-opus-4-20250115",
146
+ "03-work": "claude-sonnet-4-20250514",
147
+ "default": "claude-sonnet-4-20250514"
144
148
  },
145
149
  "thinkingStrategy": {
146
150
  "02-plan": "high",
@@ -149,140 +153,41 @@ The extension reads `modelStrategy` and `thinkingStrategy` from `.pi/settings.js
149
153
  }
150
154
  ```
151
155
 
152
- This ensures your stage-specific models and thinking levels are used when CE Agents execute.
156
+ Model switching is handled automatically no manual `/model` needed. When you run any CE skill, the extension reads the config and switches before the skill runs. Supported formats: full reference (`"anthropic/claude-opus-4-1"`) or bare model id (`"claude-opus-4-1"`).
153
157
 
154
158
  ---
155
159
 
156
160
  ## Technical Architecture
157
161
 
158
- ### 10 Skills (workflow nodes)
159
-
160
- | Skill | One-liner | Core Tool |
161
- |-------|-----------|-----------|
162
- | `01-brainstorm` | Deep requirements mining in three modes | `brainstorm_dialog` |
163
- | `02-plan` | Break into units, TDD gates, incremental updates | `plan_diff` |
164
- | `03-work` | Parallel execution, checkpoint resume, error recovery | `session_checkpoint`, `task_splitter`, `subagent` (pi-subagents) |
165
- | `04-review` | Persona-routed review + live browser testing | `review_router` |
166
- | `05-learn` | Pattern extraction → knowledge card compounding | `pattern_extractor` |
167
- | `06-next` | Not sure what to do next? Ask this | `workflow_state`, `session_history` |
168
- | `07-worktree` | Git worktree isolated development | `worktree_manager` |
169
- | `08-status` | Scan artifacts, report progress | `workflow_state`, `session_history` |
170
- | `09-help` | Usage guide | — |
171
- | `10-rules` | Progressive rule loading for coding standards | — |
172
-
173
- ### 15 Tools (underlying capabilities)
174
-
175
- | Tool | What it does |
176
- |------|-------------|
177
- | `task_splitter` | Union-Find algorithm analyzes file dependencies, auto-groups parallel-safe units |
178
- | `session_checkpoint` | JSON-persisted checkpoints with save/load/fail/retry operations |
179
- | `plan_diff` | Incremental plans: compare detects diffs, patch applies changes |
180
- | `subagent` | Parallel & serial subagent execution via pi-subagents (async, TUI, agent CRUD) |
181
- | `review_router` | Auto-assign reviewer personas from diff metadata |
182
- | `pattern_extractor` | Extract and categorize patterns from artifacts |
183
- | `brainstorm_dialog` | Multi-round dialog state machine (start → refine × N → summarize) |
184
- | `session_history` | Cross-session execution history recording and querying |
185
- | `workflow_state` | Scan docs/ and .context/ to summarize workflow state |
186
- | `worktree_manager` | Full git worktree lifecycle management |
187
- | `artifact_helper` | Artifact path resolution and directory creation |
188
- | `ask_user_question` | Structured user prompts (choices / free input) |
189
- | `subagent` | Serial subagent chain with depth guard and context control |
190
- | `subagent-depth-guard` | Env-based recursion depth tracking (prevents runaway nesting) |
191
- | `async-mutex` | Serializes `process.env` mutation for concurrency-safe child process spawning |
192
-
193
- ---
194
-
195
- ## Token Cost
162
+ ### Core: Five-Step Loop
196
163
 
197
- New conversation overhead: **~2,500 tokens** (1.26% of Claude Sonnet 4's 200K context).
164
+ | Skill | What | Core Tool |
165
+ |-------|------|----------|
166
+ | `01-brainstorm` | Three-mode requirements mining (Startup Diagnostic / Builder / CE) | `brainstorm_dialog` |
167
+ | `02-plan` | Break into units with TDD gates, incremental `plan_diff` updates | `plan_diff` |
168
+ | `03-work` | Parallel execution, checkpoint resume, error recovery | `session_checkpoint`, `task_splitter`, `subagent` |
169
+ | `04-review` | Persona-routed review + live browser QA | `review_router` |
170
+ | `05-learn` | Pattern extraction → searchable knowledge cards | `pattern_extractor` |
198
171
 
199
- | Component | Tokens | When loaded |
200
- |-----------|--------|-------------|
201
- | 10 skill registrations | ~615 | Every conversation (fixed) |
202
- | 13 tool registrations | ~1,914 | Every conversation (fixed) |
203
- | Hooks & filters | 0 | Runtime interception, zero prompt cost |
204
- | Single skill trigger | ~1,000–4,000 | On-demand via `read` |
205
- | Rules minimal (2 files) | ~900 | Before plan/work |
206
- | Rules + language (7 files) | ~2,600 | Before work with specific language |
172
+ ### Utilities
207
173
 
208
- | vs bare Pi | vs global rules injection | vs super-pi |
209
- |-----------|----------------------|------------|
210
- | No rules | All rules loaded upfront | Progressive on-demand |
211
- | No output filtering | No output filtering | Auto-compress (bash ~65–98%, read ~30–60%) |
212
- | No TDD gate | No TDD gate | Hard gate prevents rework |
213
- | 0 tokens | ~5,000–36,000 tokens | **~2,500 tokens** |
174
+ | Skill | One-liner |
175
+ |-------|-----------|
176
+ | `06-next` | Recommend the best next skill based on workflow state |
177
+ | `07-worktree` | Git worktree isolated development |
178
+ | `08-status` | Scan artifacts, report progress |
179
+ | `09-help` | Usage guide |
180
+ | `10-rules` | Progressive rule loading for coding standards |
214
181
 
215
- Single `npm install` output filtered once pays for the entire overhead. Full evaluation → [`docs/token-cost-evaluation.md`](docs/token-cost-evaluation.md)
182
+ ### Progressive Rule Loading
216
183
 
217
- ---
184
+ Built-in `rules/` directory with 13 language layers (TypeScript, Python, Rust, Go, Java, Kotlin, C#, C++, Dart, PHP, Perl, Swift, Elixir) + common + web — 78 Markdown files total.
218
185
 
219
- ## Code Scale
186
+ Rules load **progressively** — never all at once, only what the current task needs. Zero waste.
220
187
 
221
- ~2800 lines of TypeScript implementing 16 tools, 22 Markdown reference files + 78 rule files driving 10 skills, 175 tests covering all tool logic.
222
-
223
- Not a heavy framework. Each tool has a single responsibility, each skill works independently, and together they form a complete workflow.
224
-
225
- ---
226
-
227
- ## Quick Start
188
+ Customize for your project: create a `rules/` directory in your project root. Project-level rules override package defaults. See `10-rules` skill for details.
228
189
 
229
- ### New idea
230
-
231
- ```
232
- You: I want to build a tool that helps indie devs find users
233
-
234
- → Auto-enters 01-brainstorm, YC-style interrogation
235
- → Generates docs/brainstorms/2026-04-18-find-users-requirements.md
236
- → Recommends next: 02-plan
237
-
238
- You: continue
239
-
240
- → 02-plan breaks into units, optional CEO Review
241
- → Generates docs/plans/2026-04-18-find-users-plan.md
242
-
243
- You: continue
244
-
245
- → 03-work parallel execution, checkpoint resume
246
- → 04-review code review + optional browser QA
247
- → 05-learn knowledge compounding
248
- ```
249
-
250
- ### Adding a feature
251
-
252
- ```
253
- You: I want to add user authentication to the project
254
-
255
- → 01-brainstorm CE mode, multi-round dialog: OAuth2? JWT? MFA?
256
- → Requirements doc → 02-plan → 03-work → 04-review → 05-learn
257
- ```
258
-
259
- ### Resume after interruption
260
-
261
- ```
262
- You: /skill:03-work docs/plans/auth-plan.md
263
-
264
- → Auto-loads checkpoint, skips completed units, resumes from breakpoint
265
- ```
266
-
267
- ### Requirements changed
268
-
269
- ```
270
- You: Requirements changed, need to add SSO support
271
-
272
- → 02-plan uses plan_diff to detect changes, patches incrementally
273
- ```
274
-
275
- ### Check progress anytime
276
-
277
- ```
278
- You: /skill:08-status
279
-
280
- → Scans all artifacts, shows progress + recommends next step
281
- ```
282
-
283
- ---
284
-
285
- ## Generated File Structure
190
+ ### Generated File Structure
286
191
 
287
192
  ```
288
193
  your-project/
@@ -299,94 +204,6 @@ your-project/
299
204
 
300
205
  **Recommendation: commit everything to git** — these files are the project's traceable memory.
301
206
 
302
- ### `10-rules`: Progressive Rule Loading
303
-
304
- Built-in coding rules live under `rules/` in the package. The `10-rules` skill loads them **progressively** — never all at once, only what the current task needs.
305
-
306
- **How it works:**
307
-
308
- ```
309
- system prompt (30 tokens: skill name + description)
310
- → 10-rules SKILL.md (~200 tokens: loading decision tree)
311
- → specific rule files via read tool (on-demand, 900–2600 tokens)
312
- ```
313
-
314
- Three CE skills auto-trigger rule loading at their entry points:
315
-
316
- | Skill | Rules pre-loaded |
317
- |-------|-----------------|
318
- | `02-plan` | `common/` rules + language detection + matching language rules (e.g. `rules/typescript/`) |
319
- | `03-work` | `common/` rules + language detection + matching language rules + `web/` if frontend |
320
- | `04-review` | `common/code-review.md` + language detection + matching language rules + `web/` if frontend |
321
-
322
- **Rule precedence** (when layers overlap on the same topic):
323
-
324
- ```
325
- language-specific > web > common
326
- ```
327
-
328
- No rules are loaded when you brainstorm, check status, or do non-code tasks. Zero waste.
329
-
330
- #### Included rule layers
331
-
332
- | Layer | Files | When loaded |
333
- |-------|-------|------------|
334
- | `common/` | 10 files | Always (baseline for all tasks) |
335
- | `typescript/`, `python/`, `cpp/`, `csharp/`, `dart/`, `golang/`, `java/`, `kotlin/`, `perl/`, `php/`, `rust/`, `swift/` | 5 files each | When the task touches that language |
336
- | `web/` | 7 files (includes `design-quality.md`, `performance.md`) | When frontend/browser is relevant |
337
-
338
- #### Customizing rules for your project
339
-
340
- Two rule sources exist, with project-level taking priority:
341
-
342
- | Source | Location | Survives `pi update`? |
343
- |--------|----------|----------------------|
344
- | **Project-level** | `{your-project-root}/rules/` | ✅ Yes |
345
- | Package-level | Inside `node_modules/@leing2021/super-pi/rules/` | ❌ No |
346
-
347
- To customize, create a `rules/` directory in your project root. `10-rules` checks it first — if a file exists there, it overrides the package default for that topic.
348
-
349
- **Add a language** — create a new directory with the 5 standard topics:
350
-
351
- ```bash
352
- mkdir rules/elixir
353
- touch rules/elixir/{coding-style,testing,patterns,security,hooks}.md
354
- ```
355
-
356
- Each file should start with:
357
-
358
- ```markdown
359
- > This file extends [common/xxx.md](../common/xxx.md) with Elixir-specific content.
360
- ```
361
-
362
- **Remove unused languages** — just delete the directory:
363
-
364
- ```bash
365
- rm -rf rules/perl rules/cpp # don't need these? remove them
366
- ```
367
-
368
- **Tweak a rule** — edit the `.md` file directly:
369
-
370
- ```bash
371
- # Override testing conventions for your team
372
- vim rules/common/testing.md
373
-
374
- # Override for a specific language
375
- vim rules/typescript/testing.md
376
- ```
377
-
378
- **Add a new topic** — create a new `.md` in the appropriate layer:
379
-
380
- ```bash
381
- # Common topic
382
- vim rules/common/api-design.md
383
-
384
- # Language-specific override
385
- vim rules/python/api-design.md
386
- ```
387
-
388
- The `10-rules` skill will pick up any `.md` file in `rules/` — no configuration needed. If a language directory exists, it's available for loading. If it's gone, it's simply never loaded.
389
-
390
207
  ---
391
208
 
392
209
  ## Design Philosophy & Acknowledgements
@@ -397,6 +214,7 @@ The goal isn't making AI write code faster — it's making AI think before writi
397
214
 
398
215
  The following projects directly inspired this work:
399
216
 
217
+ - **[pi-subagents](https://github.com/nicobailon/pi-subagents)** (by Nico Bailon, MIT License) → Full subagent runtime integrated as built-in extension (serial, parallel, chain, async, TUI, agent CRUD)
400
218
  - **[everything-claude-code](https://github.com/affaan-m/everything-claude-code)** (162K★) → Parallel subagent orchestration, checkpoint resume, continuous learning
401
219
  - **[superpowers](https://github.com/obra/superpowers)** (161K★) → Strict TDD gates, design checklists, review discipline
402
220
  - **[gstack](https://github.com/garrytan/gstack)** (78K★) → YC-style forcing questions, CEO Review frameworks, browser QA
@@ -410,7 +228,7 @@ Not a fork. Not a wrapper. Methodologies extracted and rebuilt with Pi's native
410
228
 
411
229
  | Tip | Why |
412
230
  |-----|-----|
413
- | Start with 01-brainstorm | Whatever the scenario, thinking first never hurts |
231
+ | Start with 01-brainstorm | Thinking first never hurts |
414
232
  | Use 07-worktree for big features | Isolated dev, no impact on main branch |
415
233
  | Use CEO Review on plans | Like having a demanding CTO review for free |
416
234
  | Use browser QA for acceptance | Code review can't catch layout breaks and blank screens |
@@ -421,136 +239,118 @@ Not a fork. Not a wrapper. Methodologies extracted and rebuilt with Pi's native
421
239
 
422
240
  ## Changelog
423
241
 
242
+ ### 0.22.1 — Fix terminal freeze during parallel subagent execution
243
+ - Fixed terminal freeze and scroll lock when running 8+ parallel subagents.
244
+ - Added adaptive widget animation intervals: 250ms–1000ms based on running job count.
245
+ - Added `createThrottle()` for foreground parallel `onUpdate` with flush/dispose lifecycle.
246
+ - Added render dedup via content hash to skip unchanged `requestRender()` calls.
247
+ - Reduced activity timer and async poller frequencies with adaptive scaling.
248
+ - Extracted `stopAnimationTimer()` to prevent state loss during dynamic interval switching.
249
+ - 197 tests passing (28 new for render optimization).
250
+
251
+ ### 0.22.0 — Source-integrated pi-subagents
252
+ - Integrated pi-subagents v0.20.1 source code into `extensions/subagent/` — single package install (`pi install npm:@leing2021/super-pi`).
253
+ - Moved `typebox` from peerDependencies to dependencies.
254
+ - Removed `pi-subagents` peer dependency — no longer needed.
255
+ - Simplified `super-pi-extension/index.ts`: removed faulty installation detection and auto-install logic.
256
+ - Pruned slash commands: removed `/run`, `/chain`, `/run-chain`, `/parallel`; kept `/agents` (TUI), `/subagents-status`, `/subagents-doctor`, and `Ctrl+Shift+A` shortcut.
257
+ - Added 8 new tests covering subagent extension structure, agent counts, and integration integrity.
258
+ - 169 tests passing.
259
+
424
260
  ### 0.21.0 — Delegate subagent tools to pi-subagents
261
+ - Subagent capabilities now provided by the `pi-subagents` package.
425
262
  - Removed `subagent` and `parallel_subagent` tool registrations from `ce-core` extension.
426
- - Subagent capabilities (serial, parallel, chain, async, TUI, agent CRUD) now provided by the `pi-subagents` package.
427
- - Removed `AsyncMutex`, `subagent-depth-guard` exports — no longer needed in this package.
428
- - Added `pi-subagents` as a peer dependency in `package.json`.
429
- - Updated `03-work` skill, `ce-worker` agent, and all README references from `parallel_subagent` to `subagent` (pi-subagents).
430
- - Renamed internal `path` variable to `filePath` in read-output-filter to avoid shadowing.
431
-
432
- ### 0.20.0 — Extension API migration + v0.19.7 rework
433
- - Migrated `super-pi-extension` from legacy `export default { load() }` object format to Pi-native factory function `(pi: ExtensionAPI) => void`.
434
- - Replaced hardcoded `ExtensionContext` import with `ExtensionAPI`-only — context now provided via event handler.
435
- - Removed dead auto-install comment block and unused `ExtensionContext` type import.
436
- - Restored v0.19.6 changelog entry that was accidentally overwritten by the v0.19.7 release commit.
437
263
 
438
- ### 0.19.6pi-subagents integration extension
439
- - New `super-pi-extension`: pre-configured CE Agents (ce-scout, ce-planner, ce-worker, ce-reviewer, ce-oracle) and CE Chains (ce-standard, ce-review-only, ce-parallel-review).
440
- - New `thinkingStrategy` setting: per-stage thinking level sync (`modelStrategy` + `thinkingStrategy` → `subagents.agentOverrides`).
441
- - Removed hardcoded `model` and `thinking` from CE Agent frontmatter — now fully driven by settings.
442
- - Added graceful pi-subagents dependency detection with install instructions on extension load.
443
- - Updated `03-work`, `04-review`, `06-next` skills with pi-subagents integration docs.
444
- - Updated README with Optional: pi-subagents Integration section.
264
+ ### 0.20.0Extension API migration
265
+ - Migrated `super-pi-extension` to Pi-native factory function format.
445
266
 
446
- ### 0.19.5 — Plan/Work/Review skill rules loading alignment
267
+ <details>
268
+ <summary>Older versions</summary>
447
269
 
448
- ---
270
+ ### 0.19.6 — pi-subagents integration extension
271
+ - New `super-pi-extension`: pre-configured CE Agents and CE Chains.
272
+ - New `thinkingStrategy` setting: per-stage thinking level sync.
449
273
 
450
- > **Note:** v0.19.7 was a broken release version bump with no code change, changelog entry for v0.19.6 overwritten. v0.20.0 supersedes it.
451
- - Fixed `02-plan` not loading language-specific rules (e.g. `rules/typescript/`) during the planning phase — only `common/` rules were loaded.
452
- - Fixed `03-work` Core rules missing explicit `common/` loading and `web/` conditional loading (10-rules defined them but the skill's own instructions didn't).
453
- - Fixed `04-review` Core rules missing explicit language detection method and `web/` conditional loading.
454
- - Updated all three skills to use a consistent 4-step progressive loading strategy (common → language detect → language rules → web rules).
455
- - Updated `10-rules` SKILL.md Pre-flight to include complete language detection mapping for all three phases.
456
- - Synced `README.md` and `README_CN.md` skill tables to reflect the unified loading strategy.
274
+ ### 0.19.5Plan/Work/Review skill rules loading alignment
275
+ - Fixed `02-plan` not loading language-specific rules during the planning phase.
276
+ - Updated all three skills to use a consistent 4-step progressive loading strategy.
457
277
 
458
278
  ### 0.19.4 — Read output filter markdown truncation fix
459
- - Fixed `read-output-filter` over-truncating markdown files: raised markdown threshold from 2KB → 8KB.
460
- - Improved `filterMarkdown()` to fully preserve list items (`-`, `*`, numbered) and keep first 3 lines of paragraphs (was 1).
461
- - Filter notice now includes actual file path in actionable guidance (`bash cat <path>`).
462
- - Added 5 new tests covering list preservation, markdown threshold gate, and path-in-notice.
463
- - 175 tests passing.
279
+ - Fixed `read-output-filter` over-truncating markdown files.
280
+ - Added 5 new tests. 175 tests passing.
464
281
 
465
282
  ### 0.19.3 — Terminate fix + runtime model routing + autoContinue removal
466
- - Fixed 6 ce-core tools (`brainstorm_dialog`, `workflow_state`, `review_router`, `session_checkpoint`, `session_history`, `pattern_extractor`) incorrectly returning `terminate: true`, which caused agent turns to end prematurely (brainstorm questions not shown, "type continue to proceed" interruptions).
467
- - Implemented runtime stage model routing via ce-core extension `input` hook: reads `.pi/settings.json` `modelStrategy`, auto-switches model before skill execution. Supports full reference (`anthropic/claude-opus-4-1`) and bare model id (`claude-opus-4-1`).
468
- - Removed `pipeline.autoContinue` configuration (never had runtime implementation; Pi lacks `skill_end` event for auto-continue).
469
- - Updated `skills/references/pipeline-config.md`, `README.md`, `README_CN.md` to reflect runtime model routing behavior.
470
- - Added 4 new tests covering terminate regression, input hook model routing, and bare model id parsing.
283
+ - Fixed 6 ce-core tools incorrectly returning `terminate: true`.
284
+ - Implemented runtime stage model routing via ce-core extension `input` hook.
471
285
 
472
286
  ### 0.19.2 — Evidence-first handoff-lite + docs tracking rule
473
- - Added `context_handoff` with evidence-first default handoff-lite generation when markdown is omitted.
474
- - Standardized the shared handoff-lite template across 01-05 workflow handoffs via `skills/references/pipeline-config.md`.
475
- - Added tests protecting default handoff generation and the shared handoff docs contract.
476
- - Updated docs tracking so Git only uploads `docs/token-cost-evaluation.md` while other `docs/` artifacts stay local.
287
+ - Added `context_handoff` with evidence-first default handoff-lite generation.
477
288
 
478
289
  ### 0.19.1 — Pipeline config + typecheck baseline fix
479
- - Added shared pipeline config (`skills/references/pipeline-config.md`) for stage model routing via `.pi/settings.json`.
480
- - Added runtime stage model routing via ce-core extension `input` hook (reads `modelStrategy` from `.pi/settings.json`, auto-switches model before skill execution).
481
- - Fixed TypeScript baseline issues so `bunx tsc --noEmit` passes.
290
+ - Added shared pipeline config for stage model routing.
482
291
 
483
292
  ### 0.19.0 — 0.69.0 alignment + learn rename
484
- - TypeBox migration: `@sinclair/typebox` → `typebox` (zero old-path imports)
485
- - Peer/dev dependency upgrade: pi-coding-agent `0.67.6` → `0.69.0`
486
- - Tool termination: 6 pure-query tools now return `terminate: true` to reduce unnecessary LLM rounds
487
- - Skill rename: `05-compound` → `05-learn` for clarity
293
+ - TypeBox migration: `@sinclair/typebox` → `typebox`.
294
+ - Peer/dev dependency upgrade: pi-coding-agent `0.67.6` → `0.69.0`.
295
+ - Skill rename: `05-compound` `05-learn`.
488
296
 
489
297
  ### 0.18.0 — Progressive rules
490
- - Built-in `rules/` directory with 13 language layers + common + web (78 Markdown files)
491
- - New `10-rules` skill: progressive on-demand loading, zero waste
492
- - `02-plan`, `03-work`, `04-review` auto-trigger rule loading at entry points
493
- - Users can add/remove languages and edit rules freely — plain Markdown, no config
494
- - 10 skills, 15 tools, 162 tests passing
298
+ - Built-in `rules/` directory with 13 language layers + common + web (78 Markdown files).
299
+ - New `10-rules` skill: progressive on-demand loading.
495
300
 
496
301
  ### 0.17.0 — Subagent safety
497
- - Recursion depth guard (`PI_SUBAGENT_DEPTH` / `PI_SUBAGENT_MAX_DEPTH`) prevents runaway nesting
498
- - Async mutex for `process.env` concurrency safety during parallel subagent execution
499
- - Context slimming: `inheritSkills` parameter, parallel workers default to slim context (`--no-skills`)
500
- - Shared `createSubagentRunner` factory (deduped runner closures)
501
- - 162 tests passing
302
+ - Recursion depth guard prevents runaway nesting.
303
+ - Async mutex for `process.env` concurrency safety.
502
304
 
503
305
  ### 0.16.0 — Context optimization
504
- - Read output filter: structural compression for large code files, lock files, markdown
505
- - Compaction optimizer: focused summary instructions for session compaction
506
- - Bash output filter improvements
306
+ - Read output filter: structural compression for large code files.
507
307
 
508
308
  ### 0.15.0 — Output filtering
509
- - Bash output filter: smart truncation by command type (install, test, build)
510
- - Read output filter: preserves structure while cutting verbosity
309
+ - Bash output filter: smart truncation by command type.
511
310
 
512
311
  ### 0.14.0 — Structured solution retrieval
513
- - YAML frontmatter tagging + grep-first two-level search
514
- - 95 tests passing
312
+ - YAML frontmatter tagging + grep-first two-level search.
515
313
 
516
314
  ### 0.13.0 — Superpowers engineering discipline
517
- - Strict TDD gates, design checklists, YAGNI checks
315
+ - Strict TDD gates, design checklists, YAGNI checks.
518
316
 
519
317
  ### 0.12.0 — Error recovery
520
- - session_checkpoint fail/retry operations
318
+ - session_checkpoint fail/retry operations.
521
319
 
522
320
  ### 0.11.0 — Pattern extraction
523
- - New pattern_extractor tool
321
+ - New pattern_extractor tool.
524
322
 
525
323
  ### 0.10.0 — Continuous learning
526
- - New session_history tool
324
+ - New session_history tool.
527
325
 
528
326
  ### 0.9.0 — Incremental planning
529
- - New plan_diff tool
327
+ - New plan_diff tool.
530
328
 
531
329
  ### 0.8.0 — Multi-round dialog
532
- - New brainstorm_dialog tool
330
+ - New brainstorm_dialog tool.
533
331
 
534
332
  ### 0.7.0 — Parallel grouping
535
- - Union-Find based task_splitter
333
+ - Union-Find based task_splitter.
536
334
 
537
335
  ### 0.6.0 — Checkpoint resume
538
- - New session_checkpoint tool
336
+ - New session_checkpoint tool.
539
337
 
540
338
  ### 0.5.0 — Parallel execution
541
- - New parallel_subagent tool (now delegated to pi-subagents)
339
+ - New parallel_subagent tool.
542
340
 
543
341
  ### 0.4.0 — Smart review
544
- - New review_router tool
342
+ - New review_router tool.
545
343
 
546
344
  ### 0.3.0 — Isolated development
547
- - New worktree_manager + 07-worktree
345
+ - New worktree_manager + 07-worktree.
548
346
 
549
347
  ### 0.2.0 — State awareness
550
- - New workflow_state + 06-next
348
+ - New workflow_state + 06-next.
551
349
 
552
350
  ### 0.1.0 — Initial release
553
- - 7 skills, 3 tools
351
+ - 7 skills, 3 tools.
352
+
353
+ </details>
554
354
 
555
355
  ---
556
356