@leing2021/super-pi 0.22.1 → 0.23.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.
Files changed (110) hide show
  1. package/README.md +253 -211
  2. package/extensions/ce-core/index.ts +190 -7
  3. package/extensions/ce-core/tools/parallel-subagent.ts +3 -3
  4. package/extensions/ce-core/tools/subagent.ts +2 -2
  5. package/package.json +4 -20
  6. package/rules/common/naming.md +154 -0
  7. package/skills/02-plan/SKILL.md +3 -2
  8. package/skills/03-work/SKILL.md +9 -6
  9. package/skills/04-review/SKILL.md +3 -2
  10. package/skills/06-next/SKILL.md +38 -10
  11. package/skills/06-next/references/recommendation-logic.md +2 -2
  12. package/skills/07-worktree/SKILL.md +9 -8
  13. package/skills/{09-help → 08-help}/SKILL.md +3 -3
  14. package/skills/{09-help → 08-help}/references/workflow-sequence.md +2 -1
  15. package/skills/references/language-detection.md +44 -0
  16. package/LICENSE +0 -21
  17. package/THIRD-PARTY-NOTICES.md +0 -35
  18. package/extensions/subagent/__tests__/async-job-tracker.test.ts +0 -21
  19. package/extensions/subagent/__tests__/execution-activity.test.ts +0 -15
  20. package/extensions/subagent/__tests__/parallel-render-stress.test.ts +0 -82
  21. package/extensions/subagent/__tests__/render-dedup.test.ts +0 -98
  22. package/extensions/subagent/__tests__/render-widget.test.ts +0 -28
  23. package/extensions/subagent/__tests__/throttle.test.ts +0 -90
  24. package/extensions/subagent/agent-management.ts +0 -596
  25. package/extensions/subagent/agent-manager-chain-detail.ts +0 -163
  26. package/extensions/subagent/agent-manager-detail.ts +0 -232
  27. package/extensions/subagent/agent-manager-edit.ts +0 -391
  28. package/extensions/subagent/agent-manager-list.ts +0 -279
  29. package/extensions/subagent/agent-manager-parallel.ts +0 -305
  30. package/extensions/subagent/agent-manager.ts +0 -706
  31. package/extensions/subagent/agent-scope.ts +0 -9
  32. package/extensions/subagent/agent-selection.ts +0 -26
  33. package/extensions/subagent/agent-serializer.ts +0 -124
  34. package/extensions/subagent/agent-templates.ts +0 -63
  35. package/extensions/subagent/agents/context-builder.md +0 -37
  36. package/extensions/subagent/agents/delegate.md +0 -9
  37. package/extensions/subagent/agents/oracle.md +0 -73
  38. package/extensions/subagent/agents/planner.md +0 -52
  39. package/extensions/subagent/agents/researcher.md +0 -50
  40. package/extensions/subagent/agents/reviewer.md +0 -38
  41. package/extensions/subagent/agents/scout.md +0 -48
  42. package/extensions/subagent/agents/worker.md +0 -52
  43. package/extensions/subagent/agents.ts +0 -762
  44. package/extensions/subagent/artifacts.ts +0 -101
  45. package/extensions/subagent/async-execution.ts +0 -521
  46. package/extensions/subagent/async-job-tracker.ts +0 -240
  47. package/extensions/subagent/async-status.ts +0 -242
  48. package/extensions/subagent/chain-clarify.ts +0 -1365
  49. package/extensions/subagent/chain-execution.ts +0 -854
  50. package/extensions/subagent/chain-serializer.ts +0 -127
  51. package/extensions/subagent/completion-dedupe.ts +0 -66
  52. package/extensions/subagent/doctor.ts +0 -201
  53. package/extensions/subagent/execution.ts +0 -748
  54. package/extensions/subagent/file-coalescer.ts +0 -43
  55. package/extensions/subagent/fork-context.ts +0 -64
  56. package/extensions/subagent/formatters.ts +0 -123
  57. package/extensions/subagent/frontmatter.ts +0 -32
  58. package/extensions/subagent/index.ts +0 -586
  59. package/extensions/subagent/intercom-bridge.ts +0 -241
  60. package/extensions/subagent/jsonl-writer.ts +0 -84
  61. package/extensions/subagent/model-fallback.ts +0 -109
  62. package/extensions/subagent/notify.ts +0 -111
  63. package/extensions/subagent/parallel-utils.ts +0 -109
  64. package/extensions/subagent/pi-args.ts +0 -139
  65. package/extensions/subagent/pi-spawn.ts +0 -101
  66. package/extensions/subagent/post-exit-stdio-guard.ts +0 -88
  67. package/extensions/subagent/prompt-template-bridge.ts +0 -400
  68. package/extensions/subagent/prompts/gather-context-and-clarify.md +0 -13
  69. package/extensions/subagent/prompts/parallel-cleanup.md +0 -42
  70. package/extensions/subagent/prompts/parallel-research.md +0 -50
  71. package/extensions/subagent/prompts/parallel-review.md +0 -40
  72. package/extensions/subagent/render-helpers.ts +0 -83
  73. package/extensions/subagent/render.ts +0 -908
  74. package/extensions/subagent/result-intercom.ts +0 -238
  75. package/extensions/subagent/result-watcher.ts +0 -172
  76. package/extensions/subagent/run-history.ts +0 -58
  77. package/extensions/subagent/run-status.ts +0 -137
  78. package/extensions/subagent/schemas.ts +0 -165
  79. package/extensions/subagent/session-tokens.ts +0 -51
  80. package/extensions/subagent/settings.ts +0 -368
  81. package/extensions/subagent/single-output.ts +0 -98
  82. package/extensions/subagent/skills.ts +0 -627
  83. package/extensions/subagent/slash-bridge.ts +0 -177
  84. package/extensions/subagent/slash-commands.ts +0 -304
  85. package/extensions/subagent/slash-live-state.ts +0 -295
  86. package/extensions/subagent/subagent-control.ts +0 -151
  87. package/extensions/subagent/subagent-executor.ts +0 -1915
  88. package/extensions/subagent/subagent-prompt-runtime.ts +0 -76
  89. package/extensions/subagent/subagent-runner.ts +0 -1471
  90. package/extensions/subagent/subagents-status.ts +0 -473
  91. package/extensions/subagent/text-editor.ts +0 -273
  92. package/extensions/subagent/throttle.ts +0 -77
  93. package/extensions/subagent/top-level-async.ts +0 -16
  94. package/extensions/subagent/types.ts +0 -624
  95. package/extensions/subagent/utils.ts +0 -457
  96. package/extensions/subagent/worktree.ts +0 -580
  97. package/extensions/super-pi-extension/agents/ce-oracle.md +0 -109
  98. package/extensions/super-pi-extension/agents/ce-planner.md +0 -116
  99. package/extensions/super-pi-extension/agents/ce-reviewer.md +0 -99
  100. package/extensions/super-pi-extension/agents/ce-scout.md +0 -80
  101. package/extensions/super-pi-extension/agents/ce-worker.md +0 -78
  102. package/extensions/super-pi-extension/chains/ce-parallel-review.chain.md +0 -34
  103. package/extensions/super-pi-extension/chains/ce-review-only.chain.md +0 -12
  104. package/extensions/super-pi-extension/chains/ce-standard.chain.md +0 -28
  105. package/extensions/super-pi-extension/index.ts +0 -129
  106. package/extensions/super-pi-extension/model-sync.ts +0 -204
  107. package/skills/08-status/SKILL.md +0 -41
  108. package/skills/08-status/references/artifact-locations.md +0 -10
  109. package/skills/10-rules/SKILL.md +0 -76
  110. package/skills/pi-subagents/SKILL.md +0 -566
