@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.
- package/README.md +372 -0
- package/extensions/.gitkeep +0 -0
- package/extensions/ce-core/index.ts +528 -0
- package/extensions/ce-core/tools/artifact-helper.ts +73 -0
- package/extensions/ce-core/tools/ask-user-question.ts +53 -0
- package/extensions/ce-core/tools/brainstorm-dialog.ts +167 -0
- package/extensions/ce-core/tools/parallel-subagent.ts +54 -0
- package/extensions/ce-core/tools/pattern-extractor.ts +139 -0
- package/extensions/ce-core/tools/plan-diff.ts +136 -0
- package/extensions/ce-core/tools/review-router.ts +95 -0
- package/extensions/ce-core/tools/session-checkpoint.ts +212 -0
- package/extensions/ce-core/tools/session-history.ts +117 -0
- package/extensions/ce-core/tools/subagent.ts +59 -0
- package/extensions/ce-core/tools/task-splitter.ts +122 -0
- package/extensions/ce-core/tools/workflow-state.ts +80 -0
- package/extensions/ce-core/tools/worktree-manager.ts +131 -0
- package/extensions/ce-core/utils/artifact-paths.ts +23 -0
- package/extensions/ce-core/utils/name-utils.ts +8 -0
- package/package.json +53 -0
- package/skills/.gitkeep +0 -0
- package/skills/01-brainstorm/SKILL.md +120 -0
- package/skills/01-brainstorm/references/builder-mode.md +39 -0
- package/skills/01-brainstorm/references/handoff.md +8 -0
- package/skills/01-brainstorm/references/premise-challenge.md +23 -0
- package/skills/01-brainstorm/references/requirements-template.md +25 -0
- package/skills/01-brainstorm/references/startup-diagnostic.md +108 -0
- package/skills/02-plan/SKILL.md +77 -0
- package/skills/02-plan/references/ceo-review-mode.md +130 -0
- package/skills/02-plan/references/handoff.md +8 -0
- package/skills/02-plan/references/implementation-unit-template.md +25 -0
- package/skills/02-plan/references/plan-template.md +21 -0
- package/skills/03-work/SKILL.md +65 -0
- package/skills/03-work/references/handoff.md +8 -0
- package/skills/03-work/references/progress-update-format.md +17 -0
- package/skills/04-review/SKILL.md +72 -0
- package/skills/04-review/references/findings-schema.md +17 -0
- package/skills/04-review/references/handoff.md +20 -0
- package/skills/04-review/references/qa-test-mode.md +134 -0
- package/skills/04-review/references/reviewer-selection.md +24 -0
- package/skills/05-compound/SKILL.md +32 -0
- package/skills/05-compound/assets/solution-template.md +27 -0
- package/skills/05-compound/references/category-map.md +9 -0
- package/skills/05-compound/references/overlap-rules.md +7 -0
- package/skills/05-compound/references/solution-schema.yaml +27 -0
- package/skills/05-compound/references/solution-search-strategy.md +60 -0
- package/skills/06-next/SKILL.md +37 -0
- package/skills/06-next/references/recommendation-logic.md +46 -0
- package/skills/07-worktree/SKILL.md +35 -0
- package/skills/07-worktree/references/worktree-lifecycle.md +22 -0
- package/skills/08-status/SKILL.md +41 -0
- package/skills/08-status/references/artifact-locations.md +10 -0
- package/skills/09-help/SKILL.md +37 -0
- package/skills/09-help/references/workflow-sequence.md +9 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Solution Search Strategy
|
|
2
|
+
|
|
3
|
+
Grep-first, tiered retrieval for `docs/solutions/`. Use this in `02-plan` and `04-review` to find relevant learnings without loading all files.
|
|
4
|
+
|
|
5
|
+
## Search order
|
|
6
|
+
|
|
7
|
+
1. **Project-level**: `{project-root}/docs/solutions/` — project-specific solutions
|
|
8
|
+
2. **Global-level**: `~/.pi/agent/docs/solutions/` — cross-project solutions
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### Step 1: Extract keywords
|
|
13
|
+
|
|
14
|
+
From the task/feature description, identify:
|
|
15
|
+
- **Technical terms**: tool names, framework names, language concepts
|
|
16
|
+
- **Problem indicators**: error symptoms, failure modes, performance issues
|
|
17
|
+
- **Component types**: CLI, extension, skill, test, config
|
|
18
|
+
|
|
19
|
+
### Step 2: Grep frontmatter fields
|
|
20
|
+
|
|
21
|
+
Run parallel grep searches across both solution directories. Only return file paths, do not load content:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Search tags (most precise)
|
|
25
|
+
grep -rl "tags:.*keyword1" docs/solutions/ ~/.pi/agent/docs/solutions/
|
|
26
|
+
# Search title
|
|
27
|
+
grep -rl "title:.*keyword" docs/solutions/ ~/.pi/agent/docs/solutions/
|
|
28
|
+
# Search applies_when
|
|
29
|
+
grep -rl "applies_when:" docs/solutions/ ~/.pi/agent/docs/solutions/ | head -5
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Step 3: Narrow if needed
|
|
33
|
+
|
|
34
|
+
- **>10 candidates**: Re-run with more specific keyword combinations
|
|
35
|
+
- **<3 candidates**: Broaden search to grep full file content, not just frontmatter
|
|
36
|
+
|
|
37
|
+
### Step 4: Read frontmatter only
|
|
38
|
+
|
|
39
|
+
For each candidate file, read only the first 15 lines (frontmatter):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
head -15 <file>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Step 5: Score and rank
|
|
46
|
+
|
|
47
|
+
Match quality:
|
|
48
|
+
- **Strong**: `tags` contain direct keyword matches
|
|
49
|
+
- **Moderate**: `title` or `applies_when` are semantically related
|
|
50
|
+
- **Weak**: No overlap — skip
|
|
51
|
+
|
|
52
|
+
Sort by `severity` (critical > high > medium > low) when multiple strong matches exist.
|
|
53
|
+
|
|
54
|
+
### Step 6: Full read top-N
|
|
55
|
+
|
|
56
|
+
Only fully read the **top 3** ranked files. Summarize relevance in 1-2 sentences per file.
|
|
57
|
+
|
|
58
|
+
## When to stop
|
|
59
|
+
|
|
60
|
+
If no candidates found after Step 2, do **not** fall back to reading all files. Report "No relevant solutions found" and proceed. An empty result is valuable information — it means the area has no prior learnings.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 06-next
|
|
3
|
+
description: Inspect workflow state and recommend the single best next Compound Engineering skill.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Next
|
|
7
|
+
|
|
8
|
+
Use this skill when the user wants to know what to run next in the Compound Engineering workflow.
|
|
9
|
+
|
|
10
|
+
## Core rules
|
|
11
|
+
|
|
12
|
+
- Use the `workflow_state` tool to scan repo artifacts before making a recommendation.
|
|
13
|
+
- Use the `session_history` tool to check recent executions and avoid recommending already-completed steps.
|
|
14
|
+
- Recommend exactly **one** next skill with a clear reason.
|
|
15
|
+
- Do not execute the recommended skill — only suggest it.
|
|
16
|
+
- If the workflow state suggests multiple valid paths, pick the one closest to completing a full loop.
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
1. Call `workflow_state` with the repo root.
|
|
21
|
+
2. Read the structured state: brainstorm count, plan count, solution count, run count, and latest artifact per category.
|
|
22
|
+
3. Apply the recommendation logic from `references/recommendation-logic.md`.
|
|
23
|
+
4. Return the recommended skill and why.
|
|
24
|
+
|
|
25
|
+
## Output format
|
|
26
|
+
|
|
27
|
+
- Recommended skill name
|
|
28
|
+
- Why this is the next step
|
|
29
|
+
- Brief summary of current workflow state
|
|
30
|
+
|
|
31
|
+
## Available skills
|
|
32
|
+
|
|
33
|
+
- `01-brainstorm` — clarify the problem and produce requirements
|
|
34
|
+
- `02-plan` — turn requirements into implementation units
|
|
35
|
+
- `03-work` — execute the plan
|
|
36
|
+
- `04-review` — review changes with structured findings
|
|
37
|
+
- `05-compound` — capture learnings as solution artifacts
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Recommendation logic
|
|
2
|
+
|
|
3
|
+
Apply these rules in order. Return the first match.
|
|
4
|
+
|
|
5
|
+
## Rule 1: No brainstorm artifacts
|
|
6
|
+
|
|
7
|
+
If `brainstorms.count === 0`:
|
|
8
|
+
- Recommend `01-brainstorm`
|
|
9
|
+
- Reason: No requirements have been captured. Start by clarifying the problem.
|
|
10
|
+
|
|
11
|
+
## Rule 2: Brainstorm exists, no plan
|
|
12
|
+
|
|
13
|
+
If `brainstorms.count > 0` and `plans.count === 0`:
|
|
14
|
+
- Recommend `02-plan`
|
|
15
|
+
- Reason: Requirements exist but no implementation plan. Turn them into actionable units.
|
|
16
|
+
|
|
17
|
+
## Rule 3: Plan exists, no recent review
|
|
18
|
+
|
|
19
|
+
If `plans.count > 0` and the latest plan has no corresponding review artifact:
|
|
20
|
+
- Recommend `03-work`
|
|
21
|
+
- Reason: A plan is ready for execution. Run `03-work` to implement it.
|
|
22
|
+
|
|
23
|
+
## Rule 4: After work, review
|
|
24
|
+
|
|
25
|
+
If code changes have been made (detected by git diff) and no recent review exists:
|
|
26
|
+
- Recommend `04-review`
|
|
27
|
+
- Reason: Implementation is done. Review the changes with structured findings.
|
|
28
|
+
|
|
29
|
+
## Rule 5: After review, compound
|
|
30
|
+
|
|
31
|
+
If a review has been completed and `solutions.count` has not increased since the last workflow cycle:
|
|
32
|
+
- Recommend `05-compound`
|
|
33
|
+
- Reason: A review was completed. Capture key learnings as a durable solution artifact.
|
|
34
|
+
|
|
35
|
+
## Rule 6: All artifacts exist
|
|
36
|
+
|
|
37
|
+
If brainstorm, plan, and solution all exist:
|
|
38
|
+
- Recommend `05-compound` if no recent solution was added
|
|
39
|
+
- Otherwise recommend `01-brainstorm` for a new cycle
|
|
40
|
+
- Reason: A full loop may be complete. Either compound learnings or start a new cycle.
|
|
41
|
+
|
|
42
|
+
## Fallback
|
|
43
|
+
|
|
44
|
+
If no rule matches cleanly:
|
|
45
|
+
- Recommend `08-status`
|
|
46
|
+
- Reason: State is ambiguous. Get a detailed report before deciding.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 07-worktree
|
|
3
|
+
description: Create and manage git worktrees for isolated feature development.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 03-worktree
|
|
7
|
+
|
|
8
|
+
Use this skill when you need to create an isolated git worktree for feature work, merge changes back, or clean up after completion.
|
|
9
|
+
|
|
10
|
+
## Core rules
|
|
11
|
+
|
|
12
|
+
- Use the `worktree_manager` tool for all git worktree operations.
|
|
13
|
+
- Default behavior is to **automatically create** a worktree with a descriptive branch name derived from the plan or task.
|
|
14
|
+
- After creation, report the worktree path so that `03-work` can execute inside it.
|
|
15
|
+
- On completion, merge back and clean up.
|
|
16
|
+
- Never force operations — if a worktree already exists, report its status instead of creating a duplicate.
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
1. **Create**: Use `worktree_manager` with operation `create` to spin up a new worktree with a feature branch.
|
|
21
|
+
2. **Detect**: Use `worktree_manager` with operation `detect` to check if already inside a worktree.
|
|
22
|
+
3. **Execute**: Run `03-work` inside the worktree directory.
|
|
23
|
+
4. **Merge**: Use `worktree_manager` with operation `merge` to merge the feature branch back to main.
|
|
24
|
+
5. **Cleanup**: Use `worktree_manager` with operation `cleanup` to remove the worktree and delete the branch.
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
After creation, report:
|
|
29
|
+
- Worktree path
|
|
30
|
+
- Branch name
|
|
31
|
+
- Instruction to run `03-work` in the worktree directory
|
|
32
|
+
|
|
33
|
+
After merge, report:
|
|
34
|
+
- Merge result
|
|
35
|
+
- Whether cleanup is recommended
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Worktree lifecycle
|
|
2
|
+
|
|
3
|
+
## Default flow
|
|
4
|
+
|
|
5
|
+
1. `create` — derive branch name from plan topic or task description
|
|
6
|
+
2. `detect` — check if already in a worktree (avoid nested worktrees)
|
|
7
|
+
3. Execute work via `03-work` in the worktree directory
|
|
8
|
+
4. `merge` — merge feature branch back to main
|
|
9
|
+
5. `cleanup` — remove worktree and delete branch
|
|
10
|
+
|
|
11
|
+
## Branch naming
|
|
12
|
+
|
|
13
|
+
- Use `feat/<slug>` for feature work
|
|
14
|
+
- Use `fix/<slug>` for bug fixes
|
|
15
|
+
- Use `chore/<slug>` for maintenance tasks
|
|
16
|
+
- Slug is derived from the plan or task topic using `normalizeSlug`
|
|
17
|
+
|
|
18
|
+
## Error handling
|
|
19
|
+
|
|
20
|
+
- If worktree creation fails, check for existing worktrees with `detect`
|
|
21
|
+
- If merge has conflicts, report them and let the user resolve
|
|
22
|
+
- If cleanup fails, suggest manual `git worktree remove`
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 08-status
|
|
3
|
+
description: Inspect repo-local workflow artifacts and recommend the next Compound Engineering step.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Status
|
|
7
|
+
|
|
8
|
+
Use this skill when the user wants to know the current state of the Compound Engineering workflow in this repository.
|
|
9
|
+
|
|
10
|
+
## What to scan
|
|
11
|
+
|
|
12
|
+
Use the `workflow_state` tool to get structured artifact state. It scans these repo-local locations:
|
|
13
|
+
|
|
14
|
+
- `docs/brainstorms/`
|
|
15
|
+
- `docs/plans/`
|
|
16
|
+
- `docs/solutions/`
|
|
17
|
+
- `.context/compound-engineering/`
|
|
18
|
+
|
|
19
|
+
Use the `session_history` tool to check recent CE skill executions and their outcomes.
|
|
20
|
+
|
|
21
|
+
If `workflow_state` is not available, fall back to `bash` with `ls` and `find` to check which directories and recent files exist, then use `read` on the most relevant recent artifact.
|
|
22
|
+
|
|
23
|
+
## Recommendation logic
|
|
24
|
+
|
|
25
|
+
- If there is no recent `docs/brainstorms/` artifact and the request is still ambiguous, recommend `01-brainstorm` next.
|
|
26
|
+
- If a recent brainstorm exists but there is no matching plan in `docs/plans/`, recommend `02-plan` next.
|
|
27
|
+
- If a recent plan exists and implementation appears incomplete, recommend `03-work` next.
|
|
28
|
+
- If code has changed after planning, recommend `04-review` next.
|
|
29
|
+
- If a problem was just solved and there is no matching learning in `docs/solutions/`, recommend `05-compound` next.
|
|
30
|
+
- If multiple artifacts exist, summarize them briefly and name the single best next step.
|
|
31
|
+
|
|
32
|
+
## Output format
|
|
33
|
+
|
|
34
|
+
Return:
|
|
35
|
+
|
|
36
|
+
- latest relevant brainstorm
|
|
37
|
+
- latest relevant plan
|
|
38
|
+
- latest relevant solution
|
|
39
|
+
- latest relevant runtime artifact under `.context/compound-engineering/`
|
|
40
|
+
- recommended next step
|
|
41
|
+
- why this is the next step
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Artifact Locations
|
|
2
|
+
|
|
3
|
+
| Artifact | Path |
|
|
4
|
+
|---|---|
|
|
5
|
+
| Brainstorm | `docs/brainstorms/` |
|
|
6
|
+
| Plan | `docs/plans/` |
|
|
7
|
+
| Solution | `docs/solutions/` |
|
|
8
|
+
| Runtime | `.context/compound-engineering/` |
|
|
9
|
+
|
|
10
|
+
Use `bash` with `ls` and `find` to scan these paths.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 09-help
|
|
3
|
+
description: Explain when to use each Compound Engineering Phase 1 skill and how they connect.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Help
|
|
7
|
+
|
|
8
|
+
Use this skill when the user asks how to use the package, which workflow step comes next, or which Compound Engineering skill fits the current task.
|
|
9
|
+
|
|
10
|
+
## Phase 1 skill guide
|
|
11
|
+
|
|
12
|
+
- `01-brainstorm` — use when the request is ambiguous, needs requirements discovery, or the user has a new idea. Three modes: CE requirements discovery (adding features), Startup Diagnostic (YC-style forcing questions for new products/startups), Builder Mode (side projects, hackathons, learning).
|
|
13
|
+
- `02-plan` — use when requirements are clear enough to turn into implementation units. After planning, user can optionally run a CEO-style strategic review or strict review (error maps, failure modes, test diagrams).
|
|
14
|
+
- `03-work` — use when there is a plan or a tightly scoped task ready for controlled execution.
|
|
15
|
+
- `04-review` — use after code changes to produce structured findings. After code review, user can optionally extend to browser-based QA testing (find visual/functional bugs with agent-browser) and regression test generation.
|
|
16
|
+
- `05-compound` — use after solving a problem so the repo gains a durable learning in `docs/solutions/`.
|
|
17
|
+
- `08-status` — use when the user wants to know which artifact already exists and what the next workflow step should be.
|
|
18
|
+
|
|
19
|
+
## Recommended flow
|
|
20
|
+
|
|
21
|
+
1. Start with `01-brainstorm` when the problem is still fuzzy or you have a new idea.
|
|
22
|
+
- **Startup founders** get the YC-style diagnostic: demand reality, status quo, narrowest wedge.
|
|
23
|
+
- **Side project builders** get generative brainstorming: coolest version, fastest path to ship.
|
|
24
|
+
- **Feature additions** get the standard CE requirements discovery.
|
|
25
|
+
2. Move to `02-plan` once the desired behavior is clear.
|
|
26
|
+
- Optionally run **CEO Review** to challenge premises, map alternatives, check dream-state alignment.
|
|
27
|
+
- Or **Strict Review** for full error maps, failure modes, and test diagrams.
|
|
28
|
+
3. Use `03-work` to execute the plan.
|
|
29
|
+
4. Run `04-review` after implementation.
|
|
30
|
+
- Optionally extend to **Browser QA** for visual and functional bug finding.
|
|
31
|
+
- Or **Browser QA + Regression Tests** to also generate automated test coverage.
|
|
32
|
+
5. Capture key learnings with `05-compound`.
|
|
33
|
+
6. Use `08-status` at any point to inspect repo-local workflow state.
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
When responding, explain the smallest useful next step instead of forcing the full sequence.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Workflow Sequence
|
|
2
|
+
|
|
3
|
+
1. `01-brainstorm` → clarify the problem (CE mode / Startup Diagnostic / Builder Mode)
|
|
4
|
+
2. `02-plan` → break it into concrete units (optionally + CEO Review / Strict Review)
|
|
5
|
+
3. `03-work` → execute the plan
|
|
6
|
+
4. `04-review` → inspect the changes (optionally + Browser QA / QA + Regression Tests)
|
|
7
|
+
5. `05-compound` → save key learnings
|
|
8
|
+
|
|
9
|
+
Use `08-status` at any point to see where you are.
|