@leing2021/super-pi 0.23.0 → 0.23.2
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 +55 -324
- package/extensions/ce-core/index.ts +96 -41
- package/extensions/ce-core/tools/context-handoff.ts +115 -1
- package/extensions/ce-core/tools/workflow-state.ts +68 -1
- package/package.json +1 -1
- package/skills/01-brainstorm/SKILL.md +42 -79
- package/skills/01-brainstorm/references/ce-brainstorm-mode.md +47 -0
- package/skills/02-plan/SKILL.md +43 -62
- package/skills/02-plan/references/solution-search.md +46 -0
- package/skills/03-work/SKILL.md +34 -55
- package/skills/03-work/references/completion-report.md +51 -0
- package/skills/04-review/SKILL.md +44 -52
- package/skills/04-review/references/solution-search.md +46 -0
- package/skills/06-next/SKILL.md +15 -28
- package/skills/06-next/references/recommendation-logic.md +45 -0
- package/skills/07-worktree/SKILL.md +20 -20
- package/skills/08-help/SKILL.md +37 -28
- package/skills/08-help/references/workflow-sequence.md +128 -3
- package/skills/references/pipeline-config.md +15 -0
|
@@ -17,6 +17,11 @@ export interface ContextHandoffInput {
|
|
|
17
17
|
artifacts?: Record<string, string | undefined>
|
|
18
18
|
handoffMarkdown?: string
|
|
19
19
|
handoffPath?: string
|
|
20
|
+
currentTruth?: string[]
|
|
21
|
+
invalidatedAssumptions?: string[]
|
|
22
|
+
openDecisions?: string[]
|
|
23
|
+
recentlyAccessedFiles?: string[]
|
|
24
|
+
compressionRisk?: string[]
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export interface ContextStateEntry {
|
|
@@ -29,6 +34,11 @@ export interface ContextStateEntry {
|
|
|
29
34
|
blocker?: string
|
|
30
35
|
verification?: string
|
|
31
36
|
artifacts: Record<string, string | undefined>
|
|
37
|
+
currentTruth: string[]
|
|
38
|
+
invalidatedAssumptions: string[]
|
|
39
|
+
openDecisions: string[]
|
|
40
|
+
recentlyAccessedFiles: string[]
|
|
41
|
+
compressionRisk: string[]
|
|
32
42
|
recommendNewSession: boolean
|
|
33
43
|
updatedAt: string
|
|
34
44
|
}
|
|
@@ -47,6 +57,11 @@ export interface ContextHandoffResult {
|
|
|
47
57
|
artifacts?: Record<string, string | undefined>
|
|
48
58
|
recommendNewSession?: boolean
|
|
49
59
|
handoffMarkdown?: string
|
|
60
|
+
currentTruth?: string[]
|
|
61
|
+
invalidatedAssumptions?: string[]
|
|
62
|
+
openDecisions?: string[]
|
|
63
|
+
recentlyAccessedFiles?: string[]
|
|
64
|
+
compressionRisk?: string[]
|
|
50
65
|
updatedAt?: string
|
|
51
66
|
}
|
|
52
67
|
|
|
@@ -112,6 +127,11 @@ function buildDefaultHandoffMarkdown(input: {
|
|
|
112
127
|
artifacts: Record<string, string | undefined>
|
|
113
128
|
blocker?: string
|
|
114
129
|
verification?: string
|
|
130
|
+
currentTruth: string[]
|
|
131
|
+
invalidatedAssumptions: string[]
|
|
132
|
+
openDecisions: string[]
|
|
133
|
+
recentlyAccessedFiles: string[]
|
|
134
|
+
compressionRisk: string[]
|
|
115
135
|
}): string {
|
|
116
136
|
const currentTask = input.nextStage
|
|
117
137
|
? `Continue from ${input.currentStage} to ${input.nextStage}.`
|
|
@@ -137,12 +157,24 @@ function buildDefaultHandoffMarkdown(input: {
|
|
|
137
157
|
"## Hot Context",
|
|
138
158
|
hotContext,
|
|
139
159
|
"",
|
|
160
|
+
"## Current Truth",
|
|
161
|
+
formatBullets(input.currentTruth),
|
|
162
|
+
"",
|
|
140
163
|
"## Verified Facts",
|
|
141
164
|
verifiedFacts,
|
|
142
165
|
"",
|
|
166
|
+
"## Invalidated Assumptions",
|
|
167
|
+
formatBullets(input.invalidatedAssumptions),
|
|
168
|
+
"",
|
|
169
|
+
"## Open Decisions",
|
|
170
|
+
formatBullets(input.openDecisions),
|
|
171
|
+
"",
|
|
143
172
|
"## Active Files",
|
|
144
173
|
activeFiles,
|
|
145
174
|
"",
|
|
175
|
+
"## Recently Accessed Files",
|
|
176
|
+
formatBullets(input.recentlyAccessedFiles),
|
|
177
|
+
"",
|
|
146
178
|
"## Artifacts",
|
|
147
179
|
artifacts,
|
|
148
180
|
"",
|
|
@@ -152,6 +184,9 @@ function buildDefaultHandoffMarkdown(input: {
|
|
|
152
184
|
"## Verification",
|
|
153
185
|
`- ${verification}`,
|
|
154
186
|
"",
|
|
187
|
+
"## Compression Risk",
|
|
188
|
+
formatBullets(input.compressionRisk),
|
|
189
|
+
"",
|
|
155
190
|
"## Do Not Repeat",
|
|
156
191
|
"- Do not reload full history unless the handoff lacks required evidence.",
|
|
157
192
|
"",
|
|
@@ -161,13 +196,54 @@ function buildDefaultHandoffMarkdown(input: {
|
|
|
161
196
|
].join("\n")
|
|
162
197
|
}
|
|
163
198
|
|
|
199
|
+
function toStringArray(value: unknown): string[] {
|
|
200
|
+
return Array.isArray(value) ? value.filter((item): item is string => typeof item === "string") : []
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function normalizeStateEntry(raw: unknown): ContextStateEntry | null {
|
|
204
|
+
if (!raw || typeof raw !== "object") return null
|
|
205
|
+
|
|
206
|
+
const state = raw as Record<string, unknown>
|
|
207
|
+
const activeFiles = toStringArray(state.activeFiles)
|
|
208
|
+
|
|
209
|
+
return {
|
|
210
|
+
currentStage: typeof state.currentStage === "string" ? state.currentStage : "unknown",
|
|
211
|
+
nextStage: typeof state.nextStage === "string" ? state.nextStage : undefined,
|
|
212
|
+
contextHealth: isContextHealth(state.contextHealth) ? state.contextHealth : "watch",
|
|
213
|
+
latestHandoffPath: typeof state.latestHandoffPath === "string" ? state.latestHandoffPath : undefined,
|
|
214
|
+
latestDatedHandoffPath: typeof state.latestDatedHandoffPath === "string" ? state.latestDatedHandoffPath : undefined,
|
|
215
|
+
activeFiles,
|
|
216
|
+
blocker: typeof state.blocker === "string" ? state.blocker : undefined,
|
|
217
|
+
verification: typeof state.verification === "string" ? state.verification : undefined,
|
|
218
|
+
artifacts: isStringRecord(state.artifacts) ? state.artifacts : {},
|
|
219
|
+
currentTruth: toStringArray(state.currentTruth),
|
|
220
|
+
invalidatedAssumptions: toStringArray(state.invalidatedAssumptions),
|
|
221
|
+
openDecisions: toStringArray(state.openDecisions),
|
|
222
|
+
recentlyAccessedFiles: toStringArray(state.recentlyAccessedFiles).length > 0
|
|
223
|
+
? toStringArray(state.recentlyAccessedFiles)
|
|
224
|
+
: activeFiles.slice(0, 5),
|
|
225
|
+
compressionRisk: toStringArray(state.compressionRisk),
|
|
226
|
+
recommendNewSession: typeof state.recommendNewSession === "boolean" ? state.recommendNewSession : false,
|
|
227
|
+
updatedAt: typeof state.updatedAt === "string" ? state.updatedAt : new Date(0).toISOString(),
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function isContextHealth(value: unknown): value is ContextHealth {
|
|
232
|
+
return value === "good" || value === "watch" || value === "heavy" || value === "critical"
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function isStringRecord(value: unknown): value is Record<string, string | undefined> {
|
|
236
|
+
if (!value || typeof value !== "object") return false
|
|
237
|
+
return Object.values(value).every(item => item === undefined || typeof item === "string")
|
|
238
|
+
}
|
|
239
|
+
|
|
164
240
|
async function readState(repoRoot: string): Promise<ContextStateEntry | null> {
|
|
165
241
|
const filePath = stateFilePath(repoRoot)
|
|
166
242
|
if (!existsSync(filePath)) return null
|
|
167
243
|
|
|
168
244
|
try {
|
|
169
245
|
const content = await readFile(filePath, "utf8")
|
|
170
|
-
return JSON.parse(content)
|
|
246
|
+
return normalizeStateEntry(JSON.parse(content))
|
|
171
247
|
} catch {
|
|
172
248
|
return null
|
|
173
249
|
}
|
|
@@ -207,6 +283,14 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
|
|
|
207
283
|
const blocker = input.blocker
|
|
208
284
|
const verification = input.verification
|
|
209
285
|
const artifacts = input.artifacts ?? {}
|
|
286
|
+
const currentTruth = input.currentTruth ?? []
|
|
287
|
+
const invalidatedAssumptions = input.invalidatedAssumptions ?? []
|
|
288
|
+
const openDecisions = input.openDecisions ?? []
|
|
289
|
+
const recentlyAccessedFiles = input.recentlyAccessedFiles?.length
|
|
290
|
+
? input.recentlyAccessedFiles
|
|
291
|
+
: activeFiles.slice(0, 5)
|
|
292
|
+
const compressionRisk = input.compressionRisk ?? []
|
|
293
|
+
|
|
210
294
|
const handoffMarkdown = input.handoffMarkdown?.trim().length
|
|
211
295
|
? input.handoffMarkdown
|
|
212
296
|
: buildDefaultHandoffMarkdown({
|
|
@@ -216,6 +300,11 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
|
|
|
216
300
|
artifacts,
|
|
217
301
|
blocker,
|
|
218
302
|
verification,
|
|
303
|
+
currentTruth,
|
|
304
|
+
invalidatedAssumptions,
|
|
305
|
+
openDecisions,
|
|
306
|
+
recentlyAccessedFiles,
|
|
307
|
+
compressionRisk,
|
|
219
308
|
})
|
|
220
309
|
|
|
221
310
|
const recommendNewSession = computeRecommendNewSession(currentStage, nextStage, contextHealth)
|
|
@@ -238,6 +327,11 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
|
|
|
238
327
|
blocker,
|
|
239
328
|
verification,
|
|
240
329
|
artifacts,
|
|
330
|
+
currentTruth,
|
|
331
|
+
invalidatedAssumptions,
|
|
332
|
+
openDecisions,
|
|
333
|
+
recentlyAccessedFiles,
|
|
334
|
+
compressionRisk,
|
|
241
335
|
recommendNewSession,
|
|
242
336
|
updatedAt: new Date().toISOString(),
|
|
243
337
|
}
|
|
@@ -256,6 +350,11 @@ async function save(input: ContextHandoffInput): Promise<ContextHandoffResult> {
|
|
|
256
350
|
blocker,
|
|
257
351
|
verification,
|
|
258
352
|
artifacts,
|
|
353
|
+
currentTruth,
|
|
354
|
+
invalidatedAssumptions,
|
|
355
|
+
openDecisions,
|
|
356
|
+
recentlyAccessedFiles,
|
|
357
|
+
compressionRisk,
|
|
259
358
|
recommendNewSession,
|
|
260
359
|
updatedAt: state.updatedAt,
|
|
261
360
|
}
|
|
@@ -291,6 +390,11 @@ async function load(input: ContextHandoffInput): Promise<ContextHandoffResult> {
|
|
|
291
390
|
blocker: state.blocker,
|
|
292
391
|
verification: state.verification,
|
|
293
392
|
artifacts: state.artifacts,
|
|
393
|
+
currentTruth: state.currentTruth,
|
|
394
|
+
invalidatedAssumptions: state.invalidatedAssumptions,
|
|
395
|
+
openDecisions: state.openDecisions,
|
|
396
|
+
recentlyAccessedFiles: state.recentlyAccessedFiles,
|
|
397
|
+
compressionRisk: state.compressionRisk,
|
|
294
398
|
recommendNewSession: state.recommendNewSession,
|
|
295
399
|
handoffMarkdown: markdown,
|
|
296
400
|
updatedAt: state.updatedAt,
|
|
@@ -320,6 +424,11 @@ async function latest(input: ContextHandoffInput): Promise<ContextHandoffResult>
|
|
|
320
424
|
blocker: state.blocker,
|
|
321
425
|
verification: state.verification,
|
|
322
426
|
artifacts: state.artifacts,
|
|
427
|
+
currentTruth: state.currentTruth,
|
|
428
|
+
invalidatedAssumptions: state.invalidatedAssumptions,
|
|
429
|
+
openDecisions: state.openDecisions,
|
|
430
|
+
recentlyAccessedFiles: state.recentlyAccessedFiles,
|
|
431
|
+
compressionRisk: state.compressionRisk,
|
|
323
432
|
recommendNewSession: state.recommendNewSession,
|
|
324
433
|
updatedAt: state.updatedAt,
|
|
325
434
|
}
|
|
@@ -351,6 +460,11 @@ async function status(input: ContextHandoffInput): Promise<ContextHandoffResult>
|
|
|
351
460
|
blocker: state.blocker,
|
|
352
461
|
verification: state.verification,
|
|
353
462
|
artifacts: state.artifacts,
|
|
463
|
+
currentTruth: state.currentTruth,
|
|
464
|
+
invalidatedAssumptions: state.invalidatedAssumptions,
|
|
465
|
+
openDecisions: state.openDecisions,
|
|
466
|
+
recentlyAccessedFiles: state.recentlyAccessedFiles,
|
|
467
|
+
compressionRisk: state.compressionRisk,
|
|
354
468
|
recommendNewSession: state.recommendNewSession,
|
|
355
469
|
updatedAt: state.updatedAt,
|
|
356
470
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readdirSync,
|
|
1
|
+
import { readdirSync, existsSync, readFileSync } from "node:fs"
|
|
2
2
|
import path from "node:path"
|
|
3
3
|
|
|
4
4
|
export interface WorkflowCategoryState {
|
|
@@ -6,6 +6,25 @@ export interface WorkflowCategoryState {
|
|
|
6
6
|
latest: string | null
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export interface WorkflowContextState {
|
|
10
|
+
found: boolean
|
|
11
|
+
currentStage?: string
|
|
12
|
+
nextStage?: string
|
|
13
|
+
contextHealth?: string
|
|
14
|
+
latestHandoffPath?: string
|
|
15
|
+
latestDatedHandoffPath?: string
|
|
16
|
+
activeFiles: string[]
|
|
17
|
+
recentlyAccessedFiles: string[]
|
|
18
|
+
blocker?: string
|
|
19
|
+
verification?: string
|
|
20
|
+
currentTruth: string[]
|
|
21
|
+
invalidatedAssumptions: string[]
|
|
22
|
+
openDecisions: string[]
|
|
23
|
+
compressionRisk: string[]
|
|
24
|
+
recommendNewSession?: boolean
|
|
25
|
+
updatedAt?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
9
28
|
export interface WorkflowStateInput {
|
|
10
29
|
repoRoot: string
|
|
11
30
|
}
|
|
@@ -15,6 +34,7 @@ export interface WorkflowStateResult {
|
|
|
15
34
|
plans: WorkflowCategoryState
|
|
16
35
|
solutions: WorkflowCategoryState
|
|
17
36
|
runs: WorkflowCategoryState
|
|
37
|
+
context: WorkflowContextState
|
|
18
38
|
}
|
|
19
39
|
|
|
20
40
|
function emptyCategory(): WorkflowCategoryState {
|
|
@@ -63,6 +83,52 @@ function collectFiles(dirPath: string): string[] {
|
|
|
63
83
|
return results
|
|
64
84
|
}
|
|
65
85
|
|
|
86
|
+
function emptyContext(): WorkflowContextState {
|
|
87
|
+
return {
|
|
88
|
+
found: false,
|
|
89
|
+
activeFiles: [],
|
|
90
|
+
recentlyAccessedFiles: [],
|
|
91
|
+
currentTruth: [],
|
|
92
|
+
invalidatedAssumptions: [],
|
|
93
|
+
openDecisions: [],
|
|
94
|
+
compressionRisk: [],
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function toStringArray(value: unknown): string[] {
|
|
99
|
+
return Array.isArray(value) ? value.filter((item): item is string => typeof item === "string") : []
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function readContextState(repoRoot: string): WorkflowContextState {
|
|
103
|
+
const statePath = path.join(repoRoot, ".context", "compound-engineering", "context-state.json")
|
|
104
|
+
if (!existsSync(statePath)) return emptyContext()
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
const raw = readFileSync(statePath, "utf8")
|
|
108
|
+
const state = JSON.parse(raw) as Record<string, unknown>
|
|
109
|
+
return {
|
|
110
|
+
found: true,
|
|
111
|
+
currentStage: typeof state.currentStage === "string" ? state.currentStage : undefined,
|
|
112
|
+
nextStage: typeof state.nextStage === "string" ? state.nextStage : undefined,
|
|
113
|
+
contextHealth: typeof state.contextHealth === "string" ? state.contextHealth : undefined,
|
|
114
|
+
latestHandoffPath: typeof state.latestHandoffPath === "string" ? state.latestHandoffPath : undefined,
|
|
115
|
+
latestDatedHandoffPath: typeof state.latestDatedHandoffPath === "string" ? state.latestDatedHandoffPath : undefined,
|
|
116
|
+
activeFiles: toStringArray(state.activeFiles),
|
|
117
|
+
recentlyAccessedFiles: toStringArray(state.recentlyAccessedFiles),
|
|
118
|
+
blocker: typeof state.blocker === "string" ? state.blocker : undefined,
|
|
119
|
+
verification: typeof state.verification === "string" ? state.verification : undefined,
|
|
120
|
+
currentTruth: toStringArray(state.currentTruth),
|
|
121
|
+
invalidatedAssumptions: toStringArray(state.invalidatedAssumptions),
|
|
122
|
+
openDecisions: toStringArray(state.openDecisions),
|
|
123
|
+
compressionRisk: toStringArray(state.compressionRisk),
|
|
124
|
+
recommendNewSession: typeof state.recommendNewSession === "boolean" ? state.recommendNewSession : undefined,
|
|
125
|
+
updatedAt: typeof state.updatedAt === "string" ? state.updatedAt : undefined,
|
|
126
|
+
}
|
|
127
|
+
} catch {
|
|
128
|
+
return emptyContext()
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
66
132
|
export function createWorkflowStateTool() {
|
|
67
133
|
return {
|
|
68
134
|
name: "workflow_state",
|
|
@@ -74,6 +140,7 @@ export function createWorkflowStateTool() {
|
|
|
74
140
|
plans: scanDir(path.join(repoRoot, "docs", "plans")),
|
|
75
141
|
solutions: scanDir(path.join(repoRoot, "docs", "solutions")),
|
|
76
142
|
runs: scanDir(path.join(repoRoot, ".context", "compound-engineering")),
|
|
143
|
+
context: readContextState(repoRoot),
|
|
77
144
|
}
|
|
78
145
|
},
|
|
79
146
|
}
|
package/package.json
CHANGED
|
@@ -5,120 +5,83 @@ description: "Brainstorm requirements with three modes: CE discovery, Startup Di
|
|
|
5
5
|
|
|
6
6
|
# Brainstorm
|
|
7
7
|
|
|
8
|
-
Use this skill when the request is ambiguous, needs requirements discovery
|
|
8
|
+
Use this skill when the request is ambiguous, needs requirements discovery, or the user describes a new idea/product.
|
|
9
9
|
|
|
10
10
|
See [shared pipeline instructions](../references/pipeline-config.md) for model routing and pipeline behavior.
|
|
11
11
|
|
|
12
12
|
## Core rules
|
|
13
13
|
|
|
14
|
-
- Use **`brainstorm_dialog`** to manage multi-round conversations.
|
|
15
|
-
-
|
|
16
|
-
- Use `refine` operation: incorporate user responses and produce refined analysis with new questions.
|
|
17
|
-
- Repeat refine rounds until all open questions are resolved.
|
|
18
|
-
- End with `summarize` operation: finalize into a requirements-ready artifact.
|
|
19
|
-
- Ask **one question at a time** within each round.
|
|
14
|
+
- Use **`brainstorm_dialog`** to manage multi-round conversations (`start` → `refine` → `summarize`).
|
|
15
|
+
- Ask **one question at a time**.
|
|
20
16
|
- Compare **2-3 approaches** when multiple directions are plausible.
|
|
21
|
-
- Keep
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- **Do not proceed to planning without explicit user approval** of the design.
|
|
17
|
+
- Keep focused on **what** to build, not implementation details.
|
|
18
|
+
- **Explicit user approval required** before handoff to `02-plan`.
|
|
19
|
+
- Write result to `docs/brainstorms/` as durable requirements document.
|
|
25
20
|
|
|
26
21
|
## Mode selection
|
|
27
22
|
|
|
28
|
-
After initial context
|
|
23
|
+
After initial context, determine mode via `ask_user_question`:
|
|
29
24
|
|
|
30
|
-
>
|
|
31
|
-
>
|
|
32
|
-
> - **
|
|
33
|
-
> - **
|
|
34
|
-
> - **
|
|
35
|
-
> - **Adding a feature** — already have a project, need to design a change
|
|
25
|
+
> What's your goal?
|
|
26
|
+
> - **Building a startup** → Startup Diagnostic
|
|
27
|
+
> - **Intrapreneurship** → Startup Diagnostic
|
|
28
|
+
> - **Side project / hackathon** → Builder Mode
|
|
29
|
+
> - **Adding a feature** → CE Brainstorm
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
- Startup, intrapreneurship → **Startup Diagnostic** (see `references/startup-diagnostic.md`)
|
|
39
|
-
- Side project, hackathon, learning → **Builder Mode** (see `references/builder-mode.md`)
|
|
40
|
-
- Adding a feature → **CE Brainstorm** (the existing requirements discovery flow below)
|
|
41
|
-
|
|
42
|
-
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.
|
|
43
|
-
|
|
44
|
-
## Startup Diagnostic mode
|
|
45
|
-
|
|
46
|
-
Read `references/startup-diagnostic.md` for the full YC-style forcing questions, pushback patterns, and anti-sycophancy rules.
|
|
47
|
-
|
|
48
|
-
Key differences from CE mode:
|
|
49
|
-
- **Operating principles:** Specificity is the only currency. Interest is not demand. The status quo is your real competitor. Narrow beats wide, early.
|
|
50
|
-
- **Ask the six forcing questions** one at a time, pushing until answers are specific and uncomfortable.
|
|
51
|
-
- **Smart routing:** Pre-product (Q1-Q3), Has users (Q2, Q4, Q5), Paying customers (Q4, Q5, Q6).
|
|
52
|
-
- **End with the assignment:** One concrete action the founder should take next.
|
|
31
|
+
Skip question if mode is obvious from request.
|
|
53
32
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Read `references/builder-mode.md` for the full generative question set and response posture.
|
|
59
|
-
|
|
60
|
-
Key differences from CE mode:
|
|
61
|
-
- **Operating principles:** Delight is the currency. Ship something you can show. Solve your own problem. Explore before you optimize.
|
|
62
|
-
- **Ask generative questions** one at a time (coolest version, who would you show, fastest path, what's different, 10x version).
|
|
63
|
-
- **End with concrete build steps**, not business validation tasks.
|
|
64
|
-
- **Vibe shift detection:** If the user starts talking about customers/revenue, upgrade to Startup Diagnostic.
|
|
65
|
-
|
|
66
|
-
After the questions, run Premise Challenge (see `references/premise-challenge.md`), then proceed to Alternatives Generation and design checklist.
|
|
33
|
+
**Mode mapping:**
|
|
34
|
+
- Startup / intrapreneurship → **Startup Diagnostic** (see `references/startup-diagnostic.md`)
|
|
35
|
+
- Side project / hackathon → **Builder Mode** (see `references/builder-mode.md`)
|
|
36
|
+
- Feature addition → **CE Brainstorm** (see `references/ce-brainstorm-mode.md`)
|
|
67
37
|
|
|
68
|
-
##
|
|
38
|
+
## Mode summaries
|
|
69
39
|
|
|
70
|
-
|
|
40
|
+
| Mode | Key principle | End goal |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| Startup Diagnostic | Specificity is currency, narrow beats wide | One concrete next action |
|
|
43
|
+
| Builder Mode | Delight is currency, ship something showable | Concrete build steps |
|
|
44
|
+
| CE Brainstorm | Requirements clarity | Implementation-ready spec |
|
|
71
45
|
|
|
72
|
-
|
|
73
|
-
2. Use `brainstorm_dialog` `start` to begin multi-round refinement.
|
|
74
|
-
3. Present initial analysis and open questions to the user.
|
|
75
|
-
4. Use `brainstorm_dialog` `refine` to incorporate user responses and refine analysis.
|
|
76
|
-
5. Repeat step 4 until all questions are resolved.
|
|
46
|
+
See reference files for full question sets and patterns.
|
|
77
47
|
|
|
78
|
-
## Premise Challenge
|
|
48
|
+
## Premise Challenge
|
|
79
49
|
|
|
80
|
-
After
|
|
50
|
+
After mode-specific questions, run Premise Challenge. See `references/premise-challenge.md`.
|
|
81
51
|
|
|
82
52
|
## Design checklist
|
|
83
53
|
|
|
84
54
|
Before summarizing, ensure the design answers:
|
|
85
55
|
- What are we building?
|
|
86
56
|
- Why does it exist?
|
|
87
|
-
- What files/modules
|
|
88
|
-
- What are the boundaries
|
|
89
|
-
- What can fail, and how
|
|
57
|
+
- What files/modules will change?
|
|
58
|
+
- What are the responsibility boundaries?
|
|
59
|
+
- What can fail, and how?
|
|
90
60
|
- How will we verify success?
|
|
91
61
|
|
|
92
62
|
## Stop conditions
|
|
93
63
|
|
|
94
|
-
Stop and ask
|
|
95
|
-
- requirements conflict
|
|
96
|
-
- success criteria are unclear
|
|
97
|
-
- the task spans multiple independent systems
|
|
98
|
-
- the user has not approved the design yet
|
|
64
|
+
Stop and ask instead of guessing when: requirements conflict, success criteria unclear, task spans multiple systems, or user hasn't approved design.
|
|
99
65
|
|
|
100
66
|
## Approval gate
|
|
101
67
|
|
|
102
|
-
|
|
103
|
-
1. Present the final design to the user.
|
|
104
|
-
2. Ask for explicit approval.
|
|
105
|
-
3. Only proceed after the user confirms.
|
|
68
|
+
**Required:** Explicit user approval before handoff to `02-plan`.
|
|
106
69
|
|
|
107
70
|
## Workflow
|
|
108
71
|
|
|
109
|
-
1. Scan
|
|
110
|
-
2. Determine mode (Startup / Builder / CE)
|
|
111
|
-
3. Run mode-specific questions
|
|
112
|
-
4. Run Premise Challenge
|
|
113
|
-
5. Generate 2-3 alternatives (
|
|
114
|
-
6. Validate against
|
|
115
|
-
7. Use `brainstorm_dialog` `summarize` to finalize
|
|
116
|
-
8. Capture
|
|
117
|
-
9. Get explicit user approval
|
|
118
|
-
10.
|
|
72
|
+
1. Scan repository for nearby context
|
|
73
|
+
2. Determine mode (Startup / Builder / CE)
|
|
74
|
+
3. Run mode-specific questions (use reference files)
|
|
75
|
+
4. Run Premise Challenge
|
|
76
|
+
5. Generate 2-3 alternatives (minimal viable + ideal architecture)
|
|
77
|
+
6. Validate against design checklist
|
|
78
|
+
7. Use `brainstorm_dialog` `summarize` to finalize
|
|
79
|
+
8. Capture requirements in `docs/brainstorms/`
|
|
80
|
+
9. Get explicit user approval
|
|
81
|
+
10. Handoff to `02-plan` using `references/handoff.md`
|
|
119
82
|
|
|
120
83
|
## Artifact contract
|
|
121
84
|
|
|
122
|
-
Use `references/requirements-template.md` to structure the
|
|
85
|
+
Use `references/requirements-template.md` to structure the document. Keep implementation details out unless specifically about architecture.
|
|
123
86
|
|
|
124
87
|
Before finishing this skill, apply the completion checklist in [shared pipeline instructions](../references/pipeline-config.md).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# CE Brainstorm Mode
|
|
2
|
+
|
|
3
|
+
Standard requirements discovery flow for feature additions to existing projects.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Adding a feature to an existing project
|
|
8
|
+
- User has a project but unclear about what to build
|
|
9
|
+
- Request is somewhat specific but needs elaboration
|
|
10
|
+
|
|
11
|
+
## Operating principle
|
|
12
|
+
|
|
13
|
+
**Requirements clarity** — the goal is to produce implementation-ready specifications.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
1. Scan the repository for nearby context
|
|
18
|
+
2. Use `brainstorm_dialog` `start` to begin multi-round refinement
|
|
19
|
+
3. Present initial analysis and open questions to the user
|
|
20
|
+
4. Use `brainstorm_dialog` `refine` to incorporate user responses and refine analysis
|
|
21
|
+
5. Repeat step 4 until all questions are resolved
|
|
22
|
+
|
|
23
|
+
## Key questions
|
|
24
|
+
|
|
25
|
+
Ask one at a time:
|
|
26
|
+
- What problem does this feature solve?
|
|
27
|
+
- Who is the user/consumer?
|
|
28
|
+
- What does success look like?
|
|
29
|
+
- What are the boundaries?
|
|
30
|
+
- What could go wrong?
|
|
31
|
+
|
|
32
|
+
## End state
|
|
33
|
+
|
|
34
|
+
Requirements document covering:
|
|
35
|
+
- Feature purpose and scope
|
|
36
|
+
- User-facing behavior
|
|
37
|
+
- Edge cases and failure modes
|
|
38
|
+
- Success criteria
|
|
39
|
+
- Likely file changes
|
|
40
|
+
|
|
41
|
+
## Difference from other modes
|
|
42
|
+
|
|
43
|
+
| Aspect | CE Brainstorm | Startup Diagnostic | Builder Mode |
|
|
44
|
+
|---|---|---|---|
|
|
45
|
+
| Goal | Implementation clarity | Business validation | Buildable prototype |
|
|
46
|
+
| Questions | Requirements-focused | Problem-first | Solution-first |
|
|
47
|
+
| Output | Spec document | One action | Build steps |
|
package/skills/02-plan/SKILL.md
CHANGED
|
@@ -11,77 +11,58 @@ See [shared pipeline instructions](../references/pipeline-config.md) for model r
|
|
|
11
11
|
|
|
12
12
|
## Core rules
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
14
|
+
1. Load project rules (4 steps):
|
|
15
|
+
- Load `rules/common/development-workflow.md` and `rules/common/testing.md`
|
|
16
|
+
- Detect project language via [language detection](../references/language-detection.md)
|
|
17
|
+
- Load matching language-specific rules (e.g., `rules/typescript/`)
|
|
18
|
+
- If frontend/browser concerns, also load `rules/web/` files
|
|
19
|
+
2. **Priority:** project-level `{repo-root}/rules/` overrides package defaults
|
|
20
|
+
3. Search `docs/brainstorms/` for relevant requirements first
|
|
21
|
+
4. Run solution search (see `references/solution-search.md`):
|
|
22
|
+
- Extract keywords → `grep -rl "tags:.*keyword" docs/solutions/ ~/.pi/agent/docs/solutions/`
|
|
23
|
+
- Read **frontmatter** only (first 15 lines) of matches → score by severity + tag relevance
|
|
24
|
+
- Fully read top 3 candidates
|
|
25
|
+
5. Write plan to `docs/plans/`
|
|
26
|
+
6. If plan exists, use **`plan_diff`** to compare and patch incrementally
|
|
27
|
+
7. End by recommending `03-work`
|
|
26
28
|
|
|
27
29
|
## Hard gates — TDD enforcement
|
|
28
30
|
|
|
29
|
-
Every
|
|
30
|
-
- No production code step may appear before a failing test step.
|
|
31
|
-
- Every unit must include exact verification commands.
|
|
32
|
-
- No placeholders allowed — replace "handle edge cases" with concrete steps.
|
|
31
|
+
Every unit follows **RED → GREEN → REFACTOR**:
|
|
33
32
|
|
|
34
|
-
**TDD violation rejection criteria** —
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
33
|
+
**TDD violation rejection criteria** — reject and revise if any unit:
|
|
34
|
+
- Implements code before failing test
|
|
35
|
+
- Lacks RED step verification
|
|
36
|
+
- Lacks GREEN step verification
|
|
37
|
+
- Skips verification
|
|
38
|
+
- Uses placeholders or unstated assumptions
|
|
40
39
|
|
|
41
40
|
## Planning flow
|
|
42
41
|
|
|
43
|
-
1. Read
|
|
44
|
-
2.
|
|
45
|
-
3. Gather repository context
|
|
46
|
-
4. If
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
5. If no plan exists, write a new plan artifact under `docs/plans/` using `references/plan-template.md`.
|
|
51
|
-
6. Structure the work using `references/implementation-unit-template.md`.
|
|
52
|
-
7. Verify every unit follows strict TDD — reject units that violate the gates above.
|
|
42
|
+
1. Read relevant brainstorm from `docs/brainstorms/`
|
|
43
|
+
2. Run solution search (keywords → grep frontmatter → read top 3)
|
|
44
|
+
3. Gather repository context
|
|
45
|
+
4. If plan exists: use `plan_diff` `compare` → review with user → `patch`
|
|
46
|
+
5. If no plan: write new plan under `docs/plans/` using `references/plan-template.md`
|
|
47
|
+
6. Structure work using `references/implementation-unit-template.md`
|
|
48
|
+
7. Verify every unit follows TDD gates
|
|
53
49
|
|
|
54
50
|
## Optional: CEO Review
|
|
55
51
|
|
|
56
|
-
After
|
|
57
|
-
|
|
58
|
-
> Plan ready. How
|
|
59
|
-
>
|
|
60
|
-
> - **
|
|
61
|
-
> - **
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Implementation unit format
|
|
73
|
-
|
|
74
|
-
Every unit must include:
|
|
75
|
-
- **Purpose**: what this unit accomplishes
|
|
76
|
-
- **Files**: exact paths to create, modify, or test
|
|
77
|
-
- **Steps** as checkboxes:
|
|
78
|
-
1. Write or update a failing test
|
|
79
|
-
2. Run the targeted test and confirm it fails for the expected reason (RED)
|
|
80
|
-
3. Write the minimal implementation needed to pass
|
|
81
|
-
4. Run the targeted test and confirm it passes (GREEN)
|
|
82
|
-
5. Refactor if needed while keeping tests green
|
|
83
|
-
6. Run unit-level verification
|
|
84
|
-
- **Verification commands**: exact commands to run
|
|
85
|
-
- **Expected results**: what success looks like
|
|
52
|
+
After plan is written, offer strategic review:
|
|
53
|
+
|
|
54
|
+
> Plan ready. How to review?
|
|
55
|
+
> - **A) Just go** — trust the plan
|
|
56
|
+
> - **B) CEO Review** — challenge premises, dream-state mapping
|
|
57
|
+
> - **C) Strict Review** — CEO + error maps, failure modes, test diagrams
|
|
58
|
+
|
|
59
|
+
If B or C: read `references/ceo-review-mode.md` and execute review flow.
|
|
60
|
+
After review: update plan artifact, then handoff to `03-work`.
|
|
61
|
+
|
|
62
|
+
## Artifact output
|
|
63
|
+
|
|
64
|
+
- Plan: `docs/plans/<slug>.md`
|
|
65
|
+
- Use `references/plan-template.md` structure
|
|
66
|
+
- Implementation units follow `references/implementation-unit-template.md`
|
|
86
67
|
|
|
87
68
|
Before finishing this skill, apply the completion checklist in [shared pipeline instructions](../references/pipeline-config.md).
|