package/README.md CHANGED
@@ -8,8 +8,6 @@ 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
-
13
11
  ---
14
12
 
15
13
  ## Why Super Pi
@@ -28,6 +26,173 @@ Super Pi's answers:
28
26
 
29
27
  ---
30
28
 
29
+ ## The Five-Step Loop
30
+
31
+ ```
32
+ 01-brainstorm → 02-plan → 03-work → 04-review → 05-learn
33
+ think plan build review learn
34
+ ```
35
+
36
+ Each step has a dedicated skill + tool pair. Not just prompts — structured toolchains.
37
+
38
+ ### New: Stage model routing
39
+
40
+ Configure once in `.pi/settings.json`:
41
+
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
+ ```
54
+
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.
61
+
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
+
68
+ ---
69
+
70
+ ## What Each Step Does
71
+
72
+ ### 01-brainstorm: Think First
73
+
74
+ Not "describe your requirements." Three modes for three scenarios:
75
+
76
+ | Mode | For | What it does |
77
+ |------|-----|-------------|
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 |
81
+
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.
83
+
84
+ ### 02-plan: Plan Well
85
+
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.
89
+
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.
91
+
92
+ ### 03-work: Build Right
93
+
94
+ **Parallel execution**: `task_splitter` uses a Union-Find algorithm to analyze file dependencies, feeds conflict-free units to `ce_parallel_subagent` 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.
99
+
100
+ ### 04-review: Review Thoroughly
101
+
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.
103
+
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.
105
+
106
+ ### 05-learn: Compound Learnings
107
+
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.
111
+
112
+ Next time `02-plan` or `04-review` runs, a grep-first search strategy automatically retrieves relevant past experience.
113
+
114
+ ---
115
+
116
+ ## Technical Architecture
117
+
118
+ ### 8 Skills (workflow nodes)
119
+
120
+ | Skill | One-liner | Core Tool |
121
+ |-------|-----------|-----------|
122
+ | `01-brainstorm` | Deep requirements mining in three modes | `brainstorm_dialog` |
123
+ | `02-plan` | Break into units, TDD gates, incremental updates | `plan_diff` |
124
+ | `03-work` | Parallel execution, checkpoint resume, error recovery | `session_checkpoint`, `task_splitter`, `ce_parallel_subagent` |
125
+ | `04-review` | Persona-routed review + live browser testing | `review_router` |
126
+ | `05-learn` | Pattern extraction → knowledge card compounding | `pattern_extractor` |
127
+ | `06-next` | What to do next + full status report | `workflow_state`, `session_history` |
128
+ | `07-worktree` | Git worktree isolated development | `worktree_manager` |
129
+ | `08-help` | Usage guide | — |
130
+
131
+
132
+ ### 14 Tools + 2 Helpers (underlying capabilities)
133
+
134
+ | Tool | What it does |
135
+ |------|-------------|
136
+ | `task_splitter` | Union-Find algorithm analyzes file dependencies, auto-groups parallel-safe units |
137
+ | `session_checkpoint` | JSON-persisted checkpoints with save/load/fail/retry operations |
138
+ | `plan_diff` | Incremental plans: compare detects diffs, patch applies changes |
139
+ | `ce_parallel_subagent` | `Promise.allSettled`-style CE parallel skill-based subagent execution with context slimming |
140
+ | `review_router` | Auto-assign reviewer personas from diff metadata |
141
+ | `pattern_extractor` | Extract and categorize patterns from artifacts |
142
+ | `brainstorm_dialog` | Multi-round dialog state machine (start → refine × N → summarize) |
143
+ | `session_history` | Cross-session execution history recording and querying |
144
+ | `workflow_state` | Scan docs/ and .context/ to summarize workflow state |
145
+ | `worktree_manager` | Full git worktree lifecycle management |
146
+ | `artifact_helper` | Artifact path resolution and directory creation |
147
+ | `ask_user_question` | Structured user prompts (choices / free input) |
148
+ | `ce_subagent` | CE serial skill-based subagent chain with depth guard and context control |
149
+ | `context_handoff` | Cross-stage context handoffs with evidence-first templates (save/load/latest/status) |
150
+ | `subagent-depth-guard` | Helper: env-based recursion depth tracking (prevents runaway nesting) |
151
+ | `async-mutex` | Helper: serializes `process.env` mutation for concurrency-safe child process spawning |
152
+
153
+ ### Compatibility with pi-subagents
154
+
155
+ super-pi's CE skill-router tools use a dedicated namespace to avoid runtime tool-name conflicts:
156
+
157
+ - **CE tools**: `ce_subagent` and `ce_parallel_subagent` — for CE pipeline skill execution
158
+ - **Generic `subagent`**: reserved for third-party agent extensions like [pi-subagents](https://www.npmjs.com/package/pi-subagents)
159
+
160
+ Both extensions can be installed simultaneously without tool collision. super-pi manages the CE pipeline (brainstorm → plan → work → review → learn); pi-subagents provides general-purpose multi-agent execution. No configuration needed — install both and each keeps its own tool namespace.
161
+
162
+ ---
163
+
164
+ ## Token Cost
165
+
166
+ New conversation overhead: **~2,600 tokens** (1.3% of Claude Sonnet 4's 200K context).
167
+
168
+ | Component | Tokens | When loaded |
169
+ |-----------|--------|-------------|
170
+ | 8 skill registrations | ~490 | Every conversation (fixed) |
171
+ | 14 tool registrations | ~2,055 | Every conversation (fixed) |
172
+ | Hooks & filters | 0 | Runtime interception, zero prompt cost |
173
+ | Single skill trigger | ~1,000–4,000 | On-demand via `read` |
174
+ | Rules minimal (2 files) | ~900 | Before plan/work |
175
+ | Rules + language (7 files) | ~2,600 | Before work with specific language |
176
+
177
+ | vs bare Pi | vs global rules injection | vs super-pi |
178
+ |-----------|----------------------|------------|
179
+ | No rules | All rules loaded upfront | Progressive on-demand |
180
+ | No output filtering | No output filtering | Auto-compress (bash ~65–98%, read ~30–60%) |
181
+ | No TDD gate | No TDD gate | Hard gate prevents rework |
182
+ | 0 tokens | ~5,000–36,000 tokens | **~2,600 tokens** |
183
+
184
+ Single `npm install` output filtered once pays for the entire overhead. Full evaluation → [`docs/token-cost-evaluation.md`](docs/token-cost-evaluation.md)
185
+
186
+ ---
187
+
188
+ ## Code Scale
189
+
190
+ ~2800 lines of TypeScript implementing 14 registered tools + 2 helpers, 23 Markdown reference files + 79 rule files driving 8 skills, 175 tests covering all tool logic.
191
+
192
+ Not a heavy framework. Each tool has a single responsibility, each skill works independently, and together they form a complete workflow.
193
+
194
+ ---
195
+
31
196
  ## Quick Start
32
197
 
33
198
  ### New idea
@@ -42,6 +207,10 @@ You: I want to build a tool that helps indie devs find users
42
207
  You: continue
43
208
 
44
209
  → 02-plan breaks into units, optional CEO Review
210
+ → Generates docs/plans/2026-04-18-find-users-plan.md
211
+
212
+ You: continue
213
+
45
214
  → 03-work parallel execution, checkpoint resume
46
215
  → 04-review code review + optional browser QA
47
216
  → 05-learn knowledge compounding
@@ -52,7 +221,7 @@ You: continue
52
221
  ```
