@leing2021/super-pi 0.23.4 → 0.23.6

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
@@ -1,32 +1,86 @@
1
1
  # Super Pi
2
2
 
3
- **Turn your AI coding agent from "a tool that writes code" into "a reliable engineer."**
3
+ ![Super Pi Workflow](docs/assets/super-pi.png)
4
4
 
5
- Install it, tell Pi what you want to build, then keep saying "continue" — it walks through the full loop: **think → plan → build → review → compound learnings.**
5
+ [中文](README-CN.md) | [English](README.md)
6
+
7
+
8
+
9
+ **Turn your AI coding agent into a reliable engineer.**
10
+
11
+ Install, describe what you want to build, then keep saying "continue." Super Pi drives the full loop:
12
+
13
+ **think → plan → build → review → compound learnings.**
14
+
15
+ ```bash
16
+ pi install npm:@leing2021/super-pi
17
+ ```
18
+
19
+ ---
20
+
21
+ ## Highlights
22
+
23
+ - **Five-step loop** — brainstorm → plan → work → review → learn, with automatic skill routing
24
+ - **Checkpoint resume** — interrupted? Resume from the exact unit you left off
25
+ - **TDD enforcement** — every unit follows RED → GREEN → REFACTOR with hard gates
26
+ - **Parallel execution** — independent units run concurrently via `ce_parallel_subagent`
27
+ - **Evidence-first review** — auto-assigned reviewers across five axes, autofix loop
28
+ - **Knowledge compounding** — solved problems become searchable solution artifacts
29
+ - **Token-efficient** — ~2,600 tokens new-conversation overhead; progressive loading
30
+
31
+ ---
32
+
33
+ ## Quickstart
6
34
 
7
35
  ```bash
8
36
  pi install npm:@leing2021/super-pi
9
37
  ```
10
38
 
39
+ Then in Pi:
40
+
41
+ ```
42
+ You: I want to build a CLI tool that helps indie devs find early users
43
+
44
+ → 01-brainstorm: structured discovery → requirements artifact
45
+ → 02-plan: TDD-gated implementation units → plan artifact
46
+ → 03-work: parallel execution, checkpoint resume
47
+ → 04-review: five-axis findings, autofix loop
48
+ → 05-learn: knowledge compounding
49
+
50
+ You: continue
51
+ → Next skill recommended via /skill:06-next
52
+ ```
53
+
54
+ **Resume after interruption:**
55
+
56
+ ```
57
+ You: /skill:03-work docs/plans/plan.md
58
+ → Loads checkpoint, skips completed units, resumes from breakpoint
59
+ ```
60
+
11
61
  ---
12
62
 
13
63
  ## The Five-Step Loop
14
64
 
15
65
  ```
16
66
  01-brainstorm → 02-plan → 03-work → 04-review → 05-learn
17
- think plan build review learn
67
+ think plan build review learn
18
68
  ```
19
69
 
20
- | Skill | Does | Core Tool |
21
- |-------|------|-----------|
22
- | **01-brainstorm** | YC-style interrogation, three modes (Startup/Builder/CE) | `brainstorm_dialog` |
23
- | **02-plan** | RED→GREEN→REFACTOR, incremental updates, optional CEO Review | `plan_diff` |
24
- | **03-work** | Parallel execution, checkpoint resume, strict TDD | `ce_subagent`, `ce_parallel_subagent` |
25
- | **04-review** | Auto-assigned reviewers, structured findings, browser QA | `review_router` |
26
- | **05-learn** | Pattern extraction → searchable knowledge cards | `pattern_extractor` |
27
- | **06-next** | Next-step recommendation + full status report | `workflow_state` |
70
+ | Skill | What it does | Core tool |
71
+ |-------|-------------|-----------|
72
+ | **01-brainstorm** | Structured multi-round discovery | `brainstorm_dialog` |
73
+ | **02-plan** | TDD-gated implementation units, optional CEO Review | `plan_diff` |
74
+ | **03-work** | Parallel execution, checkpoint resume, strict TDD, stop-the-line | `ce_subagent`, `ce_parallel_subagent` |
75
+ | **04-review** | Auto-assigned reviewers, five-axis findings, autofix loop | `review_router` |
76
+ | **05-learn** | Pattern extraction → searchable solution artifacts | `pattern_extractor` |
77
+ | **06-next** | Next-step recommendation + workflow status | `workflow_state` |
28
78
  | **07-worktree** | Isolated git worktree development | `worktree_manager` |
