organic-growth 2.0.0 → 3.1.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 +10 -2
- package/bin/cli.mjs +97 -27
- package/package.json +1 -1
- package/templates/.claude/agents/gardener.md +134 -61
- package/templates/.claude/commands/grow.md +14 -7
- package/templates/.claude/commands/map.md +23 -0
- package/templates/.claude/commands/next-automatic.md +70 -0
- package/templates/.claude/commands/next.md +4 -2
- package/templates/.claude/commands/replan.md +1 -1
- package/templates/.claude/commands/review.md +3 -3
- package/templates/.claude/commands/seed.md +58 -10
- package/templates/CLAUDE.md +9 -8
- package/templates-opencode/.opencode/agents/gardener.md +133 -48
- package/templates-opencode/.opencode/commands/grow.md +16 -7
- package/templates-opencode/.opencode/commands/map.md +23 -0
- package/templates-opencode/.opencode/commands/next-automatic.md +70 -0
- package/templates-opencode/.opencode/commands/next.md +5 -1
- package/templates-opencode/.opencode/commands/replan.md +1 -1
- package/templates-opencode/.opencode/commands/review.md +1 -1
- package/templates-opencode/.opencode/commands/seed.md +58 -9
- package/templates-opencode/AGENTS.md +9 -7
package/README.md
CHANGED
|
@@ -40,16 +40,22 @@ CLAUDE.md # Project context template + growth philosop
|
|
|
40
40
|
├── commands/
|
|
41
41
|
│ ├── seed.md # /seed — bootstrap new project
|
|
42
42
|
│ ├── grow.md # /grow — plan a new feature
|
|
43
|
+
│ ├── map.md # /map — view or adjust growth map
|
|
43
44
|
│ ├── next.md # /next — implement next stage
|
|
45
|
+
│ ├── next-automatic.md # /next-automatic — run multiple stages automatically
|
|
44
46
|
│ ├── replan.md # /replan — adjust when things change
|
|
45
47
|
│ └── review.md # /review — deep quality review
|
|
46
48
|
├── hooks/
|
|
47
49
|
│ ├── post-stage-test.sh # Automatic test run after stage commits
|
|
48
50
|
│ └── post-stage-review.sh # Automatic diff review after stage commits
|
|
49
51
|
└── settings.json # Claude Code hook configuration
|
|
52
|
+
.organic-growth/
|
|
53
|
+
├── product-dna.md # Full product DNA (structured)
|
|
54
|
+
├── growth-map.md # System-level capability map (optional)
|
|
55
|
+
└── growth/ # One growth plan per feature
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
Growth plan files (
|
|
58
|
+
Growth plan files (`.organic-growth/growth/*.md`) use plant-themed visual markers -- seedlings for pending stages, trees for completed ones, vines between sections -- so you can tell at a glance where a feature stands.
|
|
53
59
|
|
|
54
60
|
A **post-stage test** hook and a **post-stage review** hook run automatically after every stage commit, in order:
|
|
55
61
|
|
|
@@ -63,14 +69,16 @@ Tests run first so failures are caught before the review. This makes the quality
|
|
|
63
69
|
```bash
|
|
64
70
|
# 1. Bootstrap (new project)
|
|
65
71
|
> /seed # interview mode
|
|
66
|
-
> /seed
|
|
72
|
+
> /seed .organic-growth/product-dna.md # from existing product document
|
|
67
73
|
|
|
68
74
|
# 2. Grow features
|
|
69
75
|
> /grow Add user authentication
|
|
76
|
+
> /map # check/update system-level growth sequence
|
|
70
77
|
> /next # stage 1
|
|
71
78
|
> /next # stage 2
|
|
72
79
|
> /next # stage 3
|
|
73
80
|
> /clear # fresh session every 3 stages
|
|
81
|
+
> /next-automatic 5 # or run multiple stages unattended
|
|
74
82
|
> /review 3 # quality check
|
|
75
83
|
> /next # continue
|
|
76
84
|
|
package/bin/cli.mjs
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
existsSync,
|
|
5
|
+
mkdirSync,
|
|
6
|
+
copyFileSync,
|
|
7
|
+
readFileSync,
|
|
8
|
+
readdirSync,
|
|
9
|
+
statSync,
|
|
10
|
+
renameSync,
|
|
11
|
+
writeFileSync
|
|
12
|
+
} from 'fs';
|
|
4
13
|
import { join, dirname, relative, resolve } from 'path';
|
|
5
14
|
import { fileURLToPath } from 'url';
|
|
6
15
|
import { createInterface } from 'readline';
|
|
@@ -45,6 +54,67 @@ function getAllFiles(dir, base = dir) {
|
|
|
45
54
|
return files;
|
|
46
55
|
}
|
|
47
56
|
|
|
57
|
+
function migrateLegacyState(targetDir) {
|
|
58
|
+
const actions = [];
|
|
59
|
+
const ogRoot = join(targetDir, '.organic-growth');
|
|
60
|
+
const legacyDocsDir = join(targetDir, 'docs');
|
|
61
|
+
const legacyGrowthDir = join(legacyDocsDir, 'growth');
|
|
62
|
+
const legacyDna = join(legacyDocsDir, 'product-dna.md');
|
|
63
|
+
const newGrowthDir = join(ogRoot, 'growth');
|
|
64
|
+
const newDna = join(ogRoot, 'product-dna.md');
|
|
65
|
+
|
|
66
|
+
if (!existsSync(ogRoot)) {
|
|
67
|
+
mkdirSync(ogRoot, { recursive: true });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (existsSync(legacyGrowthDir)) {
|
|
71
|
+
if (!existsSync(newGrowthDir)) {
|
|
72
|
+
renameSync(legacyGrowthDir, newGrowthDir);
|
|
73
|
+
actions.push('moved docs/growth/ -> .organic-growth/growth/');
|
|
74
|
+
} else {
|
|
75
|
+
const legacyFiles = getAllFiles(legacyGrowthDir);
|
|
76
|
+
let copiedAny = false;
|
|
77
|
+
for (const rel of legacyFiles) {
|
|
78
|
+
const src = join(legacyGrowthDir, rel);
|
|
79
|
+
const dest = join(newGrowthDir, rel);
|
|
80
|
+
const destDir = dirname(dest);
|
|
81
|
+
if (!existsSync(destDir)) {
|
|
82
|
+
mkdirSync(destDir, { recursive: true });
|
|
83
|
+
}
|
|
84
|
+
if (!existsSync(dest)) {
|
|
85
|
+
copyFileSync(src, dest);
|
|
86
|
+
copiedAny = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (copiedAny) {
|
|
90
|
+
actions.push('merged files from docs/growth/ into .organic-growth/growth/');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (existsSync(legacyDna) && !existsSync(newDna)) {
|
|
96
|
+
copyFileSync(legacyDna, newDna);
|
|
97
|
+
actions.push('copied docs/product-dna.md -> .organic-growth/product-dna.md');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const contextFiles = ['CLAUDE.md', 'AGENTS.md'];
|
|
101
|
+
for (const file of contextFiles) {
|
|
102
|
+
const fullPath = join(targetDir, file);
|
|
103
|
+
if (!existsSync(fullPath)) continue;
|
|
104
|
+
const before = readFileSync(fullPath, 'utf8');
|
|
105
|
+
const after = before
|
|
106
|
+
.replaceAll('docs/growth/', '.organic-growth/growth/')
|
|
107
|
+
.replaceAll('docs/product-dna.md', '.organic-growth/product-dna.md')
|
|
108
|
+
.replaceAll('docs/growth-map.md', '.organic-growth/growth-map.md');
|
|
109
|
+
if (after !== before) {
|
|
110
|
+
writeFileSync(fullPath, after);
|
|
111
|
+
actions.push(`updated paths in ${file}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return actions;
|
|
116
|
+
}
|
|
117
|
+
|
|
48
118
|
function readVersion() {
|
|
49
119
|
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
50
120
|
return pkg.version;
|
|
@@ -59,17 +129,19 @@ function printHelp() {
|
|
|
59
129
|
log('');
|
|
60
130
|
log(`${CYAN}Options:${RESET}`);
|
|
61
131
|
log(` -f, --force Overwrite existing files without prompting`);
|
|
132
|
+
log(` --migrate Move legacy docs/growth and docs/product-dna.md to .organic-growth/`);
|
|
62
133
|
log(` -h, --help Show this help message`);
|
|
63
134
|
log(` -v, --version Show version number`);
|
|
64
135
|
log(` --opencode Install opencode templates (AGENTS.md + .opencode/)`);
|
|
65
136
|
log('');
|
|
66
137
|
log(`${CYAN}Arguments:${RESET}`);
|
|
67
|
-
log(` dna-file.md Path to a product DNA document to copy into
|
|
138
|
+
log(` dna-file.md Path to a product DNA document to copy into .organic-growth/`);
|
|
68
139
|
log('');
|
|
69
140
|
log(`${CYAN}Examples:${RESET}`);
|
|
70
141
|
log(` npx organic-growth Install Claude Code templates`);
|
|
71
142
|
log(` npx organic-growth --opencode Install opencode templates`);
|
|
72
143
|
log(` npx organic-growth --force Install templates (overwrite existing)`);
|
|
144
|
+
log(` npx organic-growth --migrate Migrate legacy docs/ state into .organic-growth/`);
|
|
73
145
|
log(` npx organic-growth spec.md Install templates + copy DNA document`);
|
|
74
146
|
log('');
|
|
75
147
|
}
|
|
@@ -88,6 +160,7 @@ async function install() {
|
|
|
88
160
|
}
|
|
89
161
|
|
|
90
162
|
const force = args.includes('--force') || args.includes('-f');
|
|
163
|
+
const migrate = args.includes('--migrate');
|
|
91
164
|
const isOpencode = args.includes('--opencode');
|
|
92
165
|
const dna = args.find(a => !a.startsWith('-') && a.endsWith('.md'));
|
|
93
166
|
|
|
@@ -129,18 +202,19 @@ async function install() {
|
|
|
129
202
|
created.push(file);
|
|
130
203
|
}
|
|
131
204
|
|
|
132
|
-
// Create
|
|
133
|
-
const growthDir = join(TARGET_DIR, '
|
|
205
|
+
// Create .organic-growth/growth/ directory
|
|
206
|
+
const growthDir = join(TARGET_DIR, '.organic-growth', 'growth');
|
|
134
207
|
if (!existsSync(growthDir)) {
|
|
135
208
|
mkdirSync(growthDir, { recursive: true });
|
|
136
|
-
created.push('
|
|
209
|
+
created.push('.organic-growth/growth/');
|
|
137
210
|
}
|
|
138
211
|
|
|
139
212
|
// Handle DNA document
|
|
140
213
|
if (dna) {
|
|
141
214
|
const dnaSource = resolve(TARGET_DIR, dna);
|
|
142
215
|
if (existsSync(dnaSource)) {
|
|
143
|
-
const dnaDest = join(TARGET_DIR, '
|
|
216
|
+
const dnaDest = join(TARGET_DIR, '.organic-growth', 'product-dna.md');
|
|
217
|
+
mkdirSync(dirname(dnaDest), { recursive: true });
|
|
144
218
|
copyFileSync(dnaSource, dnaDest);
|
|
145
219
|
success(`Product DNA copied from ${dna}`);
|
|
146
220
|
} else {
|
|
@@ -148,6 +222,19 @@ async function install() {
|
|
|
148
222
|
}
|
|
149
223
|
}
|
|
150
224
|
|
|
225
|
+
if (migrate) {
|
|
226
|
+
const migrated = migrateLegacyState(TARGET_DIR);
|
|
227
|
+
if (migrated.length > 0) {
|
|
228
|
+
log('');
|
|
229
|
+
log(`${GREEN}Migrated:${RESET}`);
|
|
230
|
+
for (const step of migrated) {
|
|
231
|
+
log(` ${DIM}${step}${RESET}`);
|
|
232
|
+
}
|
|
233
|
+
} else {
|
|
234
|
+
info('No legacy docs/ state found to migrate');
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
151
238
|
log('');
|
|
152
239
|
if (created.length > 0) {
|
|
153
240
|
log(`${GREEN}Installed:${RESET}`);
|
|
@@ -167,7 +254,7 @@ async function install() {
|
|
|
167
254
|
log('');
|
|
168
255
|
if (isOpencode) {
|
|
169
256
|
if (dna) {
|
|
170
|
-
info(`Run ${CYAN}/seed
|
|
257
|
+
info(`Run ${CYAN}/seed .organic-growth/product-dna.md${RESET} to bootstrap from your DNA document`);
|
|
171
258
|
} else {
|
|
172
259
|
info(`Run ${CYAN}/seed${RESET} to bootstrap a new project (interview mode)`);
|
|
173
260
|
info(`Or: ${CYAN}/seed path/to/product-doc.md${RESET} if you have a product document`);
|
|
@@ -175,7 +262,7 @@ async function install() {
|
|
|
175
262
|
info(`Edit ${CYAN}AGENTS.md${RESET} to fill in your tech stack and quality tools`);
|
|
176
263
|
} else {
|
|
177
264
|
if (dna) {
|
|
178
|
-
info(`Run ${CYAN}/seed
|
|
265
|
+
info(`Run ${CYAN}/seed .organic-growth/product-dna.md${RESET} to bootstrap from your DNA document`);
|
|
179
266
|
} else {
|
|
180
267
|
info(`Run ${CYAN}/seed${RESET} to bootstrap a new project (interview mode)`);
|
|
181
268
|
info(`Or: ${CYAN}/seed path/to/product-doc.md${RESET} if you have a product document`);
|
|
@@ -186,29 +273,12 @@ async function install() {
|
|
|
186
273
|
log(`${DIM}Commands available after setup:${RESET}`);
|
|
187
274
|
log(` ${CYAN}/seed${RESET} — bootstrap project (interview or DNA document)`);
|
|
188
275
|
log(` ${CYAN}/grow${RESET} — plan and start a new feature`);
|
|
276
|
+
log(` ${CYAN}/map${RESET} — view or adjust the system growth map`);
|
|
189
277
|
log(` ${CYAN}/next${RESET} — implement the next growth stage`);
|
|
278
|
+
log(` ${CYAN}/next-automatic${RESET} — run multiple stages automatically`);
|
|
190
279
|
log(` ${CYAN}/replan${RESET} — re-evaluate when things change`);
|
|
191
280
|
log(` ${CYAN}/review${RESET} — deep quality review of recent stages`);
|
|
192
281
|
|
|
193
|
-
if (!isOpencode) {
|
|
194
|
-
// Detect superpowers plugin (Claude Code only — opencode uses a different plugin system)
|
|
195
|
-
const homedir = process.env.HOME || process.env.USERPROFILE || '';
|
|
196
|
-
const pluginsDir = join(homedir, '.claude', 'plugins');
|
|
197
|
-
let hasSuperpowers = false;
|
|
198
|
-
if (existsSync(pluginsDir)) {
|
|
199
|
-
try {
|
|
200
|
-
const entries = readdirSync(pluginsDir, { recursive: true });
|
|
201
|
-
hasSuperpowers = entries.some(e => String(e).includes('superpowers'));
|
|
202
|
-
} catch { /* ignore */ }
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (hasSuperpowers) {
|
|
206
|
-
success(`Superpowers plugin detected — TDD, debugging, and brainstorming skills are integrated into commands and gardener`);
|
|
207
|
-
} else {
|
|
208
|
-
info(`Tip: Install the superpowers plugin for integrated TDD, debugging, and brainstorming process skills`);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
282
|
log('');
|
|
213
283
|
}
|
|
214
284
|
|
package/package.json
CHANGED
|
@@ -18,6 +18,13 @@ each stage produces a complete, living system.
|
|
|
18
18
|
|
|
19
19
|
# How You Work
|
|
20
20
|
|
|
21
|
+
## Paths
|
|
22
|
+
|
|
23
|
+
Growth plans, Product DNA, and growth map live in `.organic-growth/`:
|
|
24
|
+
- Plans: `.organic-growth/growth/<feature-name>.md`
|
|
25
|
+
- DNA: `.organic-growth/product-dna.md`
|
|
26
|
+
- Map: `.organic-growth/growth-map.md`
|
|
27
|
+
|
|
21
28
|
You have three modes, determined by what you're asked to do:
|
|
22
29
|
|
|
23
30
|
## Mode: PLAN (invoked by /grow)
|
|
@@ -29,20 +36,39 @@ You have three modes, determined by what you're asked to do:
|
|
|
29
36
|
it in now." If the user describes the project, fill in the
|
|
30
37
|
Product/Tech Stack/Priorities sections before continuing.
|
|
31
38
|
1. Read CLAUDE.md to understand the product (seed), stack (soil),
|
|
32
|
-
and priorities (light & water)
|
|
33
|
-
2. Check if
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
and priorities (light & water).
|
|
40
|
+
2. Check if `.organic-growth/product-dna.md` exists. If yes, read it.
|
|
41
|
+
Pay special attention to:
|
|
42
|
+
- Business Rules (`BR-*`): global invariants.
|
|
43
|
+
Properties tied to a rule should reference it: `Refs: BR-3`.
|
|
44
|
+
- Core Domain Concepts: use these exact names in code.
|
|
45
|
+
If planning introduces a new concept, add it to DNA after delivery.
|
|
46
|
+
- Users & Roles: permission properties should reference these roles.
|
|
47
|
+
If no DNA exists, CLAUDE.md Product section is sufficient.
|
|
48
|
+
2b. Check if `.organic-growth/growth-map.md` exists. If yes, read it.
|
|
49
|
+
Use it to:
|
|
50
|
+
- Understand what capabilities already exist (🌳)
|
|
51
|
+
- Follow map links to completed plans and their properties
|
|
52
|
+
- See expected sequence and likely dependencies
|
|
53
|
+
If no map exists, search related plans by tag:
|
|
54
|
+
`grep -r "Capabilities:" .organic-growth/growth/`.
|
|
55
|
+
3. Explore the codebase to understand current state.
|
|
56
|
+
Search for related growth plans:
|
|
57
|
+
a. If map exists: follow links to relevant 🌳 plans.
|
|
58
|
+
b. If no map: find likely related plans by overlapping capability tags.
|
|
59
|
+
c. If related plans are found: treat their completed properties as
|
|
60
|
+
constraints. Preserve with `Depends on` or explicitly declare
|
|
61
|
+
`Breaks: <plan/property> — <reason>`.
|
|
62
|
+
d. If no related plans are found: proceed normally.
|
|
38
63
|
4. Ask the user 2-3 clarifying questions — no more.
|
|
39
64
|
Focus on: acceptance criteria, constraints, riskiest part.
|
|
40
|
-
5. Create a growth plan in
|
|
65
|
+
5. Create a growth plan in `.organic-growth/growth/<feature-name>.md`:
|
|
41
66
|
|
|
42
67
|
```markdown
|
|
43
68
|
# 🌱 Feature: <name>
|
|
44
69
|
Created: <date>
|
|
45
70
|
Status: 🌱 Growing
|
|
71
|
+
Capabilities: <3-7 domain tags, comma-separated>
|
|
46
72
|
|
|
47
73
|
## Seed (what & why)
|
|
48
74
|
<one paragraph: what this feature does and why it matters>
|
|
@@ -55,8 +81,10 @@ Status: 🌱 Growing
|
|
|
55
81
|
- Properties:
|
|
56
82
|
- P1: <property statement> [invariant|transition|roundtrip|boundary]
|
|
57
83
|
Captures: <what bug this prevents>
|
|
84
|
+
Refs: BR-<n> (optional)
|
|
58
85
|
- P2: ...
|
|
59
86
|
- Depends on: (properties from earlier stages that must still hold)
|
|
87
|
+
- Breaks: <plan/property> — <reason> (optional, only for intentional breaks)
|
|
60
88
|
- Touches: <which areas of the code>
|
|
61
89
|
- Implementation hint: <brief guidance for GROW mode>
|
|
62
90
|
|
|
@@ -75,11 +103,12 @@ Status: 🌱 Growing
|
|
|
75
103
|
|
|
76
104
|
### Planning Principles
|
|
77
105
|
- First stage is always the simplest possible thing that proves
|
|
78
|
-
the idea works end-to-end (even with hardcoded values)
|
|
79
|
-
- Order by: risk reduction first, then user value
|
|
80
|
-
- Each stage must be vertical (touch all necessary layers)
|
|
81
|
-
- If a stage feels bigger than "one intent" — split it
|
|
82
|
-
-
|
|
106
|
+
the idea works end-to-end (even with hardcoded values).
|
|
107
|
+
- Order by: risk reduction first, then user value.
|
|
108
|
+
- Each stage must be vertical (touch all necessary layers).
|
|
109
|
+
- If a stage feels bigger than "one intent" — split it.
|
|
110
|
+
- Use 3-7 domain capability tags per plan.
|
|
111
|
+
- For greenfield: follow the greenfield pattern from CLAUDE.md.
|
|
83
112
|
|
|
84
113
|
### Property-Based Planning
|
|
85
114
|
|
|
@@ -140,29 +169,28 @@ This is the primary review gate.
|
|
|
140
169
|
|
|
141
170
|
## Mode: GROW (invoked by /next)
|
|
142
171
|
|
|
143
|
-
1. Read the growth plan from
|
|
144
|
-
2. Find the next 🌱 stage
|
|
172
|
+
1. Read the growth plan from `.organic-growth/growth/`.
|
|
173
|
+
2. Find the next 🌱 stage.
|
|
145
174
|
3. Check the stage counter:
|
|
146
175
|
- If this is stage 3, 6, 9... → re-evaluate the plan first
|
|
147
|
-
(are remaining stages still correct? adjust if needed)
|
|
176
|
+
(are remaining stages still correct? adjust if needed).
|
|
148
177
|
4. Implement ONLY this stage:
|
|
149
|
-
a. Read the stage's properties — these are your acceptance criteria
|
|
178
|
+
a. Read the stage's properties — these are your acceptance criteria.
|
|
150
179
|
b. Write tests that encode the properties FIRST:
|
|
151
180
|
- Follow red/green/refactor — write a failing test first, then the minimum code to pass it.
|
|
152
|
-
- Each property (P1, P2, ...) becomes one or more tests
|
|
153
|
-
- Tests express the RULE, not a specific scenario
|
|
154
|
-
- Tests for properties from "Depends on" must still pass
|
|
155
|
-
c. Write the code to make the property tests pass
|
|
181
|
+
- Each property (P1, P2, ...) becomes one or more tests.
|
|
182
|
+
- Tests express the RULE, not a specific scenario.
|
|
183
|
+
- Tests for properties from "Depends on" must still pass.
|
|
184
|
+
c. Write the code to make the property tests pass.
|
|
156
185
|
d. Quality gate — run ALL checks, fix before proceeding:
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
- Smoke: app starts, health endpoint responds (or equivalent)
|
|
186
|
+
- Build: verify it compiles (`./gradlew build`, `npm run build`, etc.).
|
|
187
|
+
- Lint: run the project linter (`./gradlew ktlintCheck`, `npm run lint`, etc.).
|
|
188
|
+
- Type check: if applicable (`tsc --noEmit`, strict mode, etc.).
|
|
189
|
+
- Tests: ALL tests pass — current stage AND all previous properties.
|
|
190
|
+
- Smoke: app starts, health endpoint responds (or equivalent).
|
|
163
191
|
e. If any check fails — fix it within this stage, don't leave it
|
|
164
192
|
for the next one. Quality debt doesn't carry forward.
|
|
165
|
-
-
|
|
193
|
+
- Debug systematically: read the error, reproduce, hypothesize, verify.
|
|
166
194
|
5. Self-review:
|
|
167
195
|
- Do ALL property tests for this stage pass?
|
|
168
196
|
- Do ALL property tests from previous stages still pass?
|
|
@@ -172,14 +200,63 @@ This is the primary review gate.
|
|
|
172
200
|
- Could this implementation be WRONG and still pass the properties?
|
|
173
201
|
If yes — the plan has a gap. Note it in the growth log and
|
|
174
202
|
flag to the user, but do not block the stage.
|
|
175
|
-
6. Update the growth plan:
|
|
176
|
-
- Mark stage as 🌳 with brief note of what was done
|
|
177
|
-
- Add entry to Growth Log with date
|
|
203
|
+
6. Update the growth plan (MANDATORY for EVERY stage, no exceptions):
|
|
204
|
+
- Mark stage as 🌳 with brief note of what was done.
|
|
205
|
+
- Add entry to Growth Log with date — EVERY stage gets logged,
|
|
206
|
+
including stage 1. Format: `- **<date> — Stage N complete:** <what was done>. <test counts>.`
|
|
178
207
|
- If this was a re-evaluation point, update upcoming stages
|
|
179
|
-
(including their properties)
|
|
208
|
+
(including their properties).
|
|
180
209
|
- If all stages (Concrete + Horizon) are done, set
|
|
181
|
-
`Status: 🌳 Complete` at the top of the plan
|
|
182
|
-
|
|
210
|
+
`Status: 🌳 Complete` at the top of the plan.
|
|
211
|
+
If working on a feature branch: summarize what was built,
|
|
212
|
+
list verified properties, and note open PR items.
|
|
213
|
+
|
|
214
|
+
**VERIFICATION:** Before proceeding to step 7, confirm:
|
|
215
|
+
- [ ] Growth Log has an entry for THIS stage (not just previous ones)
|
|
216
|
+
- [ ] Stage marker changed from 🌱 to 🌳
|
|
217
|
+
- [ ] If all concrete stages done → Status header says 🌳 Complete
|
|
218
|
+
If any check fails, fix it NOW before continuing.
|
|
219
|
+
|
|
220
|
+
6b. Update `.organic-growth/growth-map.md` (MANDATORY if file exists):
|
|
221
|
+
- Update this capability's status marker and stage progress.
|
|
222
|
+
- When ALL stages of a capability are done, change 🌱 to 🌳.
|
|
223
|
+
- This is NOT optional — the growth map must reflect reality.
|
|
224
|
+
- After reporting, suggest: "Growth map updated. What grows next?"
|
|
225
|
+
|
|
226
|
+
**VERIFICATION:** Read growth-map.md after editing and confirm
|
|
227
|
+
the capability status matches the growth plan status.
|
|
228
|
+
|
|
229
|
+
6c. If `.organic-growth/product-dna.md` exists and this stage introduced
|
|
230
|
+
new domain concepts not in DNA:
|
|
231
|
+
- Add them to Core Domain Concepts.
|
|
232
|
+
- Note in growth log: "Added concept: <name> to DNA".
|
|
233
|
+
|
|
234
|
+
6d. Update README.md (MANDATORY — do NOT skip):
|
|
235
|
+
- If README.md is empty or only has a title: add project description,
|
|
236
|
+
install instructions, and basic usage from what's been built so far.
|
|
237
|
+
- If README.md already has content: update it to reflect new capabilities
|
|
238
|
+
added in this stage (e.g., new CLI commands, new features).
|
|
239
|
+
- Keep it concise — reflect what actually works NOW.
|
|
240
|
+
|
|
241
|
+
**VERIFICATION:** Read README.md after editing and confirm it
|
|
242
|
+
describes the current state of the project, not just the title.
|
|
243
|
+
|
|
244
|
+
6e. Update CLAUDE.md `Current state` field when the project reaches
|
|
245
|
+
a milestone (MANDATORY at milestones):
|
|
246
|
+
- After walking skeleton / bootstrap complete: "MVP exists — <what works>"
|
|
247
|
+
- After a major capability is done: update to reflect current reality
|
|
248
|
+
- Don't update on every stage — only when the state meaningfully changes.
|
|
249
|
+
- Walking skeleton complete = ALWAYS a milestone. Update it.
|
|
250
|
+
7. Commit: `feat(scope): stage N — <what grew>`.
|
|
251
|
+
|
|
252
|
+
**MANDATORY PRE-COMMIT CHECKLIST — verify ALL before committing:**
|
|
253
|
+
- [ ] Growth plan updated (stage marked 🌳, Growth Log entry added)
|
|
254
|
+
- [ ] Growth map updated (if file exists — capability progress reflected)
|
|
255
|
+
- [ ] README.md updated (describes what the project does NOW)
|
|
256
|
+
- [ ] CLAUDE.md updated (if milestone reached — Current state field)
|
|
257
|
+
- [ ] `git add` includes ALL of: source code, tests, growth plan,
|
|
258
|
+
growth map, README.md, and CLAUDE.md (if changed)
|
|
259
|
+
Do NOT commit until all applicable items are checked.
|
|
183
260
|
8. Report:
|
|
184
261
|
- What grew
|
|
185
262
|
- Properties verified (list P-numbers that pass)
|
|
@@ -191,48 +268,44 @@ This is the primary review gate.
|
|
|
191
268
|
- `🌿` — current (active — the stage you just finished)
|
|
192
269
|
- `⬜` — upcoming (pending — not yet started)
|
|
193
270
|
Format each line as: `<marker> Stage N: <title>`
|
|
194
|
-
Example (after completing Stage 3 of a 5-stage plan):
|
|
195
|
-
```
|
|
196
|
-
✅ Stage 1: Hello world endpoint
|
|
197
|
-
✅ Stage 2: Domain model with hardcoded data
|
|
198
|
-
🌿 Stage 3: Persistence layer
|
|
199
|
-
⬜ Stage 4: Real business logic
|
|
200
|
-
⬜ Stage 5: Input validation
|
|
201
|
-
```
|
|
202
|
-
Include all stages — both Concrete and Horizon.
|
|
203
|
-
This stage progress section replaces the old single-line format.
|
|
204
271
|
- If stage counter is multiple of 3: recommend `/clear` + new session
|
|
205
272
|
|
|
206
273
|
## Mode: REPLAN (invoked by /replan)
|
|
207
274
|
|
|
208
|
-
1. Read the current growth plan
|
|
209
|
-
2. Read the user's reason for replanning
|
|
210
|
-
3. If
|
|
211
|
-
replanning may relate to domain rules or business invariants
|
|
212
|
-
4. Assess current state: what's built, what works, what changed
|
|
275
|
+
1. Read the current growth plan.
|
|
276
|
+
2. Read the user's reason for replanning.
|
|
277
|
+
3. If `.organic-growth/product-dna.md` exists, consult it — the reason for
|
|
278
|
+
replanning may relate to domain rules or business invariants.
|
|
279
|
+
4. Assess current state: what's built, what works, what changed.
|
|
213
280
|
5. Rewrite the Concrete stages (next 3-5) from current state,
|
|
214
|
-
including new properties per stage
|
|
281
|
+
including new properties per stage.
|
|
215
282
|
6. Verify property accumulation: new stages must not invalidate
|
|
216
283
|
properties from completed stages. If they do, flag this
|
|
217
284
|
explicitly — it means a breaking change.
|
|
218
|
-
7. Update the Horizon section
|
|
219
|
-
8. Do NOT undo or modify completed stages
|
|
285
|
+
7. Update the Horizon section.
|
|
286
|
+
8. Do NOT undo or modify completed stages.
|
|
220
287
|
9. Report what changed and why, including:
|
|
221
288
|
- Properties added, removed, or modified
|
|
222
289
|
- Properties from completed stages that may be at risk
|
|
290
|
+
10. If `.organic-growth/growth-map.md` exists and this replan changes
|
|
291
|
+
scope significantly, flag it:
|
|
292
|
+
"This replan may affect the growth map. Review growth-map.md
|
|
293
|
+
after completing this feature."
|
|
223
294
|
|
|
224
295
|
# Critical Rules
|
|
225
296
|
|
|
226
|
-
- NEVER implement more than one stage per /next invocation
|
|
227
|
-
- NEVER plan more than 5 concrete stages ahead
|
|
228
|
-
- ALWAYS define properties before describing implementation
|
|
229
|
-
- ALWAYS write property tests before writing implementation code
|
|
230
|
-
- ALWAYS run build + tests + smoke check before committing
|
|
231
|
-
- ALWAYS update the growth plan after each stage
|
|
297
|
+
- NEVER implement more than one stage per /next invocation.
|
|
298
|
+
- NEVER plan more than 5 concrete stages ahead.
|
|
299
|
+
- ALWAYS define properties before describing implementation.
|
|
300
|
+
- ALWAYS write property tests before writing implementation code.
|
|
301
|
+
- ALWAYS run build + tests + smoke check before committing.
|
|
302
|
+
- ALWAYS update the growth plan after each stage.
|
|
303
|
+
- ALWAYS update growth map, README.md, and CLAUDE.md after each stage
|
|
304
|
+
(see steps 6b-6e for when each applies).
|
|
232
305
|
- Properties from completed stages are PERMANENT — they must
|
|
233
306
|
keep passing. If a new stage needs to break an old property,
|
|
234
307
|
this is a REPLAN, not a quiet change.
|
|
235
|
-
- If a stage reveals the plan is wrong, STOP and replan before continuing
|
|
236
|
-
- Hardcoded values are natural in early stages — don't optimize prematurely
|
|
237
|
-
- The growth plan file is the source of truth, not your memory
|
|
238
|
-
- If you don't understand the domain, ASK — don't guess
|
|
308
|
+
- If a stage reveals the plan is wrong, STOP and replan before continuing.
|
|
309
|
+
- Hardcoded values are natural in early stages — don't optimize prematurely.
|
|
310
|
+
- The growth plan file is the source of truth, not your memory.
|
|
311
|
+
- If you don't understand the domain, ASK — don't guess.
|
|
@@ -4,16 +4,23 @@ description: Plan and start growing a new feature from seed
|
|
|
4
4
|
|
|
5
5
|
Grow a new feature using the Organic Growth approach.
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
|
|
7
|
+
1. Before planning, briefly explore the problem space for: $ARGUMENTS
|
|
8
|
+
- What are 2-3 possible approaches?
|
|
9
|
+
- What is the riskiest assumption?
|
|
10
|
+
- What could fail or be harder than expected?
|
|
11
|
+
Think through this internally. Do not create separate brainstorming artifacts.
|
|
9
12
|
2. Use the gardener agent in PLAN mode
|
|
10
13
|
3. Feature to grow: $ARGUMENTS
|
|
11
|
-
4.
|
|
14
|
+
4. If `.organic-growth/growth-map.md` exists:
|
|
15
|
+
- If capability exists on the map: set status to 🌱 and add plan link
|
|
16
|
+
- If missing: add it in the best-fit section and note it was unplanned
|
|
17
|
+
- If this modifies a 🌳 capability: add as a sub-entry under the parent capability
|
|
18
|
+
5. When reviewing the plan, focus on PROPERTIES (not implementation hints) —
|
|
12
19
|
these are the primary quality gate. Ask yourself:
|
|
13
20
|
- Are the properties complete? Could someone implement this WRONG
|
|
14
21
|
and still pass all properties?
|
|
15
22
|
- Are properties from earlier stages preserved in later ones?
|
|
16
|
-
- Do
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
- Do properties express domain rules, not implementation details?
|
|
24
|
+
6. After the plan is created and approved, STOP here.
|
|
25
|
+
Do NOT start implementing stage 1.
|
|
26
|
+
Say: "Plan ready. Run `/next` when you're ready to grow stage 1."
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: View or update the growth map — your system's big picture
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Show or adjust the growth map.
|
|
6
|
+
|
|
7
|
+
1. If `.organic-growth/growth-map.md` does not exist:
|
|
8
|
+
- Check if product DNA or CLAUDE.md has enough context to draft one
|
|
9
|
+
- If yes: generate a draft and present it for review
|
|
10
|
+
- If no: tell the user to run /seed first or describe the system
|
|
11
|
+
|
|
12
|
+
2. If map exists and no $ARGUMENTS:
|
|
13
|
+
- Display current map with status summary:
|
|
14
|
+
`🌳 X complete | 🌱 Y growing | ⬜ Z planned | 💡 W candidates`
|
|
15
|
+
- Suggest next capability based on sequence
|
|
16
|
+
|
|
17
|
+
3. If $ARGUMENTS contains a change request
|
|
18
|
+
(e.g., "move invoicing before approval"):
|
|
19
|
+
- Apply the change
|
|
20
|
+
- Verify whether the new order still makes sense
|
|
21
|
+
- Present the updated map with explanation
|
|
22
|
+
|
|
23
|
+
Input: $ARGUMENTS
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run multiple growth stages automatically, each in a fresh agent context
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run multiple growth stages in sequence, each in a fresh gardener agent invocation.
|
|
6
|
+
Stop on the first failure.
|
|
7
|
+
|
|
8
|
+
## Setup
|
|
9
|
+
|
|
10
|
+
1. Find the active growth plan in `.organic-growth/growth/`.
|
|
11
|
+
If no plan exists, tell the user to run /grow first and stop.
|
|
12
|
+
|
|
13
|
+
2. Read the growth plan file. Count the number of stages currently
|
|
14
|
+
marked with a seedling marker (the stages not yet completed).
|
|
15
|
+
Store this count as `remaining_stages`.
|
|
16
|
+
|
|
17
|
+
3. Parse `$ARGUMENTS`:
|
|
18
|
+
- If `$ARGUMENTS` is a positive integer, use it as `max_stages`.
|
|
19
|
+
- If `$ARGUMENTS` is empty or blank, set `max_stages = remaining_stages`
|
|
20
|
+
(run all remaining concrete seedling stages).
|
|
21
|
+
- If `$ARGUMENTS` is not a valid positive integer, tell the user
|
|
22
|
+
the argument must be a positive integer and stop.
|
|
23
|
+
|
|
24
|
+
4. If `remaining_stages` is 0, tell the user all concrete stages are
|
|
25
|
+
already complete and suggest running /grow for the next feature.
|
|
26
|
+
|
|
27
|
+
## Orchestration Loop
|
|
28
|
+
|
|
29
|
+
For each iteration from 1 to `max_stages`:
|
|
30
|
+
|
|
31
|
+
### Before the stage
|
|
32
|
+
|
|
33
|
+
- Read the growth plan file.
|
|
34
|
+
- Identify the FIRST stage that still has a seedling marker.
|
|
35
|
+
Record its stage number and title. This is the "target stage."
|
|
36
|
+
- If no seedling-marked stage exists, report that all stages are
|
|
37
|
+
complete and exit the loop early.
|
|
38
|
+
|
|
39
|
+
### Run the stage
|
|
40
|
+
|
|
41
|
+
- Invoke the gardener agent as a subagent with the message:
|
|
42
|
+
"You are in GROW mode. Implement the next stage from the active growth plan."
|
|
43
|
+
- Each invocation MUST be a fresh agent call (subagent), not inline
|
|
44
|
+
execution in this session. This preserves the one-stage-one-context
|
|
45
|
+
principle and prevents context degradation.
|
|
46
|
+
|
|
47
|
+
### After the stage
|
|
48
|
+
|
|
49
|
+
- Read the growth plan file AGAIN (it may have been modified by the gardener).
|
|
50
|
+
- Check whether the target stage's marker has changed from seedling to tree.
|
|
51
|
+
- If YES: the stage succeeded. Log a progress line:
|
|
52
|
+
`[N/max_stages] Stage <number>: <title> -- PASSED`
|
|
53
|
+
- If NO: the stage failed. Log a failure line:
|
|
54
|
+
`[N/max_stages] Stage <number>: <title> -- FAILED`
|
|
55
|
+
Then STOP the loop immediately. Do not attempt further stages.
|
|
56
|
+
|
|
57
|
+
**Important:** Detection MUST be file-based. Read the actual growth plan
|
|
58
|
+
file and check the marker. Do NOT rely on parsing the agent's natural
|
|
59
|
+
language output to determine success or failure.
|
|
60
|
+
|
|
61
|
+
## After the loop
|
|
62
|
+
|
|
63
|
+
Report a summary:
|
|
64
|
+
- Total stages attempted: N
|
|
65
|
+
- Stages completed successfully: M
|
|
66
|
+
- If a failure occurred: which stage failed
|
|
67
|
+
- If all requested stages passed: "All stages complete."
|
|
68
|
+
|
|
69
|
+
If 3 or more stages were completed, suggest running `/review` for a
|
|
70
|
+
quality check and `/clear` for a fresh session.
|