liteagents 2.4.6 → 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 (39) hide show
  1. package/CHANGELOG.md +10 -33
  2. package/README.md +33 -15
  3. package/docs/LONG_TERM_MEMORY.md +449 -0
  4. package/installer/cli.js +10 -10
  5. package/package.json +2 -2
  6. package/packages/ampcode/AGENT.md +3 -1
  7. package/packages/ampcode/agents/context-builder.md +14 -12
  8. package/packages/ampcode/commands/docs-builder/templates.md +29 -0
  9. package/packages/ampcode/commands/docs-builder.md +261 -58
  10. package/packages/ampcode/commands/friction/friction.js +2168 -0
  11. package/packages/ampcode/commands/friction.md +139 -0
  12. package/packages/ampcode/commands/remember.md +110 -0
  13. package/packages/claude/CLAUDE.md +3 -1
  14. package/packages/claude/agents/context-builder.md +7 -4
  15. package/packages/claude/commands/friction/friction.js +2168 -0
  16. package/packages/claude/commands/friction.md +139 -0
  17. package/packages/claude/commands/remember.md +110 -0
  18. package/packages/claude/skills/docs-builder/SKILL.md +261 -58
  19. package/packages/claude/skills/docs-builder/references/templates.md +29 -0
  20. package/packages/droid/AGENTS.md +3 -1
  21. package/packages/droid/commands/docs-builder/templates.md +29 -0
  22. package/packages/droid/commands/docs-builder.md +261 -58
  23. package/packages/droid/commands/friction/friction.js +2168 -0
  24. package/packages/droid/commands/friction.md +139 -0
  25. package/packages/droid/commands/remember.md +110 -0
  26. package/packages/droid/droids/context-builder.md +15 -13
  27. package/packages/opencode/AGENTS.md +3 -1
  28. package/packages/opencode/agent/context-builder.md +14 -12
  29. package/packages/opencode/command/docs-builder/templates.md +29 -0
  30. package/packages/opencode/command/docs-builder.md +261 -58
  31. package/packages/opencode/command/friction/friction.js +2168 -0
  32. package/packages/opencode/command/friction.md +139 -0
  33. package/packages/opencode/command/remember.md +110 -0
  34. package/packages/opencode/opencode.jsonc +8 -0
  35. package/packages/subagentic-manual.md +33 -15
  36. package/packages/ampcode/README.md +0 -17
  37. package/packages/claude/README.md +0 -23
  38. package/packages/droid/README.md +0 -17
  39. 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 Droid sessions directory containing JSONL files.
