organic-growth 3.2.0 → 3.3.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 +57 -8
- package/bin/cli.mjs +89 -24
- package/package.json +6 -3
- package/templates/.claude/commands/seed.md +75 -10
- package/templates-codex/.codex/prompts/grow.md +53 -0
- package/templates-codex/.codex/prompts/map.md +22 -0
- package/templates-codex/.codex/prompts/next-automatic.md +30 -0
- package/templates-codex/.codex/prompts/next.md +49 -0
- package/templates-codex/.codex/prompts/replan.md +23 -0
- package/templates-codex/.codex/prompts/review.md +64 -0
- package/templates-codex/.codex/prompts/seed.md +70 -0
- package/templates-codex/AGENTS.md +118 -0
- package/templates-opencode/.opencode/commands/seed.md +75 -10
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/lab71tech/organic-growth/actions/workflows/test.yml) [](https://github.com/lab71tech/organic-growth/releases)
|
|
4
4
|
|
|
5
|
-
Claude Code setup for incremental software development.
|
|
5
|
+
Claude Code, opencode, and Codex setup for incremental software development.
|
|
6
6
|
|
|
7
7
|
Grow features in natural stages, where each stage delivers a complete, working system.
|
|
8
8
|
|
|
@@ -21,6 +21,14 @@ bunx organic-growth
|
|
|
21
21
|
# Or with npx:
|
|
22
22
|
npx organic-growth
|
|
23
23
|
|
|
24
|
+
# Install for opencode:
|
|
25
|
+
bunx organic-growth --opencode
|
|
26
|
+
|
|
27
|
+
# Install for Codex:
|
|
28
|
+
bunx organic-growth --codex
|
|
29
|
+
# Or:
|
|
30
|
+
bunx organic-growth --target codex
|
|
31
|
+
|
|
24
32
|
# With a product DNA document:
|
|
25
33
|
bunx organic-growth docs/my-product-spec.md
|
|
26
34
|
|
|
@@ -29,19 +37,24 @@ bunx organic-growth --force
|
|
|
29
37
|
|
|
30
38
|
# Upgrade managed files (preserves CLAUDE.md, .mcp.json, etc.):
|
|
31
39
|
bunx organic-growth --upgrade
|
|
40
|
+
|
|
41
|
+
# Upgrade Codex templates explicitly:
|
|
42
|
+
bunx organic-growth --upgrade --codex
|
|
32
43
|
```
|
|
33
44
|
|
|
34
|
-
|
|
45
|
+
Default install creates `CLAUDE.md` and `.claude/` for Claude Code. `--opencode` installs `AGENTS.md` and `.opencode/`. `--codex` installs `AGENTS.md` and `.codex/`. No runtime dependencies.
|
|
35
46
|
|
|
36
47
|
## What You Get
|
|
37
48
|
|
|
49
|
+
### Claude Code (default)
|
|
50
|
+
|
|
38
51
|
```
|
|
39
52
|
CLAUDE.md # Project context template + growth philosophy
|
|
40
53
|
.claude/
|
|
41
54
|
├── agents/
|
|
42
55
|
│ └── gardener.md # Plans, implements, and validates growth stages
|
|
43
56
|
├── commands/
|
|
44
|
-
│ ├── seed.md # /seed —
|
|
57
|
+
│ ├── seed.md # /seed — plant the seed (new or existing project)
|
|
45
58
|
│ ├── grow.md # /grow — plan a new feature
|
|
46
59
|
│ ├── map.md # /map — view or adjust growth map
|
|
47
60
|
│ ├── next.md # /next — implement next stage
|
|
@@ -58,15 +71,50 @@ CLAUDE.md # Project context template + growth philosop
|
|
|
58
71
|
└── growth/ # One growth plan per feature
|
|
59
72
|
```
|
|
60
73
|
|
|
74
|
+
### opencode
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
AGENTS.md # Project context template + growth philosophy
|
|
78
|
+
.opencode/
|
|
79
|
+
├── agents/
|
|
80
|
+
│ └── gardener.md
|
|
81
|
+
├── commands/
|
|
82
|
+
│ ├── seed.md
|
|
83
|
+
│ ├── grow.md
|
|
84
|
+
│ ├── map.md
|
|
85
|
+
│ ├── next.md
|
|
86
|
+
│ ├── next-automatic.md
|
|
87
|
+
│ ├── replan.md
|
|
88
|
+
│ └── review.md
|
|
89
|
+
└── ...
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Codex
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
AGENTS.md # Project context template + growth philosophy
|
|
96
|
+
.codex/
|
|
97
|
+
└── prompts/
|
|
98
|
+
├── seed.md
|
|
99
|
+
├── grow.md
|
|
100
|
+
├── map.md
|
|
101
|
+
├── next.md
|
|
102
|
+
├── next-automatic.md
|
|
103
|
+
├── replan.md
|
|
104
|
+
└── review.md
|
|
105
|
+
```
|
|
106
|
+
|
|
61
107
|
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.
|
|
62
108
|
|
|
63
109
|
A **post-stage test** hook and a **post-stage review** hook run automatically after every stage commit, in order:
|
|
64
110
|
|
|
65
|
-
1. **Test hook** — runs your test suite (discovered from the `**Test:**` field in CLAUDE.md) and injects pass/fail results into the conversation. On failure, tells Claude to fix before continuing.
|
|
111
|
+
1. **Test hook** — runs your test suite (discovered from the `**Test:**` field in `CLAUDE.md`) and injects pass/fail results into the conversation. On failure, tells Claude to fix before continuing.
|
|
66
112
|
2. **Review hook** — captures the commit diff and injects it as review context, giving the gardener agent an immediate second look at what changed.
|
|
67
113
|
|
|
68
114
|
Tests run first so failures are caught before the review. This makes the quality gate deterministic — tests always run after stage commits, regardless of whether the agent remembers to.
|
|
69
115
|
|
|
116
|
+
Codex support uses prompt files in `.codex/prompts/`. Launch Codex with `CODEX_HOME=.codex codex` to use the repo-local Organic Growth prompts. Claude-style post-stage hooks are not currently installed for Codex. Upgrade auto-detects the installed target when the repo contains only one managed config tree, but the explicit form `npx organic-growth --upgrade --codex` is also supported.
|
|
117
|
+
|
|
70
118
|
## Workflow
|
|
71
119
|
|
|
72
120
|
```bash
|
|
@@ -95,7 +143,7 @@ Tests run first so failures are caught before the review. This makes the quality
|
|
|
95
143
|
- **Rolling plan:** 3-5 stages ahead, re-evaluate every 3
|
|
96
144
|
- **Two-layer quality:** [properties](#property-based-planning) before code, deterministic tools after every stage, LLM review on demand
|
|
97
145
|
- **Context hygiene:** fresh session every 3 stages
|
|
98
|
-
- **Product context required:** fill in CLAUDE.md or provide a DNA document
|
|
146
|
+
- **Product context required:** fill in `CLAUDE.md` or `AGENTS.md`, or provide a DNA document
|
|
99
147
|
|
|
100
148
|
## Property-Based Planning
|
|
101
149
|
|
|
@@ -109,7 +157,7 @@ Properties are not test cases or user stories. A test says "when I do X, Y happe
|
|
|
109
157
|
count decreases by exactly one" [invariant]
|
|
110
158
|
```
|
|
111
159
|
|
|
112
|
-
**Why this matters for LLM-assisted development:** When
|
|
160
|
+
**Why this matters for LLM-assisted development:** When your coding agent generates a stage, you review 3-5 properties instead of a 300-line diff. If the properties are right, the code is constrained to be right. The review shifts from "is this code correct?" to "are these rules complete?"
|
|
113
161
|
|
|
114
162
|
Properties **accumulate** across stages. Stage 3 must still satisfy the properties from stages 1 and 2. They are permanent commitments, not checkboxes to discard. This is what prevents regressions as the feature grows.
|
|
115
163
|
|
|
@@ -117,9 +165,10 @@ The gardener agent handles the full property format — categories, failure anal
|
|
|
117
165
|
|
|
118
166
|
## After Install
|
|
119
167
|
|
|
120
|
-
1. Edit `CLAUDE.md` — fill in the Product section (or run `/seed`)
|
|
168
|
+
1. Edit `CLAUDE.md` or `AGENTS.md` — fill in the Product section (or run `/seed`)
|
|
121
169
|
2. Fill in Quality Tools section with your project's lint/test commands
|
|
122
|
-
3.
|
|
170
|
+
3. For Codex, launch with `CODEX_HOME=.codex codex`
|
|
171
|
+
4. Start building with `/grow`
|
|
123
172
|
|
|
124
173
|
See the [example growth plan](.organic-growth/example-growth-plan.md) to see properties, stages, and accumulation in action.
|
|
125
174
|
|
package/bin/cli.mjs
CHANGED
|
@@ -18,6 +18,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
18
18
|
const __dirname = dirname(__filename);
|
|
19
19
|
const TEMPLATES_DIR = join(__dirname, '..', 'templates');
|
|
20
20
|
const TEMPLATES_OPENCODE_DIR = join(__dirname, '..', 'templates-opencode');
|
|
21
|
+
const TEMPLATES_CODEX_DIR = join(__dirname, '..', 'templates-codex');
|
|
21
22
|
const TARGET_DIR = process.cwd();
|
|
22
23
|
|
|
23
24
|
const RESET = '\x1b[0m';
|
|
@@ -120,9 +121,74 @@ function readVersion() {
|
|
|
120
121
|
return pkg.version;
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
const TARGETS = {
|
|
125
|
+
claude: {
|
|
126
|
+
label: 'Claude Code',
|
|
127
|
+
templatesDir: TEMPLATES_DIR,
|
|
128
|
+
contextFile: 'CLAUDE.md',
|
|
129
|
+
userFiles: ['CLAUDE.md', '.mcp.json'],
|
|
130
|
+
},
|
|
131
|
+
opencode: {
|
|
132
|
+
label: 'opencode',
|
|
133
|
+
templatesDir: TEMPLATES_OPENCODE_DIR,
|
|
134
|
+
contextFile: 'AGENTS.md',
|
|
135
|
+
userFiles: ['AGENTS.md', 'opencode.json'],
|
|
136
|
+
},
|
|
137
|
+
codex: {
|
|
138
|
+
label: 'Codex',
|
|
139
|
+
templatesDir: TEMPLATES_CODEX_DIR,
|
|
140
|
+
contextFile: 'AGENTS.md',
|
|
141
|
+
userFiles: ['AGENTS.md'],
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
function detectInstalledTarget(targetDir) {
|
|
146
|
+
const installedTargets = [];
|
|
147
|
+
|
|
148
|
+
if (existsSync(join(targetDir, '.claude'))) installedTargets.push('claude');
|
|
149
|
+
if (existsSync(join(targetDir, '.opencode'))) installedTargets.push('opencode');
|
|
150
|
+
if (existsSync(join(targetDir, '.codex'))) installedTargets.push('codex');
|
|
151
|
+
|
|
152
|
+
if (installedTargets.length > 1) {
|
|
153
|
+
console.error(`Error: multiple managed target directories found (${installedTargets.join(', ')}). Re-run with --target, --opencode, or --codex.`);
|
|
154
|
+
process.exit(1);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return installedTargets[0] || null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function parseTarget(args, targetDir, upgrade) {
|
|
161
|
+
const explicitTargetIndex = args.findIndex(arg => arg === '--target');
|
|
162
|
+
const explicitTarget = explicitTargetIndex >= 0 ? args[explicitTargetIndex + 1] : null;
|
|
163
|
+
const isOpencode = args.includes('--opencode');
|
|
164
|
+
const isCodex = args.includes('--codex');
|
|
165
|
+
|
|
166
|
+
if (explicitTargetIndex >= 0 && !explicitTarget) {
|
|
167
|
+
console.error(`Error: missing value for --target. Expected one of: ${Object.keys(TARGETS).join(', ')}.`);
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (explicitTarget && !TARGETS[explicitTarget]) {
|
|
172
|
+
console.error(`Error: unknown target "${explicitTarget}". Expected one of: ${Object.keys(TARGETS).join(', ')}.`);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const selected = [explicitTarget, isOpencode ? 'opencode' : null, isCodex ? 'codex' : null].filter(Boolean);
|
|
177
|
+
if (selected.length > 1) {
|
|
178
|
+
console.error('Error: choose only one install target. Use either --target, --opencode, or --codex.');
|
|
179
|
+
process.exit(1);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (selected.length === 0 && upgrade) {
|
|
183
|
+
return detectInstalledTarget(targetDir) || 'claude';
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return selected[0] || 'claude';
|
|
187
|
+
}
|
|
188
|
+
|
|
123
189
|
function printHelp() {
|
|
124
190
|
log('');
|
|
125
|
-
log(`${GREEN}🌱 Organic Growth${RESET} — Claude Code
|
|
191
|
+
log(`${GREEN}🌱 Organic Growth${RESET} — Claude Code, opencode, and Codex setup for incremental development`);
|
|
126
192
|
log('');
|
|
127
193
|
log(`${CYAN}Usage:${RESET}`);
|
|
128
194
|
log(` npx organic-growth [options] [dna-file.md]`);
|
|
@@ -133,7 +199,9 @@ function printHelp() {
|
|
|
133
199
|
log(` --migrate Move legacy docs/growth and docs/product-dna.md to .organic-growth/`);
|
|
134
200
|
log(` -h, --help Show this help message`);
|
|
135
201
|
log(` -v, --version Show version number`);
|
|
202
|
+
log(` --target Install templates for claude, opencode, or codex`);
|
|
136
203
|
log(` --opencode Install opencode templates (AGENTS.md + .opencode/)`);
|
|
204
|
+
log(` --codex Install Codex templates (AGENTS.md + .codex/)`);
|
|
137
205
|
log('');
|
|
138
206
|
log(`${CYAN}Arguments:${RESET}`);
|
|
139
207
|
log(` dna-file.md Path to a product DNA document to copy into .organic-growth/`);
|
|
@@ -141,6 +209,8 @@ function printHelp() {
|
|
|
141
209
|
log(`${CYAN}Examples:${RESET}`);
|
|
142
210
|
log(` npx organic-growth Install Claude Code templates`);
|
|
143
211
|
log(` npx organic-growth --opencode Install opencode templates`);
|
|
212
|
+
log(` npx organic-growth --codex Install Codex templates`);
|
|
213
|
+
log(` npx organic-growth --target codex Install Codex templates`);
|
|
144
214
|
log(` npx organic-growth --force Install templates (overwrite existing)`);
|
|
145
215
|
log(` npx organic-growth --upgrade Update managed files, keep user customizations`);
|
|
146
216
|
log(` npx organic-growth --migrate Migrate legacy docs/ state into .organic-growth/`);
|
|
@@ -164,7 +234,8 @@ async function install() {
|
|
|
164
234
|
const force = args.includes('--force') || args.includes('-f');
|
|
165
235
|
const upgrade = args.includes('--upgrade');
|
|
166
236
|
const migrate = args.includes('--migrate');
|
|
167
|
-
const
|
|
237
|
+
const target = parseTarget(args, TARGET_DIR, upgrade);
|
|
238
|
+
const targetConfig = TARGETS[target];
|
|
168
239
|
const dna = args.find(a => !a.startsWith('-') && a.endsWith('.md'));
|
|
169
240
|
|
|
170
241
|
// --upgrade and --force are mutually exclusive
|
|
@@ -174,7 +245,7 @@ async function install() {
|
|
|
174
245
|
}
|
|
175
246
|
|
|
176
247
|
// User-customized files that --upgrade should never overwrite or create
|
|
177
|
-
const USER_FILES = new Set(
|
|
248
|
+
const USER_FILES = new Set(targetConfig.userFiles);
|
|
178
249
|
|
|
179
250
|
function isUserFile(filePath) {
|
|
180
251
|
// Check if the file's basename (top-level name) is in the user files set
|
|
@@ -184,10 +255,8 @@ async function install() {
|
|
|
184
255
|
log('');
|
|
185
256
|
if (upgrade) {
|
|
186
257
|
log(`${GREEN}🌱 Organic Growth${RESET} — upgrading managed files`);
|
|
187
|
-
} else if (isOpencode) {
|
|
188
|
-
log(`${GREEN}🌱 Organic Growth${RESET} — opencode setup for incremental development`);
|
|
189
258
|
} else {
|
|
190
|
-
log(`${GREEN}🌱 Organic Growth${RESET} —
|
|
259
|
+
log(`${GREEN}🌱 Organic Growth${RESET} — ${targetConfig.label} setup for incremental development`);
|
|
191
260
|
}
|
|
192
261
|
log('');
|
|
193
262
|
|
|
@@ -199,7 +268,7 @@ async function install() {
|
|
|
199
268
|
: 'unknown';
|
|
200
269
|
const toVersion = readVersion();
|
|
201
270
|
|
|
202
|
-
const templatesDir =
|
|
271
|
+
const templatesDir = targetConfig.templatesDir;
|
|
203
272
|
const files = getAllFiles(templatesDir);
|
|
204
273
|
const updated = [];
|
|
205
274
|
const skippedUser = [];
|
|
@@ -255,7 +324,7 @@ async function install() {
|
|
|
255
324
|
log('');
|
|
256
325
|
} else {
|
|
257
326
|
// Normal install flow
|
|
258
|
-
const templatesDir =
|
|
327
|
+
const templatesDir = targetConfig.templatesDir;
|
|
259
328
|
const files = getAllFiles(templatesDir);
|
|
260
329
|
const created = [];
|
|
261
330
|
const skipped = [];
|
|
@@ -343,22 +412,15 @@ async function install() {
|
|
|
343
412
|
log('');
|
|
344
413
|
log(`${GREEN}Done!${RESET} Next steps:`);
|
|
345
414
|
log('');
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
info(`Run ${CYAN}/seed .organic-growth/product-dna.md${RESET} to bootstrap from your DNA document`);
|
|
349
|
-
} else {
|
|
350
|
-
info(`Run ${CYAN}/seed${RESET} to bootstrap a new project (interview mode)`);
|
|
351
|
-
info(`Or: ${CYAN}/seed path/to/product-doc.md${RESET} if you have a product document`);
|
|
352
|
-
}
|
|
353
|
-
info(`Edit ${CYAN}AGENTS.md${RESET} to fill in your tech stack and quality tools`);
|
|
415
|
+
if (dna) {
|
|
416
|
+
info(`Run ${CYAN}/seed .organic-growth/product-dna.md${RESET} to bootstrap from your DNA document`);
|
|
354
417
|
} else {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
info(`Edit ${CYAN}CLAUDE.md${RESET} to fill in your tech stack and quality tools`);
|
|
418
|
+
info(`Run ${CYAN}/seed${RESET} to bootstrap a new project (interview mode)`);
|
|
419
|
+
info(`Or: ${CYAN}/seed path/to/product-doc.md${RESET} if you have a product document`);
|
|
420
|
+
}
|
|
421
|
+
info(`Edit ${CYAN}${targetConfig.contextFile}${RESET} to fill in your tech stack and quality tools`);
|
|
422
|
+
if (target === 'codex') {
|
|
423
|
+
info(`Launch Codex with ${CYAN}CODEX_HOME=.codex codex${RESET} so the installed prompts are used for this repo`);
|
|
362
424
|
}
|
|
363
425
|
log('');
|
|
364
426
|
log(`${DIM}Commands available after setup:${RESET}`);
|
|
@@ -371,7 +433,10 @@ async function install() {
|
|
|
371
433
|
log(` ${CYAN}/review${RESET} — deep quality review of recent stages`);
|
|
372
434
|
|
|
373
435
|
log('');
|
|
374
|
-
|
|
436
|
+
const upgradeHint = target === 'claude'
|
|
437
|
+
? 'npx organic-growth --upgrade'
|
|
438
|
+
: `npx organic-growth --upgrade --${target}`;
|
|
439
|
+
log(`${DIM}To upgrade later: ${upgradeHint}${RESET}`);
|
|
375
440
|
log('');
|
|
376
441
|
}
|
|
377
442
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "organic-growth",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Claude Code and
|
|
3
|
+
"version": "3.3.0",
|
|
4
|
+
"description": "Claude Code, opencode, and Codex setup for incremental software development — grow features in natural stages",
|
|
5
5
|
"bin": {
|
|
6
6
|
"organic-growth": "bin/cli.mjs"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"bin/",
|
|
10
10
|
"templates/",
|
|
11
|
-
"templates-opencode/"
|
|
11
|
+
"templates-opencode/",
|
|
12
|
+
"templates-codex/"
|
|
12
13
|
],
|
|
13
14
|
"keywords": [
|
|
14
15
|
"claude-code",
|
|
15
16
|
"opencode",
|
|
17
|
+
"codex",
|
|
18
|
+
"openai",
|
|
16
19
|
"ai",
|
|
17
20
|
"agents",
|
|
18
21
|
"agile",
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Plant the seed for a project — from DNA document or interview
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Plant the seed for a
|
|
5
|
+
Plant the seed for a project.
|
|
6
6
|
|
|
7
|
-
0.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
7
|
+
0. **Detect existing project.**
|
|
8
|
+
Scan project root for existing code (`src/`, `lib/`, `app/`, `package.json`, `build.gradle`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`, `README.md`, etc.).
|
|
9
|
+
|
|
10
|
+
- If code or build files already exist → **EXISTING = true**
|
|
11
|
+
- If the project root is empty or contains only config files → **EXISTING = false**
|
|
12
|
+
|
|
13
|
+
When EXISTING = true, scan these files and extract the noted information:
|
|
14
|
+
|
|
15
|
+
**Auto-discovery checklist:**
|
|
16
|
+
- `package.json` → scripts (build, test, lint, start), engines, dependencies and devDependencies for stack detection (e.g., react, express, typescript)
|
|
17
|
+
- `build.gradle` / `build.gradle.kts` → plugins (java, kotlin, spring-boot), tasks (test, check, ktlintCheck), dependencies for framework detection
|
|
18
|
+
- `pyproject.toml` → build-system, project.scripts, dependencies, optional-dependencies, tool sections (pytest, ruff, mypy, black)
|
|
19
|
+
- `Cargo.toml` → edition, dependencies, dev-dependencies, workspace members, features
|
|
20
|
+
- `go.mod` → go version, module path, require directives for framework detection (gin, echo, fiber)
|
|
21
|
+
- `pom.xml` → plugins, parent (spring-boot-starter-parent), dependencies, build configuration
|
|
22
|
+
- `Makefile` → target names (build, test, lint, check, fmt, run) and the commands they execute
|
|
23
|
+
- `README.md` → project description, setup/install instructions, usage examples for product context
|
|
24
|
+
- `.github/workflows/*.yml` → build/test/lint commands used in CI steps, language versions in matrix
|
|
25
|
+
- `.gitlab-ci.yml` → build/test/lint commands used in CI stages, image versions
|
|
26
|
+
|
|
27
|
+
From the discovered files, populate the **Quality Tools** section of CLAUDE.md with the exact commands for:
|
|
28
|
+
- **Build:** (e.g., `npm run build`, `./gradlew build`, `cargo build`)
|
|
29
|
+
- **Lint:** (e.g., `npm run lint`, `./gradlew ktlintCheck`, `cargo clippy`)
|
|
30
|
+
- **Type check:** (e.g., `tsc --noEmit`, or N/A)
|
|
31
|
+
- **Test:** (e.g., `npm test`, `./gradlew test`, `cargo test`)
|
|
32
|
+
- **Smoke:** (e.g., `npm start`, `./gradlew bootRun`, or a health endpoint)
|
|
33
|
+
|
|
34
|
+
Present the discovered tech stack and quality tools to the user for confirmation before writing them.
|
|
35
|
+
|
|
36
|
+
Also:
|
|
11
37
|
- Adjust interview: skip "what tech stack?" and "what are you building?"
|
|
12
38
|
- Ask instead: "what change do you want to make?" and "any constraints?"
|
|
13
39
|
- Check recent git commits and ask whether to follow existing commit convention
|
|
@@ -24,7 +50,22 @@ Plant the seed for a new project.
|
|
|
24
50
|
- If Business Rules are missing, ask: "Any rules that must ALWAYS hold?"
|
|
25
51
|
- Confirm with the user: "Here's what I extracted. Anything to adjust?"
|
|
26
52
|
|
|
27
|
-
**Path
|
|
53
|
+
**Path B1 — Existing project, no DNA (EXISTING = true):**
|
|
54
|
+
- Present what you discovered in Step 0 to the user:
|
|
55
|
+
"Here's what I discovered about your project:" followed by a summary of
|
|
56
|
+
the tech stack, quality tools, and any product context from README.md.
|
|
57
|
+
- Ask the user to confirm or adjust what was discovered.
|
|
58
|
+
- Then ask only gap-filling questions ONE AT A TIME (skip any already
|
|
59
|
+
answered by the discoveries):
|
|
60
|
+
- What core problem does this project solve?
|
|
61
|
+
- What business rules must ALWAYS be true?
|
|
62
|
+
- What are the current priorities? (e.g., new feature, refactor, stabilize)
|
|
63
|
+
- Any hard constraints? (performance, compliance, deployment, backwards compatibility)
|
|
64
|
+
- Generate `.organic-growth/product-dna.md` using the structured template.
|
|
65
|
+
Leave missing sections as `<!-- to be filled -->`.
|
|
66
|
+
- Fill in CLAUDE.md Product section from discoveries + answers.
|
|
67
|
+
|
|
68
|
+
**Path B2 — Greenfield, no DNA (EXISTING = false):**
|
|
28
69
|
- Before the interview, briefly consider what this project could be:
|
|
29
70
|
what kind of system, likely domain risks, and which questions matter most.
|
|
30
71
|
Do not create separate brainstorming artifacts.
|
|
@@ -49,7 +90,13 @@ Plant the seed for a new project.
|
|
|
49
90
|
3. Check if CLAUDE.md already has a filled Product section.
|
|
50
91
|
If yes, ask: "Product context already exists. Overwrite or update?"
|
|
51
92
|
|
|
52
|
-
4.
|
|
93
|
+
4. **Growth plan generation (greenfield only).**
|
|
94
|
+
|
|
95
|
+
If EXISTING = true → **skip this step entirely.** Do NOT generate
|
|
96
|
+
`project-bootstrap.md`. Existing projects do not need bootstrap stages —
|
|
97
|
+
the user will run `/grow` to plan their first feature against the existing codebase.
|
|
98
|
+
|
|
99
|
+
If EXISTING = false → generate `.organic-growth/growth/project-bootstrap.md` — the first growth plan:
|
|
53
100
|
- Stage 1: Initialize project (build tool, dependencies, empty build passes)
|
|
54
101
|
- Stage 2: Hello World endpoint/page (proves stack works end-to-end)
|
|
55
102
|
- Stage 3: First domain concept with hardcoded data
|
|
@@ -57,7 +104,12 @@ Plant the seed for a new project.
|
|
|
57
104
|
- Stage 5: First real behavior with real data
|
|
58
105
|
- Include `Capabilities:` tags in the plan header
|
|
59
106
|
|
|
60
|
-
5.
|
|
107
|
+
5. **Growth map generation (greenfield only).**
|
|
108
|
+
|
|
109
|
+
If EXISTING = true → **skip this step entirely.** Do NOT generate
|
|
110
|
+
`growth-map.md`. There is no bootstrap plan to map.
|
|
111
|
+
|
|
112
|
+
If EXISTING = false → if the project has 4+ distinct capabilities (from DNA/interview),
|
|
61
113
|
generate `.organic-growth/growth-map.md` draft:
|
|
62
114
|
- Organize sequence into Walking Skeleton and what follows
|
|
63
115
|
- Add short "Why This Order"
|
|
@@ -65,6 +117,12 @@ Plant the seed for a new project.
|
|
|
65
117
|
- Present as aspirational, not a commitment
|
|
66
118
|
|
|
67
119
|
6. Present a summary of what was created:
|
|
120
|
+
|
|
121
|
+
If EXISTING = true:
|
|
122
|
+
- Product DNA (`.organic-growth/product-dna.md`)
|
|
123
|
+
- CLAUDE.md Product/Tech Stack/Priorities sections
|
|
124
|
+
|
|
125
|
+
If EXISTING = false:
|
|
68
126
|
- Product DNA (`.organic-growth/product-dna.md`)
|
|
69
127
|
- CLAUDE.md Product/Tech Stack/Priorities sections
|
|
70
128
|
- Growth plan (`.organic-growth/growth/project-bootstrap.md`)
|
|
@@ -79,7 +137,14 @@ Plant the seed for a new project.
|
|
|
79
137
|
- Do NOT create src/, lib/, app/, or any implementation directories.
|
|
80
138
|
- Do NOT commit anything beyond the seed files created above.
|
|
81
139
|
|
|
82
|
-
|
|
140
|
+
If EXISTING = true, the ONLY files you create are:
|
|
141
|
+
- `.organic-growth/product-dna.md`
|
|
142
|
+
- `CLAUDE.md` (fill in Product/Tech Stack/Priorities sections)
|
|
143
|
+
|
|
144
|
+
Say exactly:
|
|
145
|
+
"Seed planted. Run `/grow` when you're ready to plan your first feature."
|
|
146
|
+
|
|
147
|
+
If EXISTING = false, the ONLY files you create are:
|
|
83
148
|
- `.organic-growth/product-dna.md`
|
|
84
149
|
- `.organic-growth/growth/project-bootstrap.md`
|
|
85
150
|
- `.organic-growth/growth-map.md` (if applicable)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Plan and start growing a new feature from seed
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Grow a new feature using the Organic Growth approach.
|
|
6
|
+
|
|
7
|
+
1. Read `AGENTS.md` first.
|
|
8
|
+
- If the Product section is still placeholders or empty, stop and tell the user to run `/seed` first.
|
|
9
|
+
|
|
10
|
+
2. Read `.organic-growth/product-dna.md` and `.organic-growth/growth-map.md` if they exist.
|
|
11
|
+
- Treat business rules and completed capabilities as constraints.
|
|
12
|
+
- Search `.organic-growth/growth/` for related plans by capability tag when needed.
|
|
13
|
+
|
|
14
|
+
3. Explore the current codebase so the plan reflects reality, not assumptions.
|
|
15
|
+
|
|
16
|
+
4. Briefly reason through the problem space for `$ARGUMENTS`:
|
|
17
|
+
- 2-3 possible approaches
|
|
18
|
+
- riskiest assumption
|
|
19
|
+
- likely failure points
|
|
20
|
+
Keep this internal. Do not create separate artifacts.
|
|
21
|
+
|
|
22
|
+
5. Ask the user 2-3 clarifying questions at most.
|
|
23
|
+
Focus on acceptance criteria, constraints, and the riskiest part.
|
|
24
|
+
|
|
25
|
+
6. Create `.organic-growth/growth/<feature-name>.md` with:
|
|
26
|
+
- `Status: 🌱 Growing`
|
|
27
|
+
- 3-7 capability tags
|
|
28
|
+
- a one-paragraph Seed section
|
|
29
|
+
- 3-5 concrete stages
|
|
30
|
+
- a short horizon
|
|
31
|
+
- a Growth Log section
|
|
32
|
+
|
|
33
|
+
7. For every concrete stage, define properties before implementation hints.
|
|
34
|
+
Consider invariants, state transitions, roundtrips, and boundaries.
|
|
35
|
+
Properties must express domain rules, not implementation details.
|
|
36
|
+
|
|
37
|
+
8. Self-check the plan before presenting it:
|
|
38
|
+
- completeness
|
|
39
|
+
- independence from implementation
|
|
40
|
+
- property accumulation across stages
|
|
41
|
+
- boundary coverage where meaningful
|
|
42
|
+
|
|
43
|
+
9. If `.organic-growth/growth-map.md` exists, update it:
|
|
44
|
+
- mark matching capabilities as `🌱`
|
|
45
|
+
- add the plan link
|
|
46
|
+
- insert new capabilities in the best-fit section when missing
|
|
47
|
+
|
|
48
|
+
10. Present the plan for review.
|
|
49
|
+
Focus the user on reviewing properties, not implementation hints.
|
|
50
|
+
|
|
51
|
+
11. Stop after the plan is approved.
|
|
52
|
+
Do not implement stage 1.
|
|
53
|
+
Say exactly: `Plan ready. Run /next when you're ready to grow stage 1.`
|
|
@@ -0,0 +1,22 @@
|
|
|
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 whether `AGENTS.md` or `.organic-growth/product-dna.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 the map exists and `$ARGUMENTS` is empty:
|
|
13
|
+
- show the current map
|
|
14
|
+
- summarize statuses as `🌳 complete | 🌱 growing | ⬜ planned | 💡 candidates`
|
|
15
|
+
- suggest the next capability based on sequence and dependencies
|
|
16
|
+
|
|
17
|
+
3. If `$ARGUMENTS` requests a change:
|
|
18
|
+
- update the map
|
|
19
|
+
- verify the new order still makes sense given completed plans and dependencies
|
|
20
|
+
- explain the reasoning behind the change
|
|
21
|
+
|
|
22
|
+
Input: $ARGUMENTS
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run multiple growth stages automatically from the active plan
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run multiple growth stages in sequence. Stop on the first failure.
|
|
6
|
+
|
|
7
|
+
1. Find the active growth plan in `.organic-growth/growth/`.
|
|
8
|
+
If no plan exists, tell the user to run `/grow` first and stop.
|
|
9
|
+
|
|
10
|
+
2. Count the remaining concrete stages marked with `🌱`.
|
|
11
|
+
|
|
12
|
+
3. Parse `$ARGUMENTS`.
|
|
13
|
+
- If it is a positive integer, use it as the maximum number of stages to run.
|
|
14
|
+
- If it is empty, run all remaining concrete stages.
|
|
15
|
+
- Otherwise, tell the user the argument must be a positive integer and stop.
|
|
16
|
+
|
|
17
|
+
4. For each stage:
|
|
18
|
+
- re-read `AGENTS.md` and the growth plan from disk
|
|
19
|
+
- identify the first remaining `🌱` stage
|
|
20
|
+
- execute the full `/next` workflow for exactly that stage
|
|
21
|
+
- re-read the plan and verify the stage changed from `🌱` to `🌳`
|
|
22
|
+
- if verification fails, stop immediately
|
|
23
|
+
|
|
24
|
+
5. After the loop, report:
|
|
25
|
+
- stages attempted
|
|
26
|
+
- stages completed
|
|
27
|
+
- first failure, if any
|
|
28
|
+
- whether all requested stages completed
|
|
29
|
+
|
|
30
|
+
6. If 3 or more stages completed, suggest running `/review` and starting a fresh Codex session.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Grow the next stage from the current growth plan
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Continue growing: implement the next stage from the active growth plan.
|
|
6
|
+
|
|
7
|
+
1. Read `AGENTS.md`, the active growth plan in `.organic-growth/growth/`, and any related completed plans.
|
|
8
|
+
|
|
9
|
+
2. Find the next `🌱` stage.
|
|
10
|
+
- If no plan exists, tell the user to run `/grow` first.
|
|
11
|
+
- If all stages are complete, say so and suggest what might grow next.
|
|
12
|
+
|
|
13
|
+
3. If this is stage 3, 6, 9, or later, re-evaluate the remaining stages before implementing.
|
|
14
|
+
Update the plan if reality has changed.
|
|
15
|
+
|
|
16
|
+
4. Implement only this stage.
|
|
17
|
+
- Treat the stage properties as acceptance criteria.
|
|
18
|
+
- Write or update tests first so each property is encoded explicitly.
|
|
19
|
+
- Then write the minimum code needed to pass the new and inherited properties.
|
|
20
|
+
|
|
21
|
+
5. Run the quality gate and fix failures within the same stage:
|
|
22
|
+
- Build
|
|
23
|
+
- Lint
|
|
24
|
+
- Type check
|
|
25
|
+
- Full test suite
|
|
26
|
+
- Smoke check
|
|
27
|
+
|
|
28
|
+
6. Self-review before committing:
|
|
29
|
+
- this stage only
|
|
30
|
+
- no work smuggled in from future stages
|
|
31
|
+
- earlier properties still hold
|
|
32
|
+
- implementation still matches the properties
|
|
33
|
+
|
|
34
|
+
7. Update project state files.
|
|
35
|
+
- Mark the stage as `🌳` in the growth plan.
|
|
36
|
+
- Add a Growth Log entry for this stage.
|
|
37
|
+
- Update `.organic-growth/growth-map.md` if it exists.
|
|
38
|
+
- Add new domain concepts to `.organic-growth/product-dna.md` if introduced.
|
|
39
|
+
- Update `README.md` to reflect the current working system.
|
|
40
|
+
- Update `AGENTS.md` Current state when the milestone meaningfully changed.
|
|
41
|
+
|
|
42
|
+
8. Commit with:
|
|
43
|
+
```
|
|
44
|
+
feat(scope): stage N — <what grew>
|
|
45
|
+
|
|
46
|
+
Growth plan: .organic-growth/growth/<feature>.md
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
9. Report what grew, what properties were verified, what commands you ran, and what should happen next.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Re-evaluate the growth plan when reality changes
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Something changed. Re-evaluate the active growth plan from current state.
|
|
6
|
+
|
|
7
|
+
1. Find the active plan in `.organic-growth/growth/`.
|
|
8
|
+
If no active plan exists, tell the user to run `/grow` first.
|
|
9
|
+
|
|
10
|
+
2. Read `AGENTS.md`, the active growth plan, related completed plans, and the current codebase.
|
|
11
|
+
|
|
12
|
+
3. Use `$ARGUMENTS` as the reason for replanning.
|
|
13
|
+
If no reason is given, ask: `What changed?`
|
|
14
|
+
|
|
15
|
+
4. Preserve completed stages unless there is an explicit reason to invalidate them.
|
|
16
|
+
If a previous property must be broken, record it in `Breaks:` with the reason.
|
|
17
|
+
|
|
18
|
+
5. Rewrite only the remaining stages and horizon so they reflect current reality.
|
|
19
|
+
Keep properties first, implementation hints second.
|
|
20
|
+
|
|
21
|
+
6. Update `.organic-growth/growth-map.md` if the capability ordering or dependencies changed.
|
|
22
|
+
|
|
23
|
+
7. Present the updated plan and explain the delta from the previous one.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Deep quality review of recent growth stages (fresh context, no implementation bias)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Review code quality of recent stages. Run this after several stages
|
|
6
|
+
or before merging — it provides a second opinion with zero bias from
|
|
7
|
+
the implementation session.
|
|
8
|
+
|
|
9
|
+
1. Determine scope:
|
|
10
|
+
- If $ARGUMENTS contains a number (e.g., `/review 3`): review last N stages
|
|
11
|
+
- If $ARGUMENTS contains a feature name: review that feature's stages
|
|
12
|
+
- Default: review all stages since last review (or last 5, whichever is smaller)
|
|
13
|
+
|
|
14
|
+
2. Read the growth plan to understand intent of each reviewed stage.
|
|
15
|
+
|
|
16
|
+
3. For each stage in scope, examine the git diff and review for:
|
|
17
|
+
|
|
18
|
+
**Correctness:**
|
|
19
|
+
- Does the code actually do what the stage intended?
|
|
20
|
+
- Are there logic errors, off-by-one, null cases?
|
|
21
|
+
- Do the tests test the right thing? (not just "test exists")
|
|
22
|
+
|
|
23
|
+
**Consistency:**
|
|
24
|
+
- Does new code follow the same patterns as existing code?
|
|
25
|
+
- Naming conventions, error handling style, project structure
|
|
26
|
+
- If `.organic-growth/product-dna.md` exists: do domain terms match?
|
|
27
|
+
|
|
28
|
+
**Simplicity:**
|
|
29
|
+
- Is anything over-engineered for the current stage?
|
|
30
|
+
- Code that belongs in future stages?
|
|
31
|
+
- Unnecessary abstractions or premature optimization?
|
|
32
|
+
|
|
33
|
+
**Security basics:**
|
|
34
|
+
- SQL injection, XSS, hardcoded secrets
|
|
35
|
+
- Auth/authz gaps if relevant
|
|
36
|
+
- Input validation
|
|
37
|
+
|
|
38
|
+
**Test quality:**
|
|
39
|
+
- Do tests break if the feature is removed? (vs always-green tests)
|
|
40
|
+
- Are edge cases covered?
|
|
41
|
+
- Test readability — can someone understand intent from the test?
|
|
42
|
+
|
|
43
|
+
4. Output a review report:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
## Review: <feature> — stages N-M
|
|
47
|
+
|
|
48
|
+
### 🟢 Good
|
|
49
|
+
- <what's well done — be specific>
|
|
50
|
+
|
|
51
|
+
### 🟡 Suggestions
|
|
52
|
+
- <improvements, not blockers>
|
|
53
|
+
- <file:line — what to consider>
|
|
54
|
+
|
|
55
|
+
### 🔴 Issues
|
|
56
|
+
- <things that should be fixed before continuing>
|
|
57
|
+
- <file:line — what's wrong and why>
|
|
58
|
+
|
|
59
|
+
### Verdict: ✅ Continue / ⚠️ Fix before next stage / 🔴 Stop and address
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
5. If there are 🔴 Issues, offer to fix them now.
|
|
63
|
+
|
|
64
|
+
Scope: $ARGUMENTS
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Plant the seed for a project — from DNA document or interview
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Plant the seed for a project.
|
|
6
|
+
|
|
7
|
+
0. Detect whether this is an existing project.
|
|
8
|
+
Scan project root for existing code (`src/`, `lib/`, `app/`, `package.json`, `build.gradle`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`, `README.md`, etc.).
|
|
9
|
+
|
|
10
|
+
- If code or build files already exist -> `EXISTING = true`
|
|
11
|
+
- If the project root is empty or contains only config files -> `EXISTING = false`
|
|
12
|
+
|
|
13
|
+
When `EXISTING = true`, inspect the repo and extract:
|
|
14
|
+
- build, lint, typecheck, test, and smoke commands
|
|
15
|
+
- major frameworks and language/runtime versions
|
|
16
|
+
- product context from `README.md`, docs, or recent commits
|
|
17
|
+
|
|
18
|
+
Populate the Quality Tools section of `AGENTS.md` with exact commands.
|
|
19
|
+
Present the discovered stack and tools to the user for confirmation before writing them.
|
|
20
|
+
|
|
21
|
+
1. Check for a product DNA document from `$ARGUMENTS` or `.organic-growth/product-dna.md`.
|
|
22
|
+
|
|
23
|
+
Path A — DNA exists:
|
|
24
|
+
- Read it.
|
|
25
|
+
- Distill it into the Product section of `AGENTS.md`.
|
|
26
|
+
- Normalize it into `.organic-growth/product-dna.md`.
|
|
27
|
+
- Fill `AGENTS.md` Product, Tech Stack, and Priorities sections from the DNA plus the project scan from Step 0.
|
|
28
|
+
- Populate the Quality Tools section with exact build, lint, typecheck, test, and smoke commands discovered from the repo.
|
|
29
|
+
- If the DNA omits stack or priority details, ask only the minimum follow-up needed to avoid placeholders.
|
|
30
|
+
- If business rules are missing, ask: "Any rules that must ALWAYS hold?"
|
|
31
|
+
- Confirm the extracted summary with the user.
|
|
32
|
+
|
|
33
|
+
Path B1 — existing project, no DNA:
|
|
34
|
+
- Present discovered project context first.
|
|
35
|
+
- Ask only gap-filling questions, one at a time:
|
|
36
|
+
- What core problem does this project solve?
|
|
37
|
+
- What business rules must ALWAYS be true?
|
|
38
|
+
- What are the current priorities?
|
|
39
|
+
- Any hard constraints?
|
|
40
|
+
- Generate `.organic-growth/product-dna.md` using the structured template.
|
|
41
|
+
- Fill `AGENTS.md` Product, Tech Stack, and Priorities sections from discoveries plus answers.
|
|
42
|
+
|
|
43
|
+
Path B2 — greenfield, no DNA:
|
|
44
|
+
- Ask one question at a time:
|
|
45
|
+
- What are you building?
|
|
46
|
+
- Who is it for?
|
|
47
|
+
- What core problem does it solve?
|
|
48
|
+
- What tech stack do you want?
|
|
49
|
+
- Any hard constraints?
|
|
50
|
+
- What matters most right now?
|
|
51
|
+
- What user roles exist?
|
|
52
|
+
- What business rules must ALWAYS be true?
|
|
53
|
+
- What is the main process flow?
|
|
54
|
+
- Generate `.organic-growth/product-dna.md`.
|
|
55
|
+
- Fill `AGENTS.md` Product, Tech Stack, and Priorities sections.
|
|
56
|
+
|
|
57
|
+
2. In all paths, leave `AGENTS.md` with concrete Product, Tech Stack, Priorities, and Quality Tools entries, not placeholders.
|
|
58
|
+
|
|
59
|
+
3. If `AGENTS.md` already has real product context, ask whether to overwrite or update it.
|
|
60
|
+
|
|
61
|
+
4. For greenfield projects only, generate `.organic-growth/growth/project-bootstrap.md` with 3-5 concrete stages and a short horizon.
|
|
62
|
+
Follow the greenfield pattern in `AGENTS.md`.
|
|
63
|
+
|
|
64
|
+
5. For greenfield projects only, generate `.organic-growth/growth-map.md` if the product has at least 4 distinct capabilities.
|
|
65
|
+
|
|
66
|
+
6. Present a summary of what was created.
|
|
67
|
+
|
|
68
|
+
7. Finish with exactly one of:
|
|
69
|
+
- Existing project: `Seed planted. Run /grow when you're ready to plan your first feature.`
|
|
70
|
+
- Greenfield project: `Seed planted. Review the files above, then run /next when you're ready to grow stage 1.`
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Project Context
|
|
2
|
+
|
|
3
|
+
## Product (THE SEED — fill this in)
|
|
4
|
+
|
|
5
|
+
<!-- Without this section, the agent grows weeds. Be brief but specific. -->
|
|
6
|
+
<!-- If you have a full product document, put it in .organic-growth/product-dna.md -->
|
|
7
|
+
<!-- This section is the distilled version — what the agent sees always. -->
|
|
8
|
+
<!-- The DNA document is read only during planning (/grow, /replan). -->
|
|
9
|
+
|
|
10
|
+
**What:** [One sentence. What is this product?]
|
|
11
|
+
**For whom:** [Who uses it? What's their context?]
|
|
12
|
+
**Core problem:** [What pain does it solve?]
|
|
13
|
+
**Key domain concepts:** [3-7 terms that someone new needs to understand]
|
|
14
|
+
**Current state:** [Greenfield / MVP exists / Production system]
|
|
15
|
+
**Full DNA:** [.organic-growth/product-dna.md if exists, otherwise "N/A"]
|
|
16
|
+
|
|
17
|
+
## Tech Stack (THE SOIL — auto-discovered, but document the non-obvious)
|
|
18
|
+
|
|
19
|
+
<!-- Codex reads your build files. Only add what it CAN'T discover. -->
|
|
20
|
+
|
|
21
|
+
- [Any non-standard commands, e.g.: `./gradlew test --profile staging`]
|
|
22
|
+
- [Unusual conventions, e.g.: "endpoint names in Polish"]
|
|
23
|
+
- [Hard constraints, e.g.: "no Lombok", "Flyway not Liquibase"]
|
|
24
|
+
|
|
25
|
+
### Quality tools (fill in for your project)
|
|
26
|
+
|
|
27
|
+
<!-- Organic Growth runs these after every stage. List the exact commands. -->
|
|
28
|
+
|
|
29
|
+
- **Build:** [e.g.: `./gradlew build` or `npm run build`]
|
|
30
|
+
- **Lint:** [e.g.: `./gradlew ktlintCheck` or `npm run lint`]
|
|
31
|
+
- **Type check:** [e.g.: `tsc --noEmit` or N/A for dynamic languages]
|
|
32
|
+
- **Test:** [e.g.: `./gradlew test` or `npm test`]
|
|
33
|
+
- **Smoke:** [e.g.: `curl http://localhost:8080/health` or `npm run dev` + check]
|
|
34
|
+
|
|
35
|
+
## Priorities (LIGHT & WATER — what matters now)
|
|
36
|
+
|
|
37
|
+
<!-- This changes. Update it when priorities shift. -->
|
|
38
|
+
|
|
39
|
+
- [e.g.: "MVP speed over production polish"]
|
|
40
|
+
- [e.g.: "Must work offline first"]
|
|
41
|
+
- [e.g.: "Security is non-negotiable, even for MVP"]
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
# Development Philosophy: Organic Growth
|
|
46
|
+
|
|
47
|
+
Every feature is grown in stages from seed to maturity.
|
|
48
|
+
Each stage produces a complete, working system — not a partial one.
|
|
49
|
+
A seedling is a whole plant, not 10% of a tree.
|
|
50
|
+
|
|
51
|
+
## Growth Rules
|
|
52
|
+
|
|
53
|
+
1. **One stage = one intent = one commit**
|
|
54
|
+
- Each stage has a single purpose
|
|
55
|
+
- Each stage defines properties (rules that must be true) before implementation
|
|
56
|
+
- Properties become tests — write tests first, then code to pass them
|
|
57
|
+
- Each stage is committed separately with a clear message
|
|
58
|
+
- The app builds, tests pass, and runs after every stage
|
|
59
|
+
|
|
60
|
+
2. **Rolling plan: 3-5 stages ahead**
|
|
61
|
+
- Never plan more than 5 concrete stages ahead
|
|
62
|
+
- Keep a rough outline of what comes after, but expect it to change
|
|
63
|
+
- Re-evaluate the plan every 3 stages or when something unexpected happens
|
|
64
|
+
- Update `.organic-growth/growth/<feature>.md` after every stage
|
|
65
|
+
|
|
66
|
+
3. **Vertical, not horizontal**
|
|
67
|
+
- Each stage touches all layers needed (API + service + DB + test)
|
|
68
|
+
- No "build all the backend first, then the frontend"
|
|
69
|
+
- Early stages can return hardcoded values — that's natural
|
|
70
|
+
- Growth: hardcoded -> configurable -> dynamic -> optimized
|
|
71
|
+
|
|
72
|
+
4. **Context hygiene**
|
|
73
|
+
- Start a fresh Codex session every 3 stages
|
|
74
|
+
- The growth plan in `.organic-growth/growth/` is the continuity mechanism
|
|
75
|
+
- Relaunch Codex with `CODEX_HOME=.codex codex` before continuing if context gets stale
|
|
76
|
+
|
|
77
|
+
5. **Quality gate after every stage**
|
|
78
|
+
- Build must pass
|
|
79
|
+
- Linter must pass (zero new warnings)
|
|
80
|
+
- Type check must pass (if applicable)
|
|
81
|
+
- ALL tests must pass (not just new ones)
|
|
82
|
+
- App must start (health check / smoke test)
|
|
83
|
+
- Fix all failures within the stage — don't carry debt forward
|
|
84
|
+
|
|
85
|
+
6. **Deep review on demand**
|
|
86
|
+
- Run `/review` after every 3-5 stages or before merging
|
|
87
|
+
- Reviews run with fresh context (no implementation bias)
|
|
88
|
+
- Check: correctness, consistency, simplicity, security, test quality
|
|
89
|
+
- Fix 🔴 issues before continuing growth
|
|
90
|
+
|
|
91
|
+
## Growth Stage Patterns
|
|
92
|
+
|
|
93
|
+
For **greenfield** projects, first stages always follow this pattern:
|
|
94
|
+
1. Empty project with passing build
|
|
95
|
+
2. Hello World endpoint/page (proves the stack works end-to-end)
|
|
96
|
+
3. First real domain concept with hardcoded data
|
|
97
|
+
4. Persistence (database, migration, repository)
|
|
98
|
+
5. First real behavior with real data
|
|
99
|
+
|
|
100
|
+
For **existing** projects, first stages are:
|
|
101
|
+
1. The simplest possible version of the new behavior (even hardcoded)
|
|
102
|
+
2. Connect it to existing data/services
|
|
103
|
+
3. Add the real logic incrementally
|
|
104
|
+
|
|
105
|
+
## Commit Convention
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
feat(scope): stage N — <what grew>
|
|
109
|
+
|
|
110
|
+
Growth plan: .organic-growth/growth/<feature>.md
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Growth Plan Location
|
|
114
|
+
|
|
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).
|
|
118
|
+
Prompt files live in `.codex/prompts/` and are used when you launch Codex with `CODEX_HOME=.codex codex`.
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Plant the seed for a project — from DNA document or interview
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Plant the seed for a
|
|
5
|
+
Plant the seed for a project.
|
|
6
6
|
|
|
7
|
-
0.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
7
|
+
0. **Detect existing project.**
|
|
8
|
+
Scan project root for existing code (`src/`, `lib/`, `app/`, `package.json`, `build.gradle`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`, `README.md`, etc.).
|
|
9
|
+
|
|
10
|
+
- If code or build files already exist → **EXISTING = true**
|
|
11
|
+
- If the project root is empty or contains only config files → **EXISTING = false**
|
|
12
|
+
|
|
13
|
+
When EXISTING = true, scan these files and extract the noted information:
|
|
14
|
+
|
|
15
|
+
**Auto-discovery checklist:**
|
|
16
|
+
- `package.json` → scripts (build, test, lint, start), engines, dependencies and devDependencies for stack detection (e.g., react, express, typescript)
|
|
17
|
+
- `build.gradle` / `build.gradle.kts` → plugins (java, kotlin, spring-boot), tasks (test, check, ktlintCheck), dependencies for framework detection
|
|
18
|
+
- `pyproject.toml` → build-system, project.scripts, dependencies, optional-dependencies, tool sections (pytest, ruff, mypy, black)
|
|
19
|
+
- `Cargo.toml` → edition, dependencies, dev-dependencies, workspace members, features
|
|
20
|
+
- `go.mod` → go version, module path, require directives for framework detection (gin, echo, fiber)
|
|
21
|
+
- `pom.xml` → plugins, parent (spring-boot-starter-parent), dependencies, build configuration
|
|
22
|
+
- `Makefile` → target names (build, test, lint, check, fmt, run) and the commands they execute
|
|
23
|
+
- `README.md` → project description, setup/install instructions, usage examples for product context
|
|
24
|
+
- `.github/workflows/*.yml` → build/test/lint commands used in CI steps, language versions in matrix
|
|
25
|
+
- `.gitlab-ci.yml` → build/test/lint commands used in CI stages, image versions
|
|
26
|
+
|
|
27
|
+
From the discovered files, populate the **Quality Tools** section of AGENTS.md with the exact commands for:
|
|
28
|
+
- **Build:** (e.g., `npm run build`, `./gradlew build`, `cargo build`)
|
|
29
|
+
- **Lint:** (e.g., `npm run lint`, `./gradlew ktlintCheck`, `cargo clippy`)
|
|
30
|
+
- **Type check:** (e.g., `tsc --noEmit`, or N/A)
|
|
31
|
+
- **Test:** (e.g., `npm test`, `./gradlew test`, `cargo test`)
|
|
32
|
+
- **Smoke:** (e.g., `npm start`, `./gradlew bootRun`, or a health endpoint)
|
|
33
|
+
|
|
34
|
+
Present the discovered tech stack and quality tools to the user for confirmation before writing them.
|
|
35
|
+
|
|
36
|
+
Also:
|
|
11
37
|
- Adjust interview: skip "what tech stack?" and "what are you building?"
|
|
12
38
|
- Ask instead: "what change do you want to make?" and "any constraints?"
|
|
13
39
|
- Check recent git commits and ask whether to follow existing commit convention
|
|
@@ -24,7 +50,22 @@ Plant the seed for a new project.
|
|
|
24
50
|
- If Business Rules are missing, ask: "Any rules that must ALWAYS hold?"
|
|
25
51
|
- Confirm with the user: "Here's what I extracted. Anything to adjust?"
|
|
26
52
|
|
|
27
|
-
**Path
|
|
53
|
+
**Path B1 — Existing project, no DNA (EXISTING = true):**
|
|
54
|
+
- Present what you discovered in Step 0 to the user:
|
|
55
|
+
"Here's what I discovered about your project:" followed by a summary of
|
|
56
|
+
the tech stack, quality tools, and any product context from README.md.
|
|
57
|
+
- Ask the user to confirm or adjust what was discovered.
|
|
58
|
+
- Then ask only gap-filling questions ONE AT A TIME (skip any already
|
|
59
|
+
answered by the discoveries):
|
|
60
|
+
- What core problem does this project solve?
|
|
61
|
+
- What business rules must ALWAYS be true?
|
|
62
|
+
- What are the current priorities? (e.g., new feature, refactor, stabilize)
|
|
63
|
+
- Any hard constraints? (performance, compliance, deployment, backwards compatibility)
|
|
64
|
+
- Generate `.organic-growth/product-dna.md` using the structured template.
|
|
65
|
+
Leave missing sections as `<!-- to be filled -->`.
|
|
66
|
+
- Fill in AGENTS.md Product section from discoveries + answers.
|
|
67
|
+
|
|
68
|
+
**Path B2 — Greenfield, no DNA (EXISTING = false):**
|
|
28
69
|
- Before the interview, briefly consider what this project could be:
|
|
29
70
|
what kind of system, likely domain risks, and which questions matter most.
|
|
30
71
|
Do not create separate brainstorming artifacts.
|
|
@@ -49,7 +90,13 @@ Plant the seed for a new project.
|
|
|
49
90
|
3. Check if AGENTS.md already has a filled Product section.
|
|
50
91
|
If yes, ask: "Product context already exists. Overwrite or update?"
|
|
51
92
|
|
|
52
|
-
4.
|
|
93
|
+
4. **Growth plan generation (greenfield only).**
|
|
94
|
+
|
|
95
|
+
If EXISTING = true → **skip this step entirely.** Do NOT generate
|
|
96
|
+
`project-bootstrap.md`. Existing projects do not need bootstrap stages —
|
|
97
|
+
the user will run `/grow` to plan their first feature against the existing codebase.
|
|
98
|
+
|
|
99
|
+
If EXISTING = false → generate `.organic-growth/growth/project-bootstrap.md` — the first growth plan:
|
|
53
100
|
- Stage 1: Initialize project (build tool, dependencies, empty build passes)
|
|
54
101
|
- Stage 2: Hello World endpoint/page (proves stack works end-to-end)
|
|
55
102
|
- Stage 3: First domain concept with hardcoded data
|
|
@@ -57,7 +104,12 @@ Plant the seed for a new project.
|
|
|
57
104
|
- Stage 5: First real behavior with real data
|
|
58
105
|
- Include `Capabilities:` tags in the plan header
|
|
59
106
|
|
|
60
|
-
5.
|
|
107
|
+
5. **Growth map generation (greenfield only).**
|
|
108
|
+
|
|
109
|
+
If EXISTING = true → **skip this step entirely.** Do NOT generate
|
|
110
|
+
`growth-map.md`. There is no bootstrap plan to map.
|
|
111
|
+
|
|
112
|
+
If EXISTING = false → if the project has 4+ distinct capabilities (from DNA/interview),
|
|
61
113
|
generate `.organic-growth/growth-map.md` draft:
|
|
62
114
|
- Organize sequence into Walking Skeleton and what follows
|
|
63
115
|
- Add short "Why This Order"
|
|
@@ -65,6 +117,12 @@ Plant the seed for a new project.
|
|
|
65
117
|
- Present as aspirational, not a commitment
|
|
66
118
|
|
|
67
119
|
6. Present a summary of what was created:
|
|
120
|
+
|
|
121
|
+
If EXISTING = true:
|
|
122
|
+
- Product DNA (`.organic-growth/product-dna.md`)
|
|
123
|
+
- AGENTS.md Product/Tech Stack/Priorities sections
|
|
124
|
+
|
|
125
|
+
If EXISTING = false:
|
|
68
126
|
- Product DNA (`.organic-growth/product-dna.md`)
|
|
69
127
|
- AGENTS.md Product/Tech Stack/Priorities sections
|
|
70
128
|
- Growth plan (`.organic-growth/growth/project-bootstrap.md`)
|
|
@@ -79,7 +137,14 @@ Plant the seed for a new project.
|
|
|
79
137
|
- Do NOT create src/, lib/, app/, or any implementation directories.
|
|
80
138
|
- Do NOT commit anything beyond the seed files created above.
|
|
81
139
|
|
|
82
|
-
|
|
140
|
+
If EXISTING = true, the ONLY files you create are:
|
|
141
|
+
- `.organic-growth/product-dna.md`
|
|
142
|
+
- `AGENTS.md` (fill in Product/Tech Stack/Priorities sections)
|
|
143
|
+
|
|
144
|
+
Say exactly:
|
|
145
|
+
"Seed planted. Run `/grow` when you're ready to plan your first feature."
|
|
146
|
+
|
|
147
|
+
If EXISTING = false, the ONLY files you create are:
|
|
83
148
|
- `.organic-growth/product-dna.md`
|
|
84
149
|
- `.organic-growth/growth/project-bootstrap.md`
|
|
85
150
|
- `.organic-growth/growth-map.md` (if applicable)
|