53
222
  You: I want to add user authentication to the project
54
223
 
55
- → 01-brainstorm CE mode: OAuth2? JWT? MFA?
224
+ → 01-brainstorm CE mode, multi-round dialog: OAuth2? JWT? MFA?
56
225
  → Requirements doc → 02-plan → 03-work → 04-review → 05-learn
57
226
  ```
58
227
 
@@ -72,137 +241,122 @@ You: Requirements changed, need to add SSO support
72
241
  → 02-plan uses plan_diff to detect changes, patches incrementally
73
242
  ```
74
243
 
75
- ---
76
-
77
- ## The Five-Step Loop
244
+ ### Check progress anytime
78
245
 
79
246
  ```
80
- 01-brainstorm → 02-plan → 03-work → 04-review → 05-learn
81
- think plan build review learn
82
- ```
247
+ You: /skill:06-next
83
248
 
84
- Each step has a dedicated skill + tool pair. Not just prompts — structured toolchains.
249
+ Scans all artifacts, shows progress + recommends next step
250
+ ```
85
251
 
86
- ### 01-brainstorm: Think First
252
+ ---
87
253
 
88
- Three modes for three scenarios:
254
+ ## Generated File Structure
89
255
 
90
- | Mode | For | What it does |
91
- |------|-----|-------------|
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 |
256
+ ```
257
+ your-project/
258
+ ├── docs/
259
+ │ ├── brainstorms/ # Requirements (01-brainstorm)
260
+ │ ├── plans/ # Execution plans (02-plan)
261
+ │ └── solutions/ # Knowledge cards (05-learn)
262
+ └── .context/
263
+ └── compound-engineering/
264
+ ├── checkpoints/ # Breakpoint files (session_checkpoint)
265
+ ├── dialogs/ # Dialog state (brainstorm_dialog)
266
+ └── history/ # Execution history (session_history)
267
+ ```
95
268
 
96
- All three run a **premise challenge** (are your assumptions valid?) and **alternatives generation** before you move on.
269
+ **Recommendation: commit everything to git** these files are the project's traceable memory.
97
270
 
98
- ### 02-plan: Plan Well
271
+ ### Progressive Rule Loading
99
272
 
100
- Breaks requirements into implementation units with strict **RED GREEN REFACTOR**. Requirements changed? `plan_diff` patches incrementally instead of rewriting.
273
+ Built-in coding rules live under `rules/` in the package. Rules are loaded **progressively** by each skill never all at once, only what the current task needs.
101
274
 
102
- **CEO Review (optional)**: Challenges your plan using Bezos reversible-decision frameworks, Munger inversion, Jobs subtraction. Like having a demanding CTO review for free.
275
+ **How it works:**
103
276
 
104
- ### 03-work: Build Right
277
+ ```
278
+ system prompt (30 tokens: skill name + description)
279
+ → skill SKILL.md (~200 tokens: loading decision tree)
280
+ → specific rule files via read tool (on-demand, 900–2600 tokens)
281
+ ```
105
282
 
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 passes → refactor. Every step requires command output as evidence
283
+ Three skills auto-trigger rule loading at their entry points:
109
284
 
110
- ### 04-review: Review Thoroughly
285
+ | Skill | Rules pre-loaded |
286
+ |-------|-----------------|
287
+ | `02-plan` | `common/` rules + language detection + matching language rules (e.g. `rules/typescript/`) |
288
+ | `03-work` | `common/` rules + language detection + matching language rules + `web/` if frontend |
289
+ | `04-review` | `common/code-review.md` + language detection + matching language rules + `web/` if frontend |
111
290
 
112
- `review_router` auto-assigns reviewer personas based on diff metadata. Every finding must cite specific code no performative agreement.
291
+ Language detection uses file heuristics (see `skills/references/language-detection.md`): `tsconfig.json` TypeScript, `Cargo.toml` Rust, `go.mod` Go, etc.
113
292
 
114
- **Browser QA (optional)**: Opens your app, clicks through pages, screenshots bugs, fixes by severity, up to 3 auto-fix iterations.
293
+ **Rule precedence** (when layers overlap on the same topic):
115
294
 
116
- ### 05-learn: Compound Learnings
295
+ ```
296
+ language-specific > web > common
297
+ ```
117
298
 
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/`).
299
+ No rules are loaded when you brainstorm, check status, or do non-code tasks. Zero waste.
119
300
 