17
+ - Example: `/friction ~/.factory/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 `.factory/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. `~/.factory/commands/friction/friction.js` (installed)
35
+ 2. `packages/droid/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 `.factory/friction/`**
87
+ - Create `.factory/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: `.factory/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 AGENTS.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 (`.factory/stash/*.md` + `.factory/friction/antigen_clusters.json`), extracts durable facts, episodes, and behavioral preferences into a single `.factory/memory/MEMORY.md`, then injects a managed memory section into `AGENTS.md`.
16
+
17
+ **Steps**
18
+
19
+ 1. **Gather sources**
20
+ - Read all `.factory/stash/*.md` files in the current project
21
+ - Check for friction output at `.factory/friction/antigen_clusters.json` (preferred) or `.factory/friction/antigen_review.md` (fallback)
22
+ - Read existing `.factory/memory/MEMORY.md` if it exists — create dir if missing
23
+ - Read processed manifest at `.factory/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 `.factory/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 `.factory/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 `.factory/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 AGENTS.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 `.factory/memory/MEMORY.md` — Claude loads the full file directly, so no inline duplication is needed
90
+ - If AGENTS.md already has MEMORY markers, replace the section between them
91
+ - If AGENTS.md has no MEMORY markers, append the section at the end
92
+ - If no AGENTS.md exists, create one with just the memory section
93
+
94
+ 6. **Update processed manifest**
95
+ - Append paths of newly processed stashes to `.factory/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 AGENTS.md updated
103
+
104
+ **File locations (all project-local)**
105
+ - Memory file: `.factory/memory/MEMORY.md` (single source of truth, referenced as @MEMORY.md)
106
+ - Stash files: `.factory/stash/*.md`
107
+ - Friction output: `.factory/friction/antigen_clusters.json` (clustered patterns with user contexts)
108
+ - Friction fallback: `.factory/friction/antigen_review.md` (human-readable clusters)
109
+ - Processed manifest: `.factory/memory/.processed`
110
+ - Output: `AGENTS.md` (managed MEMORY section with @MEMORY.md reference)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: context-builder
3
3
  description: Initialize or update project context documentation
4
- when_to_use: Use to initialize Claude Code context for new/existing projects, discover and organize documentation, create CLAUDE.md and KNOWLEDGE_BASE.md for optimal token-efficient memory
4
+ when_to_use: Use to initialize Droid context for new/existing projects, discover and organize documentation, create AGENTS.md and KNOWLEDGE_BASE.md for optimal token-efficient memory
5
5
  model: inherit
6
6
  tools: ["Read", "LS", "Grep", "Glob", "Create", "Edit", "MultiEdit", "ApplyPatch", "Execute", "WebSearch", "FetchUrl", "mcp"]
7
7
  ---
@@ -35,17 +35,17 @@ digraph ContextBuilder {
35
35
 
36
36
  // Scan phase
37
37
  scan [label="Scan existing docs\n& project type"];
38
- exists [label="CLAUDE.md\nexists?", shape=diamond];
38
+ exists [label="AGENTS.md\nexists?", shape=diamond];
39
39
 
40
40
  // Update path
41
- read_existing [label="Read existing\nCLAUDE.md"];
41
+ read_existing [label="Read existing\nAGENTS.md"];
42
42
  merge_update [label="Merge updates\npreserve structure"];
43
43
  update_tiers [label="Update Tier 2/3\nif needed"];
44
44
 
45
45
  // Create path
46
46
  create_t3 [label="Create Tier 3\ndocs/*.md"];
47
47
  create_t2 [label="Create Tier 2\nKNOWLEDGE_BASE.md"];
48
- create_t1 [label="Create Tier 1\nCLAUDE.md"];
48
+ create_t1 [label="Create Tier 1\nAGENTS.md"];
49
49
 
50
50
  // Validation
51
51
  validate [label="Validate limits\n& anti-patterns"];
@@ -85,21 +85,23 @@ digraph ContextBuilder {
85
85
 
86
86
  | Tier | File | Lines | Tokens | Purpose |
87
87
  |------|------|-------|--------|---------|
88
- | 1 | CLAUDE.md | < 95 | < 2,000 | Daily essentials, always loaded |
88
+ | 1 | AGENTS.md | < 95 | < 2,000 | Daily essentials, always loaded |
89
89
  | 2 | docs/KNOWLEDGE_BASE.md | < 100 | < 1,500 | TOC with 1-2 line summaries |
90
90
  | 3 | docs/*.md | Unlimited | Unlimited | Comprehensive details |
91
91
 
92
- **Flow:** CLAUDE.md → KNOWLEDGE_BASE.md → docs/*.md (progressive disclosure)
92
+ **Flow:** AGENTS.md → KNOWLEDGE_BASE.md → docs/*.md (progressive disclosure)
93
93
 
94
94
  **Rule:** Plain text paths only (no @ triggers) in Tier 1 and 2
95
95
 
96
+ **Permanent reference:** `@MEMORY.md` from `.factory/memory/MEMORY.md` — this is the only file allowed to use @ for direct loading. It contains project memory (facts, episodes, preferences) auto-generated by `/remember`. Always check for it during discovery. If it exists, include it as a source and ensure AGENTS.md references it.
97
+
96
98
  # Anti-Patterns
97
99
 
98
100
  | Don't | Why |
99
101
  |-------|-----|
100
102
  | @ triggers in markdown | Bloats context window |
101
103
  | Comprehensive content in KNOWLEDGE_BASE.md | It's a TOC, not a database |
102
- | Embedded agent/skill definitions | Don't duplicate ~/.claude/ |
104
+ | Embedded droid/command definitions | Don't duplicate ~/.factory/ |
103
105
  | ASCII trees (├─ └─) | Use arrows (→) or tables |
104
106
  | "How to" boilerplate | Remove instructional text |
105
107
 
@@ -114,10 +116,10 @@ Create detailed docs: `architecture.md`, `development.md`, `api-reference.md`, `
114
116
  ## 3. Tier 2: KNOWLEDGE_BASE.md (TOC)
115
117
  Format: `## Topic` + 1-2 sentence summary + `→ docs/file.md`
116
118
 
117
- ## 4. Tier 1: CLAUDE.md (Essentials)
119
+ ## 4. Tier 1: AGENTS.md (Essentials)
118
120
  Include: Project summary (2-3 sentences), Tech stack (list), Commands (essential only), Key patterns (top 3), Pointer to `docs/KNOWLEDGE_BASE.md`
119
121
 
120
- ## 5. Update Existing (when CLAUDE.md exists)
122
+ ## 5. Update Existing (when AGENTS.md exists)
121
123
  Read existing → Preserve structure → Merge new info → Update Tier 2/3 if needed → Validate limits
122
124
 
123
125
  ## 6. Validation
@@ -125,18 +127,18 @@ Check limits (see 3-Tier table), no @ triggers, no ASCII trees.
125
127
 
126
128
  # Content Placement
127
129
 
128
- | Content | CLAUDE.md | KNOWLEDGE_BASE.md | docs/*.md |
130
+ | Content | AGENTS.md | KNOWLEDGE_BASE.md | docs/*.md |
129
131
  |---------|-----------|-------------------|-----------|
130
- | Project summary | 2-3 sentences | | |
132
+ | Project summary | 2-3 sentences | - | - |
131
133
  | Tech stack | List only | 1-line summary | Full details |
132
134
  | Commands | Essential only | ❌ | All commands |
133
135
  | Architecture | ❌ | 1-2 line summary | Full design |
134
136
  | API/Troubleshooting | ❌ | 1-2 line summary | Full content |
135
137
 
136
- **Rule:** If used every session → CLAUDE.md. If need to know it exists → KNOWLEDGE_BASE.md. If need details → docs/*.md
138
+ **Rule:** If used every session → AGENTS.md. If need to know it exists → KNOWLEDGE_BASE.md. If need details → docs/*.md
137
139
 
138
140
  # Emergency Compression
139
141
 
140
142
  If over limits: Remove non-essentials, compress to 1 sentence, use tables, combine topics. For docs/*.md >500 lines: split by topic.
141
143
 
142
- You create lightweight indexes (Tier 1-2) that point to comprehensive docs (Tier 3). Never bloat CLAUDE.md or KNOWLEDGE_BASE.md.
144
+ You create lightweight indexes (Tier 1-2) that point to comprehensive docs (Tier 3). Never bloat AGENTS.md or KNOWLEDGE_BASE.md.
@@ -22,7 +22,7 @@ These subagents are available when using Claude Code CLI. Opencode can reference
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
- ## Opencode Commands (20 total)
25
+ ## Opencode 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. Opencode can reference
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 | - |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: context-builder
3
3
  description: Initialize or update project context documentation
4
- when_to_use: Use to initialize Claude Code context for new/existing projects, discover and organize documentation, create CLAUDE.md and KNOWLEDGE_BASE.md for optimal token-efficient memory
4
+ when_to_use: Use to initialize OpenCode context for new/existing projects, discover and organize documentation, create AGENTS.md and KNOWLEDGE_BASE.md for optimal token-efficient memory
5
5
  mode: subagent
6
6
  temperature: 0.2
7
7
  tools:
@@ -39,17 +39,17 @@ digraph ContextBuilder {
39
39
 
40
40
  // Scan phase
41
41
  scan [label="Scan existing docs\n& project type"];
42
- exists [label="CLAUDE.md\nexists?", shape=diamond];
42
+ exists [label="AGENTS.md\nexists?", shape=diamond];
43
43
 
44
44
  // Update path
45
- read_existing [label="Read existing\nCLAUDE.md"];
45
+ read_existing [label="Read existing\nAGENTS.md"];
46
46
  merge_update [label="Merge updates\npreserve structure"];
47
47
  update_tiers [label="Update Tier 2/3\nif needed"];
48
48
 
49
49
  // Create path
50
50
  create_t3 [label="Create Tier 3\ndocs/*.md"];
51
51
  create_t2 [label="Create Tier 2\nKNOWLEDGE_BASE.md"];
52
- create_t1 [label="Create Tier 1\nCLAUDE.md"];
52
+ create_t1 [label="Create Tier 1\nAGENTS.md"];
53
53
 
54
54
  // Validation
55
55
  validate [label="Validate limits\n& anti-patterns"];
@@ -89,21 +89,23 @@ digraph ContextBuilder {
89
89
 
90
90
  | Tier | File | Lines | Tokens | Purpose |
91
91
  |------|------|-------|--------|---------|
92
- | 1 | CLAUDE.md | < 95 | < 2,000 | Daily essentials, always loaded |
92
+ | 1 | AGENTS.md | < 95 | < 2,000 | Daily essentials, always loaded |
93
93
  | 2 | docs/KNOWLEDGE_BASE.md | < 100 | < 1,500 | TOC with 1-2 line summaries |
94
94
  | 3 | docs/*.md | Unlimited | Unlimited | Comprehensive details |
95
95
 
96
- **Flow:** CLAUDE.md → KNOWLEDGE_BASE.md → docs/*.md (progressive disclosure)
96
+ **Flow:** AGENTS.md → KNOWLEDGE_BASE.md → docs/*.md (progressive disclosure)
97
97
 
98
98
  **Rule:** Plain text paths only (no @ triggers) in Tier 1 and 2
99
99
 
100
+ **Permanent reference:** `@MEMORY.md` from `.opencode/memory/MEMORY.md` — this is the only file allowed to use @ for direct loading. It contains project memory (facts, episodes, preferences) auto-generated by `/remember`. Always check for it during discovery. If it exists, include it as a source and ensure AGENTS.md references it.
101
+
100
102
  # Anti-Patterns
101
103
 
102
104
  | Don't | Why |
103
105
  |-------|-----|
104
106
  | @ triggers in markdown | Bloats context window |
105
107
  | Comprehensive content in KNOWLEDGE_BASE.md | It's a TOC, not a database |
106
- | Embedded agent/skill definitions | Don't duplicate ~/.claude/ |
108
+ | Embedded agent/command definitions | Don't duplicate ~/.config/opencode/ |
107
109
  | ASCII trees (├─ └─) | Use arrows (→) or tables |
108
110
  | "How to" boilerplate | Remove instructional text |
109
111
 
@@ -118,10 +120,10 @@ Create detailed docs: `architecture.md`, `development.md`, `api-reference.md`, `
118
120
  ## 3. Tier 2: KNOWLEDGE_BASE.md (TOC)
119
121
  Format: `## Topic` + 1-2 sentence summary + `→ docs/file.md`
120
122
 
121
- ## 4. Tier 1: CLAUDE.md (Essentials)
123
+ ## 4. Tier 1: AGENTS.md (Essentials)
122
124
  Include: Project summary (2-3 sentences), Tech stack (list), Commands (essential only), Key patterns (top 3), Pointer to `docs/KNOWLEDGE_BASE.md`
123
125
 
124
- ## 5. Update Existing (when CLAUDE.md exists)
126
+ ## 5. Update Existing (when AGENTS.md exists)
125
127
  Read existing → Preserve structure → Merge new info → Update Tier 2/3 if needed → Validate limits
126
128
 
127
129
  ## 6. Validation
@@ -129,7 +131,7 @@ Check limits (see 3-Tier table), no @ triggers, no ASCII trees.
129
131
 
130
132
  # Content Placement
131
133
 
132
- | Content | CLAUDE.md | KNOWLEDGE_BASE.md | docs/*.md |
134
+ | Content | AGENTS.md | KNOWLEDGE_BASE.md | docs/*.md |
133
135
  |---------|-----------|-------------------|-----------|
134
136
  | Project summary | 2-3 sentences | ❌ | ❌ |
135
137
  | Tech stack | List only | 1-line summary | Full details |
@@ -137,10 +139,10 @@ Check limits (see 3-Tier table), no @ triggers, no ASCII trees.
137
139
  | Architecture | ❌ | 1-2 line summary | Full design |
138
140
  | API/Troubleshooting | ❌ | 1-2 line summary | Full content |
139
141
 
140
- **Rule:** If used every session → CLAUDE.md. If need to know it exists → KNOWLEDGE_BASE.md. If need details → docs/*.md
142
+ **Rule:** If used every session → AGENTS.md. If need to know it exists → KNOWLEDGE_BASE.md. If need details → docs/*.md
141
143
 
142
144
  # Emergency Compression
143
145
 
144
146
  If over limits: Remove non-essentials, compress to 1 sentence, use tables, combine topics. For docs/*.md >500 lines: split by topic.
145
147
 
146
- You create lightweight indexes (Tier 1-2) that point to comprehensive docs (Tier 3). Never bloat CLAUDE.md or KNOWLEDGE_BASE.md.
148
+ You create lightweight indexes (Tier 1-2) that point to comprehensive docs (Tier 3). Never bloat AGENTS.md or KNOWLEDGE_BASE.md.
@@ -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