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
@@ -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 Amp context for new/existing projects, discover and organize documentation, create AGENT.md and KNOWLEDGE_BASE.md for optimal token-efficient memory
5
5
  model: inherit
6
6
  color: purple
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="AGENT.md\nexists?", shape=diamond];
39
39
 
40
40
  // Update path
41
- read_existing [label="Read existing\nCLAUDE.md"];
41
+ read_existing [label="Read existing\nAGENT.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\nAGENT.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 | AGENT.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:** AGENT.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 `.amp/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 AGENT.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 agent/command definitions | Don't duplicate ~/.config/amp/ |
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: AGENT.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 AGENT.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,7 +127,7 @@ 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 | AGENT.md | KNOWLEDGE_BASE.md | docs/*.md |
129
131
  |---------|-----------|-------------------|-----------|
130
132
  | Project summary | 2-3 sentences | ❌ | ❌ |
131
133
  | Tech stack | List only | 1-line summary | Full details |
@@ -133,10 +135,10 @@ Check limits (see 3-Tier table), no @ triggers, no ASCII trees.
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 → AGENT.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 AGENT.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
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: docs-builder
3
- description: Create comprehensive project documentation with structured /docs hierarchy
3
+ description: Create or reorganize project documentation with structured /docs hierarchy
4
4
  usage: /docs-builder
5
5
  auto_trigger: false
6
6
  ---
7
7
 
8
8
  # Documentation Architecture Skill
9
9
 
10
- Create systematic /docs structure following this 5-tier hierarchy:
10
+ Create or reorganize `/docs` following a 5-tier hierarchy:
11
11
 
12
12
  ```
13
13
  /docs
@@ -16,91 +16,294 @@ Create systematic /docs structure following this 5-tier hierarchy:
16
16
  ├── 02-features/ # HOW features are designed & built
17
17
  ├── 03-logs/ # MEMORY (what changed over time)
18
18
  ├── 04-process/ # HOW to work with this system
19
+ ├── archive/ # Old/unclear docs preserved here
19
20
  └── README.md # Navigation guide
20
21
  ```
21
22
 
22
- ## Workflow
23
+ ---
24
+
25
+ ## Step 1: Detect Mode
26
+
27
+ Check if `/docs` exists and has content:
28
+
29
+ ```bash
30
+ find docs -name "*.md" 2>/dev/null | wc -l
31
+ ```
32
+
33
+ - **0 files** → **Fresh Mode** (skip to Step 3)
34
+ - **1+ files** → **Existing Mode** (continue to Step 2)
35
+
36
+ ---
37
+
38
+ ## Step 2: Existing Mode - Analyze First
39
+
40
+ ### 2.1 Inventory
41
+
42
+ List all markdown files:
43
+ ```bash
44
+ find docs -name "*.md" -exec wc -l {} \; | sort -n
45
+ ```
46
+
47
+ ### 2.2 Read and Categorize
48
+
49
+ **For each file**, read first 50-100 lines and categorize:
50
+
51
+ | Category | Criteria | Action |
52
+ |----------|----------|--------|
53
+ | **KEEP** | Evergreen guides, references, architecture, troubleshooting | Move to appropriate tier |
54
+ | **CONSOLIDATE** | Duplicate/overlapping content | Merge into one, originals to archive |
55
+ | **ARCHIVE** | Work logs, status reports, old phase docs, unclear purpose | Move to `/docs/archive/` |
56
+
57
+ ### 2.3 Categorization Heuristics
58
+
59
+ **Likely KEEP/MOVE:**
60
+ - Filename contains: GUIDE, REFERENCE, HOWTO, ARCHITECTURE, COMMANDS, TROUBLESHOOTING, QUICKSTART
61
+ - Content: Has TOC, structured sections, explains "how to" or "what is"
62
+ - Purpose: Teaches something reusable
63
+
64
+ **Likely ARCHIVE:**
65
+ - Filename contains: REPORT, STATUS, SUMMARY, FIX_, PHASE_, SPRINT_, _LOG, DRAFT, WIP, OLD, TEMP
66
+ - Filename has dates: 2024-01-15-meeting.md
67
+ - Located in: archive/, old/, reports/, fixes/, phases/
68
+ - Content: Dated entries, task IDs, one-time status updates
69
+ - Under ~20 lines and looks like placeholder
70
+
71
+ **When uncertain → ARCHIVE** (can always recover later)
72
+
73
+ ### 2.4 Present Plan to User
23
74
 
24
- ### 1. Discover Project
25
- - Scan: README, existing /docs, package.json/pyproject.toml, src/, tests/
26
- - Map existing docs: commands/ → where? development/ → where?
27
- - Ask: "What's built? What's planned? What's missing?"
75
+ Before making changes, show categorization:
76
+
77
+ ```
78
+ KEEP Move to new structure (X files):
79
+ - guides/COMMANDS.md → 02-features/cli/COMMANDS.md
80
+ - reference/CONFIG.md → 04-process/reference/CONFIG.md
81
+ ...
82
+
83
+ CONSOLIDATE (X groups):
84
+ - architecture.md + ARCHITECTURE.md → 00-context/system-state.md
85
+ ...
86
+
87
+ ARCHIVE (X files):
88
+ - PHASE1_STATUS.md
89
+ - FIX_SUMMARY_2024.md
90
+ - reports/old-metrics.md
91
+ ...
92
+ ```
93
+
94
+ **Wait for user approval before proceeding.**
95
+
96
+ ### 2.5 Execute Reorganization
97
+
98
+ 1. Create directory structure (including archive):
99
+ ```bash
100
+ mkdir -p docs/{00-context,01-product,02-features,03-logs,04-process,archive}
101
+ ```
102
+
103
+ 2. Move ARCHIVE files first:
104
+ ```bash
105
+ mv docs/old-file.md docs/archive/
106
+ ```
107
+
108
+ 3. Move KEEP files to appropriate tiers
109
+
110
+ 4. For CONSOLIDATE: read both files, merge content into new file, move originals to archive
111
+
112
+ 5. Remove empty old directories
113
+
114
+ ---
115
+
116
+ ## Step 3: Create Structure
117
+
118
+ ### 3.1 Create Directories
28
119
 
29
- ### 2. Create Directories
30
120
  ```bash
31
- mkdir -p docs/{00-context,01-product,02-features,03-logs,04-process}
121
+ mkdir -p docs/{00-context,01-product,02-features,03-logs,04-process,archive}
32
122
  ```
33
123
 
34
- ### 3. Create Files with TodoWrite
124
+ ### 3.2 Required Files
125
+
126
+ Create these files (see `docs-builder/templates.md` for content):
127
+
128
+ **00-context/** (4 files):
129
+ - [ ] `blueprint.md` - Overarching project artifact (see below)
130
+ - [ ] `vision.md` - Product purpose & boundaries
131
+ - [ ] `assumptions.md` - Constraints, risks, unknowns
132
+ - [ ] `system-state.md` - What's currently built
35
133
 
36
- Track progress:
37
- - [ ] 00-context (3 files: vision.md, assumptions.md, system-state.md)
38
- - [ ] 01-product (1 file: prd.md)
39
- - [ ] 02-features (per feature discovered: feature-spec.md, tech-design.md, dev-tasks.md, test-plan.md)
40
- - [ ] 03-logs (5 files: implementation-log.md, decisions-log.md, bug-log.md, validation-log.md, insights.md)
41
- - [ ] 04-process (3 files: dev-workflow.md, definition-of-done.md, llm-prompts.md)
42
- - [ ] docs/README.md
134
+ **01-product/** (1 file):
135
+ - [ ] `prd.md` - Product requirements
43
136
 
44
- Mark each **completed** before next.
137
+ **02-features/** (per feature):
138
+ - [ ] `feature-<name>/` subdirectories as needed
139
+ - [ ] Or flat files for simpler projects
45
140
 
46
- For detailed templates, see: `docs-builder/templates.md`
141
+ **03-logs/** (5 files):
142
+ - [ ] `implementation-log.md`
143
+ - [ ] `decisions-log.md`
144
+ - [ ] `bug-log.md`
145
+ - [ ] `validation-log.md`
146
+ - [ ] `insights.md`
47
147
 
48
- ### 4. Integrate with Existing Docs
148
+ **04-process/** (3+ files):
149
+ - [ ] `dev-workflow.md`
150
+ - [ ] `definition-of-done.md`
151
+ - [ ] `llm-prompts.md`
49
152
 
50
- **If CLAUDE.md/KNOWLEDGE_BASE.md exist**:
51
- Update KNOWLEDGE_BASE.md to reference new structure:
153
+ **Root:**
154
+ - [ ] `README.md` - Navigation guide
155
+
156
+ ---
157
+
158
+ ## Step 4: Populate Files
159
+
160
+ ### Content Sources
161
+
162
+ Pull content from:
163
+ - Project README.md
164
+ - Package files (package.json, pyproject.toml)
165
+ - Existing code comments/docstrings
166
+ - Existing docs being reorganized
167
+
168
+ ### For Existing Mode
169
+
170
+ When moving files:
171
+ - Update any internal links to match new locations
172
+ - Merge duplicate content thoughtfully
173
+ - Preserve useful information, don't just copy-paste
174
+
175
+ ---
176
+
177
+ ## Step 5: Integration
178
+
179
+ **If AGENT.md exists:**
180
+ Add or update documentation pointer:
52
181
  ```markdown
53
- ## Project Documentation
54
- Full /docs structure with context, product, features, logs, process
55
- → `docs/README.md`
182
+ ## Documentation
183
+ See `docs/README.md` for full documentation structure.
56
184
  ```
57
185
 
58
- **If existing /docs subdirs exist**:
59
- - Don't delete - add migration note in docs/README.md
60
- - Reference existing content where relevant
61
- - Note in system-state.md that migration in progress
186
+ **If KNOWLEDGE_BASE.md exists:**
187
+ Update to reference new structure with quick links.
62
188
 
63
- ### 5. Validate
189
+ ---
190
+
191
+ ## Step 6: Validate
64
192
 
65
193
  ```bash
66
- # Check structure
67
- ls -la docs/{00-context,01-product,02-features,03-logs,04-process}
194
+ # Check structure exists
195
+ ls -la docs/{00-context,01-product,02-features,03-logs,04-process,archive}
196
+
197
+ # Verify minimum files
198
+ test -f docs/00-context/blueprint.md && echo "✓ blueprint.md"
199
+ test -f docs/00-context/vision.md && echo "✓ vision.md"
200
+ test -f docs/00-context/system-state.md && echo "✓ system-state.md"
201
+ test -f docs/01-product/prd.md && echo "✓ prd.md"
202
+ test -f docs/README.md && echo "✓ README.md"
68
203
 
69
- # Count minimum files
70
- find docs/00-context -name "*.md" | wc -l # >= 3
204
+ # Count files per tier
205
+ find docs/00-context -name "*.md" | wc -l # >= 4
71
206
  find docs/03-logs -name "*.md" | wc -l # >= 5
72
207
  find docs/04-process -name "*.md" | wc -l # >= 3
73
- test -f docs/01-product/prd.md && echo "✓ PRD exists"
74
- test -f docs/README.md && echo "✓ README exists"
75
208
  ```
76
209
 
210
+ ---
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
+
77
261
  ## Rules
78
262
 
79
- **DO**:
80
- - Complete one section fully before next
81
- - Use TodoWrite to track progress
82
- - Populate files (don't leave empty templates)
83
- - Use discovered content from project
84
- - Create feature-<name>/ for each major feature found
85
- - Initialize all 5 log files with format
86
- - Mark todos completed immediately after finishing
87
-
88
- **DON'T**:
89
- - Skip sections
90
- - Create empty placeholders
91
- - Duplicate content across files
92
- - Delete existing docs
93
- - Forget to validate at end
263
+ **DO:**
264
+ - Read files before categorizing (don't guess from filename alone)
265
+ - Present plan to user before bulk changes
266
+ - Archive instead of delete
267
+ - Complete one section before moving to next
268
+ - Populate files with real content (not empty templates)
269
+ - Preserve original files in archive when consolidating
270
+
271
+ **DON'T:**
272
+ - Delete any files (archive instead)
273
+ - Move files without reading them first
274
+ - Make bulk changes without user approval
275
+ - Create empty placeholder files
276
+ - Skip the analysis phase for existing docs
277
+
278
+ ---
94
279
 
95
280
  ## Success Criteria
96
281
 
97
- All 5 tier directories created
98
- Minimum files in each (00-context: 3, 01-product: 1, 03-logs: 5, 04-process: 3)
282
+ Mode correctly detected (fresh vs existing)
283
+ For existing: categorization presented and approved
284
+ ✅ All 5 tier directories created (+ archive)
285
+ ✅ Minimum files in each tier
99
286
  ✅ Files populated with project-specific content
100
- Feature folders created for discovered features
101
- ✅ docs/README.md complete with navigation
102
- ✅ Integration with CLAUDE.md/KNOWLEDGE_BASE.md done
287
+ Archive contains old/unclear docs (not deleted)
288
+ ✅ docs/README.md with navigation
103
289
  ✅ Validation checks pass
104
- ✅ All todos marked completed
105
290
 
106
- Complete when /docs structure is fully populated and navigable.
291
+ ---
292
+
293
+ ## Quick Reference
294
+
295
+ ### Tier Mapping
296
+
297
+ | Old Location | New Location |
298
+ |--------------|--------------|
299
+ | guides/, howto/ | 02-features/ or 04-process/ |
300
+ | reference/, api/ | 04-process/reference/ |
301
+ | architecture/ | 00-context/ |
302
+ | commands/ | 02-features/cli/ |
303
+ | development/ | 04-process/development/ |
304
+ | troubleshooting/ | 04-process/troubleshooting/ |
305
+ | reports/, status/, phases/ | archive/ |
306
+
307
+ ### File Templates
308
+
309
+ See: `docs-builder/templates.md`