know-thy-build 0.3.2 → 0.4.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 CHANGED
@@ -24,9 +24,9 @@ Pick a language, and three commands are installed into your `.claude/commands/`:
24
24
 
25
25
  | Command | Purpose | Output |
26
26
  |---------|---------|--------|
27
- | `/know-thy-build:project` | Define what you're building and why | `PROJECT.md` |
28
- | `/know-thy-build:technical` | Define how you'll build it | `TECHNICAL.md` |
29
- | `/know-thy-build:feature` | Design a specific feature | `features/NNN.md` |
27
+ | `/know-thy-build:project` | Define what you're building and why | `docs/PROJECT.md` |
28
+ | `/know-thy-build:technical` | Define how you'll build it | `docs/TECHNICAL.md` |
29
+ | `/know-thy-build:feature` | Design a specific feature | `docs/features/NNN.md` |
30
30
 
31
31
  ## The flow
32
32
 
@@ -54,7 +54,7 @@ A conversation that explores:
54
54
 
55
55
  Not every area needs equal depth. The conversation follows you, not a script.
56
56
 
57
- Result: `PROJECT.md` — the project's identity and compass.
57
+ Result: `docs/PROJECT.md` — the project's identity and compass.
58
58
 
59
59
  ### 2. Technical — How
60
60
 
@@ -74,7 +74,7 @@ Explores:
74
74
 
75
75
  Depth matches project scale. A CLI tool might only need Stack + Interfaces.
76
76
 
77
- Result: `TECHNICAL.md` — the technical foundation.
77
+ Result: `docs/TECHNICAL.md` — the technical foundation.
78
78
 
79
79
  ### 3. Feature — Specific work
80
80
 
@@ -93,16 +93,20 @@ Each feature spec covers:
93
93
 
94
94
  Features are quick — 3-8 exchanges. Create new ones or edit existing ones by number.
95
95
 
96
- Result: `features/001.md`, `features/002.md`, ...
96
+ Result: `docs/features/001.md`, `docs/features/002.md`, ...
97
97
 
98
98
  ## Evolution
99
99
 
100
100
  All documents support evolution. Run the same command again on a completed document:
101
101
 
102
- - `/know-thy-build:project` on a complete `PROJECT.md` → evolve mode
103
- - `/know-thy-build:technical` on a complete `TECHNICAL.md` → evolve mode
102
+ - `/know-thy-build:project` on a complete `docs/PROJECT.md` → evolve mode
103
+ - `/know-thy-build:technical` on a complete `docs/TECHNICAL.md` → evolve mode
104
104
  - `/know-thy-build:feature` → edit existing features by number
105
105
 
106
+ ### Migration from v0.3.x
107
+
108
+ If you have existing `PROJECT.md`, `TECHNICAL.md`, or `features/` at your project root, they will be automatically moved to `docs/` the next time you run any `/know-thy-build:*` command. References in `CLAUDE.md` are updated automatically.
109
+
106
110
  Changes are tracked with reasoning in a changelog — not just *what* changed, but *why*.
107
111
 