120
- Next time `02-plan` or `04-review` runs, relevant past experience is automatically retrieved.
301
+ #### Included rule layers
121
302
 
122
- ---
303
+ | Layer | Files | When loaded |
304
+ |-------|-------|------------|
305
+ | `common/` | 11 files (includes `naming.md`) | Always (baseline for all tasks) |
306
+ | `typescript/`, `python/`, `cpp/`, `csharp/`, `dart/`, `golang/`, `java/`, `kotlin/`, `perl/`, `php/`, `rust/`, `swift/` | 5 files each | When the task touches that language |
307
+ | `web/` | 7 files (includes `design-quality.md`, `performance.md`) | When frontend/browser is relevant |
123
308
 
124
- ## Built-in Capabilities
309
+ #### Customizing rules for your project
125
310
 
126
- One package includes everything:
311
+ Two rule sources exist, with project-level taking priority:
127
312
 
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` |
313
+ | Source | Location | Survives `pi update`? |
314
+ |--------|----------|----------------------|
315
+ | **Project-level** | `{your-project-root}/rules/` | Yes |
316
+ | Package-level | Inside `node_modules/@leing2021/super-pi/rules/` | No |
136
317
 
137
- ### Stage model routing
318
+ To customize, create a `rules/` directory in your project root. Skills check it first — if a file exists there, it overrides the package default for that topic.
138
319
 
139
- Configure once in `.pi/settings.json`:
320
+ **Add a language** — create a new directory with the 5 standard topics:
140
321
 
141
- ```json
142
- {
143
- "modelStrategy": {
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"
148
- },
149
- "thinkingStrategy": {
150
- "02-plan": "high",
151
- "03-work": "medium"
152
- }
153
- }
322
+ ```bash
323
+ mkdir rules/elixir
324
+ touch rules/elixir/{coding-style,testing,patterns,security,hooks}.md
154
325
  ```
