liteagents 2.4.7 → 2.5.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.
Files changed (37) hide show
  1. package/README.md +24 -8
  2. package/docs/LONG_TERM_MEMORY.md +449 -0
  3. package/package.json +2 -2
  4. package/packages/ampcode/AGENT.md +3 -1
  5. package/packages/ampcode/agents/context-builder.md +14 -12
  6. package/packages/ampcode/commands/docs-builder/templates.md +29 -0
  7. package/packages/ampcode/commands/docs-builder.md +54 -3
  8. package/packages/ampcode/commands/friction/friction.js +2168 -0
  9. package/packages/ampcode/commands/friction.md +139 -0
  10. package/packages/ampcode/commands/remember.md +110 -0
  11. package/packages/claude/CLAUDE.md +3 -1
  12. package/packages/claude/agents/context-builder.md +7 -4
  13. package/packages/claude/commands/friction/friction.js +2168 -0
  14. package/packages/claude/commands/friction.md +139 -0
  15. package/packages/claude/commands/remember.md +110 -0
  16. package/packages/claude/skills/docs-builder/SKILL.md +53 -2
  17. package/packages/claude/skills/docs-builder/references/templates.md +29 -0
  18. package/packages/droid/AGENTS.md +3 -1
  19. package/packages/droid/commands/docs-builder/templates.md +29 -0
  20. package/packages/droid/commands/docs-builder.md +54 -3
  21. package/packages/droid/commands/friction/friction.js +2168 -0
  22. package/packages/droid/commands/friction.md +139 -0
  23. package/packages/droid/commands/remember.md +110 -0
  24. package/packages/droid/droids/context-builder.md +15 -13
  25. package/packages/opencode/AGENTS.md +3 -1
  26. package/packages/opencode/agent/context-builder.md +14 -12
  27. package/packages/opencode/command/docs-builder/templates.md +29 -0
  28. package/packages/opencode/command/docs-builder.md +54 -3
  29. package/packages/opencode/command/friction/friction.js +2168 -0
  30. package/packages/opencode/command/friction.md +139 -0
  31. package/packages/opencode/command/remember.md +110 -0
  32. package/packages/opencode/opencode.jsonc +8 -0
  33. package/packages/subagentic-manual.md +33 -15
  34. package/packages/ampcode/README.md +0 -17
  35. package/packages/claude/README.md +0 -23
  36. package/packages/droid/README.md +0 -17
  37. package/packages/opencode/README.md +0 -17
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: friction
3
+ description: Analyze session behavior patterns
4
+ usage: /friction <sessions-path>
5
+ argument-hint: <sessions-path>
6
+ ---
7
+
8
+ Analyze Claude Code session logs for friction signals, behavioral patterns, and failure antigens.
9
+
10
+ **Guardrails**
11
+ - Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
12
+ - Keep changes tightly scoped to the requested outcome.
13
+
14
+ **Argument: sessions-path (required)**
15
+
16
+ Path to the Claude Code sessions directory containing JSONL files.
17
+ - Example: `/friction ~/.claude/projects/-home-hamr-PycharmProjects-aurora/`
18
+ - If no argument provided, ask the user for the path. Do NOT guess.
19
+
20
+ **What it does**
21
+
22
+ Runs friction analysis on session JSONL files and writes results to `.claude/friction/` in the current project.
23
+
24
+ **Steps**
25
+
26
+ 1. **Validate path**
27
+ - The argument `$ARGUMENTS` is the sessions path
28
+ - Verify the path exists and contains `.jsonl` files
29
+ - If path doesn't exist or has no JSONL files, tell the user and stop
30
+ - Count total session files found
31
+
32
+ 2. **Run friction.js** (bundled at `commands/friction/friction.js`)
33
+ - Look for friction.js in order:
34
+ 1. `~/.claude/commands/friction/friction.js` (installed)
35
+ 2. `packages/claude/commands/friction/friction.js` (package development)
36
+ - If found, run: `node <path-to-friction.js> "$ARGUMENTS"`
37
+ - If it does NOT exist anywhere, fall back to running the analysis manually (step 3)
38
+ - If friction.js succeeds, skip to step 7
39
+
40
+ 3. **Manual analysis fallback** (only if friction.js not available)
41
+ - For each `.jsonl` session file in the path:
42
+ - Read the file
43
+ - Extract signals using these patterns:
44
+
45
+ | Signal | Weight | How to detect |
46
+ |---|---|---|
47
+ | `user_intervention` | 10 | User message contains `/stash` |
48
+ | `session_abandoned` | 10 | Last 3 turns have friction > 15 and no `exit_success` |
49
+ | `false_success` | 8 | LLM text contains "done"/"complete"/"fixed" AND next tool result has error |
50
+ | `no_resolution` | 8 | Session has `exit_error` signals but no `exit_success` after them |
51
+ | `tool_loop` | 6 | Same tool called 3+ times with identical arguments |
52
+ | `rapid_exit` | 6 | <3 turns AND ends with error |
53
+ | `interrupt_cascade` | 5 | Multiple `request_interrupted` within 60 seconds |
54
+ | `user_curse` | 5 | User message matches profanity patterns |
55
+ | `request_interrupted` | 2.5 | Turn has `is_interrupted: true` or ESC/Ctrl+C signal |
56
+ | `exit_error` | 1 | Tool result has non-zero exit code |
57
+ | `repeated_question` | 1 | User asks same question twice (fuzzy match) |
58
+ | `long_silence` | 0.5 | >10 minute gap between turns |
59
+ | `user_negation` | 0.5 | User message starts with "no", "wrong", "didn't work" |
60
+ | `compaction` | 0.5 | System message indicates context compaction |
61
+
62
+ 4. **Score each session**
63
+ - Accumulate weighted signal scores (no subtraction, only accumulation)
64
+ - Track peak friction score
65
+ - Classify session quality:
66
+ - **BAD**: has `user_intervention` or `session_abandoned`
67
+ - **FRICTION**: has `user_curse` or `false_success`
68
+ - **ROUGH**: peak friction >= 15, no intervention
69
+ - **OK**: low friction, completed normally
70
+ - **ONE-SHOT**: single turn, not interactive (filter out)
71
+
72
+ 5. **Aggregate stats**
73
+ - Count sessions by quality
74
+ - Calculate BAD rate
75
+ - Identify worst and best sessions
76
+ - Daily trend if sessions span multiple days
77
+
78
+ 6. **Extract antigen candidates from BAD sessions**
79
+ - For each BAD session, extract:
80
+ - Anchor signal (what triggered BAD classification)
81
+ - Tool sequence around the failure
82
+ - Error messages
83
+ - Pattern description
84
+ - Write as antigen candidates
85
+
86
+ 7. **Write output to `.claude/friction/`**
87
+ - Create `.claude/friction/` directory if it doesn't exist
88
+ - Write these files:
89
+ - `friction_analysis.json` — per-session breakdown (quality, peak, signals)
90
+ - `friction_summary.json` — aggregate stats, verdict, daily trend
91
+ - `friction_raw.jsonl` — all raw signals with timestamps
92
+ - `antigen_candidates.json` — raw extracted failure patterns
93
+ - `antigen_clusters.json` — clustered patterns (primary artifact for /remember)
94
+ - `antigen_review.md` — human-readable clustered review
95
+
96
+ 8. **Report to user**
97
+ - Sessions analyzed count
98
+ - BAD / FRICTION / ROUGH / OK counts
99
+ - BAD rate percentage
100
+ - Worst session ID and peak friction
101
+ - Path to `antigen_review.md` for review
102
+ - Remind: run `/remember` to consolidate into project memory
103
+
104
+ **Output format for antigen_review.md**
105
+
106
+ ```markdown
107
+ # Friction Antigen Clusters
108
+
109
+ Generated: [date]
110
+ BAD sessions: [count] | Raw candidates: [count] | Clusters: [count]
111
+
112
+ ## Cluster Summary
113
+
114
+ | # | Signal | Tool Pattern | Count | Sessions | Score | Median Peak |
115
+ |---|--------|-------------|-------|----------|-------|-------------|
116
+ | 1 | false_success | Bash,Bash | 35 | 23 | 280 | 73 |
117
+ | 2 | user_intervention | (none) | 34 | 24 | 340 | 65 |
118
+
119
+ ## Cluster 1: false_success | Bash,Bash
120
+
121
+ **Occurrences:** 35 across 23 sessions | **Score:** 280
122
+
123
+ ### User Context (what the user said)
124
+ > [actual user quote from session]
125
+
126
+ ### Errors
127
+ [error messages if any]
128
+
129
+ ### Files involved
130
+ - [file paths]
131
+ ```
132
+
133
+ **File locations**
134
+ - Design doc: `docs/02-features/memory/LONG_TERM_MEMORY.md`
135
+ - Input: JSONL session files from `$ARGUMENTS` path
136
+ - Output: `.claude/friction/` (project-local)
137
+ - JS script: `commands/friction/friction.js` (bundled alongside this command)
138
+ - Python equivalent: `scripts/friction.py` (aurora users, same logic)
139
+ - Manual fallback: built into this command if friction.js unavailable
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: remember
3
+ description: Consolidate stashes + friction into project memory
4
+ usage: /remember
5
+ ---
6
+
7
+ Consolidate session stashes and friction analysis into a single project-local MEMORY.md, then inject into CLAUDE.md.
8
+
9
+ **Guardrails**
10
+ - Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
11
+ - Keep changes tightly scoped to the requested outcome.
12
+
13
+ **What it does**
14
+
15
+ Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_clusters.json`), extracts durable facts, episodes, and behavioral preferences into a single `.claude/memory/MEMORY.md`, then injects a managed memory section into `CLAUDE.md`.
16
+
17
+ **Steps**
18
+
19
+ 1. **Gather sources**
20
+ - Read all `.claude/stash/*.md` files in the current project
21
+ - Check for friction output at `.claude/friction/antigen_clusters.json` (preferred) or `.claude/friction/antigen_review.md` (fallback)
22
+ - Read existing `.claude/memory/MEMORY.md` if it exists — create dir if missing
23
+ - Read processed manifest at `.claude/memory/.processed` — skip already-processed stashes
24
+ - If no unprocessed stashes, report "nothing to consolidate" and stop
25
+
26
+ 2. **Extract from unprocessed stashes** (use Task tool with sonnet model for each)
27
+ - For each unprocessed stash, call sonnet to extract:
28
+ - **FACTS** (atomic, one-line): stable preferences, decisions, corrections, explicit "remember this"
29
+ - **EPISODE** (3-5 bullet narrative): what was the goal, what was tried, outcome, lesson
30
+ - **SKIP**: code details, file paths, errors, mechanical steps, LLM responses
31
+ - Collect all new facts and episodes
32
+
33
+ 3. **Merge into MEMORY.md**
34
+ - Read existing `.claude/memory/MEMORY.md` and parse its three sections (## Facts, ## Episodes, ## Preferences)
35
+ - **Facts section**: call sonnet with existing facts + newly extracted facts
36
+ - Rules: new updates replace old, contradictions keep new version, duplicates dropped
37
+ - Keep facts atomic, one line each
38
+ - **Episodes section**: append new episode entries (append-only, timestamped, no dedup)
39
+ - **Preferences section**: only update if friction output exists (step 4)
40
+ - Write merged result to `.claude/memory/MEMORY.md` in this format:
41
+
42
+ ```markdown
43
+ # Project Memory
44
+ > Auto-generated by /remember. Do not edit manually.
45
+
46
+ ## Facts
47
+ - [atomic fact 1]
48
+ - [atomic fact 2]
49
+
50
+ ## Episodes
51
+ ### YYYY-MM-DD - [title]
52
+ - [bullet narrative]
53
+
54
+ ### YYYY-MM-DD - [title]
55
+ - [bullet narrative]
56
+
57
+ ## Preferences
58
+ ### High Confidence
59
+ - [pattern] (evidence: [count] observations)
60
+
61
+ ### Medium Confidence
62
+ - [pattern] (evidence: [count] observations)
63
+
64
+ ### Low Confidence
65
+ - [pattern] (evidence: [count] observations)
66
+ ```
67
+
68
+ 4. **Distill friction into preferences** (only if friction output exists)
69
+ - Read `.claude/friction/antigen_clusters.json` — this contains clustered failure patterns with counts, user_context quotes, and tool sequences
70
+ - For the **top 10 clusters** (by score), extract the `contexts` field — these are the actual user messages that show behavioral patterns
71
+ - Call sonnet with:
72
+ - The top 10 clusters (signal, tool_pattern, count, sessions, contexts, errors)
73
+ - Existing Preferences section from MEMORY.md
74
+ - Extract BEHAVIORAL preferences (patterns demonstrated, not stated) — the user_context quotes are the primary evidence
75
+ - Confidence tiers:
76
+ - **High Confidence**: 5+ observations — available via @MEMORY.md
77
+ - **Medium Confidence**: 3+ observations — observing, not loaded
78
+ - **Low Confidence**: <3 observations — needs more data
79
+ - Promote/demote based on new evidence
80
+ - Update the Preferences section in MEMORY.md
81
+
82
+ 5. **Inject memory reference into CLAUDE.md**
83
+ - Compose the section between `<!-- MEMORY:START -->` and `<!-- MEMORY:END -->` markers:
84
+ ```
85
+ <!-- MEMORY:START -->
86
+ @MEMORY.md
87
+ <!-- MEMORY:END -->
88
+ ```
89
+ - The `@MEMORY.md` reference points to `.claude/memory/MEMORY.md` — Claude loads the full file directly, so no inline duplication is needed
90
+ - If CLAUDE.md already has MEMORY markers, replace the section between them
91
+ - If CLAUDE.md has no MEMORY markers, append the section at the end
92
+ - If no CLAUDE.md exists, create one with just the memory section
93
+
94
+ 6. **Update processed manifest**
95
+ - Append paths of newly processed stashes to `.claude/memory/.processed`
96
+
97
+ 7. **Report to user**
98
+ - Number of stashes processed
99
+ - Facts count (total, new)
100
+ - Episodes count (total, new)
101
+ - Preferences count by confidence tier
102
+ - Confirm MEMORY.md and CLAUDE.md updated
103
+
104
+ **File locations (all project-local)**
105
+ - Memory file: `.claude/memory/MEMORY.md` (single source of truth, referenced as @MEMORY.md)
106
+ - Stash files: `.claude/stash/*.md`
107
+ - Friction output: `.claude/friction/antigen_clusters.json` (clustered patterns with user contexts)
108
+ - Friction fallback: `.claude/friction/antigen_review.md` (human-readable clusters)
109
+ - Processed manifest: `.claude/memory/.processed`
110
+ - Output: `CLAUDE.md` (managed MEMORY section with @MEMORY.md reference)
@@ -125,7 +125,8 @@ mkdir -p docs/{00-context,01-product,02-features,03-logs,04-process,archive}
125
125
 
126
126
  Create these files (see `references/templates.md` for content):
127
127
 
128
- **00-context/** (3 files):
128
+ **00-context/** (4 files):
129
+ - [ ] `blueprint.md` - Overarching project artifact (see below)
129
130
  - [ ] `vision.md` - Product purpose & boundaries
130
131
  - [ ] `assumptions.md` - Constraints, risks, unknowns
131
132
  - [ ] `system-state.md` - What's currently built
@@ -194,19 +195,69 @@ Update to reference new structure with quick links.
194
195
  ls -la docs/{00-context,01-product,02-features,03-logs,04-process,archive}
195
196
 
196
197
  # Verify minimum files
198
+ test -f docs/00-context/blueprint.md && echo "✓ blueprint.md"
197
199
  test -f docs/00-context/vision.md && echo "✓ vision.md"
198
200
  test -f docs/00-context/system-state.md && echo "✓ system-state.md"
199
201
  test -f docs/01-product/prd.md && echo "✓ prd.md"
200
202
  test -f docs/README.md && echo "✓ README.md"
201
203
 
202
204
  # Count files per tier
203
- find docs/00-context -name "*.md" | wc -l # >= 3
205
+ find docs/00-context -name "*.md" | wc -l # >= 4
204
206
  find docs/03-logs -name "*.md" | wc -l # >= 5
205
207
  find docs/04-process -name "*.md" | wc -l # >= 3
206
208
  ```
207
209
 
208
210
  ---
209
211
 
212
+ ## Blueprint: The Overarching Project Artifact
213
+
214
+ `docs/00-context/blueprint.md` is the **one and only** high-level project document. It answers: what is this project, what's built, what's planned, where is it headed.
215
+
216
+ **When to create:** Always. blueprint.md is the first file created in 00-context/. It is required for both Fresh and Existing modes.
217
+
218
+ **Content sources:**
219
+ - Root `README.md` — project identity, purpose, stats
220
+ - `package.json` / `pyproject.toml` — tech stack, dependencies
221
+ - Existing docs — features implemented vs planned
222
+ - Code structure — what modules/packages exist
223
+
224
+ **Structure:**
225
+
226
+ ```markdown
227
+ # [Project Name] Blueprint
228
+
229
+ ## Identity
230
+ [What this project IS in 2-3 sentences. Sourced from README.]
231
+
232
+ ## Status
233
+ | Area | Status | Notes |
234
+ |------|--------|-------|
235
+ | [feature/module] | implemented / in-progress / planned | [brief] |
236
+
237
+ ## Architecture
238
+ [High-level structure: packages, modules, entry points. No ASCII trees — use tables or flat lists.]
239
+
240
+ ## Implemented
241
+ [What works today. Group by feature area. Be specific.]
242
+
243
+ ## Planned
244
+ [What's next. Ordered by priority. Include design docs if they exist.]
245
+
246
+ ## Future Direction
247
+ [Where does this project want to be? North star. 3-5 bullets max.]
248
+
249
+ ## Key Decisions
250
+ [Major architectural choices already made. Link to decisions-log if it exists.]
251
+ ```
252
+
253
+ **Rules for blueprint.md:**
254
+ - Keep it under 150 lines — it's an overview, not a manual
255
+ - Update it when features ship or plans change
256
+ - It is the FIRST document a new contributor or LLM should read
257
+ - No duplication with vision.md (vision = WHY, blueprint = WHAT + WHERE)
258
+
259
+ ---
260
+
210
261
  ## Rules
211
262
 
212
263
  **DO:**
@@ -2,6 +2,35 @@
2
2
 
3
3
  Detailed templates for each file in the /docs structure.
4
4
 
5
+ ## 00-context/blueprint.md
6
+
7
+ ```markdown
8
+ # [Project Name] Blueprint
9
+
10
+ ## Identity
11
+ [What this project IS in 2-3 sentences. Sourced from README.]
12
+
13
+ ## Status
14
+ | Area | Status | Notes |
15
+ |------|--------|-------|
16
+ | [feature/module] | implemented / in-progress / planned | [brief] |
17
+
18
+ ## Architecture
19
+ [High-level structure: packages, modules, entry points. Tables or flat lists, no ASCII trees.]
20
+
21
+ ## Implemented
22
+ [What works today. Group by feature area. Be specific about what ships.]
23
+
24
+ ## Planned
25
+ [What's next. Ordered by priority. Link to design docs if they exist.]
26
+
27
+ ## Future Direction
28
+ [Where does this project want to be? North star. 3-5 bullets max.]
29
+
30
+ ## Key Decisions
31
+ [Major architectural choices already made. Brief rationale. Link to decisions-log if available.]
32
+ ```
33
+
5
34
  ## 00-context/vision.md
6
35
 
7
36
  ```markdown
@@ -22,7 +22,7 @@ These subagents are available when using Claude Code CLI. Droid can reference th
22
22
  | system-architect | Architect | Use for system design, architecture documents, technology selection, API design, and infrastructure planning |
23
23
  | ui-designer | UX Expert | Use for UI/UX design, wireframes, prototypes, front-end specifications, and user experience optimization |
24
24
 
25
- ## Droid Commands (20 total)
25
+ ## Droid Commands (22 total)
26
26
 
27
27
  | ID | Description | Usage | Auto |
28
28
  |---|---|---|---|
@@ -32,9 +32,11 @@ These subagents are available when using Claude Code CLI. Droid can reference th
32
32
  | debug | Debug an issue systematically using structured investigation techniques | /debug <issue-description> | - |
33
33
  | docs-builder | Create comprehensive project documentation with structured /docs hierarchy | /docs-builder | false |
34
34
  | explain | Explain code for someone new to the codebase | /explain <code-section> | - |
35
+ | friction | Analyze session logs for failure patterns and behavioral signals | /friction <sessions-path> | - |
35
36
  | git-commit | Analyze changes and create intelligent git commits | /git-commit | - |
36
37
  | optimize | Analyze and optimize performance issues | /optimize <target-area> | - |
37
38
  | refactor | Refactor code while maintaining behavior and tests | /refactor <code-section> | - |
39
+ | remember | Consolidate stashes + friction into project memory | /remember | - |
38
40
  | review | Comprehensive code review including quality, tests, and architecture | /review | - |
39
41
  | root-cause-tracing | Systematically traces bugs backward through call stack to identify source | /root-cause-tracing <issue-description> | false |
40
42
  | security | Security vulnerability scan and analysis | /security | - |
@@ -2,6 +2,35 @@
2
2
 
3
3
  Detailed templates for each file in the /docs structure.
4
4
 
5
+ ## 00-context/blueprint.md
6
+
7
+ ```markdown
8
+ # [Project Name] Blueprint
9
+
10
+ ## Identity
11
+ [What this project IS in 2-3 sentences. Sourced from README.]
12
+
13
+ ## Status
14
+ | Area | Status | Notes |
15
+ |------|--------|-------|
16
+ | [feature/module] | implemented / in-progress / planned | [brief] |
17
+
18
+ ## Architecture
19
+ [High-level structure: packages, modules, entry points. Tables or flat lists, no ASCII trees.]
20
+
21
+ ## Implemented
22
+ [What works today. Group by feature area. Be specific about what ships.]
23
+
24
+ ## Planned
25
+ [What's next. Ordered by priority. Link to design docs if they exist.]
26
+
27
+ ## Future Direction
28
+ [Where does this project want to be? North star. 3-5 bullets max.]
29
+
30
+ ## Key Decisions
31
+ [Major architectural choices already made. Brief rationale. Link to decisions-log if available.]
32
+ ```
33
+
5
34
  ## 00-context/vision.md
6
35
 
7
36
  ```markdown
@@ -125,7 +125,8 @@ mkdir -p docs/{00-context,01-product,02-features,03-logs,04-process,archive}
125
125
 
126
126
  Create these files (see `docs-builder/templates.md` for content):
127
127
 
128
- **00-context/** (3 files):
128
+ **00-context/** (4 files):
129
+ - [ ] `blueprint.md` - Overarching project artifact (see below)
129
130
  - [ ] `vision.md` - Product purpose & boundaries
130
131
  - [ ] `assumptions.md` - Constraints, risks, unknowns
131
132
  - [ ] `system-state.md` - What's currently built
@@ -175,7 +176,7 @@ When moving files:
175
176
 
176
177
  ## Step 5: Integration
177
178
 
178
- **If CLAUDE.md exists:**
179
+ **If AGENTS.md exists:**
179
180
  Add or update documentation pointer:
180
181
  ```markdown
181
182
  ## Documentation
@@ -194,19 +195,69 @@ Update to reference new structure with quick links.
194
195
  ls -la docs/{00-context,01-product,02-features,03-logs,04-process,archive}
195
196
 
196
197
  # Verify minimum files
198
+ test -f docs/00-context/blueprint.md && echo "✓ blueprint.md"
197
199
  test -f docs/00-context/vision.md && echo "✓ vision.md"
198
200
  test -f docs/00-context/system-state.md && echo "✓ system-state.md"
199
201
  test -f docs/01-product/prd.md && echo "✓ prd.md"
200
202
  test -f docs/README.md && echo "✓ README.md"
201
203
 
202
204
  # Count files per tier
203
- find docs/00-context -name "*.md" | wc -l # >= 3
205
+ find docs/00-context -name "*.md" | wc -l # >= 4
204
206
  find docs/03-logs -name "*.md" | wc -l # >= 5
205
207
  find docs/04-process -name "*.md" | wc -l # >= 3
206
208
  ```
207
209
 
208
210
  ---
209
211
 
212
+ ## Blueprint: The Overarching Project Artifact
213
+
214
+ `docs/00-context/blueprint.md` is the **one and only** high-level project document. It answers: what is this project, what's built, what's planned, where is it headed.
215
+
216
+ **When to create:** Always. blueprint.md is the first file created in 00-context/. It is required for both Fresh and Existing modes.
217
+
218
+ **Content sources:**
219
+ - Root `README.md` — project identity, purpose, stats
220
+ - `package.json` / `pyproject.toml` — tech stack, dependencies
221
+ - Existing docs — features implemented vs planned
222
+ - Code structure — what modules/packages exist
223
+
224
+ **Structure:**
225
+
226
+ ```markdown
227
+ # [Project Name] Blueprint
228
+
229
+ ## Identity
230
+ [What this project IS in 2-3 sentences. Sourced from README.]
231
+
232
+ ## Status
233
+ | Area | Status | Notes |
234
+ |------|--------|-------|
235
+ | [feature/module] | implemented / in-progress / planned | [brief] |
236
+
237
+ ## Architecture
238
+ [High-level structure: packages, modules, entry points. No ASCII trees — use tables or flat lists.]
239
+
240
+ ## Implemented
241
+ [What works today. Group by feature area. Be specific.]
242
+
243
+ ## Planned
244
+ [What's next. Ordered by priority. Include design docs if they exist.]
245
+
246
+ ## Future Direction
247
+ [Where does this project want to be? North star. 3-5 bullets max.]
248
+
249
+ ## Key Decisions
250
+ [Major architectural choices already made. Link to decisions-log if it exists.]
251
+ ```
252
+
253
+ **Rules for blueprint.md:**
254
+ - Keep it under 150 lines — it's an overview, not a manual
255
+ - Update it when features ship or plans change
256
+ - It is the FIRST document a new contributor or LLM should read
257
+ - No duplication with vision.md (vision = WHY, blueprint = WHAT + WHERE)
258
+
259
+ ---
260
+
210
261
  ## Rules
211
262
 
212
263
  **DO:**