108
112
  ## Session resilience
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "know-thy-build",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Socratic project definition tool for Claude Code",
5
5
  "bin": {
6
6
  "know-thy-build": "./bin/cli.js"
@@ -27,21 +27,45 @@ Technical terms (e.g. CLI, API, MVP) stay in English. Everything else uses the s
27
27
 
28
28
  ## Before You Begin
29
29
 
30
+ ### 0. Migration check
31
+
32
+ Check if documents exist at the project root (legacy location):
33
+
34
+ ```bash
35
+ ls PROJECT.md TECHNICAL.md 2>/dev/null
36
+ ls features/*.md 2>/dev/null
37
+ ```
38
+
39
+ **If any are found at the root**, these are from a previous version. Migrate them to `docs/`:
40
+
41
+ 1. Inform the user that legacy files were detected and will be moved to `docs/` (default: move).
42
+ 2. Execute:
43
+ ```bash
44
+ mkdir -p docs
45
+ [ -f PROJECT.md ] && mv PROJECT.md docs/PROJECT.md
46
+ [ -f TECHNICAL.md ] && mv TECHNICAL.md docs/TECHNICAL.md
47
+ [ -d features ] && mv features docs/features
48
+ ```
49
+ 3. If `CLAUDE.md` exists, update any path references from `PROJECT.md` to `docs/PROJECT.md`, and `TECHNICAL.md` to `docs/TECHNICAL.md`, `features/` to `docs/features/`.
50
+ 4. Inform the user what was moved.
51
+
52
+ If no legacy files are found, skip silently.
53
+
30
54
  ### 1. Read project context
31
55
 
32
56
  ```bash
33
- cat PROJECT.md 2>/dev/null
34
- cat TECHNICAL.md 2>/dev/null
57
+ cat docs/PROJECT.md 2>/dev/null
58
+ cat docs/TECHNICAL.md 2>/dev/null
35
59
  ```
36
60
 
37
- If PROJECT.md doesn't exist, suggest running `/know-thy-build:project` first. A feature spec without project context is rootless.
61
+ If `docs/PROJECT.md` doesn't exist, suggest running `/know-thy-build:project` first. A feature spec without project context is rootless.
38
62
 
39
- If TECHNICAL.md exists, use it as technical context — reference the stack, architecture, and constraints when exploring the feature's approach. If it doesn't exist, that's fine — technical context is helpful but not required.
63
+ If `docs/TECHNICAL.md` exists, use it as technical context — reference the stack, architecture, and constraints when exploring the feature's approach. If it doesn't exist, that's fine — technical context is helpful but not required.
40
64
 
41
65
  ### 2. Scan existing features
42
66
 
43
67
  ```bash
44
- ls features/*.md 2>/dev/null | sort -V
68
+ ls docs/features/*.md 2>/dev/null | sort -V
45
69
  ```
46
70
 
47
71
  ### 3. Route based on state
@@ -61,7 +85,7 @@ ls features/*.md 2>/dev/null | sort -V
61
85
 
62
86
  ### Determine next number
63
87
 
64
- Find the highest existing number and increment by 1. Zero-pad to 3 digits. If `features/` doesn't exist, start at `001`.
88
+ Find the highest existing number and increment by 1. Zero-pad to 3 digits. If `docs/features/` doesn't exist, start at `001`.
65
89
 
66
90
  ### Areas to Explore
67
91
 
@@ -126,9 +150,9 @@ Don't drag the conversation. Features should be quick.
126
150
 
127
151
  ### Generate Feature Spec
128
152
 
129
- Create the `features/` directory if it doesn't exist.
153
+ Create the `docs/features/` directory if it doesn't exist.
130
154
 
131
- Write to `features/{{NNN}}.md`:
155
+ Write to `docs/features/{{NNN}}.md`:
132
156
 
133
157
  **Frontmatter:**
134
158
  ```yaml
@@ -200,7 +224,7 @@ When the user chooses to edit an existing feature by number:
200
224
  ### 1. Read the feature
201
225
 
202
226
  ```bash
203
- cat features/{{NNN}}.md 2>/dev/null
227
+ cat docs/features/{{NNN}}.md 2>/dev/null
204
228
  ```
205
229
 
206
230
  ### 2. Present the current state
@@ -256,7 +280,7 @@ Write whatever content has been confirmed so far. The next `/know-thy-build:feat
256
280
  ## Closing
257
281
 
258
282
  **After CREATE:**
259
- - Feature spec has been saved to `features/{{NNN}}.md`
283
+ - Feature spec has been saved to `docs/features/{{NNN}}.md`
260
284
  - They can start implementing whenever ready
261
285
  - Run `/know-thy-build:feature` again for the next feature
262
286
 
@@ -28,17 +28,41 @@ Technical terms (e.g. CLI, API, NON-NEGOTIABLE) stay in English. Everything else
28
28
 
29
29
  ## Before You Begin
30
30
 
31
- Silently scan the project for existing context:
31
+ ### 0. Migration check
32
+
33
+ Check if documents exist at the project root (legacy location):
34
+
35
+ ```bash
36
+ ls PROJECT.md TECHNICAL.md 2>/dev/null
37
+ ls features/*.md 2>/dev/null
38
+ ```
39
+
40
+ **If any are found at the root**, these are from a previous version. Migrate them to `docs/`:
41
+
42
+ 1. Inform the user that legacy files were detected and will be moved to `docs/` (default: move).
43
+ 2. Execute:
44
+ ```bash
45
+ mkdir -p docs
46
+ [ -f PROJECT.md ] && mv PROJECT.md docs/PROJECT.md
47
+ [ -f TECHNICAL.md ] && mv TECHNICAL.md docs/TECHNICAL.md
48
+ [ -d features ] && mv features docs/features
49
+ ```
50
+ 3. If `CLAUDE.md` exists, update any path references from `PROJECT.md` to `docs/PROJECT.md`, and `TECHNICAL.md` to `docs/TECHNICAL.md`, `features/` to `docs/features/`.
51
+ 4. Inform the user what was moved.
52
+
53
+ If no legacy files are found, skip silently.
54
+
55
+ ### 1. Scan project context
32
56
 
33
57
  ```bash
34
58
  ls -la 2>/dev/null | head -20
35
59
  cat package.json pyproject.toml Cargo.toml go.mod README.md 2>/dev/null | head -80
36
- cat CLAUDE.md PROJECT.md 2>/dev/null
60
+ cat CLAUDE.md docs/PROJECT.md 2>/dev/null
37
61
  ```
38
62
 
39
- Route based on PROJECT.md state:
63
+ Route based on `docs/PROJECT.md` state:
40
64
 
41
- ### No PROJECT.md → CREATE mode
65
+ ### No docs/PROJECT.md → CREATE mode
42
66
 
43
67
  Note the blank canvas and begin exploring areas.
44
68
 
@@ -55,7 +79,7 @@ Present what was gathered so far and ask:
55
79
  ### `status: evolving` → RESUME EVOLVE mode
56
80
 
57
81
  Read `evolveProgress` from frontmatter and resume:
58
- > "We started evolving PROJECT.md before. Here's where we left off: [summary]. Shall we continue?"
82
+ > "We started evolving docs/PROJECT.md before. Here's where we left off: [summary]. Shall we continue?"
59
83
 
60
84
  ### `status: complete` → EVOLVE mode
61
85
 
@@ -216,7 +240,7 @@ After exploring an area, summarize and read it back. Ask the user to confirm or
216
240
 
217
241
  Don't checkpoint after every question. Checkpoint when you've accumulated enough — typically after a natural cluster.
218
242
 
219
- **At each checkpoint, save progress to PROJECT.md** with `status: drafting`:
243
+ **At each checkpoint, save progress to `docs/PROJECT.md`** with `status: drafting`:
220
244
 
221
245
  ```yaml
222
246
  ---
@@ -243,9 +267,9 @@ Signs the conversation is ready:
243
267
 
244
268
  ---
245
269
 
246
- ## Generate PROJECT.md
270
+ ## Generate docs/PROJECT.md
247
271
 
248
- Finalize the document. Update frontmatter:
272
+ Finalize the document. Write to `docs/PROJECT.md`. Create the `docs/` directory if it doesn't exist. Update frontmatter:
249
273
 
250
274
  ```yaml
251
275
  ---
@@ -459,19 +483,19 @@ If `CLAUDE.md` exists → prepend reference (if not already present). If not →
459
483
  **Reference to add:**
460
484
  ```markdown
461
485
  ## Project Compass
462
- This project follows the principles defined in [PROJECT.md](./PROJECT.md).
463
- AI agents MUST read PROJECT.md before starting any work.
486
+ This project follows the principles defined in [PROJECT.md](./docs/PROJECT.md).
487
+ AI agents MUST read docs/PROJECT.md before starting any work.
464
488
  NON-NEGOTIABLE rules in PROJECT.md cannot be overridden.
465
489
  ```
466
490
 
467
491
  ## Closing
468
492
 
469
493
  **After CREATE:**
470
- - PROJECT.md has been generated.
494
+ - `docs/PROJECT.md` has been generated.
471
495
  - This document is the compass for all agents working on this project.
472
496
  - Run `/know-thy-build:project` again when the project's direction shifts.
473
497
 
474
498
  **After EVOLVE:**
475
- - PROJECT.md has been updated.
499
+ - `docs/PROJECT.md` has been updated.
476
500
  - The changelog records not just what changed, but why.
477
501
  - Run `/know-thy-build:project` again whenever the direction shifts.
@@ -29,15 +29,39 @@ Technical terms (e.g. REST, PostgreSQL, Docker, CI/CD) stay in English. Everythi
29
29
 
30
30
  ## Before You Begin
31
31
 
32
+ ### 0. Migration check
33
+
34
+ Check if documents exist at the project root (legacy location):
35
+
36
+ ```bash
37
+ ls PROJECT.md TECHNICAL.md 2>/dev/null
38
+ ls features/*.md 2>/dev/null
39
+ ```
40
+
41
+ **If any are found at the root**, these are from a previous version. Migrate them to `docs/`:
42
+
43
+ 1. Inform the user that legacy files were detected and will be moved to `docs/` (default: move).
44
+ 2. Execute:
45
+ ```bash
46
+ mkdir -p docs
47
+ [ -f PROJECT.md ] && mv PROJECT.md docs/PROJECT.md
48
+ [ -f TECHNICAL.md ] && mv TECHNICAL.md docs/TECHNICAL.md
49
+ [ -d features ] && mv features docs/features
50
+ ```
51
+ 3. If `CLAUDE.md` exists, update any path references from `PROJECT.md` to `docs/PROJECT.md`, and `TECHNICAL.md` to `docs/TECHNICAL.md`, `features/` to `docs/features/`.
52
+ 4. Inform the user what was moved.
53
+
54
+ If no legacy files are found, skip silently.
55
+
32
56
  ### 1. Read project context
33
57
 
34
58
  ```bash
35
- cat PROJECT.md 2>/dev/null
36
- cat TECHNICAL.md 2>/dev/null
59
+ cat docs/PROJECT.md 2>/dev/null
60
+ cat docs/TECHNICAL.md 2>/dev/null
37
61
  ```
38
62
 
39
- **If PROJECT.md doesn't exist or has `status: drafting`:**
40
- > "PROJECT.md needs to be complete first — the technical design should follow the project definition. Run `/know-thy-build:project` first."
63
+ **If `docs/PROJECT.md` doesn't exist or has `status: drafting`:**
64
+ > "docs/PROJECT.md needs to be complete first — the technical design should follow the project definition. Run `/know-thy-build:project` first."
41
65
  → Stop here.
42
66
 
43
67
  ### 2. Scan existing technical context
@@ -50,14 +74,14 @@ ls .github/workflows/ .gitlab-ci.yml 2>/dev/null
50
74
  cat CLAUDE.md 2>/dev/null
51
75
  ```
52
76
 
53
- ### 3. Route based on TECHNICAL.md state
77
+ ### 3. Route based on `docs/TECHNICAL.md` state
54
78
 
55
- **No TECHNICAL.md → CREATE mode**
56
- Present what you found from PROJECT.md and codebase:
79
+ **No `docs/TECHNICAL.md` → CREATE mode**
80
+ Present what you found from `docs/PROJECT.md` and codebase:
57
81
  > "PROJECT.md defines [one-liner summary]. I can see [tech context from files]. Let's define the technical foundation."
58
82
 
59
83
  **`status: drafting` → RESUME mode**
60
- Read frontmatter, present progress, offer to continue.
84
+ Read `docs/TECHNICAL.md` frontmatter, present progress, offer to continue.
61
85
 
62
86
  **`status: complete` → EVOLVE mode**
63
87
  Present current technical definition:
@@ -168,7 +192,7 @@ Slots to fill:
168
192
 
169
193
  Same pattern as project — checkpoint after natural clusters, not every question.
170
194
 
171
- **Save progress to TECHNICAL.md** with `status: drafting`:
195
+ **Save progress to `docs/TECHNICAL.md`** with `status: drafting`:
172
196
 
173
197
  ```yaml
174
198
  ---
@@ -194,9 +218,9 @@ Not every area needs to be explored. A CLI tool might only need Stack + Interfac
194
218
 
195
219
  ---
196
220
 
197
- ## Generate TECHNICAL.md
221
+ ## Generate docs/TECHNICAL.md
198
222
 
199
- Write to `TECHNICAL.md` in the project root.
223
+ Write to `docs/TECHNICAL.md`. Create the `docs/` directory if it doesn't exist.
200
224
 
201
225
  **Frontmatter:**
202
226
  ```yaml
@@ -316,11 +340,11 @@ lastEvolve: {{date}}
316
340
  ## Closing
317
341
 
318
342
  **After CREATE:**
319
- - TECHNICAL.md has been generated.
343
+ - `docs/TECHNICAL.md` has been generated.
320
344
  - This defines the technical foundation for all implementation work.
321
345
  - Feature specs (`/know-thy-build:feature`) will reference this automatically.
322
346
  - Run `/know-thy-build:technical` again when technical direction shifts.
323
347
 
324
348
  **After EVOLVE:**
325
- - TECHNICAL.md has been updated with changelog.
349
+ - `docs/TECHNICAL.md` has been updated with changelog.
326
350
  - Review if existing features need adjustment based on technical changes.