155
326
 
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"`).
157
-
158
- ---
159
-
160
- ## Technical Architecture
161
-
162
- ### Core: Five-Step Loop
327
+ Each file should start with:
163
328
 
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` |
329
+ ```markdown
330
+ > This file extends [common/xxx.md](../common/xxx.md) with Elixir-specific content.
331
+ ```
171
332
 
172
- ### Utilities
333
+ **Remove unused languages** — just delete the directory:
173
334
 
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 |
335
+ ```bash
336
+ rm -rf rules/perl rules/cpp # don't need these? remove them
337
+ ```
181
338
 
182
- ### Progressive Rule Loading
339
+ **Tweak a rule** — edit the `.md` file directly:
183
340
 
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.
341
+ ```bash
342
+ # Override testing conventions for your team
343
+ vim rules/common/testing.md
185
344
 
186
- Rules load **progressively** never all at once, only what the current task needs. Zero waste.
345
+ # Override for a specific language
346
+ vim rules/typescript/testing.md
347
+ ```
187
348
 
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.
349
+ **Add a new topic** create a new `.md` in the appropriate layer:
189
350
 
190
- ### Generated File Structure
351
+ ```bash
352
+ # Common topic
353
+ vim rules/common/api-design.md
191
354
 
192
- ```
193
- your-project/
194
- ├── docs/
195
- │ ├── brainstorms/ # Requirements (01-brainstorm)
196
- │ ├── plans/ # Execution plans (02-plan)
197
- │ └── solutions/ # Knowledge cards (05-learn)
198
- └── .context/
199
- └── compound-engineering/
200
- ├── checkpoints/ # Breakpoint files (session_checkpoint)
201
- ├── dialogs/ # Dialog state (brainstorm_dialog)
202
- └── history/ # Execution history (session_history)
355
+ # Language-specific override
356
+ vim rules/python/api-design.md
203
357
  ```
