@leing2021/super-pi 0.14.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 (53) hide show
  1. package/README.md +372 -0
  2. package/extensions/.gitkeep +0 -0
  3. package/extensions/ce-core/index.ts +528 -0
  4. package/extensions/ce-core/tools/artifact-helper.ts +73 -0
  5. package/extensions/ce-core/tools/ask-user-question.ts +53 -0
  6. package/extensions/ce-core/tools/brainstorm-dialog.ts +167 -0
  7. package/extensions/ce-core/tools/parallel-subagent.ts +54 -0
  8. package/extensions/ce-core/tools/pattern-extractor.ts +139 -0
  9. package/extensions/ce-core/tools/plan-diff.ts +136 -0
  10. package/extensions/ce-core/tools/review-router.ts +95 -0
  11. package/extensions/ce-core/tools/session-checkpoint.ts +212 -0
  12. package/extensions/ce-core/tools/session-history.ts +117 -0
  13. package/extensions/ce-core/tools/subagent.ts +59 -0
  14. package/extensions/ce-core/tools/task-splitter.ts +122 -0
  15. package/extensions/ce-core/tools/workflow-state.ts +80 -0
  16. package/extensions/ce-core/tools/worktree-manager.ts +131 -0
  17. package/extensions/ce-core/utils/artifact-paths.ts +23 -0
  18. package/extensions/ce-core/utils/name-utils.ts +8 -0
  19. package/package.json +53 -0
  20. package/skills/.gitkeep +0 -0
  21. package/skills/01-brainstorm/SKILL.md +120 -0
  22. package/skills/01-brainstorm/references/builder-mode.md +39 -0
  23. package/skills/01-brainstorm/references/handoff.md +8 -0
  24. package/skills/01-brainstorm/references/premise-challenge.md +23 -0
  25. package/skills/01-brainstorm/references/requirements-template.md +25 -0
  26. package/skills/01-brainstorm/references/startup-diagnostic.md +108 -0
  27. package/skills/02-plan/SKILL.md +77 -0
  28. package/skills/02-plan/references/ceo-review-mode.md +130 -0
  29. package/skills/02-plan/references/handoff.md +8 -0
  30. package/skills/02-plan/references/implementation-unit-template.md +25 -0
  31. package/skills/02-plan/references/plan-template.md +21 -0
  32. package/skills/03-work/SKILL.md +65 -0
  33. package/skills/03-work/references/handoff.md +8 -0
  34. package/skills/03-work/references/progress-update-format.md +17 -0
  35. package/skills/04-review/SKILL.md +72 -0
  36. package/skills/04-review/references/findings-schema.md +17 -0
  37. package/skills/04-review/references/handoff.md +20 -0
  38. package/skills/04-review/references/qa-test-mode.md +134 -0
  39. package/skills/04-review/references/reviewer-selection.md +24 -0
  40. package/skills/05-compound/SKILL.md +32 -0
  41. package/skills/05-compound/assets/solution-template.md +27 -0
  42. package/skills/05-compound/references/category-map.md +9 -0
  43. package/skills/05-compound/references/overlap-rules.md +7 -0
  44. package/skills/05-compound/references/solution-schema.yaml +27 -0
  45. package/skills/05-compound/references/solution-search-strategy.md +60 -0
  46. package/skills/06-next/SKILL.md +37 -0
  47. package/skills/06-next/references/recommendation-logic.md +46 -0
  48. package/skills/07-worktree/SKILL.md +35 -0
  49. package/skills/07-worktree/references/worktree-lifecycle.md +22 -0
  50. package/skills/08-status/SKILL.md +41 -0
  51. package/skills/08-status/references/artifact-locations.md +10 -0
  52. package/skills/09-help/SKILL.md +37 -0
  53. package/skills/09-help/references/workflow-sequence.md +9 -0
