@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,131 @@
|
|
|
1
|
+
import path from "node:path"
|
|
2
|
+
|
|
3
|
+
export type GitRunner = (args: string[]) => Promise<string>
|
|
4
|
+
|
|
5
|
+
export interface WorktreeManagerInput {
|
|
6
|
+
operation: "create" | "detect" | "merge" | "cleanup"
|
|
7
|
+
repoRoot: string
|
|
8
|
+
branchName?: string
|
|
9
|
+
worktreePath?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface WorktreeManagerResult {
|
|
13
|
+
operation: string
|
|
14
|
+
worktreePath?: string
|
|
15
|
+
isWorktree?: boolean
|
|
16
|
+
merged?: boolean
|
|
17
|
+
cleanedUp?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function createWorktreeManagerTool() {
|
|
21
|
+
return {
|
|
22
|
+
name: "worktree_manager",
|
|
23
|
+
async execute(
|
|
24
|
+
input: WorktreeManagerInput,
|
|
25
|
+
runner: GitRunner,
|
|
26
|
+
): Promise<WorktreeManagerResult> {
|
|
27
|
+
switch (input.operation) {
|
|
28
|
+
case "create":
|
|
29
|
+
return createWorktree(input, runner)
|
|
30
|
+
case "detect":
|
|
31
|
+
return detectWorktree(input, runner)
|
|
32
|
+
case "merge":
|
|
33
|
+
return mergeWorktree(input, runner)
|
|
34
|
+
case "cleanup":
|
|
35
|
+
return cleanupWorktree(input, runner)
|
|
36
|
+
default:
|
|
37
|
+
throw new Error(`Unknown operation: ${input.operation}`)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function createWorktree(
|
|
44
|
+
input: WorktreeManagerInput,
|
|
45
|
+
runner: GitRunner,
|
|
46
|
+
): Promise<WorktreeManagerResult> {
|
|
47
|
+
const branchName = required(input.branchName, "branchName")
|
|
48
|
+
const worktreeDir = `${path.basename(input.repoRoot)}-${normalizeBranchSlug(branchName)}`
|
|
49
|
+
const worktreePath = path.join(path.dirname(input.repoRoot), worktreeDir)
|
|
50
|
+
|
|
51
|
+
await runner(["git", "branch", branchName])
|
|
52
|
+
await runner(["git", "worktree", "add", worktreePath, branchName])
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
operation: "create",
|
|
56
|
+
worktreePath,
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function detectWorktree(
|
|
61
|
+
input: WorktreeManagerInput,
|
|
62
|
+
runner: GitRunner,
|
|
63
|
+
): Promise<WorktreeManagerResult> {
|
|
64
|
+
const output = await runner(["git", "worktree", "list"])
|
|
65
|
+
const lines = output.trim().split("\n")
|
|
66
|
+
|
|
67
|
+
if (lines.length <= 1) {
|
|
68
|
+
return { operation: "detect", isWorktree: false }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Find a worktree that is not the main one
|
|
72
|
+
const mainLine = lines[0]
|
|
73
|
+
const worktreeLine = lines.find(
|
|
74
|
+
(line) => line !== mainLine && line.includes(input.repoRoot),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
if (worktreeLine) {
|
|
78
|
+
const worktreePath = worktreeLine.split(/\s+/)[0]
|
|
79
|
+
return { operation: "detect", isWorktree: true, worktreePath }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Check if any secondary worktree exists
|
|
83
|
+
const secondaryLine = lines.find((line) => line !== mainLine)
|
|
84
|
+
if (secondaryLine) {
|
|
85
|
+
const worktreePath = secondaryLine.split(/\s+/)[0]
|
|
86
|
+
return { operation: "detect", isWorktree: true, worktreePath }
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return { operation: "detect", isWorktree: false }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async function mergeWorktree(
|
|
93
|
+
input: WorktreeManagerInput,
|
|
94
|
+
runner: GitRunner,
|
|
95
|
+
): Promise<WorktreeManagerResult> {
|
|
96
|
+
const branchName = required(input.branchName, "branchName")
|
|
97
|
+
|
|
98
|
+
await runner(["git", "checkout", "main"])
|
|
99
|
+
await runner(["git", "merge", branchName])
|
|
100
|
+
|
|
101
|
+
return { operation: "merge", merged: true }
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function cleanupWorktree(
|
|
105
|
+
input: WorktreeManagerInput,
|
|
106
|
+
runner: GitRunner,
|
|
107
|
+
): Promise<WorktreeManagerResult> {
|
|
108
|
+
const branchName = required(input.branchName, "branchName")
|
|
109
|
+
const worktreePath = required(input.worktreePath, "worktreePath")
|
|
110
|
+
|
|
111
|
+
await runner(["git", "worktree", "remove", worktreePath])
|
|
112
|
+
await runner(["git", "branch", "-d", branchName])
|
|
113
|
+
|
|
114
|
+
return { operation: "cleanup", cleanedUp: true }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function required(value: string | undefined, field: string): string {
|
|
118
|
+
if (!value) {
|
|
119
|
+
throw new Error(`worktree_manager requires ${field}`)
|
|
120
|
+
}
|
|
121
|
+
return value
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function normalizeBranchSlug(value: string): string {
|
|
125
|
+
return value
|
|
126
|
+
.trim()
|
|
127
|
+
.toLowerCase()
|
|
128
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
129
|
+
.replace(/-+/g, "-")
|
|
130
|
+
.replace(/^-+|-+$/g, "")
|
|
131
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import path from "node:path"
|
|
2
|
+
import { normalizeSlug } from "./name-utils"
|
|
3
|
+
|
|
4
|
+
export function getBrainstormArtifactPath(repoRoot: string, date: string, topic: string): string {
|
|
5
|
+
return path.join(repoRoot, "docs", "brainstorms", `${date}-${normalizeSlug(topic)}-requirements.md`)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function getPlanArtifactPath(repoRoot: string, date: string, topic: string): string {
|
|
9
|
+
return path.join(repoRoot, "docs", "plans", `${date}-${normalizeSlug(topic)}-plan.md`)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function getSolutionArtifactPath(
|
|
13
|
+
repoRoot: string,
|
|
14
|
+
category: string,
|
|
15
|
+
topic: string,
|
|
16
|
+
date: string,
|
|
17
|
+
): string {
|
|
18
|
+
return path.join(repoRoot, "docs", "solutions", normalizeSlug(category), `${date}-${normalizeSlug(topic)}.md`)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getRunArtifactPath(repoRoot: string, skillName: string, runId: string): string {
|
|
22
|
+
return path.join(repoRoot, ".context", "compound-engineering", normalizeSlug(skillName), runId)
|
|
23
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@leing2021/super-pi",
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Pi-native Compound Engineering package for iterative development workflows",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/leing2021/super-pi.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/leing2021/super-pi",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/leing2021/super-pi/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"@leing2021/super-pi",
|
|
18
|
+
"pi-package",
|
|
19
|
+
"pi",
|
|
20
|
+
"super-pi",
|
|
21
|
+
"coding-agent",
|
|
22
|
+
"compound-engineering"
|
|
23
|
+
],
|
|
24
|
+
"files": [
|
|
25
|
+
"skills",
|
|
26
|
+
"extensions",
|
|
27
|
+
"README.md",
|
|
28
|
+
"package.json"
|
|
29
|
+
],
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"test": "bun test"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"@mariozechner/pi-coding-agent": "*",
|
|
38
|
+
"@sinclair/typebox": "*"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@mariozechner/pi-coding-agent": "0.67.6",
|
|
42
|
+
"@sinclair/typebox": "0.34.41",
|
|
43
|
+
"bun-types": "^1.3.12"
|
|
44
|
+
},
|
|
45
|
+
"pi": {
|
|
46
|
+
"skills": [
|
|
47
|
+
"./skills"
|
|
48
|
+
],
|
|
49
|
+
"extensions": [
|
|
50
|
+
"./extensions"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
package/skills/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 01-brainstorm
|
|
3
|
+
description: "Brainstorm requirements with three modes: CE discovery, Startup Diagnostic, Builder Mode."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brainstorm
|
|
7
|
+
|
|
8
|
+
Use this skill when the request is ambiguous, needs requirements discovery before planning, or the user describes a new idea/product.
|
|
9
|
+
|
|
10
|
+
## Core rules
|
|
11
|
+
|
|
12
|
+
- Use **`brainstorm_dialog`** to manage multi-round conversations.
|
|
13
|
+
- Start with `start` operation: present initial analysis and open questions.
|
|
14
|
+
- Use `refine` operation: incorporate user responses and produce refined analysis with new questions.
|
|
15
|
+
- Repeat refine rounds until all open questions are resolved.
|
|
16
|
+
- End with `summarize` operation: finalize into a requirements-ready artifact.
|
|
17
|
+
- Ask **one question at a time** within each round.
|
|
18
|
+
- Compare **2-3 approaches** when multiple directions are plausible.
|
|
19
|
+
- Keep the artifact focused on **what** should be built, not implementation details by default.
|
|
20
|
+
- Write the result to `docs/brainstorms/` as a durable requirements document.
|
|
21
|
+
- End by recommending `02-plan` when the requirements are ready.
|
|
22
|
+
- **Do not proceed to planning without explicit user approval** of the design.
|
|
23
|
+
|
|
24
|
+
## Mode selection
|
|
25
|
+
|
|
26
|
+
After initial context gathering, determine which mode to use. Use `ask_user_question`:
|
|
27
|
+
|
|
28
|
+
> Before we dig in, what's your goal with this?
|
|
29
|
+
>
|
|
30
|
+
> - **Building a startup** (or thinking about it)
|
|
31
|
+
> - **Intrapreneurship** — internal project, need to ship fast
|
|
32
|
+
> - **Side project / hackathon / learning** — building for fun or exploration
|
|
33
|
+
> - **Adding a feature** — already have a project, need to design a change
|
|
34
|
+
|
|
35
|
+
**Mode mapping:**
|
|
36
|
+
- Startup, intrapreneurship → **Startup Diagnostic** (see `references/startup-diagnostic.md`)
|
|
37
|
+
- Side project, hackathon, learning → **Builder Mode** (see `references/builder-mode.md`)
|
|
38
|
+
- Adding a feature → **CE Brainstorm** (the existing requirements discovery flow below)
|
|
39
|
+
|
|
40
|
+
If the user's request already makes the mode obvious (e.g., "I have a startup idea"), skip the question and go directly to the matching mode.
|
|
41
|
+
|
|
42
|
+
## Startup Diagnostic mode
|
|
43
|
+
|
|
44
|
+
Read `references/startup-diagnostic.md` for the full YC-style forcing questions, pushback patterns, and anti-sycophancy rules.
|
|
45
|
+
|
|
46
|
+
Key differences from CE mode:
|
|
47
|
+
- **Operating principles:** Specificity is the only currency. Interest is not demand. The status quo is your real competitor. Narrow beats wide, early.
|
|
48
|
+
- **Ask the six forcing questions** one at a time, pushing until answers are specific and uncomfortable.
|
|
49
|
+
- **Smart routing:** Pre-product (Q1-Q3), Has users (Q2, Q4, Q5), Paying customers (Q4, Q5, Q6).
|
|
50
|
+
- **End with the assignment:** One concrete action the founder should take next.
|
|
51
|
+
|
|
52
|
+
After the diagnostic, run Premise Challenge (see `references/premise-challenge.md`), then proceed to Alternatives Generation and design checklist.
|
|
53
|
+
|
|
54
|
+
## Builder Mode
|
|
55
|
+
|
|
56
|
+
Read `references/builder-mode.md` for the full generative question set and response posture.
|
|
57
|
+
|
|
58
|
+
Key differences from CE mode:
|
|
59
|
+
- **Operating principles:** Delight is the currency. Ship something you can show. Solve your own problem. Explore before you optimize.
|
|
60
|
+
- **Ask generative questions** one at a time (coolest version, who would you show, fastest path, what's different, 10x version).
|
|
61
|
+
- **End with concrete build steps**, not business validation tasks.
|
|
62
|
+
- **Vibe shift detection:** If the user starts talking about customers/revenue, upgrade to Startup Diagnostic.
|
|
63
|
+
|
|
64
|
+
After the questions, run Premise Challenge (see `references/premise-challenge.md`), then proceed to Alternatives Generation and design checklist.
|
|
65
|
+
|
|
66
|
+
## CE Brainstorm mode (existing flow)
|
|
67
|
+
|
|
68
|
+
This is the original Compound Engineering brainstorm. Use when adding a feature to an existing project.
|
|
69
|
+
|
|
70
|
+
1. Scan the repository for nearby context.
|
|
71
|
+
2. Use `brainstorm_dialog` `start` to begin multi-round refinement.
|
|
72
|
+
3. Present initial analysis and open questions to the user.
|
|
73
|
+
4. Use `brainstorm_dialog` `refine` to incorporate user responses and refine analysis.
|
|
74
|
+
5. Repeat step 4 until all questions are resolved.
|
|
75
|
+
|
|
76
|
+
## Premise Challenge (all modes)
|
|
77
|
+
|
|
78
|
+
After the mode-specific questions are complete, run the Premise Challenge. See `references/premise-challenge.md`.
|
|
79
|
+
|
|
80
|
+
## Design checklist
|
|
81
|
+
|
|
82
|
+
Before summarizing, ensure the design answers:
|
|
83
|
+
- What are we building?
|
|
84
|
+
- Why does it exist?
|
|
85
|
+
- What files/modules are likely to change?
|
|
86
|
+
- What are the boundaries between responsibilities?
|
|
87
|
+
- What can fail, and how should failure be handled?
|
|
88
|
+
- How will we verify success?
|
|
89
|
+
|
|
90
|
+
## Stop conditions
|
|
91
|
+
|
|
92
|
+
Stop and ask the user instead of guessing when:
|
|
93
|
+
- requirements conflict
|
|
94
|
+
- success criteria are unclear
|
|
95
|
+
- the task spans multiple independent systems
|
|
96
|
+
- the user has not approved the design yet
|
|
97
|
+
|
|
98
|
+
## Approval gate
|
|
99
|
+
|
|
100
|
+
Before handing off to `02-plan`:
|
|
101
|
+
1. Present the final design to the user.
|
|
102
|
+
2. Ask for explicit approval.
|
|
103
|
+
3. Only proceed after the user confirms.
|
|
104
|
+
|
|
105
|
+
## Workflow
|
|
106
|
+
|
|
107
|
+
1. Scan the repository for nearby context.
|
|
108
|
+
2. Determine mode (Startup / Builder / CE) via the mode selection step.
|
|
109
|
+
3. Run mode-specific questions using the appropriate reference file.
|
|
110
|
+
4. Run Premise Challenge.
|
|
111
|
+
5. Generate 2-3 alternatives (at least one "minimal viable" and one "ideal architecture").
|
|
112
|
+
6. Validate against the design checklist.
|
|
113
|
+
7. Use `brainstorm_dialog` `summarize` to finalize the conversation.
|
|
114
|
+
8. Capture the agreed direction in a requirements artifact under `docs/brainstorms/`.
|
|
115
|
+
9. Get explicit user approval before handing off.
|
|
116
|
+
10. Hand off to `02-plan` using `references/handoff.md`.
|
|
117
|
+
|
|
118
|
+
## Artifact contract
|
|
119
|
+
|
|
120
|
+
Use `references/requirements-template.md` to structure the requirements document. Keep implementation details out unless the brainstorm is specifically about architecture or technical direction.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Builder Mode
|
|
2
|
+
|
|
3
|
+
Design thinking brainstorming for side projects, hackathons, learning, open source, and creative outlets. Use when the user is building for fun, learning, hacking, or exploring.
|
|
4
|
+
|
|
5
|
+
## Operating principles
|
|
6
|
+
|
|
7
|
+
1. **Delight is the currency.** What makes someone say "whoa"?
|
|
8
|
+
2. **Ship something you can show people.** The best version of anything is the one that exists.
|
|
9
|
+
3. **The best side projects solve your own problem.** If you're building it for yourself, trust that instinct.
|
|
10
|
+
4. **Explore before you optimize.** Try the weird idea first. Polish later.
|
|
11
|
+
|
|
12
|
+
## Response posture
|
|
13
|
+
|
|
14
|
+
- **Enthusiastic, opinionated collaborator.** You're here to help them build the coolest thing possible. Riff on their ideas. Get excited about what's exciting.
|
|
15
|
+
- **Help them find the most exciting version of their idea.** Don't settle for the obvious version.
|
|
16
|
+
- **Suggest cool things they might not have thought of.** Bring adjacent ideas, unexpected combinations, "what if you also..." suggestions.
|
|
17
|
+
- **End with concrete build steps, not business validation tasks.** The deliverable is "what to build next," not "who to interview."
|
|
18
|
+
|
|
19
|
+
## Generative questions
|
|
20
|
+
|
|
21
|
+
Ask these **ONE AT A TIME** via `ask_user_question`. The goal is to brainstorm and sharpen the idea, not interrogate.
|
|
22
|
+
|
|
23
|
+
- **What's the coolest version of this?** What would make it genuinely delightful?
|
|
24
|
+
- **Who would you show this to?** What would make them say "whoa"?
|
|
25
|
+
- **What's the fastest path to something you can actually use or share?**
|
|
26
|
+
- **What existing thing is closest to this, and how is yours different?**
|
|
27
|
+
- **What would you add if you had unlimited time?** What's the 10x version?
|
|
28
|
+
|
|
29
|
+
**Smart-skip:** If the user's initial prompt already answers a question, skip it. Only ask questions whose answers aren't yet clear.
|
|
30
|
+
|
|
31
|
+
**STOP** after each question. Wait for the response before asking the next.
|
|
32
|
+
|
|
33
|
+
## Escape hatch
|
|
34
|
+
|
|
35
|
+
If the user says "just do it" or provides a fully formed plan: fast-track to Premise Challenge and Alternatives Generation.
|
|
36
|
+
|
|
37
|
+
## Vibe shift detection
|
|
38
|
+
|
|
39
|
+
If the user starts saying things like "actually I think this could be a real company" or mentions customers, revenue, or fundraising: upgrade to Startup Diagnostic mode naturally. Say: "Okay, now we're talking. Let me ask you some harder questions." Then switch to the Startup Diagnostic questions.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Handoff from 01-brainstorm
|
|
2
|
+
|
|
3
|
+
When the requirements artifact is ready:
|
|
4
|
+
|
|
5
|
+
1. Report the artifact path under `docs/brainstorms/`.
|
|
6
|
+
2. Summarize the recommended direction in 2-3 bullets.
|
|
7
|
+
3. Recommend `02-plan` as the next step.
|
|
8
|
+
4. If key ambiguity remains, say so before handing off.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Premise Challenge
|
|
2
|
+
|
|
3
|
+
Before proposing solutions, challenge the premises. Run this after the diagnostic questions (Startup or Builder) and before Alternatives Generation.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
1. **Is this the right problem?** Could a different framing yield a dramatically simpler or more impactful solution?
|
|
8
|
+
2. **What happens if we do nothing?** Real pain point or hypothetical one?
|
|
9
|
+
3. **What existing code already partially solves this?** Map existing patterns, utilities, and flows that could be reused.
|
|
10
|
+
4. **If the deliverable is a new artifact** (CLI binary, library, package, container image, mobile app): **how will users get it?** Code without distribution is code nobody can use.
|
|
11
|
+
|
|
12
|
+
## Output format
|
|
13
|
+
|
|
14
|
+
Present premises as clear statements the user must agree with before proceeding:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
PREMISES:
|
|
18
|
+
1. [statement] — agree/disagree?
|
|
19
|
+
2. [statement] — agree/disagree?
|
|
20
|
+
3. [statement] — agree/disagree?
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use `ask_user_question` to confirm each premise. If the user disagrees, revise understanding and loop back.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Requirements
|
|
2
|
+
|
|
3
|
+
## Problem
|
|
4
|
+
|
|
5
|
+
Describe the user or product problem being solved.
|
|
6
|
+
|
|
7
|
+
## Goals
|
|
8
|
+
|
|
9
|
+
List the primary outcomes this work should achieve.
|
|
10
|
+
|
|
11
|
+
## Non-goals
|
|
12
|
+
|
|
13
|
+
List what this brainstorm intentionally does not cover.
|
|
14
|
+
|
|
15
|
+
## Approach options
|
|
16
|
+
|
|
17
|
+
Compare 2-3 approaches with tradeoffs.
|
|
18
|
+
|
|
19
|
+
## Recommended direction
|
|
20
|
+
|
|
21
|
+
Describe the chosen direction and why it is the best fit.
|
|
22
|
+
|
|
23
|
+
## Success criteria
|
|
24
|
+
|
|
25
|
+
List the concrete outcomes that would mean this work succeeded.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Startup Diagnostic
|
|
2
|
+
|
|
3
|
+
The YC-style forcing questions. Use these when the user is building a startup or doing intrapreneurship.
|
|
4
|
+
|
|
5
|
+
## Smart routing by product stage
|
|
6
|
+
|
|
7
|
+
| Stage | Questions to ask |
|
|
8
|
+
|-------|-----------------|
|
|
9
|
+
| Pre-product (idea stage) | Q1, Q2, Q3 |
|
|
10
|
+
| Has users (not yet paying) | Q2, Q4, Q5 |
|
|
11
|
+
| Has paying customers | Q4, Q5, Q6 |
|
|
12
|
+
| Pure engineering/infra | Q2, Q4 only |
|
|
13
|
+
|
|
14
|
+
## The six forcing questions
|
|
15
|
+
|
|
16
|
+
Ask these **ONE AT A TIME** via `ask_user_question`. Push on each one until the answer is specific and uncomfortable. Comfort means the founder hasn't gone deep enough.
|
|
17
|
+
|
|
18
|
+
### Q1: Demand Reality
|
|
19
|
+
|
|
20
|
+
**Ask:** "What's the strongest evidence you have that someone actually wants this? Not 'is interested,' not 'signed up for a waitlist,' but would be genuinely upset if it disappeared tomorrow?"
|
|
21
|
+
|
|
22
|
+
**Push until you hear:** Specific behavior. Someone paying. Someone expanding usage. Someone building their workflow around it. Someone who would have to scramble if you vanished.
|
|
23
|
+
|
|
24
|
+
**Red flags:** "People say it's interesting." "We got 500 waitlist signups." "VCs are excited about the space." None of these are demand.
|
|
25
|
+
|
|
26
|
+
### Q2: Status Quo
|
|
27
|
+
|
|
28
|
+
**Ask:** "What are your users doing right now to solve this problem, even badly? What does that workaround cost them?"
|
|
29
|
+
|
|
30
|
+
**Push until you hear:** A specific workflow. Hours spent. Dollars wasted. Tools duct-taped together. People hired to do it manually.
|
|
31
|
+
|
|
32
|
+
**Red flags:** "Nothing. There's no solution, that's why the opportunity is so big." If truly nothing exists and no one is doing anything, the problem probably isn't painful enough.
|
|
33
|
+
|
|
34
|
+
### Q3: Desperate Specificity
|
|
35
|
+
|
|
36
|
+
**Ask:** "Name the actual human who needs this most. What's their title? What gets them promoted? What gets them fired? What keeps them up at night?"
|
|
37
|
+
|
|
38
|
+
**Push until you hear:** A name. A role. A specific consequence they face if the problem isn't solved.
|
|
39
|
+
|
|
40
|
+
**Red flags:** Category-level answers. "Healthcare enterprises." "SMBs." "Marketing teams." You can't email a category.
|
|
41
|
+
|
|
42
|
+
### Q4: Narrowest Wedge
|
|
43
|
+
|
|
44
|
+
**Ask:** "What's the smallest possible version of this that someone would pay real money for, this week, not after you build the platform?"
|
|
45
|
+
|
|
46
|
+
**Push until you hear:** One feature. One workflow. Maybe something as simple as a weekly email or a single automation. Something they could ship in days, not months, that someone would pay for.
|
|
47
|
+
|
|
48
|
+
**Red flags:** "We need to build the full platform before anyone can really use it." "We could strip it down but then it wouldn't be differentiated."
|
|
49
|
+
|
|
50
|
+
**Bonus push:** "What if the user didn't have to do anything at all to get value? No login, no integration, no setup. What would that look like?"
|
|
51
|
+
|
|
52
|
+
### Q5: Observation and Surprise
|
|
53
|
+
|
|
54
|
+
**Ask:** "Have you actually sat down and watched someone use this without helping them? What did they do that surprised you?"
|
|
55
|
+
|
|
56
|
+
**Push until you hear:** A specific surprise. Something the user did that contradicted assumptions.
|
|
57
|
+
|
|
58
|
+
**Red flags:** "We sent out a survey." "We did some demo calls." "Nothing surprising, it's going as expected." Surveys lie. Demos are theater.
|
|
59
|
+
|
|
60
|
+
**The gold:** Users doing something the product wasn't designed for. That's often the real product trying to emerge.
|
|
61
|
+
|
|
62
|
+
### Q6: Future-Fit
|
|
63
|
+
|
|
64
|
+
**Ask:** "If the world looks meaningfully different in 3 years, and it will, does your product become more essential or less?"
|
|
65
|
+
|
|
66
|
+
**Push until you hear:** A specific claim about how their users' world changes and why that change makes their product more valuable.
|
|
67
|
+
|
|
68
|
+
**Red flags:** "The market is growing 20% per year." Growth rate is not a vision. "AI will make everything better." That's not a product thesis.
|
|
69
|
+
|
|
70
|
+
## Response posture
|
|
71
|
+
|
|
72
|
+
- **Be direct to the point of discomfort.** Comfort means you haven't pushed hard enough. Your job is diagnosis, not encouragement.
|
|
73
|
+
- **Push once, then push again.** The first answer is usually the polished version. The real answer comes after the second or third push.
|
|
74
|
+
- **Name common failure patterns:** "solution in search of a problem," "hypothetical users," "waiting to launch until it's perfect," "assuming interest equals demand." Name them directly.
|
|
75
|
+
- **End with the assignment.** Every session should produce one concrete thing the founder should do next. Not a strategy, an action.
|
|
76
|
+
|
|
77
|
+
## Anti-sycophancy rules
|
|
78
|
+
|
|
79
|
+
**Never say these during the diagnostic:**
|
|
80
|
+
- "That's an interesting approach" (take a position instead)
|
|
81
|
+
- "There are many ways to think about this" (pick one)
|
|
82
|
+
- "You might want to consider..." (say "This is wrong because..." or "This works because...")
|
|
83
|
+
- "That could work" (say whether it WILL work based on evidence)
|
|
84
|
+
|
|
85
|
+
**Always:**
|
|
86
|
+
- Take a position on every answer. State your position AND what evidence would change it.
|
|
87
|
+
- Challenge the strongest version of the claim, not a strawman.
|
|
88
|
+
|
|
89
|
+
## Pushback patterns
|
|
90
|
+
|
|
91
|
+
**Vague market, force specificity:**
|
|
92
|
+
- BAD: "That's a big market! Let's explore what kind of tool."
|
|
93
|
+
- GOOD: "There are 10,000 AI developer tools right now. What specific task does a specific developer currently waste 2+ hours/week on that your tool eliminates? Name the person."
|
|
94
|
+
|
|
95
|
+
**Social proof, demand test:**
|
|
96
|
+
- BAD: "That's encouraging! Who specifically have you talked to?"
|
|
97
|
+
- GOOD: "Loving an idea is free. Has anyone offered to pay? Has anyone asked when it ships? Love is not demand."
|
|
98
|
+
|
|
99
|
+
**Platform vision, wedge challenge:**
|
|
100
|
+
- BAD: "What would a stripped-down version look like?"
|
|
101
|
+
- GOOD: "That's a red flag. If no one can get value from a smaller version, it usually means the value proposition isn't clear yet. What's the one thing a user would pay for this week?"
|
|
102
|
+
|
|
103
|
+
## Escape hatch
|
|
104
|
+
|
|
105
|
+
If the user says "just do it" or expresses impatience:
|
|
106
|
+
- Say: "The hard questions are the value. Skipping them is like skipping the exam and going straight to the prescription. Let me ask two more, then we'll move."
|
|
107
|
+
- Ask the 2 most critical remaining questions, then proceed to Premise Challenge.
|
|
108
|
+
- If the user pushes back a second time, respect it. Proceed immediately.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 02-plan
|
|
3
|
+
description: "Turn requirements into a plan. Optional CEO-style strategic review after."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Plan
|
|
7
|
+
|
|
8
|
+
Use this skill when requirements are ready to become an execution-ready plan.
|
|
9
|
+
|
|
10
|
+
## Core rules
|
|
11
|
+
|
|
12
|
+
- Search `docs/brainstorms/` for a relevant requirements artifact first.
|
|
13
|
+
- Search solutions with grep-first strategy: extract keywords from the task → `bash grep -rl "tags:.*keyword" docs/solutions/ ~/.pi/agent/docs/solutions/` → read only frontmatter (first 15 lines) of matching files → score by severity + tag relevance → fully read top 3. Search both project-level (`docs/solutions/`) and global-level (`~/.pi/agent/docs/solutions/`). If no matches, report "No relevant solutions found" and proceed.
|
|
14
|
+
- Write the final plan to `docs/plans/`.
|
|
15
|
+
- Break the work into implementation units instead of writing an execution script.
|
|
16
|
+
- If a plan already exists, use **`plan_diff`** to compare existing units with new requirements and apply incremental changes instead of rewriting.
|
|
17
|
+
- End by recommending `03-work` once the plan is ready.
|
|
18
|
+
|
|
19
|
+
## Hard gates — TDD enforcement
|
|
20
|
+
|
|
21
|
+
Every implementation unit must follow **RED, GREEN, REFACTOR**:
|
|
22
|
+
- No production code step may appear before a failing test step.
|
|
23
|
+
- Every unit must include exact verification commands.
|
|
24
|
+
- No placeholders allowed — replace "handle edge cases" with concrete steps.
|
|
25
|
+
|
|
26
|
+
**TDD violation rejection criteria** — stop and revise the plan if any unit:
|
|
27
|
+
- implements code before a failing test
|
|
28
|
+
- lacks a command proving the RED step
|
|
29
|
+
- lacks a command proving the GREEN step
|
|
30
|
+
- skips verification
|
|
31
|
+
- relies on unstated tools or assumptions
|
|
32
|
+
|
|
33
|
+
## Planning flow
|
|
34
|
+
|
|
35
|
+
1. Read the most relevant brainstorm artifact from `docs/brainstorms/` when one exists.
|
|
36
|
+
2. Execute the solution search strategy: extract keywords → grep frontmatter fields (tags, title) in `docs/solutions/` and `~/.pi/agent/docs/solutions/` → read frontmatter of candidates only → score and rank → fully read top 3.
|
|
37
|
+
3. Gather repository context from the affected areas.
|
|
38
|
+
4. If a plan already exists:
|
|
39
|
+
a. Use `plan_diff` `compare` to identify added, removed, modified, and unchanged units.
|
|
40
|
+
b. Review the diff with the user.
|
|
41
|
+
c. Use `plan_diff` `patch` to apply approved changes.
|
|
42
|
+
5. If no plan exists, write a new plan artifact under `docs/plans/` using `references/plan-template.md`.
|
|
43
|
+
6. Structure the work using `references/implementation-unit-template.md`.
|
|
44
|
+
7. Verify every unit follows strict TDD — reject units that violate the gates above.
|
|
45
|
+
|
|
46
|
+
## Optional: CEO Review
|
|
47
|
+
|
|
48
|
+
After the plan artifact is written (step 5 or 6 above), offer the user a strategic review:
|
|
49
|
+
|
|
50
|
+
> Plan ready. How do you want to review it?
|
|
51
|
+
>
|
|
52
|
+
> - **A) Just go** — trust the plan, skip review
|
|
53
|
+
> - **B) CEO Review** — challenge premises, check for better alternatives, dream-state mapping
|
|
54
|
+
> - **C) Strict Review** — full CEO Review plus error maps, failure modes, test diagrams
|
|
55
|
+
|
|
56
|
+
If the user picks A, proceed directly to the `03-work` handoff.
|
|
57
|
+
If the user picks B or C, read `references/ceo-review-mode.md` and execute the review flow.
|
|
58
|
+
|
|
59
|
+
After CEO/Strict Review:
|
|
60
|
+
1. Update the plan artifact with any changes the user approved.
|
|
61
|
+
2. Note the review mode and key decisions in the plan.
|
|
62
|
+
3. Proceed to the `03-work` handoff.
|
|
63
|
+
|
|
64
|
+
## Implementation unit format
|
|
65
|
+
|
|
66
|
+
Every unit must include:
|
|
67
|
+
- **Purpose**: what this unit accomplishes
|
|
68
|
+
- **Files**: exact paths to create, modify, or test
|
|
69
|
+
- **Steps** as checkboxes:
|
|
70
|
+
1. Write or update a failing test
|
|
71
|
+
2. Run the targeted test and confirm it fails for the expected reason (RED)
|
|
72
|
+
3. Write the minimal implementation needed to pass
|
|
73
|
+
4. Run the targeted test and confirm it passes (GREEN)
|
|
74
|
+
5. Refactor if needed while keeping tests green
|
|
75
|
+
6. Run unit-level verification
|
|
76
|
+
- **Verification commands**: exact commands to run
|
|
77
|
+
- **Expected results**: what success looks like
|