organic-growth 2.0.0 → 3.0.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 +8 -2
- package/bin/cli.mjs +96 -27
- package/package.json +1 -1
- package/templates/.claude/agents/gardener.md +91 -60
- package/templates/.claude/commands/grow.md +13 -6
- package/templates/.claude/commands/map.md +23 -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 +34 -10
- package/templates/CLAUDE.md +9 -8
- package/templates-opencode/.opencode/agents/gardener.md +90 -47
- package/templates-opencode/.opencode/commands/grow.md +15 -6
- package/templates-opencode/.opencode/commands/map.md +23 -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 +34 -9
- package/templates-opencode/AGENTS.md +9 -7
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ 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
|
|
44
45
|
│ ├── replan.md # /replan — adjust when things change
|
|
45
46
|
│ └── review.md # /review — deep quality review
|
|
@@ -47,9 +48,13 @@ CLAUDE.md # Project context template + growth philosop
|
|
|
47
48
|
│ ├── post-stage-test.sh # Automatic test run after stage commits
|
|
48
49
|
│ └── post-stage-review.sh # Automatic diff review after stage commits
|
|
49
50
|
└── settings.json # Claude Code hook configuration
|
|
51
|
+
.organic-growth/
|
|
52
|
+
├── product-dna.md # Full product DNA (structured)
|
|
53
|
+
├── growth-map.md # System-level capability map (optional)
|
|
54
|
+
└── growth/ # One growth plan per feature
|
|
50
55
|
```
|
|
51
56
|
|
|
52
|
-
Growth plan files (
|
|
57
|
+
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
58
|
|
|
54
59
|
A **post-stage test** hook and a **post-stage review** hook run automatically after every stage commit, in order:
|
|
55
60
|
|
|
@@ -63,10 +68,11 @@ Tests run first so failures are caught before the review. This makes the quality
|
|
|
63
68
|
```bash
|
|
64
69
|
# 1. Bootstrap (new project)
|
|
65
70
|
> /seed # interview mode
|
|
66
|
-
> /seed
|
|
71
|
+
> /seed .organic-growth/product-dna.md # from existing product document
|
|
67
72
|
|
|
68
73
|
# 2. Grow features
|
|
69
74
|
> /grow Add user authentication
|
|
75
|
+
> /map # check/update system-level growth sequence
|
|
70
76
|
> /next # stage 1
|
|
71
77
|
> /next # stage 2
|
|
72
78
|
> /next # stage 3
|
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,11 @@ 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`);
|
|
190
278
|
log(` ${CYAN}/replan${RESET} — re-evaluate when things change`);
|
|
191
279
|
log(` ${CYAN}/review${RESET} — deep quality review of recent stages`);
|
|
192
280
|
|
|
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
281
|
log('');
|
|
213
282
|
}
|
|
214
283
|
|
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?
|
|
@@ -173,13 +201,22 @@ This is the primary review gate.
|
|
|
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
203
|
6. Update the growth plan:
|
|
176
|
-
- Mark stage as 🌳 with brief note of what was done
|
|
177
|
-
- Add entry to Growth Log with date
|
|
204
|
+
- Mark stage as 🌳 with brief note of what was done.
|
|
205
|
+
- Add entry to Growth Log with date.
|
|
178
206
|
- If this was a re-evaluation point, update upcoming stages
|
|
179
|
-
(including their properties)
|
|
207
|
+
(including their properties).
|
|
180
208
|
- If all stages (Concrete + Horizon) are done, set
|
|
181
|
-
`Status: 🌳 Complete` at the top of the plan
|
|
182
|
-
|
|
209
|
+
`Status: 🌳 Complete` at the top of the plan.
|
|
210
|
+
If working on a feature branch: summarize what was built,
|
|
211
|
+
list verified properties, and note open PR items.
|
|
212
|
+
6b. If `.organic-growth/growth-map.md` exists:
|
|
213
|
+
- Update this capability status to 🌳.
|
|
214
|
+
- After reporting, suggest: "Growth map updated. What grows next?"
|
|
215
|
+
6c. If `.organic-growth/product-dna.md` exists and this stage introduced
|
|
216
|
+
new domain concepts not in DNA:
|
|
217
|
+
- Add them to Core Domain Concepts.
|
|
218
|
+
- Note in growth log: "Added concept: <name> to DNA".
|
|
219
|
+
7. Commit: `feat(scope): stage N — <what grew>`.
|
|
183
220
|
8. Report:
|
|
184
221
|
- What grew
|
|
185
222
|
- Properties verified (list P-numbers that pass)
|
|
@@ -191,48 +228,42 @@ This is the primary review gate.
|
|
|
191
228
|
- `🌿` — current (active — the stage you just finished)
|
|
192
229
|
- `⬜` — upcoming (pending — not yet started)
|
|
193
230
|
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
231
|
- If stage counter is multiple of 3: recommend `/clear` + new session
|
|
205
232
|
|
|
206
233
|
## Mode: REPLAN (invoked by /replan)
|
|
207
234
|
|
|
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
|
|
235
|
+
1. Read the current growth plan.
|
|
236
|
+
2. Read the user's reason for replanning.
|
|
237
|
+
3. If `.organic-growth/product-dna.md` exists, consult it — the reason for
|
|
238
|
+
replanning may relate to domain rules or business invariants.
|
|
239
|
+
4. Assess current state: what's built, what works, what changed.
|
|
213
240
|
5. Rewrite the Concrete stages (next 3-5) from current state,
|
|
214
|
-
including new properties per stage
|
|
241
|
+
including new properties per stage.
|
|
215
242
|
6. Verify property accumulation: new stages must not invalidate
|
|
216
243
|
properties from completed stages. If they do, flag this
|
|
217
244
|
explicitly — it means a breaking change.
|
|
218
|
-
7. Update the Horizon section
|
|
219
|
-
8. Do NOT undo or modify completed stages
|
|
245
|
+
7. Update the Horizon section.
|
|
246
|
+
8. Do NOT undo or modify completed stages.
|
|
220
247
|
9. Report what changed and why, including:
|
|
221
248
|
- Properties added, removed, or modified
|
|
222
249
|
- Properties from completed stages that may be at risk
|
|
250
|
+
10. If `.organic-growth/growth-map.md` exists and this replan changes
|
|
251
|
+
scope significantly, flag it:
|
|
252
|
+
"This replan may affect the growth map. Review growth-map.md
|
|
253
|
+
after completing this feature."
|
|
223
254
|
|
|
224
255
|
# Critical Rules
|
|
225
256
|
|
|
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
|
|
257
|
+
- NEVER implement more than one stage per /next invocation.
|
|
258
|
+
- NEVER plan more than 5 concrete stages ahead.
|
|
259
|
+
- ALWAYS define properties before describing implementation.
|
|
260
|
+
- ALWAYS write property tests before writing implementation code.
|
|
261
|
+
- ALWAYS run build + tests + smoke check before committing.
|
|
262
|
+
- ALWAYS update the growth plan after each stage.
|
|
232
263
|
- Properties from completed stages are PERMANENT — they must
|
|
233
264
|
keep passing. If a new stage needs to break an old property,
|
|
234
265
|
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
|
|
266
|
+
- If a stage reveals the plan is wrong, STOP and replan before continuing.
|
|
267
|
+
- Hardcoded values are natural in early stages — don't optimize prematurely.
|
|
268
|
+
- The growth plan file is the source of truth, not your memory.
|
|
269
|
+
- 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
|
-
|
|
23
|
+
- Do properties express domain rules, not implementation details?
|
|
24
|
+
6. After the plan is created and approved, ask:
|
|
18
25
|
"Plan ready. Start growing stage 1?"
|
|
19
|
-
|
|
26
|
+
7. If yes, immediately proceed with GROW mode for 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
|
|
@@ -4,11 +4,13 @@ description: Grow the next stage from the current growth plan
|
|
|
4
4
|
|
|
5
5
|
Continue growing: implement the next stage from the active growth plan.
|
|
6
6
|
|
|
7
|
-
1. Find the active plan in
|
|
7
|
+
1. Find the active plan in `.organic-growth/growth/`
|
|
8
8
|
2. Use the gardener agent in GROW mode
|
|
9
9
|
3. If no plan exists, tell the user to run /grow first
|
|
10
10
|
4. If all stages are done, congratulate and suggest what might grow next
|
|
11
11
|
|
|
12
|
-
Tip: If you hit a wall during implementation,
|
|
12
|
+
Tip: If you hit a wall during implementation, debug systematically:
|
|
13
|
+
reproduce the issue, form a hypothesis, verify it, and fix one thing at a time.
|
|
14
|
+
Don't guess.
|
|
13
15
|
|
|
14
16
|
Feature filter (optional): $ARGUMENTS
|
|
@@ -4,7 +4,7 @@ description: Re-evaluate the growth plan when reality changes
|
|
|
4
4
|
|
|
5
5
|
Something changed. Re-evaluate the growth plan from current state.
|
|
6
6
|
|
|
7
|
-
1. Find the active plan in
|
|
7
|
+
1. Find the active plan in `.organic-growth/growth/`
|
|
8
8
|
2. Use the gardener agent in REPLAN mode
|
|
9
9
|
3. Reason for replanning: $ARGUMENTS
|
|
10
10
|
4. If no reason given, ask: "What changed?"
|
|
@@ -23,7 +23,7 @@ the implementation session.
|
|
|
23
23
|
**Consistency:**
|
|
24
24
|
- Does new code follow the same patterns as existing code?
|
|
25
25
|
- Naming conventions, error handling style, project structure
|
|
26
|
-
- If
|
|
26
|
+
- If `.organic-growth/product-dna.md` exists: do domain terms match?
|
|
27
27
|
|
|
28
28
|
**Simplicity:**
|
|
29
29
|
- Is anything over-engineered for the current stage?
|
|
@@ -40,7 +40,7 @@ the implementation session.
|
|
|
40
40
|
- Are edge cases covered?
|
|
41
41
|
- Test readability — can someone understand intent from the test?
|
|
42
42
|
|
|
43
|
-
4. Output a review report
|
|
43
|
+
4. Output a review report:
|
|
44
44
|
|
|
45
45
|
```
|
|
46
46
|
## Review: <feature> — stages N-M
|
|
@@ -59,6 +59,6 @@ the implementation session.
|
|
|
59
59
|
### Verdict: ✅ Continue / ⚠️ Fix before next stage / 🔴 Stop and address
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
5. If there are 🔴 Issues,
|
|
62
|
+
5. If there are 🔴 Issues, offer to fix them now.
|
|
63
63
|
|
|
64
64
|
Scope: $ARGUMENTS
|
|
@@ -4,18 +4,30 @@ description: Bootstrap a new project — from DNA document or interview
|
|
|
4
4
|
|
|
5
5
|
Plant the seed for a new project.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
0. Scan project root for existing code (`src/`, `package.json`, `build.gradle`, `README.md`, etc.).
|
|
8
|
+
If code already exists:
|
|
9
|
+
- Read README/build files to auto-fill Tech Stack
|
|
10
|
+
- Discover quality commands (build, lint, test)
|
|
11
|
+
- Adjust interview: skip "what tech stack?" and "what are you building?"
|
|
12
|
+
- Ask instead: "what change do you want to make?" and "any constraints?"
|
|
13
|
+
- Check recent git commits and ask whether to follow existing commit convention
|
|
14
|
+
|
|
15
|
+
1. Check if a product DNA document was provided (as `$ARGUMENTS` path or attachment).
|
|
16
|
+
Also check if `.organic-growth/product-dna.md` already exists.
|
|
9
17
|
|
|
10
18
|
**Path A — DNA exists:**
|
|
11
19
|
- Read the document
|
|
12
20
|
- Distill it into CLAUDE.md Product section (~10 lines: what, for whom,
|
|
13
21
|
core problem, key domain concepts, current state)
|
|
14
|
-
-
|
|
22
|
+
- Map content into the structured DNA format and store in
|
|
23
|
+
`.organic-growth/product-dna.md`
|
|
24
|
+
- If Business Rules are missing, ask: "Any rules that must ALWAYS hold?"
|
|
15
25
|
- Confirm with the user: "Here's what I extracted. Anything to adjust?"
|
|
16
26
|
|
|
17
27
|
**Path B — No DNA:**
|
|
18
|
-
-
|
|
28
|
+
- Before the interview, briefly consider what this project could be:
|
|
29
|
+
what kind of system, likely domain risks, and which questions matter most.
|
|
30
|
+
Do not create separate brainstorming artifacts.
|
|
19
31
|
- Interview the user. Ask these questions ONE AT A TIME:
|
|
20
32
|
- What are you building? (one sentence)
|
|
21
33
|
- Who is it for? What's their context?
|
|
@@ -23,23 +35,35 @@ Plant the seed for a new project.
|
|
|
23
35
|
- What tech stack do you want? (or: should I suggest one?)
|
|
24
36
|
- Any hard constraints? (hosting, budget, compliance, language)
|
|
25
37
|
- What's the priority: speed to MVP, production quality, or learning?
|
|
26
|
-
|
|
38
|
+
- What are the main user roles? What can each do?
|
|
39
|
+
- What business rules must ALWAYS be true?
|
|
40
|
+
- What's the main process flow? (e.g. browse -> cart -> order -> approval -> invoice)
|
|
41
|
+
- Generate `.organic-growth/product-dna.md` using the structured template.
|
|
42
|
+
Leave missing sections as `<!-- to be filled -->`.
|
|
43
|
+
- Fill in CLAUDE.md Product section from answers.
|
|
27
44
|
|
|
28
45
|
2. In both paths, also fill in:
|
|
29
|
-
- Tech Stack (THE SOIL): from DNA
|
|
30
|
-
- Priorities (LIGHT & WATER): from DNA
|
|
46
|
+
- Tech Stack (THE SOIL): from DNA/interview + scan of existing project files
|
|
47
|
+
- Priorities (LIGHT & WATER): from DNA/interview
|
|
31
48
|
|
|
32
49
|
3. Check if CLAUDE.md already has a filled Product section.
|
|
33
50
|
If yes, ask: "Product context already exists. Overwrite or update?"
|
|
34
51
|
|
|
35
|
-
4. Generate
|
|
52
|
+
4. Generate `.organic-growth/growth/project-bootstrap.md` — the first growth plan:
|
|
36
53
|
- Stage 1: Initialize project (build tool, dependencies, empty build passes)
|
|
37
54
|
- Stage 2: Hello World endpoint/page (proves stack works end-to-end)
|
|
38
55
|
- Stage 3: First domain concept with hardcoded data
|
|
39
56
|
- Stage 4: Persistence (database, migration, first real data)
|
|
40
57
|
- Stage 5: First real behavior with real data
|
|
41
|
-
|
|
58
|
+
- Include `Capabilities:` tags in the plan header
|
|
59
|
+
|
|
60
|
+
5. If the project has 4+ distinct capabilities (from DNA/interview),
|
|
61
|
+
generate `.organic-growth/growth-map.md` draft:
|
|
62
|
+
- Organize sequence into Walking Skeleton and what follows
|
|
63
|
+
- Add short "Why This Order"
|
|
64
|
+
- Mark `project-bootstrap` as 🌱
|
|
65
|
+
- Present as aspirational, not a commitment
|
|
42
66
|
|
|
43
|
-
|
|
67
|
+
6. Ask: "Seed planted. Start growing stage 1?"
|
|
44
68
|
|
|
45
69
|
Input: $ARGUMENTS
|
package/templates/CLAUDE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Product (THE SEED — fill this in)
|
|
4
4
|
|
|
5
5
|
<!-- Without this section, the agent grows weeds. Be brief but specific. -->
|
|
6
|
-
<!-- If you have a full product document, put it in
|
|
6
|
+
<!-- If you have a full product document, put it in .organic-growth/product-dna.md -->
|
|
7
7
|
<!-- This section is the distilled version — what the agent sees always. -->
|
|
8
8
|
<!-- The DNA document is read only during planning (/grow, /replan). -->
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
**Core problem:** [What pain does it solve?]
|
|
13
13
|
**Key domain concepts:** [3-7 terms that someone new needs to understand]
|
|
14
14
|
**Current state:** [Greenfield / MVP exists / Production system]
|
|
15
|
-
**Full DNA:** [
|
|
15
|
+
**Full DNA:** [.organic-growth/product-dna.md if exists, otherwise "N/A"]
|
|
16
16
|
|
|
17
17
|
## Tech Stack (THE SOIL — auto-discovered, but document the non-obvious)
|
|
18
18
|
|
|
@@ -61,17 +61,17 @@ A seedling is a whole plant, not 10% of a tree.
|
|
|
61
61
|
- Never plan more than 5 concrete stages ahead
|
|
62
62
|
- Keep a rough outline of what comes after, but expect it to change
|
|
63
63
|
- Re-evaluate the plan every 3 stages or when something unexpected happens
|
|
64
|
-
- Update
|
|
64
|
+
- Update `.organic-growth/growth/<feature>.md` after every stage
|
|
65
65
|
|
|
66
66
|
3. **Vertical, not horizontal**
|
|
67
67
|
- Each stage touches all layers needed (API + service + DB + test)
|
|
68
68
|
- No "build all the backend first, then the frontend"
|
|
69
69
|
- Early stages can return hardcoded values — that's natural
|
|
70
|
-
- Growth: hardcoded
|
|
70
|
+
- Growth: hardcoded -> configurable -> dynamic -> optimized
|
|
71
71
|
|
|
72
72
|
4. **Context hygiene**
|
|
73
73
|
- Start a fresh session every 3 stages
|
|
74
|
-
- The growth plan in
|
|
74
|
+
- The growth plan in `.organic-growth/growth/` is the continuity mechanism
|
|
75
75
|
- After `/clear`, run `/next` — the agent reads the plan and continues
|
|
76
76
|
|
|
77
77
|
5. **Quality gate after every stage**
|
|
@@ -81,7 +81,6 @@ A seedling is a whole plant, not 10% of a tree.
|
|
|
81
81
|
- ALL tests must pass (not just new ones)
|
|
82
82
|
- App must start (health check / smoke test)
|
|
83
83
|
- Fix all failures within the stage — don't carry debt forward
|
|
84
|
-
- If the superpowers plugin is installed, its process skills (TDD, debugging, brainstorming) are integrated into commands and the gardener agent automatically
|
|
85
84
|
|
|
86
85
|
6. **Deep review on demand**
|
|
87
86
|
- Run `/review` after every 3-5 stages or before merging
|
|
@@ -108,10 +107,12 @@ For **existing** projects, first stages are:
|
|
|
108
107
|
```
|
|
109
108
|
feat(scope): stage N — <what grew>
|
|
110
109
|
|
|
111
|
-
Growth plan:
|
|
110
|
+
Growth plan: .organic-growth/growth/<feature>.md
|
|
112
111
|
```
|
|
113
112
|
|
|
114
113
|
## Growth Plan Location
|
|
115
114
|
|
|
116
|
-
All plans live in
|
|
115
|
+
All plans live in `.organic-growth/growth/<feature-name>.md`.
|
|
116
|
+
Product DNA lives in `.organic-growth/product-dna.md`.
|
|
117
|
+
Growth map lives in `.organic-growth/growth-map.md` (if exists).
|
|
117
118
|
Format documented in the gardener agent.
|
|
@@ -19,6 +19,13 @@ each stage produces a complete, living system.
|
|
|
19
19
|
|
|
20
20
|
# How You Work
|
|
21
21
|
|
|
22
|
+
## Paths
|
|
23
|
+
|
|
24
|
+
Growth plans, Product DNA, and growth map live in `.organic-growth/`:
|
|
25
|
+
- Plans: `.organic-growth/growth/<feature-name>.md`
|
|
26
|
+
- DNA: `.organic-growth/product-dna.md`
|
|
27
|
+
- Map: `.organic-growth/growth-map.md`
|
|
28
|
+
|
|
22
29
|
You have three modes, determined by what you're asked to do:
|
|
23
30
|
|
|
24
31
|
## Mode: PLAN (invoked by /grow)
|
|
@@ -30,20 +37,39 @@ You have three modes, determined by what you're asked to do:
|
|
|
30
37
|
it in now." If the user describes the project, fill in the
|
|
31
38
|
Product/Tech Stack/Priorities sections before continuing.
|
|
32
39
|
1. Read AGENTS.md to understand the product (seed), stack (soil),
|
|
33
|
-
and priorities (light & water)
|
|
34
|
-
2. Check if
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
and priorities (light & water).
|
|
41
|
+
2. Check if `.organic-growth/product-dna.md` exists. If yes, read it.
|
|
42
|
+
Pay special attention to:
|
|
43
|
+
- Business Rules (`BR-*`): global invariants.
|
|
44
|
+
Properties tied to a rule should reference it: `Refs: BR-3`.
|
|
45
|
+
- Core Domain Concepts: use these exact names in code.
|
|
46
|
+
If planning introduces a new concept, add it to DNA after delivery.
|
|
47
|
+
- Users & Roles: permission properties should reference these roles.
|
|
48
|
+
If no DNA exists, AGENTS.md Product section is sufficient.
|
|
49
|
+
2b. Check if `.organic-growth/growth-map.md` exists. If yes, read it.
|
|
50
|
+
Use it to:
|
|
51
|
+
- Understand what capabilities already exist (🌳)
|
|
52
|
+
- Follow map links to completed plans and their properties
|
|
53
|
+
- See expected sequence and likely dependencies
|
|
54
|
+
If no map exists, search related plans by tag:
|
|
55
|
+
`grep -r "Capabilities:" .organic-growth/growth/`.
|
|
56
|
+
3. Explore the codebase to understand current state.
|
|
57
|
+
Search for related growth plans:
|
|
58
|
+
a. If map exists: follow links to relevant 🌳 plans.
|
|
59
|
+
b. If no map: find likely related plans by overlapping capability tags.
|
|
60
|
+
c. If related plans are found: treat their completed properties as
|
|
61
|
+
constraints. Preserve with `Depends on` or explicitly declare
|
|
62
|
+
`Breaks: <plan/property> — <reason>`.
|
|
63
|
+
d. If no related plans are found: proceed normally.
|
|
39
64
|
4. Ask the user 2-3 clarifying questions — no more.
|
|
40
65
|
Focus on: acceptance criteria, constraints, riskiest part.
|
|
41
|
-
5. Create a growth plan in
|
|
66
|
+
5. Create a growth plan in `.organic-growth/growth/<feature-name>.md`:
|
|
42
67
|
|
|
43
68
|
```markdown
|
|
44
69
|
# 🌱 Feature: <name>
|
|
45
70
|
Created: <date>
|
|
46
71
|
Status: 🌱 Growing
|
|
72
|
+
Capabilities: <3-7 domain tags, comma-separated>
|
|
47
73
|
|
|
48
74
|
## Seed (what & why)
|
|
49
75
|
<one paragraph: what this feature does and why it matters>
|
|
@@ -56,8 +82,10 @@ Status: 🌱 Growing
|
|
|
56
82
|
- Properties:
|
|
57
83
|
- P1: <property statement> [invariant|transition|roundtrip|boundary]
|
|
58
84
|
Captures: <what bug this prevents>
|
|
85
|
+
Refs: BR-<n> (optional)
|
|
59
86
|
- P2: ...
|
|
60
87
|
- Depends on: (properties from earlier stages that must still hold)
|
|
88
|
+
- Breaks: <plan/property> — <reason> (optional, only for intentional breaks)
|
|
61
89
|
- Touches: <which areas of the code>
|
|
62
90
|
- Implementation hint: <brief guidance for GROW mode>
|
|
63
91
|
|
|
@@ -76,11 +104,12 @@ Status: 🌱 Growing
|
|
|
76
104
|
|
|
77
105
|
### Planning Principles
|
|
78
106
|
- First stage is always the simplest possible thing that proves
|
|
79
|
-
the idea works end-to-end (even with hardcoded values)
|
|
80
|
-
- Order by: risk reduction first, then user value
|
|
81
|
-
- Each stage must be vertical (touch all necessary layers)
|
|
82
|
-
- If a stage feels bigger than "one intent" — split it
|
|
83
|
-
-
|
|
107
|
+
the idea works end-to-end (even with hardcoded values).
|
|
108
|
+
- Order by: risk reduction first, then user value.
|
|
109
|
+
- Each stage must be vertical (touch all necessary layers).
|
|
110
|
+
- If a stage feels bigger than "one intent" — split it.
|
|
111
|
+
- Use 3-7 domain capability tags per plan.
|
|
112
|
+
- For greenfield: follow the greenfield pattern from AGENTS.md.
|
|
84
113
|
|
|
85
114
|
### Property-Based Planning
|
|
86
115
|
|
|
@@ -141,27 +170,28 @@ This is the primary review gate.
|
|
|
141
170
|
|
|
142
171
|
## Mode: GROW (invoked by /next)
|
|
143
172
|
|
|
144
|
-
1. Read the growth plan from
|
|
145
|
-
2. Find the next 🌱 stage
|
|
173
|
+
1. Read the growth plan from `.organic-growth/growth/`.
|
|
174
|
+
2. Find the next 🌱 stage.
|
|
146
175
|
3. Check the stage counter:
|
|
147
176
|
- If this is stage 3, 6, 9... → re-evaluate the plan first
|
|
148
|
-
(are remaining stages still correct? adjust if needed)
|
|
177
|
+
(are remaining stages still correct? adjust if needed).
|
|
149
178
|
4. Implement ONLY this stage:
|
|
150
|
-
a. Read the stage's properties — these are your acceptance criteria
|
|
179
|
+
a. Read the stage's properties — these are your acceptance criteria.
|
|
151
180
|
b. Write tests that encode the properties FIRST:
|
|
152
181
|
- Follow red/green/refactor — write a failing test first, then the minimum code to pass it.
|
|
153
|
-
- Each property (P1, P2, ...) becomes one or more tests
|
|
154
|
-
- Tests express the RULE, not a specific scenario
|
|
155
|
-
- Tests for properties from "Depends on" must still pass
|
|
156
|
-
c. Write the code to make the property tests pass
|
|
182
|
+
- Each property (P1, P2, ...) becomes one or more tests.
|
|
183
|
+
- Tests express the RULE, not a specific scenario.
|
|
184
|
+
- Tests for properties from "Depends on" must still pass.
|
|
185
|
+
c. Write the code to make the property tests pass.
|
|
157
186
|
d. Quality gate — run ALL checks, fix before proceeding:
|
|
158
|
-
- Build: verify it compiles (`./gradlew build`, `npm run build`, etc.)
|
|
159
|
-
- Lint: run the project linter (`./gradlew ktlintCheck`, `npm run lint`, etc.)
|
|
160
|
-
- Type check: if applicable (`tsc --noEmit`, strict mode, etc.)
|
|
161
|
-
- Tests: ALL tests pass — current stage AND all previous properties
|
|
162
|
-
- Smoke: app starts, health endpoint responds (or equivalent)
|
|
187
|
+
- Build: verify it compiles (`./gradlew build`, `npm run build`, etc.).
|
|
188
|
+
- Lint: run the project linter (`./gradlew ktlintCheck`, `npm run lint`, etc.).
|
|
189
|
+
- Type check: if applicable (`tsc --noEmit`, strict mode, etc.).
|
|
190
|
+
- Tests: ALL tests pass — current stage AND all previous properties.
|
|
191
|
+
- Smoke: app starts, health endpoint responds (or equivalent).
|
|
163
192
|
e. If any check fails — fix it within this stage, don't leave it
|
|
164
193
|
for the next one. Quality debt doesn't carry forward.
|
|
194
|
+
- Debug systematically: read the error, reproduce, hypothesize, verify.
|
|
165
195
|
5. Self-review:
|
|
166
196
|
- Do ALL property tests for this stage pass?
|
|
167
197
|
- Do ALL property tests from previous stages still pass?
|
|
@@ -172,13 +202,22 @@ This is the primary review gate.
|
|
|
172
202
|
If yes — the plan has a gap. Note it in the growth log and
|
|
173
203
|
flag to the user, but do not block the stage.
|
|
174
204
|
6. Update the growth plan:
|
|
175
|
-
- Mark stage as 🌳 with brief note of what was done
|
|
176
|
-
- Add entry to Growth Log with date
|
|
205
|
+
- Mark stage as 🌳 with brief note of what was done.
|
|
206
|
+
- Add entry to Growth Log with date.
|
|
177
207
|
- If this was a re-evaluation point, update upcoming stages
|
|
178
|
-
(including their properties)
|
|
208
|
+
(including their properties).
|
|
179
209
|
- If all stages (Concrete + Horizon) are done, set
|
|
180
210
|
`Status: 🌳 Complete` at the top of the plan.
|
|
181
|
-
|
|
211
|
+
If working on a feature branch: summarize what was built,
|
|
212
|
+
list verified properties, and note open PR items.
|
|
213
|
+
6b. If `.organic-growth/growth-map.md` exists:
|
|
214
|
+
- Update this capability status to 🌳.
|
|
215
|
+
- After reporting, suggest: "Growth map updated. What grows next?"
|
|
216
|
+
6c. If `.organic-growth/product-dna.md` exists and this stage introduced
|
|
217
|
+
new domain concepts not in DNA:
|
|
218
|
+
- Add them to Core Domain Concepts.
|
|
219
|
+
- Note in growth log: "Added concept: <name> to DNA".
|
|
220
|
+
7. Commit: `feat(scope): stage N — <what grew>`.
|
|
182
221
|
8. Report:
|
|
183
222
|
- What grew
|
|
184
223
|
- Properties verified (list P-numbers that pass)
|
|
@@ -194,34 +233,38 @@ This is the primary review gate.
|
|
|
194
233
|
|
|
195
234
|
## Mode: REPLAN (invoked by /replan)
|
|
196
235
|
|
|
197
|
-
1. Read the current growth plan
|
|
198
|
-
2. Read the user's reason for replanning
|
|
199
|
-
3. If
|
|
200
|
-
replanning may relate to domain rules or business invariants
|
|
201
|
-
4. Assess current state: what's built, what works, what changed
|
|
236
|
+
1. Read the current growth plan.
|
|
237
|
+
2. Read the user's reason for replanning.
|
|
238
|
+
3. If `.organic-growth/product-dna.md` exists, consult it — the reason for
|
|
239
|
+
replanning may relate to domain rules or business invariants.
|
|
240
|
+
4. Assess current state: what's built, what works, what changed.
|
|
202
241
|
5. Rewrite the Concrete stages (next 3-5) from current state,
|
|
203
|
-
including new properties per stage
|
|
242
|
+
including new properties per stage.
|
|
204
243
|
6. Verify property accumulation: new stages must not invalidate
|
|
205
244
|
properties from completed stages. If they do, flag this
|
|
206
245
|
explicitly — it means a breaking change.
|
|
207
|
-
7. Update the Horizon section
|
|
208
|
-
8. Do NOT undo or modify completed stages
|
|
246
|
+
7. Update the Horizon section.
|
|
247
|
+
8. Do NOT undo or modify completed stages.
|
|
209
248
|
9. Report what changed and why, including:
|
|
210
249
|
- Properties added, removed, or modified
|
|
211
250
|
- Properties from completed stages that may be at risk
|
|
251
|
+
10. If `.organic-growth/growth-map.md` exists and this replan changes
|
|
252
|
+
scope significantly, flag it:
|
|
253
|
+
"This replan may affect the growth map. Review growth-map.md
|
|
254
|
+
after completing this feature."
|
|
212
255
|
|
|
213
256
|
# Critical Rules
|
|
214
257
|
|
|
215
|
-
- NEVER implement more than one stage per /next invocation
|
|
216
|
-
- NEVER plan more than 5 concrete stages ahead
|
|
217
|
-
- ALWAYS define properties before describing implementation
|
|
218
|
-
- ALWAYS write property tests before writing implementation code
|
|
219
|
-
- ALWAYS run build + tests + smoke check before committing
|
|
220
|
-
- ALWAYS update the growth plan after each stage
|
|
258
|
+
- NEVER implement more than one stage per /next invocation.
|
|
259
|
+
- NEVER plan more than 5 concrete stages ahead.
|
|
260
|
+
- ALWAYS define properties before describing implementation.
|
|
261
|
+
- ALWAYS write property tests before writing implementation code.
|
|
262
|
+
- ALWAYS run build + tests + smoke check before committing.
|
|
263
|
+
- ALWAYS update the growth plan after each stage.
|
|
221
264
|
- Properties from completed stages are PERMANENT — they must
|
|
222
265
|
keep passing. If a new stage needs to break an old property,
|
|
223
266
|
this is a REPLAN, not a quiet change.
|
|
224
|
-
- If a stage reveals the plan is wrong, STOP and replan before continuing
|
|
225
|
-
- Hardcoded values are natural in early stages — don't optimize prematurely
|
|
226
|
-
- The growth plan file is the source of truth, not your memory
|
|
227
|
-
- If you don't understand the domain, ASK — don't guess
|
|
267
|
+
- If a stage reveals the plan is wrong, STOP and replan before continuing.
|
|
268
|
+
- Hardcoded values are natural in early stages — don't optimize prematurely.
|
|
269
|
+
- The growth plan file is the source of truth, not your memory.
|
|
270
|
+
- If you don't understand the domain, ASK — don't guess.
|
|
@@ -4,14 +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
|
-
|
|
9
|
-
|
|
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.
|
|
12
|
+
2. Use the @gardener agent in PLAN mode
|
|
13
|
+
3. Feature to grow: $ARGUMENTS
|
|
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) —
|
|
10
19
|
these are the primary quality gate. Ask yourself:
|
|
11
20
|
- Are the properties complete? Could someone implement this WRONG
|
|
12
21
|
and still pass all properties?
|
|
13
22
|
- Are properties from earlier stages preserved in later ones?
|
|
14
|
-
- Do
|
|
15
|
-
|
|
23
|
+
- Do properties express domain rules, not implementation details?
|
|
24
|
+
6. After the plan is created and approved, ask:
|
|
16
25
|
"Plan ready. Start growing stage 1?"
|
|
17
|
-
|
|
26
|
+
7. If yes, immediately proceed with GROW mode for 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 AGENTS.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
|
|
@@ -4,9 +4,13 @@ description: Grow the next stage from the current growth plan
|
|
|
4
4
|
|
|
5
5
|
Continue growing: implement the next stage from the active growth plan.
|
|
6
6
|
|
|
7
|
-
1. Find the active plan in
|
|
7
|
+
1. Find the active plan in `.organic-growth/growth/`
|
|
8
8
|
2. Use the @gardener agent in GROW mode
|
|
9
9
|
3. If no plan exists, tell the user to run /grow first
|
|
10
10
|
4. If all stages are done, congratulate and suggest what might grow next
|
|
11
11
|
|
|
12
|
+
Tip: If you hit a wall during implementation, debug systematically:
|
|
13
|
+
reproduce the issue, form a hypothesis, verify it, and fix one thing at a time.
|
|
14
|
+
Don't guess.
|
|
15
|
+
|
|
12
16
|
Feature filter (optional): $ARGUMENTS
|
|
@@ -4,7 +4,7 @@ description: Re-evaluate the growth plan when reality changes
|
|
|
4
4
|
|
|
5
5
|
Something changed. Re-evaluate the growth plan from current state.
|
|
6
6
|
|
|
7
|
-
1. Find the active plan in
|
|
7
|
+
1. Find the active plan in `.organic-growth/growth/`
|
|
8
8
|
2. Use the @gardener agent in REPLAN mode
|
|
9
9
|
3. Reason for replanning: $ARGUMENTS
|
|
10
10
|
4. If no reason given, ask: "What changed?"
|
|
@@ -23,7 +23,7 @@ the implementation session.
|
|
|
23
23
|
**Consistency:**
|
|
24
24
|
- Does new code follow the same patterns as existing code?
|
|
25
25
|
- Naming conventions, error handling style, project structure
|
|
26
|
-
- If
|
|
26
|
+
- If `.organic-growth/product-dna.md` exists: do domain terms match?
|
|
27
27
|
|
|
28
28
|
**Simplicity:**
|
|
29
29
|
- Is anything over-engineered for the current stage?
|
|
@@ -4,17 +4,30 @@ description: Bootstrap a new project — from DNA document or interview
|
|
|
4
4
|
|
|
5
5
|
Plant the seed for a new project.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
0. Scan project root for existing code (`src/`, `package.json`, `build.gradle`, `README.md`, etc.).
|
|
8
|
+
If code already exists:
|
|
9
|
+
- Read README/build files to auto-fill Tech Stack
|
|
10
|
+
- Discover quality commands (build, lint, test)
|
|
11
|
+
- Adjust interview: skip "what tech stack?" and "what are you building?"
|
|
12
|
+
- Ask instead: "what change do you want to make?" and "any constraints?"
|
|
13
|
+
- Check recent git commits and ask whether to follow existing commit convention
|
|
14
|
+
|
|
15
|
+
1. Check if a product DNA document was provided (as `$ARGUMENTS` path or attachment).
|
|
16
|
+
Also check if `.organic-growth/product-dna.md` already exists.
|
|
9
17
|
|
|
10
18
|
**Path A — DNA exists:**
|
|
11
19
|
- Read the document
|
|
12
20
|
- Distill it into AGENTS.md Product section (~10 lines: what, for whom,
|
|
13
21
|
core problem, key domain concepts, current state)
|
|
14
|
-
-
|
|
22
|
+
- Map content into the structured DNA format and store in
|
|
23
|
+
`.organic-growth/product-dna.md`
|
|
24
|
+
- If Business Rules are missing, ask: "Any rules that must ALWAYS hold?"
|
|
15
25
|
- Confirm with the user: "Here's what I extracted. Anything to adjust?"
|
|
16
26
|
|
|
17
27
|
**Path B — No DNA:**
|
|
28
|
+
- Before the interview, briefly consider what this project could be:
|
|
29
|
+
what kind of system, likely domain risks, and which questions matter most.
|
|
30
|
+
Do not create separate brainstorming artifacts.
|
|
18
31
|
- Interview the user. Ask these questions ONE AT A TIME:
|
|
19
32
|
- What are you building? (one sentence)
|
|
20
33
|
- Who is it for? What's their context?
|
|
@@ -22,23 +35,35 @@ Plant the seed for a new project.
|
|
|
22
35
|
- What tech stack do you want? (or: should I suggest one?)
|
|
23
36
|
- Any hard constraints? (hosting, budget, compliance, language)
|
|
24
37
|
- What's the priority: speed to MVP, production quality, or learning?
|
|
25
|
-
|
|
38
|
+
- What are the main user roles? What can each do?
|
|
39
|
+
- What business rules must ALWAYS be true?
|
|
40
|
+
- What's the main process flow? (e.g. browse -> cart -> order -> approval -> invoice)
|
|
41
|
+
- Generate `.organic-growth/product-dna.md` using the structured template.
|
|
42
|
+
Leave missing sections as `<!-- to be filled -->`.
|
|
43
|
+
- Fill in AGENTS.md Product section from answers.
|
|
26
44
|
|
|
27
45
|
2. In both paths, also fill in:
|
|
28
|
-
- Tech Stack (THE SOIL): from DNA
|
|
29
|
-
- Priorities (LIGHT & WATER): from DNA
|
|
46
|
+
- Tech Stack (THE SOIL): from DNA/interview + scan of existing project files
|
|
47
|
+
- Priorities (LIGHT & WATER): from DNA/interview
|
|
30
48
|
|
|
31
49
|
3. Check if AGENTS.md already has a filled Product section.
|
|
32
50
|
If yes, ask: "Product context already exists. Overwrite or update?"
|
|
33
51
|
|
|
34
|
-
4. Generate
|
|
52
|
+
4. Generate `.organic-growth/growth/project-bootstrap.md` — the first growth plan:
|
|
35
53
|
- Stage 1: Initialize project (build tool, dependencies, empty build passes)
|
|
36
54
|
- Stage 2: Hello World endpoint/page (proves stack works end-to-end)
|
|
37
55
|
- Stage 3: First domain concept with hardcoded data
|
|
38
56
|
- Stage 4: Persistence (database, migration, first real data)
|
|
39
57
|
- Stage 5: First real behavior with real data
|
|
40
|
-
|
|
58
|
+
- Include `Capabilities:` tags in the plan header
|
|
59
|
+
|
|
60
|
+
5. If the project has 4+ distinct capabilities (from DNA/interview),
|
|
61
|
+
generate `.organic-growth/growth-map.md` draft:
|
|
62
|
+
- Organize sequence into Walking Skeleton and what follows
|
|
63
|
+
- Add short "Why This Order"
|
|
64
|
+
- Mark `project-bootstrap` as 🌱
|
|
65
|
+
- Present as aspirational, not a commitment
|
|
41
66
|
|
|
42
|
-
|
|
67
|
+
6. Ask: "Seed planted. Start growing stage 1?"
|
|
43
68
|
|
|
44
69
|
Input: $ARGUMENTS
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Product (THE SEED — fill this in)
|
|
4
4
|
|
|
5
5
|
<!-- Without this section, the agent grows weeds. Be brief but specific. -->
|
|
6
|
-
<!-- If you have a full product document, put it in
|
|
6
|
+
<!-- If you have a full product document, put it in .organic-growth/product-dna.md -->
|
|
7
7
|
<!-- This section is the distilled version — what the agent sees always. -->
|
|
8
8
|
<!-- The DNA document is read only during planning (/grow, /replan). -->
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
**Core problem:** [What pain does it solve?]
|
|
13
13
|
**Key domain concepts:** [3-7 terms that someone new needs to understand]
|
|
14
14
|
**Current state:** [Greenfield / MVP exists / Production system]
|
|
15
|
-
**Full DNA:** [
|
|
15
|
+
**Full DNA:** [.organic-growth/product-dna.md if exists, otherwise "N/A"]
|
|
16
16
|
|
|
17
17
|
## Tech Stack (THE SOIL — auto-discovered, but document the non-obvious)
|
|
18
18
|
|
|
@@ -61,17 +61,17 @@ A seedling is a whole plant, not 10% of a tree.
|
|
|
61
61
|
- Never plan more than 5 concrete stages ahead
|
|
62
62
|
- Keep a rough outline of what comes after, but expect it to change
|
|
63
63
|
- Re-evaluate the plan every 3 stages or when something unexpected happens
|
|
64
|
-
- Update
|
|
64
|
+
- Update `.organic-growth/growth/<feature>.md` after every stage
|
|
65
65
|
|
|
66
66
|
3. **Vertical, not horizontal**
|
|
67
67
|
- Each stage touches all layers needed (API + service + DB + test)
|
|
68
68
|
- No "build all the backend first, then the frontend"
|
|
69
69
|
- Early stages can return hardcoded values — that's natural
|
|
70
|
-
- Growth: hardcoded
|
|
70
|
+
- Growth: hardcoded -> configurable -> dynamic -> optimized
|
|
71
71
|
|
|
72
72
|
4. **Context hygiene**
|
|
73
73
|
- Start a fresh session every 3 stages
|
|
74
|
-
- The growth plan in
|
|
74
|
+
- The growth plan in `.organic-growth/growth/` is the continuity mechanism
|
|
75
75
|
- After `/clear`, run `/next` — the agent reads the plan and continues
|
|
76
76
|
|
|
77
77
|
5. **Quality gate after every stage**
|
|
@@ -107,10 +107,12 @@ For **existing** projects, first stages are:
|
|
|
107
107
|
```
|
|
108
108
|
feat(scope): stage N — <what grew>
|
|
109
109
|
|
|
110
|
-
Growth plan:
|
|
110
|
+
Growth plan: .organic-growth/growth/<feature>.md
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
## Growth Plan Location
|
|
114
114
|
|
|
115
|
-
All plans live in
|
|
115
|
+
All plans live in `.organic-growth/growth/<feature-name>.md`.
|
|
116
|
+
Product DNA lives in `.organic-growth/product-dna.md`.
|
|
117
|
+
Growth map lives in `.organic-growth/growth-map.md` (if exists).
|
|
116
118
|
Format documented in the gardener agent.
|