package/README.md ADDED
@@ -0,0 +1,372 @@
1
+ # Super Pi
2
+
3
+ A Pi-native iterative development workflow package, integrating the best ideas from four outstanding open-source projects.
4
+
5
+ [中文文档](README_CN.md)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pi install npm:@leing2021/super-pi
11
+ ```
12
+
13
+ ---
14
+
15
+ ## Quick Start
16
+
17
+ After installation, tell Pi what you want to build, then keep saying "continue" to walk through the full workflow.
18
+
19
+ ### Scenario A: Starting a new idea
20
+
21
+ ```
22
+ You: I want to build a tool that helps indie devs find users
23
+
24
+ → /skill:01-brainstorm
25
+ → AI asks your goal → you pick "Building a startup"
26
+ → Enters Startup Diagnostic mode
27
+ → YC-style forcing questions one at a time: demand evidence? current alternatives? narrowest wedge?
28
+ → Challenges premises, generates 2-3 approaches
29
+ → Generates docs/brainstorms/2026-04-18-find-users-requirements.md
30
+ → Recommends next step: 02-plan
31
+
32
+ You: continue
33
+
34
+ → /skill:02-plan
35
+ → Reads requirements artifact
36
+ → Generates docs/plans/2026-04-18-find-users-plan.md
37
+ → Asks if you want CEO Review → you pick "CEO Review"
38
+ → Challenges plan premises, dream-state mapping, forces alternatives, temporal interrogation
39
+ → Recommends next step: 03-work
40
+
41
+ You: continue
42
+
43
+ → /skill:03-work
44
+ → Parallel execution, checkpoint resume
45
+ → Recommends next step: 04-review
46
+
47
+ You: continue
48
+
49
+ → /skill:04-review
50
+ → Structured code review + autofix
51
+ → Asks if you want browser QA → you pick "Browser QA"
52
+ → Opens your app with agent-browser, tests page by page
53
+ → Fixes bugs found, screenshots as evidence
54
+ → Recommends next step: 05-compound
55
+
56
+ You: continue
57
+
58
+ → /skill:05-compound
59
+ → Extracts reusable patterns
60
+ → Writes to docs/solutions/ for lasting knowledge
61
+ ```
62
+
63
+ ### Scenario B: Side Project / Hackathon
64
+
65
+ ```
66
+ You: I want to make a fun music visualization side project
67
+
68
+ → /skill:01-brainstorm
69
+ → AI asks your goal → you pick "Side project / hackathon"
70
+ → Enters Builder Mode
71
+ → Asks: what's the coolest version? fastest path to something you can show?
72
+ → No business validation, focused on building the coolest thing
73
+ → If conversation shifts to revenue → auto-upgrades to Startup Diagnostic
74
+ ```
75
+
76
+ ### Scenario C: Adding a feature to an existing project
77
+
78
+ ```
79
+ You: I want to add user authentication to the project
80
+
81
+ → /skill:01-brainstorm
82
+ → AI asks your goal → you pick "Adding a feature"
83
+ → Enters CE Brainstorm (classic requirements discovery)
84
+ → Multi-round dialog to clarify requirements (OAuth2? JWT? MFA?)
85
+ → Generates docs/brainstorms/2026-04-18-auth-requirements.md
86
+ → Recommends next step: 02-plan
87
+ ```
88
+
89
+ ### Scenario D: Check project status anytime
90
+
91
+ ```
92
+ You: /skill:08-status
93
+
94
+ → Scans docs/brainstorms/, docs/plans/, docs/solutions/
95
+ → Queries session_history for recent execution records
96
+ → Shows current progress + recommends next step
97
+ ```
98
+
99
+ ### Scenario E: Requirements changed, update the plan
100
+
101
+ ```
102
+ You: Requirements changed, need to add SSO support
103
+
104
+ → /skill:02-plan
105
+ → plan_diff compare detects added/removed/modified units
106
+ → plan_diff patch applies incremental changes
107
+ → No need to rewrite the entire plan
108
+ ```
109
+
110
+ ### Scenario F: Resume after interruption
111
+
112
+ ```
113
+ You: /skill:03-work docs/plans/auth-plan.md
114
+
115
+ → session_checkpoint.load finds completed units
116
+ → Automatically skips completed parts, resumes from checkpoint
117
+ ```
118
+
119
+ ### Scenario G: Isolated development
120
+
121
+ ```
122
+ You: /skill:07-worktree
123
+
124
+ → worktree_manager creates git worktree isolation
125
+ → Execute 03-work within the worktree
126
+ → Merge back to main branch when done
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Skills (9)
132
+
133
+ | Skill | Command | Description | Associated Tools |
134
+ |-------|---------|-------------|-----------------|
135
+ | `01-brainstorm` | `/skill:01-brainstorm` | Requirements discovery, three modes: CE / Startup Diagnostic / Builder | `brainstorm_dialog` |
136
+ | `02-plan` | `/skill:02-plan` | Create/update plans, optional CEO Review | `plan_diff` |
137
+ | `03-work` | `/skill:03-work` | Execute plans (parallel + checkpoint + recovery) | `session_checkpoint`, `task_splitter`, `parallel_subagent` |
138
+ | `04-review` | `/skill:04-review` | Code review + optional browser QA | `review_router` |
139
+ | `05-compound` | `/skill:05-compound` | Knowledge compounding | `pattern_extractor` |
140
+ | `06-next` | `/skill:06-next` | Recommend next step | `workflow_state`, `session_history` |
141
+ | `07-worktree` | `/skill:07-worktree` | Worktree isolated development | `worktree_manager` |
142
+ | `08-status` | `/skill:08-status` | Check project status | `workflow_state`, `session_history` |
143
+ | `09-help` | `/skill:09-help` | Usage guide | — |
144
+
145
+ ---
146
+
147
+ ## Tools (13)
148
+
149
+ | Tool | Description |
150
+ |------|-------------|
151
+ | `artifact_helper` | Artifact path resolution + directory creation |
152
+ | `ask_user_question` | Structured user questions (free input / fixed options) |
153
+ | `subagent` | Serial subagent chain |
154
+ | `parallel_subagent` | Parallel subagent execution (`Promise.allSettled`) |
155
+ | `workflow_state` | Workflow artifact state scanning |
156
+ | `worktree_manager` | Git worktree lifecycle (create/detect/merge/cleanup) |
157
+ | `review_router` | Diff analysis + reviewer persona routing (base + conditional) |
158
+ | `session_checkpoint` | Plan execution checkpoint + error recovery (save/load/fail/retry) |
159
+ | `task_splitter` | File-level dependency analysis + parallel grouping (union-find) |
160
+ | `brainstorm_dialog` | Multi-round brainstorm dialog management (start/refine/summarize) |
161
+ | `plan_diff` | Plan incremental comparison + patching (compare/patch) |
162
+ | `session_history` | Cross-session execution history (record/query/latest) |
163
+ | `pattern_extractor` | Artifact pattern extraction + categorization (extract/categorize) |
164
+
165
+ ---
166
+
167
+ ## Core Workflow
168
+
169
+ ```
170
+ 01-brainstorm → 02-plan → 03-work → 04-review → 05-compound
171
+ Three modes CEO Review Parallel Browser QA Knowledge
172
+ (CE/Startup/ (optional) Checkpoint (optional) compounding
173
+ Builder) Resume
174
+ ```
175
+
176
+ `06-next`, `07-worktree`, `08-status`, `09-help` can be used at any stage.
177
+
178
+ ---
179
+
180
+ ## Generated File Structure
181
+
182
+ ```
183
+ your-project/
184
+ ├── docs/
185
+ │ ├── brainstorms/ # Generated by 01-brainstorm
186
+ │ │ └── 2026-04-18-auth-requirements.md
187
+ │ ├── plans/ # Generated by 02-plan
188
+ │ │ └── 2026-04-18-auth-plan.md
189
+ │ └── solutions/ # Generated by 05-compound
190
+ │ └── auth/
191
+ │ └── oauth2-solution.md
192
+ └── .context/
193
+ └── compound-engineering/
194
+ ├── checkpoints/ # Generated by session_checkpoint
195
+ │ └── docs-plans-auth-plan.json
196
+ ├── dialogs/ # Generated by brainstorm_dialog
197
+ │ └── docs-brainstorms-auth.json
198
+ └── history/ # Generated by session_history
199
+ └── 1745000000-01-brainstorm.json
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Best Practices
205
+
206
+ | Tip | Description |
207
+ |-----|-------------|
208
+ | **Start with 01-brainstorm** | New ideas → Startup/Builder Mode, features → CE Mode |
209
+ | **Use 08-status to check progress** | Not sure where you are? Use 08-status |
210
+ | **Use 06-next for direction** | Don't know the next step? Use 06-next |
211
+ | **Commit artifacts to git** | Both `docs/` and `.context/` should be committed |
212
+ | **Use 07-worktree for big features** | Isolated development without affecting main branch |
213
+ | **Don't panic on interruption** | Next 03-work will auto-resume from checkpoint |
214
+ | **Use CEO Review to stress-test plans** | After planning, pick CEO Review to challenge premises and find blind spots |
215
+ | **Use Browser QA for acceptance** | After code review, pick Browser QA for real-app testing |
216
+
217
+ ---
218
+
219
+ ## Acknowledgments & Sources
220
+
221
+ Super Pi integrates ideas and practices from four outstanding open-source projects. This is not a fork — it's a Pi-native reimplementation of their core insights.
222
+
223
+ ### [Compound Engineering](https://github.com/EveryInc/compound-engineering-plugin) — Every Inc.
224
+
225
+ > "Each unit of engineering work should make subsequent units easier — not harder."
226
+
227
+ The foundational workflow of Super Pi comes directly from Compound Engineering's core philosophy: the **brainstorm → plan → work → review → compound** cycle. The "80% planning and review, 20% execution" philosophy is the backbone of the entire package.
228
+
229
+ **What we adopted:**
230
+ - Five-step workflow architecture (brainstorm → plan → work → review → compound)
231
+ - Knowledge compounding: every engineering cycle produces a reusable solution artifact
232
+ - Artifact-driven state management (tracking progress through persistent docs under `docs/`)
233
+ - Structured review methodology (reviewer persona routing, findings schema)
234
+
235
+ ### [Superpowers](https://github.com/obra/superpowers) — Jesse Vincent
236
+
237
+ > "A complete software development methodology for your coding agents."
238
+
239
+ Superpowers' main contribution to Super Pi is **engineering discipline**: strict TDD gates, design checklists, and the anti-performative-agreement principle in reviews.
240
+
241
+ **What we adopted:**
242
+ - Strict TDD gates (RED → GREEN → REFACTOR) with violation rejection criteria
243
+ - Design checklist (what/why/boundaries/failure/verification)
244
+ - Review discipline: technical evaluation over performative agreement, YAGNI checks
245
+ - User approval gates: no advancing to the next step without explicit confirmation
246
+ - Subagent-driven development patterns
247
+
248
+ ### [Everything Claude Code](https://github.com/affaan-m/everything-claude-code) — Affaan Mustafa
249
+
250
+ > "The performance optimization system for AI agent harnesses. Not just configs — a complete system."
251
+
252
+ With 140K+ stars, ECC demonstrated best practices for AI agent toolchains. Super Pi adopted its systematic approach to token optimization, continuous learning, parallelization, and subagent orchestration.
253
+
254
+ **What we adopted:**
255
+ - Session history management and continuous learning mechanisms
256
+ - Parallel subagent orchestration patterns (`Promise.allSettled` style)
257
+ - Checkpoint-based resume and error recovery strategies
258
+ - Systematic tool design: each skill paired with a dedicated tool
259
+
260
+ ### [gstack](https://github.com/garrytan/gstack) — Garry Tan / Y Combinator
261
+
262
+ > "One person's software factory. 23 specialist roles and 8 power tools."
263
+
264
+ gstack is Y Combinator CEO Garry Tan's personal AI toolchain, representing the "AI-native founder" way of working. Super Pi integrated the methodology from three core gstack modules in v1.2.0.
265
+
266
+ **What we adopted:**
267
+ - **office-hours → 01-brainstorm Startup Diagnostic**: YC-style six forcing questions (demand evidence, status quo alternatives, narrowest wedge), anti-sycophancy rules, per-question pushback patterns
268
+ - **plan-ceo-review → 02-plan CEO Review**: CEO cognitive frameworks (Bezos irreversible decisions, Munger inversion, Jobs subtraction), dream-state mapping, mandatory alternative generation, error maps and failure mode registries
269
+ - **qa → 04-review Browser QA**: Browser-driven QA testing workflow (using Pi-native `agent-browser` instead of gstack's `$B`), health scoring system, diff-aware test scoping, fix loops and regression test generation
270
+
271
+ **Design decisions:** gstack depends on its own infrastructure (`$B` browser binary, `gstack-*` scripts, `~/.gstack/` directory, telemetry). Super Pi replaces all of these with Pi-native tools — zero external infrastructure. All gstack capabilities are integrated as optional branch points within the existing flow; not selecting a new path = identical to the original behavior.
272
+
273
+ ---
274
+
275
+ ## Changelog
276
+
277
+ ### 0.14.0
278
+
279
+ **Structured solution retrieval**
280
+
281
+ - New 5-field YAML frontmatter for solution artifacts: title, category, severity, tags, applies_when
282
+ - `02-plan` and `04-review`: grep-first search strategy (project-level + global-level `~/.pi/agent/docs/solutions/`)
283
+ - `05-compound`: mandatory frontmatter, two-level storage (project-specific vs cross-project global)
284
+ - Added `solution-search-strategy.md` reference
285
+ - 95 tests passing
286
+
287
+ ### 0.13.0
288
+
289
+ - Merged Superpowers insights into CE skills
290
+ - `01-brainstorm`: design checklist, stop conditions, user approval gate
291
+ - `02-plan`: strict TDD gates (RED→GREEN→REFACTOR), TDD violation rejection
292
+ - `03-work`: TDD execution discipline, structured completion report
293
+ - `04-review`: review discipline (technical evaluation), YAGNI check
294
+
295
+ ### 0.12.0
296
+
297
+ - Extended `session_checkpoint` with `fail` and `retry` operations
298
+
299
+ ### 0.11.0
300
+
301
+ - Added `pattern_extractor` tool
302
+
303
+ ### 0.10.0
304
+
305
+ - Added `session_history` tool
306
+
307
+ ### 0.9.0
308
+
309
+ - Added `plan_diff` tool: incremental plan updates
310
+
311
+ ### 0.8.0
312
+
313
+ - Added `brainstorm_dialog` tool
314
+
315
+ ### 0.7.0
316
+
317
+ - Added `task_splitter` tool: union-find parallel grouping
318
+
319
+ ### 0.6.0
320
+
321
+ - Added `session_checkpoint` tool: resume-from-checkpoint
322
+
323
+ ### 0.5.0
324
+
325
+ - Added `parallel_subagent` tool
326
+
327
+ ### 0.4.0
328
+
329
+ - Added `review_router` tool
330
+
331
+ ### 0.3.0
332
+
333
+ - Added `worktree_manager` tool and `07-worktree` skill
334
+
335
+ ### 0.2.0
336
+
337
+ - Added `workflow_state` tool and `06-next` skill
338
+
339
+ ### 0.1.0–0.1.2
340
+
341
+ - Initial release: 7 skills, 3 tools, CI/CD
342
+
343
+ ---
344
+
345
+ ## Repository
346
+
347
+ - **GitHub**: https://github.com/leing2021/super-pi
348
+ - **npm**: https://www.npmjs.com/package/@leing2021/super-pi
349
+
350
+ ## Development
351
+
352
+ ```bash
353
+ bun test
354
+ npm publish --dry-run
355
+ ```
356
+
357
+ ## CI/CD
358
+
359
+ - **Test**: runs `bun test` on every push/PR to main
360
+ - **Publish**: runs `bun test` + `npm publish` on version tags (`v*`)
361
+
362
+ ### Release process
363
+
364
+ 1. Bump version in `package.json`
365
+ 2. Update README Changelog
366
+ 3. `git commit -m "chore: bump to x.y.z"`
367
+ 4. `git tag vx.y.z`
368
+ 5. `git push origin main --tags`
369
+
370
+ ### Required secrets
371
+
372
+ Set `NPM_TOKEN` in GitHub → Settings → Secrets → Actions.
File without changes