204
358
 
205
- **Recommendation: commit everything to git**these files are the project's traceable memory.
359
+ Skills 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.
206
360
 
207
361
  ---
208
362
 
@@ -214,7 +368,6 @@ The goal isn't making AI write code faster — it's making AI think before writi
214
368
 
215
369
  The following projects directly inspired this work:
216
370
 
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)
218
371
  - **[everything-claude-code](https://github.com/affaan-m/everything-claude-code)** (162K★) → Parallel subagent orchestration, checkpoint resume, continuous learning
219
372
  - **[superpowers](https://github.com/obra/superpowers)** (161K★) → Strict TDD gates, design checklists, review discipline
220
373
  - **[gstack](https://github.com/garrytan/gstack)** (78K★) → YC-style forcing questions, CEO Review frameworks, browser QA
@@ -228,129 +381,18 @@ Not a fork. Not a wrapper. Methodologies extracted and rebuilt with Pi's native
228
381
 
229
382
  | Tip | Why |
230
383
  |-----|-----|
231
- | Start with 01-brainstorm | Thinking first never hurts |
384
+ | Start with 01-brainstorm | Whatever the scenario, thinking first never hurts |
232
385
  | Use 07-worktree for big features | Isolated dev, no impact on main branch |
233
386
  | Use CEO Review on plans | Like having a demanding CTO review for free |
234
387
  | Use browser QA for acceptance | Code review can't catch layout breaks and blank screens |
235
388
  | Don't panic on interruption | Next 03-work auto-resumes from checkpoint |
236
- | Use 08-status when lost | One glance shows where you are |
389
+ | Use 06-next when lost | One glance shows where you are and what to do next |
237
390
 
238
391
  ---
239
392
 
240
393
  ## Changelog
241
394
 
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
-
260
- ### 0.21.0 — Delegate subagent tools to pi-subagents
261
- - Subagent capabilities now provided by the `pi-subagents` package.
262
- - Removed `subagent` and `parallel_subagent` tool registrations from `ce-core` extension.
263
-
264
- ### 0.20.0 — Extension API migration
265
- - Migrated `super-pi-extension` to Pi-native factory function format.
266
-
267
- <details>
268
- <summary>Older versions</summary>
269
-
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.
273
-
274
- ### 0.19.5 — Plan/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.
277
-
278
- ### 0.19.4 — Read output filter markdown truncation fix
279
- - Fixed `read-output-filter` over-truncating markdown files.
280
- - Added 5 new tests. 175 tests passing.
281
-
282
- ### 0.19.3 — Terminate fix + runtime model routing + autoContinue removal
283
- - Fixed 6 ce-core tools incorrectly returning `terminate: true`.
284
- - Implemented runtime stage model routing via ce-core extension `input` hook.
285
-
286
- ### 0.19.2 — Evidence-first handoff-lite + docs tracking rule
287
- - Added `context_handoff` with evidence-first default handoff-lite generation.
288
-
289
- ### 0.19.1 — Pipeline config + typecheck baseline fix
290
- - Added shared pipeline config for stage model routing.
291
-
292
- ### 0.19.0 — 0.69.0 alignment + learn rename
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`.
296
-
297
- ### 0.18.0 — Progressive rules
298
- - Built-in `rules/` directory with 13 language layers + common + web (78 Markdown files).
299
- - New `10-rules` skill: progressive on-demand loading.
300
-
301
- ### 0.17.0 — Subagent safety
302
- - Recursion depth guard prevents runaway nesting.
303
- - Async mutex for `process.env` concurrency safety.
304
-
305
- ### 0.16.0 — Context optimization
306
- - Read output filter: structural compression for large code files.
307
-
308
- ### 0.15.0 — Output filtering
309
- - Bash output filter: smart truncation by command type.
310
-
311
- ### 0.14.0 — Structured solution retrieval
312
- - YAML frontmatter tagging + grep-first two-level search.
313
-
314
- ### 0.13.0 — Superpowers engineering discipline
315
- - Strict TDD gates, design checklists, YAGNI checks.
316
-
317
- ### 0.12.0 — Error recovery
318
- - session_checkpoint fail/retry operations.
319
-
320
- ### 0.11.0 — Pattern extraction
321
- - New pattern_extractor tool.
322
-
323
- ### 0.10.0 — Continuous learning
324
- - New session_history tool.
325
-
326
- ### 0.9.0 — Incremental planning
327
- - New plan_diff tool.
328
-
329
- ### 0.8.0 — Multi-round dialog
330
- - New brainstorm_dialog tool.
331
-
332
- ### 0.7.0 — Parallel grouping
333
- - Union-Find based task_splitter.
334
-
335
- ### 0.6.0 — Checkpoint resume
336
- - New session_checkpoint tool.
337
-
338
- ### 0.5.0 — Parallel execution
339
- - New parallel_subagent tool.
340
-
341
- ### 0.4.0 — Smart review
342
- - New review_router tool.
343
-
344
- ### 0.3.0 — Isolated development
345
- - New worktree_manager + 07-worktree.
346
-
347
- ### 0.2.0 — State awareness
348
- - New workflow_state + 06-next.
349
-
350
- ### 0.1.0 — Initial release
351
- - 7 skills, 3 tools.
352
-
353
- </details>
395
+ See [CHANGELOG.md](./CHANGELOG.md) for full version history.
354
396
 
355
397
  ---
356
398