29
- | **08-help** | Phase 1 skill explainer and usage guide | — |
79
+ | **08-help** | Phase 1 skill explainer | — |
80
+
81
+ ### Subagent tool namespace
82
+
83
+ Super Pi ships CE-specific tools named `ce_subagent` and `ce_parallel_subagent`. They are intentionally namespaced so they can coexist with the compatible third-party `pi-subagents` extension without tool-name collisions.
30
84
 
31
85
  ### Model & Thinking Routing
32
86
 
@@ -48,32 +102,46 @@ Configure in `.pi/settings.json`:
48
102
 
49
103
  Model and thinking level switch automatically — no manual `/model` needed.
50
104
 
51
- ### pi-subagents Compatibility
105
+ ## Design Philosophy & Acknowledgements
106
+
107
+ **80% planning and review, 20% execution.**
108
+
109
+ The goal is not to make AI write code faster. The goal is to make AI think before writing, review after writing, and compound what it learns.
110
+
111
+ Super Pi is not a fork or wrapper. It extracts useful methods from the projects below and rebuilds them with Pi-native skills, tools, artifacts, checkpoints, and handoffs.
52
112
 
53
- CE skill tools use a dedicated namespace (`ce_subagent`, `ce_parallel_subagent`) to avoid conflicts with third-party extensions like [pi-subagents](https://www.npmjs.com/package/pi-subagents). Both can coexist without configuration.
113
+ | Project | What Super Pi adopted |
114
+ |---------|------------------------|
115
+ | [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills) | "Use when" skill trigger conditions, source-driven verification, stop-the-line hard gate, anti-rationalization, and the five-axis review baseline. Adopted as embedded micro-patterns only — no new skills, tools, commands, or agents. |
116
+ | [everything-claude-code](https://github.com/affaan-m/everything-claude-code) | Parallel subagent orchestration, checkpoint resume, continuous learning loops, and token-conscious agent workflow design. |
117
+ | [superpowers](https://github.com/obra/superpowers) | Strict TDD gates, design checklists, review discipline, and the idea that agents need hard gates instead of gentle suggestions. |
118
+ | [compound-engineering-plugin](https://github.com/EveryInc/compound-engineering-plugin) | The five-step think → plan → build → review → learn loop and the knowledge-compounding backbone. |
119
+ | [gstack](https://github.com/garrytan/gstack) | YC-style forcing questions, CEO Review cognitive frameworks, browser QA patterns, failure maps, and evidence-first validation. |
54
120
 
55
121
  ---
56
122
 
57
- ## Quick Start
123
+ ## Behavioral Gates
58
124
 
59
- ```
60
- You: I want to build a tool that helps indie devs find users
125
+ ### Stop-the-line (Hard gate)
61
126
 
62
- 01-brainstorm: YC-style interrogation docs/brainstorms/requirements.md
63
- → 02-plan: RED→GREEN→REFACTOR units → docs/plans/plan.md
64
- → 03-work: parallel execution, checkpoint resume
65
- → 04-review: structured findings, optional browser QA
66
- → 05-learn: knowledge compounding
127
+ When an unexpected failure occurs during `03-work`:
67
128
 
68
- You: continue
69
- Next skill recommended automatically via /skill:06-next
70
- ```
129
+ 1. **STOP** adding features
130
+ 2. **PRESERVE** evidence
131
+ 3. **DIAGNOSE** root cause
132
+ 4. **FIX** the root cause
133
+ 5. **GUARD** with a regression test
134
+ 6. **RESUME** only after verification passes
71
135
 
72
- **After interruption:**
73
- ```
74
- You: /skill:03-work docs/plans/plan.md
75
- → Auto-loads checkpoint, skips completed units, resumes from breakpoint
76
- ```
136
+ Anti-rationalization: do not rationalize, downgrade, or explain away failures. Stop and report with evidence.
137
+
138
+ ### Source-driven verification
139
+
140
+ When implementation depends on a framework/library API, version-specific behavior, or a recommended pattern: verify against official documentation before implementing. Pure logic, renaming, or in-project pattern reuse does not require external citation.
141
+
142
+ ### Review five axes
143
+
144
+ All reviewers evaluate changes across: **correctness, readability, architecture, security, performance.**
77
145
 
78
146
  ---
79
147
 
@@ -84,12 +152,12 @@ New conversation overhead: **~2,600 tokens** (1.3% of 200K context).
84
152
  | Component | Tokens |
85
153
  |-----------|--------|
86
154
  | 8 skill registrations | ~490 |
87
- | System prompt (skills) | ~1,400 |
155
+ | System prompt | ~1,400 |
88
156
  | Skill inlining (per invocation) | ~500-800 |
89
157
 
90
158
  Progressive loading: only needed skills loaded on-demand.
91
159
 
92
- Full evaluation → [`docs/token-cost-evaluation.md`](docs/token-cost-evaluation.md)
160
+ See [docs/token-cost-evaluation.md](docs/token-cost-evaluation.md) for detailed per-skill breakdown and measurement methodology.
93
161
 
94
162
  ---
95
163
 
@@ -100,26 +168,38 @@ your-project/
100
168
  ├── docs/
101
169
  │ ├── brainstorms/ # Requirements
102
170
  │ ├── plans/ # Execution plans
103
- │ └── solutions/ # Knowledge cards
171
+ │ └── solutions/ # Knowledge cards
104
172
  └── .context/
105
173
  └── compound-engineering/
106
174
  ├── checkpoints/ # Breakpoint files
107
- ├── dialogs/ # Dialog state
175
+ ├── handoffs/ # Cross-stage context
108
176
  └── history/ # Execution history
109
177
  ```
110
178
 
111
- **Commit everything to git** — these files are the project's traceable memory.
179
+ Commit everything to git — these files are the project's traceable memory.
112
180
 
113
181
  ---
114
182
 
115
183
  ## Architecture
116
184
 
117
- - **8 skills** with dedicated tools
118
- - **14 tools** + 2 helpers
119
- - **~2800 lines** TypeScript, **175 tests**
120
- - **Progressive rule loading** — only what each task needs
185
+ | Component | Count |
186
+ |-----------|------:|
187
+ | Skills | 8 |
188
+ | Tools | 19 |
189
+ | Rules | 79 |
190
+ | TypeScript lines | ~4,400 |
191
+ | Tests | 209 (786 assertions) |
192
+
193
+ Rules in `rules/` cover 11 common topics + language-specific sets (TypeScript, Rust, Go, Python, Java, Kotlin, C++, C#, Dart, Swift, Perl, PHP). Project-level overrides take priority.
194
+
195
+ ---
196
+
197
+ ## Commands
121
198
 
122
- Rules in `rules/` (11 common + language-specific). Project-level overrides take priority.
199
+ | Command | Description |
200
+ |---------|-------------|
201
+ | `bun test` | Run all tests |
202
+ | `npm publish --dry-run` | Preview package contents |
123
203
 
124
204
  ---
125
205
 
@@ -127,14 +207,8 @@ Rules in `rules/` (11 common + language-specific). Project-level overrides take
127
207
 
128
208
  See [CHANGELOG.md](./CHANGELOG.md) for full version history.
129
209
 
130
- ## Repository
210
+ ## Links
131
211
 
132
- - **GitHub**: https://github.com/leing2021/super-pi
133
212
  - **npm**: https://www.npmjs.com/package/@leing2021/super-pi
134
-
135
- ## Development
136
-
137
- ```bash
138
- bun test
139
- npm publish --dry-run
140
- ```
213
+ - **GitHub**: https://github.com/leing2021/super-pi
214
+ - **License**: MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leing2021/super-pi",
3
- "version": "0.23.4",
3
+ "version": "0.23.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Pi-native Compound Engineering package for iterative development workflows",
@@ -13,6 +13,7 @@ The Feature Implementation Workflow describes the development pipeline: research
13
13
  - **Check package registries:** Search npm, PyPI, crates.io, and other registries before writing utility code. Prefer battle-tested libraries over hand-rolled solutions.
14
14
  - **Search for adaptable implementations:** Look for open-source projects that solve 80%+ of the problem and can be forked, ported, or wrapped.
15
15
  - Prefer adopting or porting a proven approach over writing net-new code when it meets the requirement.
16
+ - **Source-driven trigger:** When implementation depends on a framework/library API, version-specific behavior, or a recommended pattern, verify against official documentation and cite key sources in the output. Pure logic, renaming, or in-project pattern reuse does not require external citation.
16
17
 
17
18
  1. **Plan First**
18
19
  - Use **planner** agent to create implementation plan
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 01-brainstorm
3
- description: "Brainstorm requirements with three modes: CE discovery, Startup Diagnostic, Builder Mode."
3
+ description: "Discover requirements through structured multi-round dialog. Use when the request is ambiguous, needs discovery, or describes a new idea/product."
4
4
  ---
5
5
 
6
6
  # Brainstorm
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 02-plan
3
- description: "Turn requirements into a plan. Optional CEO-style strategic review after."
3
+ description: "Turn requirements into an execution-ready plan with TDD-gated implementation units. Use when a brainstorm artifact exists and is ready for planning."
4
4
  ---
5
5
 
6
6
  # Plan
@@ -43,7 +43,8 @@ Every unit follows **RED → GREEN → REFACTOR**:
43
43
  2. Read relevant brainstorm from `docs/brainstorms/`
44
44
  3. Run solution search (keywords → grep frontmatter → read top 3)
45
45
  4. Gather repository context
46
- 5. If plan exists: use `plan_diff` `compare` review with user `patch`
46
+ 5. **Source-driven check:** For each unit that involves framework/library APIs, add a note: "Verify against official docs before implementing."
47
+ 6. If plan exists: use `plan_diff` `compare` → review with user → `patch`
47
48
  6. If no plan: write new plan under `docs/plans/` using `references/plan-template.md`
48
49
  7. Structure work using `references/implementation-unit-template.md`
49
50
  8. Verify every unit follows TDD gates
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 03-work
3
- description: Execute plan-driven work in a controlled Phase 1 workflow.
3
+ description: "Execute plan units with parallel subagents, TDD enforcement, and checkpoint resume. Use when a plan path is ready for implementation."
4
4
  ---
5
5
 
6
6
  # Work
@@ -39,6 +39,24 @@ Every step follows **RED → GREEN → REFACTOR**:
39
39
  - Missing evidence test passed after implementation
40
40
  - Tests added only after code
41
41
 
42
+ ## Stop-the-line rule (Hard gate)
43
+
44
+ When any unexpected failure occurs during execution:
45
+
46
+ 1. **STOP** adding features or making changes
47
+ 2. **PRESERVE** evidence (error output, repro steps)
48
+ 3. **DIAGNOSE** root cause — reproduce, localize, reduce
49
+ 4. **FIX** the root cause, not the symptom
50
+ 5. **GUARD** with a regression test
51
+ 6. **RESUME** only after verification passes
52
+
53
+ Anti-rationalization — when a gate fails or evidence is missing:
54
+ - Do not rationalize, downgrade, or explain away the failure.
55
+ - Stop, report the blocker with evidence, and either fix the root cause or ask for direction.
56
+ - Do not continue unrelated implementation after failed verification.
57
+
58
+ This is a hard gate — do not push past a failing test or broken build to continue implementation. Errors compound.
59
+
42
60
  ## Workflow
43
61
 
44
62
  1. **Load context**: consume latest handoff before any broad file reads — `context_handoff load` or read `.context/compound-engineering/handoffs/latest.md`. If found, use `activeFiles`, `blocker`, `verification`, `activeRules` as starting point. If not found, proceed normally.
@@ -48,7 +66,8 @@ Every step follows **RED → GREEN → REFACTOR**:
48
66
  5. Use `task_splitter` for dependency analysis
49
67
  6. Execute: **inline mode** by default, `ce_parallel_subagent` for independent units
50
68
  7. Follow TDD per unit: RED → minimal code → GREEN → refactor → unit-level **verification**
51
- 8. Record progress via `references/progress-update-format.md`
69
+ 8. **Source-driven gate:** Before implementing framework/library-specific code, verify the API or pattern against official documentation. Flag unverified patterns as UNVERIFIED in output.
70
+ 9. Record progress via `references/progress-update-format.md`
52
71
  9. Save `session_checkpoint` after each unit
53
72
  10. On failure: `session_checkpoint` `fail` → `retry` → follow strategy
54
73
  11. Provide completion report (see `references/completion-report.md`)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 04-review
3
- description: "Review code with structured findings. Optional browser QA and regression tests."
3
+ description: "Review code changes across five axes with evidence-first findings. Use after implementation is complete and before committing."
4
4
  ---
5
5
 
6
6
  # Review
@@ -10,6 +10,8 @@ Use the `review_router` tool to determine which reviewers to apply based on diff
10
10
 
11
11
  ## Reviewer personas
12
12
 
13
+ All reviewers evaluate changes across five axes: correctness, readability, architecture, security, performance. Base reviewers cover axes 1–3 by default; conditional reviewers add depth on specific axes.
14
+
13
15
  ### Base reviewers (always active)
14
16
 
15
17
  - **correctness-reviewer**: Logical correctness, intended behavior, edge cases.
@@ -19,6 +21,6 @@ Use the `review_router` tool to determine which reviewers to apply based on diff
19
21
  ### Conditional reviewers (routed by `review_router`)
20
22
 
21
23
  - **security-reviewer**: Triggered when auth, permissions, tokens, sessions, or crypto files change. Reviews for injection, auth bypass, credential leakage.
22
- - **performan04-reviewer**: Triggered when query, cache, database, or streaming files change. Reviews for N+1, unnecessary allocation, missing indexes.
24
+ - **performance-reviewer**: Triggered when query, cache, database, or streaming files change. Reviews for N+1, unnecessary allocation, missing indexes.
23
25
  - **integration-reviewer**: Triggered when CI/CD, Docker, package.json, or config files change. Reviews for dependency conflicts, build breakage, deployment issues.
24
26
  - **thoroughness-reviewer**: Triggered for large diffs (5+ files or 300+ lines). Reviews for incomplete refactors, missed callers, inconsistent changes.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 05-learn
3
- description: Capture solved problems as reusable solution artifacts.
3
+ description: "Capture solved problems as searchable solution artifacts. Use after a workflow loop completes or a non-trivial problem is solved."
4
4
  ---
5
5
 
6
6
  # Learn
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 06-next
3
- description: "Inspect workflow state and recommend the single best next Compound Engineering skill. Use --verbose for a full status report."
3
+ description: "Inspect workflow artifacts and recommend the single best next skill. Use when unsure what to run next."
4
4
  ---
5
5
 
6
6
  # Next
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 07-worktree
3
- description: Create and manage git worktrees for isolated feature development.
3
+ description: "Create and manage git worktrees for isolated feature development. Use when starting a feature that needs branch isolation."
4
4
  ---
5
5
 
6
6
  # Worktree
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: 08-help
3
- description: Explain when to use each Compound Engineering Phase 1 skill and how they connect.
3
+ description: "Explain Phase 1 skills and their connections. Use when learning the workflow or deciding which skill applies."
4
4
  ---
5
5
 
6
6
  # Help