liteagents 2.4.7 → 2.5.1

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 (38) hide show
  1. package/README.md +24 -8
  2. package/docs/LONG_TERM_MEMORY.md +449 -0
  3. package/installer/cli.js +1 -1
  4. package/package.json +2 -2
  5. package/packages/ampcode/AGENT.md +3 -1
  6. package/packages/ampcode/agents/context-builder.md +14 -12
  7. package/packages/ampcode/commands/docs-builder/templates.md +29 -0
  8. package/packages/ampcode/commands/docs-builder.md +54 -3
  9. package/packages/ampcode/commands/friction/friction.js +2168 -0
  10. package/packages/ampcode/commands/friction.md +139 -0
  11. package/packages/ampcode/commands/remember.md +110 -0
  12. package/packages/claude/CLAUDE.md +3 -1
  13. package/packages/claude/agents/context-builder.md +7 -4
  14. package/packages/claude/commands/friction/friction.js +2168 -0
  15. package/packages/claude/commands/friction.md +139 -0
  16. package/packages/claude/commands/remember.md +110 -0
  17. package/packages/claude/skills/docs-builder/SKILL.md +53 -2
  18. package/packages/claude/skills/docs-builder/references/templates.md +29 -0
  19. package/packages/droid/AGENTS.md +3 -1
  20. package/packages/droid/commands/docs-builder/templates.md +29 -0
  21. package/packages/droid/commands/docs-builder.md +54 -3
  22. package/packages/droid/commands/friction/friction.js +2168 -0
  23. package/packages/droid/commands/friction.md +139 -0
  24. package/packages/droid/commands/remember.md +110 -0
  25. package/packages/droid/droids/context-builder.md +15 -13
  26. package/packages/opencode/AGENTS.md +3 -1
  27. package/packages/opencode/agent/context-builder.md +14 -12
  28. package/packages/opencode/command/docs-builder/templates.md +29 -0
  29. package/packages/opencode/command/docs-builder.md +54 -3
  30. package/packages/opencode/command/friction/friction.js +2168 -0
  31. package/packages/opencode/command/friction.md +139 -0
  32. package/packages/opencode/command/remember.md +110 -0
  33. package/packages/opencode/opencode.jsonc +8 -0
  34. package/packages/subagentic-manual.md +33 -15
  35. package/packages/ampcode/README.md +0 -17
  36. package/packages/claude/README.md +0 -23
  37. package/packages/droid/README.md +0 -17
  38. package/packages/opencode/README.md +0 -17
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  ╚══════╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝
10
10
  ```
11
11
 
12
- **AI development toolkit with 11 specialized agents and 20 commands per tool**
12
+ **AI development toolkit with 11 specialized agents and 22 commands per tool**
13
13
 
14
14
  [![npm version](https://img.shields.io/npm/v/liteagents)](https://www.npmjs.com/package/liteagents)
15
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -43,10 +43,10 @@ liteagents
43
43
 
44
44
  ### Supported Tools
45
45
 
46
- - **Claude Code** - 11 subagents + 10 skills + 10 commands
47
- - **Opencode** - 11 agent references + 20 commands
48
- - **Ampcode** - 11 subagents + 10 skills + 10 commands
49
- - **Droid** - 11 agent references + 20 commands
46
+ - **Claude Code** - 11 subagents + 10 skills + 12 commands
47
+ - **Opencode** - 11 agent references + 22 commands
48
+ - **Ampcode** - 11 subagents + 10 skills + 12 commands
49
+ - **Droid** - 11 agent references + 22 commands
50
50
 
51
51
  **Key Difference:**
52
52
  - **Claude Code**: Full subagent system with orchestrator + skills (auto-triggering)
@@ -88,14 +88,14 @@ liteagents
88
88
  - **system-architect** - System design, technology selection, API design, scalability planning
89
89
  - **ui-designer** - UI/UX design, wireframes, prototypes, accessibility, design systems
90
90
 
91
- ### 20 Commands/Skills
91
+ ### 22 Commands/Skills
92
92
 
93
93
  **Auto-Triggering Skills (3)** - Claude Code only:
94
94
  - **test-driven-development** - Write test first, watch fail, minimal passing code
95
95
  - **testing-anti-patterns** - Prevent mocking anti-patterns
96
96
  - **verification-before-completion** - Verify before claiming done
97
97
 
98
- **Manual Skills/Commands (17):**
98
+ **Manual Skills/Commands (19):**
99
99
  - **brainstorming** - Structured brainstorming sessions
100
100
  - **code-review** - Implementation review against requirements
101
101
  - **condition-based-waiting** - Replace timeouts with condition polling
@@ -105,15 +105,31 @@ liteagents
105
105
  - **systematic-debugging** - Four-phase debugging framework
106
106
  - **debug** - Systematic issue investigation
107
107
  - **explain** - Explain code for newcomers
108
+ - **friction** - Analyze session logs for failure patterns and behavioral signals
108
109
  - **git-commit** - Intelligent commit creation
109
110
  - **optimize** - Performance analysis
110
111
  - **refactor** - Safe refactoring with behavior preservation
112
+ - **remember** - Consolidate stashes + friction into project memory
111
113
  - **review** - Comprehensive code review
112
114
  - **security** - Vulnerability scanning
113
115
  - **ship** - Pre-deployment checklist
114
116
  - **stash** - Save session context for compaction recovery or handoffs
115
117
  - **test-generate** - Generate test suites
116
118
 
119
+ ### Hot Memory (3-step pipeline)
120
+
121
+ Lightweight session memory that learns from your usage patterns.
122
+
123
+ ```
124
+ /stash → /friction → /remember
125
+ ```
126
+
127
+ 1. **`/stash`** - Snapshot current session context to `.claude/stash/`. Use before compaction, handoffs, or ending complex work.
128
+ 2. **`/friction`** - Analyze session logs for failure patterns. Scores sessions, clusters failures, outputs actionable antigens.
129
+ 3. **`/remember`** - Consolidate stashes + friction into `.claude/memory/MEMORY.md`. Extracts facts, episodes, and behavioral preferences. Injects into CLAUDE.md via `@MEMORY.md`.
130
+
131
+ **Result:** Project-local memory that accumulates across sessions — no external dependencies, no databases, just markdown.
132
+
117
133
  ---
118
134
 
119
135
  ## 📖 Documentation
@@ -158,7 +174,7 @@ liteagents
158
174
  ## 📊 Stats
159
175
 
160
176
  - **11** Specialized Agents
161
- - **20** Workflow Commands & Skills
177
+ - **22** Workflow Commands & Skills
162
178
  - **4** Supported Tools (Claude, Opencode, Ampcode, Droid)
163
179
  - **MIT** License
164
180
 
@@ -0,0 +1,449 @@
1
+ # Long-Term Memory Architecture
2
+
3
+ **Status:** IMPLEMENTING
4
+ **Updated:** 2026-02-11
5
+
6
+ ---
7
+
8
+ ## Problem
9
+
10
+ AI dev agents forget everything between sessions. Current mitigations (CLAUDE.md, .aurora/config) are manually maintained and project-scoped. Cross-project preferences, past decisions, and learned lessons are lost unless the user re-states them.
11
+
12
+ ## Design Principles
13
+
14
+ 1. **Three independent actions** — `/stash`, `/friction`, `/remember` — no coupling
15
+ 2. **All project-local** — memory lives in `.claude/`, travels with the project
16
+ 3. **No session-end hook** — there is no reliable session boundary
17
+ 4. **No per-turn extraction** — 90% of dev turns are mechanical noise
18
+ 5. **Curation > retrieval** — store less, store better, load everything
19
+ 6. **No vector store** — the curated set is small enough to load as a preamble
20
+ 7. **Portable** — plain markdown files, works with any agent
21
+ 8. **JS runtime** — friction script in Node.js (guaranteed available with Claude Code)
22
+ 9. **Single file** — one MEMORY.md with sections, not multiple files
23
+
24
+ ## Architecture
25
+
26
+ ```
27
+ ACTIONS (independent) STORAGE (project-local) RETRIEVAL
28
+ ───────────────────── ──────────────────────── ─────────
29
+
30
+ /stash .claude/stash/*.md
31
+ (capture session, (raw material,
32
+ unchanged from today) accumulates)
33
+
34
+ /friction <path> │
35
+ (analyze behavior, .claude/friction/
36
+ JS script, produces antigen_review.md
37
+ antigen_review) │
38
+
39
+ /remember ────────────────────────────┤
40
+ (consolidate all sources) │
41
+
42
+ .claude/memory/
43
+ MEMORY.md ──→ CLAUDE.md
44
+ (## Facts (@MEMORY.md ref +
45
+ ## Episodes MEMORY:START/END
46
+ ## Preferences) markers)
47
+ ```
48
+
49
+ ### Key Separation
50
+
51
+ | Action | Job | Weight | Frequency |
52
+ |---|---|---|---|
53
+ | `/stash` | Capture session context | Light (haiku, one file) | Multiple times/day |
54
+ | `/friction` | Analyze behavioral signals | Medium (JS script) | Every 1-2 weeks |
55
+ | `/remember` | Consolidate → MEMORY.md → CLAUDE.md | Heavy (reads all, multiple LLM calls) | Weekly or on-demand |
56
+
57
+ Each action is independent. `/stash` and `/friction` produce raw material. `/remember` consumes it.
58
+
59
+ ---
60
+
61
+ ## Decisions Made
62
+
63
+ | Decision | Choice | Rationale |
64
+ |---|---|---|
65
+ | Storage format | Single MEMORY.md with 3 sections | Simpler than 3 files, one source of truth |
66
+ | CLAUDE.md loading | @MEMORY.md reference + injected content | Direct loading via @ ref, content between MEMORY:START/END markers |
67
+ | @ exception | @MEMORY.md is the ONLY allowed @ reference | All other file refs remain plain text paths |
68
+ | Friction JS | Single file, embedded config, no deps | Lightweight, vanilla Node.js, portable |
69
+ | Friction JS location | `packages/claude/commands/friction/friction.js` (dev), `.claude/commands/friction/friction.js` (installed) | Package-first development |
70
+ | Principles | Static section in CLAUDE.md, manually maintained | Not auto-managed — stable, rarely changes |
71
+ | Blueprint | New artifact in docs-builder at `docs/00-context/blueprint.md` | Overarching project doc, created by /docs-builder |
72
+
73
+ ---
74
+
75
+ ## User Types
76
+
77
+ Two paths to the same memory system:
78
+
79
+ | | Liteagents user | Aurora user |
80
+ |---|---|---|
81
+ | Capture sessions | `/stash` (skill/command) | `/stash` (same) |
82
+ | Analyze behavior | `/friction` (command, runs `friction.js`) | `aur friction` (CLI, runs `friction.py`) |
83
+ | Consolidate memory | `/remember` (command) | `/remember` (same) |
84
+ | Friction output | `.claude/friction/` | `.aurora/friction/` (legacy) or `.claude/friction/` |
85
+
86
+ Both produce the same output format. `/remember` checks both locations.
87
+
88
+ ### Friction Script: JS vs Python
89
+
90
+ | | `friction.js` (liteagents) | `friction.py` (aurora) |
91
+ |---|---|---|
92
+ | Runtime | Node.js (guaranteed with Claude Code) | Python (may not be installed) |
93
+ | Invoked by | `/friction` command | `aur friction` CLI |
94
+ | Location | `packages/claude/commands/friction/friction.js` | `scripts/friction.py` |
95
+ | Output format | Same: `.claude/friction/` | Same: `.aurora/friction/` |
96
+ | Logic | Same 14 signals, same weights, same scoring | Original implementation |
97
+ | Structure | Single file, embedded config | 3 files (friction.py + friction_analyze.py + antigen_extract.py) |
98
+
99
+ ---
100
+
101
+ ## Actions
102
+
103
+ ### /stash — Capture session (unchanged)
104
+
105
+ What it does today. No changes needed.
106
+
107
+ ```
108
+ 1. User runs /stash at natural breakpoints
109
+ 2. Haiku summarizes session context
110
+ 3. Writes .claude/stash/<name>.md
111
+ 4. Done. No extraction, no consolidation.
112
+ ```
113
+
114
+ Stash files accumulate as raw material for `/remember`.
115
+
116
+ ### /friction — Analyze behavior
117
+
118
+ Runs friction analysis via Node.js script. Takes session path as required argument.
119
+
120
+ ```
121
+ 1. User runs /friction <sessions-path>
122
+ e.g. /friction ~/.claude/projects/-home-hamr-PycharmProjects-aurora/
123
+
124
+ 2. Looks for friction.js:
125
+ - packages/claude/commands/friction/friction.js (development)
126
+ - .claude/commands/friction/friction.js (installed)
127
+ - Falls back to manual analysis if neither found
128
+
129
+ 3. Script analyzes Claude session JSONL files:
130
+ - Reads session files from <path>
131
+ - Detects 14 signal types (same as friction.py)
132
+ - Scores sessions, identifies BAD/FRICTION/ROUGH/OK
133
+ - Extracts antigen candidates from BAD sessions
134
+
135
+ 4. Output writes to .claude/friction/ (project-local):
136
+ - friction_analysis.json per-session breakdown
137
+ - friction_summary.json aggregate stats + verdict
138
+ - friction_raw.jsonl raw signals
139
+ - antigen_candidates.json extracted patterns
140
+ - antigen_review.md human-readable review
141
+
142
+ 5. Done. No memory consolidation yet.
143
+ ```
144
+
145
+ ### /remember — Consolidate into MEMORY.md and CLAUDE.md
146
+
147
+ Reads all sources, extracts what matters, writes single MEMORY.md, injects into CLAUDE.md.
148
+
149
+ ```
150
+ /remember pseudocode:
151
+
152
+ # 1. Gather sources
153
+ stashes = glob(".claude/stash/*.md")
154
+
155
+ friction = find_first([
156
+ ".claude/friction/antigen_review.md", # liteagents output
157
+ ".aurora/friction/antigen_review.md" # aurora output (legacy)
158
+ ])
159
+
160
+ existing_memory = read(".claude/memory/MEMORY.md") # parse 3 sections
161
+ processed = read(".claude/memory/.processed")
162
+
163
+ # 2. Extract facts + episodes from unprocessed stashes
164
+ unprocessed = filter(stashes, not_in=processed)
165
+
166
+ for stash in unprocessed:
167
+ extraction = haiku.call(
168
+ system = """Extract from this session stash:
169
+
170
+ FACTS (atomic, one-line):
171
+ - Stable preferences (tools, languages, style)
172
+ - Decisions made ("chose X over Y because Z")
173
+ - Corrections ("no, I meant...", "don't do that")
174
+ - Explicit "remember this"
175
+
176
+ EPISODE (3-5 bullet narrative):
177
+ - What was the problem/goal?
178
+ - What approaches were tried?
179
+ - What was the outcome and lesson?
180
+
181
+ SKIP: code details, file paths, errors, mechanical steps,
182
+ LLM responses, one-off details""",
183
+ content = stash.content
184
+ )
185
+
186
+ new_facts += extraction.facts
187
+ new_episodes += extraction.episode
188
+
189
+ # 3. Merge facts (deduplicate)
190
+ facts = haiku.call(
191
+ system = """Merge new facts with existing. Rules:
192
+ - New updates replace old, contradictions keep new
193
+ - Duplicates dropped, keep atomic one-line each""",
194
+ existing = existing_memory.facts,
195
+ new = new_facts
196
+ )
197
+
198
+ # 4. Append episodes (no dedup, append-only)
199
+ episodes = existing_memory.episodes + new_episodes
200
+
201
+ # 5. Distill friction into preferences (if output exists)
202
+ if friction.exists:
203
+ preferences = haiku.call(
204
+ system = """Extract BEHAVIORAL preferences (demonstrated, not stated).
205
+ High Confidence: 5+ observations (loaded into CLAUDE.md)
206
+ Medium Confidence: 3+ observations (observing)
207
+ Low Confidence: <3 observations (needs more data)
208
+ Promote/demote based on new evidence.""",
209
+ friction_review = friction.content,
210
+ existing_prefs = existing_memory.preferences
211
+ )
212
+
213
+ # 6. Write single MEMORY.md
214
+ write(".claude/memory/MEMORY.md", format(facts, episodes, preferences))
215
+
216
+ # 7. Inject into CLAUDE.md between MEMORY:START/END markers
217
+ # Include @MEMORY.md reference for direct loading
218
+ update_section("CLAUDE.md", "MEMORY:START", "MEMORY:END", {
219
+ facts: all,
220
+ preferences: high_confidence_only,
221
+ episodes: last_5
222
+ })
223
+
224
+ # 8. Mark stashes as processed
225
+ append(".claude/memory/.processed", [s.path for s in unprocessed])
226
+ ```
227
+
228
+ ---
229
+
230
+ ## MEMORY.md — Single Source of Truth
231
+
232
+ One file with three sections. Auto-generated by `/remember`. Do not edit manually.
233
+
234
+ ```markdown
235
+ # Project Memory
236
+ > Auto-generated by /remember. Do not edit manually.
237
+
238
+ ## Facts
239
+ - timezone: EST
240
+ - python projects: always use hatchling
241
+ - commit style: conventional commits, no co-author line
242
+ - preferred test runner: pytest with -x flag
243
+ - switched from setuptools to hatchling for cli package (2026-01)
244
+
245
+ ## Episodes
246
+ ### 2026-02-03 aurora/lsp-hook
247
+ - tried text fallback when LSP cold — caused noise from keyword extraction
248
+ - root cause: symbol extraction from arbitrary lines picks up keywords not symbols
249
+ - solution: only show count+risk when LSP works, text fallback only for 0 refs
250
+ - lesson: don't mix search strategies in same code path
251
+
252
+ ### 2026-01-28 aurora/friction-pipeline
253
+ - explored 3 approaches to friction scoring: flat weights, decay, tier-based
254
+ - picked tier-based because it maps to confidence levels naturally
255
+ - key insight: gold signals (user_intervention) are 95% predictive alone
256
+
257
+ ## Preferences
258
+ ### High Confidence
259
+ - never add docstrings unless asked (rejected 12/15 times)
260
+ - prefer editing existing files over creating new (rejected new file 8/10)
261
+ - keep commit messages short, one line (rewrote 4/7 verbose ones)
262
+
263
+ ### Medium Confidence
264
+ - may prefer tabs over spaces (2 observations)
265
+
266
+ ### Low Confidence
267
+ - possible preference for click over argparse (1 observation)
268
+ ```
269
+
270
+ **Promotion:** low → medium at 3 obs, medium → high at 5+ obs
271
+
272
+ ---
273
+
274
+ ## Retrieval: CLAUDE.md + @MEMORY.md
275
+
276
+ Memory is loaded two ways:
277
+ 1. **@MEMORY.md** — direct file reference in CLAUDE.md, points to `.claude/memory/MEMORY.md`
278
+ 2. **MEMORY:START/END markers** — injected summary (facts + high-confidence prefs + last 5 episodes)
279
+
280
+ This is the ONLY file that uses the @ reference pattern. All other file references remain plain text paths.
281
+
282
+ ### What Gets Loaded
283
+
284
+ ```markdown
285
+ <!-- MEMORY:START -->
286
+ # Project Memory (auto-generated by /remember)
287
+ @MEMORY.md
288
+
289
+ ## Facts
290
+ - timezone: EST
291
+ - python: hatchling, pytest -x, make
292
+ - commit: conventional, no co-author
293
+
294
+ ## Preferences
295
+ - never add docstrings unless asked
296
+ - prefer editing existing files over creating new
297
+ - keep commit messages short
298
+
299
+ ## Recent Episodes
300
+ ### 2026-02-03 aurora/lsp-hook
301
+ - tried text fallback when LSP cold — noise
302
+ - lesson: don't mix search strategies
303
+ <!-- MEMORY:END -->
304
+ ```
305
+
306
+ ### Why This Works
307
+
308
+ - **MEMORY.md** — single file, ~100-200 lines, all sections
309
+ - **CLAUDE.md injection** — summary only (facts + high prefs + last 5 episodes), ~100-150 lines
310
+ - **@MEMORY.md** — full file available for deep context when needed
311
+
312
+ ---
313
+
314
+ ## Why Not Per-Turn Extraction?
315
+
316
+ Dev sessions are different from chatbots:
317
+ - "Edit line 42 of foo.py" — not memorable
318
+ - "Run pytest" — not memorable
319
+ - 90%+ of turns are mechanical tool invocations
320
+
321
+ Per-turn extraction burns an LLM call per turn to store nothing.
322
+
323
+ ## Why Not Session-End Hooks?
324
+
325
+ There is no reliable "session end" event in Claude Code:
326
+ - `/clear` — new session, no hook fires
327
+ - Close terminal — process killed, no hook
328
+ - Idle for hours — no timeout event
329
+
330
+ The only reliable triggers are explicit: `/stash`, `/friction`, `/remember`.
331
+
332
+ ## Why Not Global Memory?
333
+
334
+ - Project-local memory moves with the project (git, clone, share)
335
+ - Cross-project preferences are rare (~15 lines) and stable
336
+ - Cross-project preferences belong in `~/.claude/MEMORY.md` (manually maintained, tiny)
337
+ - Project-specific context is 90% of what matters
338
+
339
+ ---
340
+
341
+ ## Workflow
342
+
343
+ ```
344
+ Day-to-day:
345
+ /stash, /stash, /stash accumulate raw material
346
+ (natural breakpoints: feature done, bug solved, decision made)
347
+
348
+ Every 1-2 weeks:
349
+ /friction <sessions-path> analyze behavioral patterns
350
+ (or: aur friction for aurora users)
351
+
352
+ When ready:
353
+ /remember consolidate → MEMORY.md → CLAUDE.md
354
+ (reads stashes + friction, extracts, dedupes, writes MEMORY.md, injects into CLAUDE.md)
355
+ ```
356
+
357
+ Three independent actions. No dependencies between them. One output file.
358
+
359
+ ---
360
+
361
+ ## File Locations
362
+
363
+ ```
364
+ .claude/ # All project-local
365
+ stash/ # Raw session captures
366
+ lsp-poc-complete.md
367
+ headless-removal.md
368
+ friction/ # Friction analysis output
369
+ friction_analysis.json
370
+ friction_summary.json
371
+ friction_raw.jsonl
372
+ antigen_candidates.json
373
+ antigen_review.md
374
+ memory/ # Consolidated memory
375
+ MEMORY.md # Single source of truth (referenced as @MEMORY.md)
376
+ .processed # Manifest of processed stashes
377
+
378
+ packages/claude/
379
+ commands/
380
+ remember.md # /remember command
381
+ friction.md # /friction command
382
+ scripts/
383
+ friction.js # Friction analysis script (Node.js)
384
+
385
+ CLAUDE.md # Project preamble (has MEMORY section with @MEMORY.md ref)
386
+ ```
387
+
388
+ ---
389
+
390
+ ## Friction Script: JS Port
391
+
392
+ Single `friction.js` file — Node.js port of the existing Python pipeline (~2000 lines across `friction_analyze.py` + `antigen_extract.py`).
393
+
394
+ ### Why JS
395
+
396
+ - Node.js is guaranteed available (Claude Code requires it)
397
+ - Python is NOT guaranteed (Windows, minimal Linux)
398
+ - The script uses only: file I/O, regex, JSON, string matching
399
+ - No ML, no heavy deps — trivial port to Node stdlib
400
+
401
+ ### What It Does
402
+
403
+ ```
404
+ Input: Session JSONL files from <sessions-path>
405
+ Output: .claude/friction/ (analysis, summary, raw signals, antigens, review)
406
+
407
+ 1. Read session JSONL files (fs.readFileSync)
408
+ 2. Extract 14 signal types per turn (regex, string match)
409
+ 3. Score sessions (weighted accumulation, same config)
410
+ 4. Classify quality (BAD/FRICTION/ROUGH/OK)
411
+ 5. Aggregate stats (daily trends, best/worst)
412
+ 6. Extract antigen candidates from BAD sessions
413
+ 7. Write all output files
414
+ ```
415
+
416
+ ### Signals (same as Python, same weights)
417
+
418
+ | Signal | Weight | Detection |
419
+ |---|---|---|
420
+ | `user_intervention` | 10 | `/stash` in user message |
421
+ | `session_abandoned` | 10 | High friction at end, no resolution |
422
+ | `false_success` | 8 | LLM claimed success but tool failed |
423
+ | `no_resolution` | 8 | Errors without subsequent success |
424
+ | `tool_loop` | 6 | Same tool called 3+ times identically |
425
+ | `rapid_exit` | 6 | <3 turns, ends with error |
426
+ | `interrupt_cascade` | 5 | Multiple ESC/Ctrl+C within 60s |
427
+ | `user_curse` | 5 | Profanity detected |
428
+ | `request_interrupted` | 2.5 | User hit ESC/Ctrl+C |
429
+ | `exit_error` | 1 | Command failed (non-zero exit) |
430
+ | `repeated_question` | 1 | Same question asked twice |
431
+ | `long_silence` | 0.5 | >10 min gap |
432
+ | `user_negation` | 0.5 | "no", "didn't work" |
433
+ | `compaction` | 0.5 | Context overflow |
434
+
435
+ ---
436
+
437
+ ## Open Questions (Remaining)
438
+
439
+ 1. **Episode pruning** — last N entries? Age-based? Or keep all and only load recent 5 into CLAUDE.md?
440
+ 2. **CLAUDE.md section size** — if memory grows beyond ~150 lines, should `/remember` compress older facts?
441
+ 3. **Stash gitignore** — should `.claude/stash/` and `.claude/memory/` be git-tracked or gitignored?
442
+
443
+ ---
444
+
445
+ ## Related
446
+
447
+ - [FRICTION_DETECTION.md](../FRICTION_DETECTION.md) — friction pipeline (Python version, aurora users)
448
+ - [MEM_INDEXING.md](MEM_INDEXING.md) — code memory indexing (separate system)
449
+ - [ACTR_ACTIVATION.md](ACTR_ACTIVATION.md) — activation scoring (could inform episode relevance)
package/installer/cli.js CHANGED
@@ -456,7 +456,7 @@ ${colors.bright}${colors.cyan}██╔══██║██║ ██║█
456
456
  ${colors.bright}${colors.cyan}██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ██║╚██████╗ ██║ ██╗██║ ██║${colors.reset}
457
457
  ${colors.bright}${colors.cyan}╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝${colors.reset}
458
458
 
459
- ${colors.bright}v2.4.0 | 11 agents + 20 commands per tool${colors.reset}
459
+ ${colors.bright}v2.5.0 | 11 agents + 22 commands per tool${colors.reset}
460
460
  `);
461
461
  }
462
462
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "liteagents",
3
- "version": "2.4.7",
4
- "description": "AI development toolkit with 11 specialized agents and 20 commands. Simple one-question installer for Claude, Opencode, Ampcode, and Droid.",
3
+ "version": "2.5.1",
4
+ "description": "AI development toolkit with 11 specialized agents and 22 commands. Simple one-question installer for Claude, Opencode, Ampcode, and Droid.",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "liteagents": "./installer/cli.js",
@@ -37,15 +37,17 @@ These subagents are available when using Ampcode CLI.
37
37
  | testing-anti-patterns | Prevents testing mock behavior and production pollution with test-only methods | /testing-anti-patterns <testing-scenario> | true |
38
38
  | verification-before-completion | Requires running verification commands before making any success claims | /verification-before-completion <work-to-verify> | true |
39
39
 
40
- ### Commands (10 total)
40
+ ### Commands (12 total)
41
41
 
42
42
  | ID | Description | Usage |
43
43
  |---|---|---|
44
44
  | debug | Debug an issue systematically using structured investigation techniques | /debug <issue-description> |
45
45
  | explain | Explain code for someone new to the codebase | /explain <code-section> |
46
+ | friction | Analyze session logs for failure patterns and behavioral signals | /friction <sessions-path> |
46
47
  | git-commit | Analyze changes and create intelligent git commits | /git-commit |
47
48
  | optimize | Analyze and optimize performance issues | /optimize <target-area> |
48
49
  | refactor | Refactor code while maintaining behavior and tests | /refactor <code-section> |
50
+ | remember | Consolidate stashes + friction into project memory | /remember |
49
51
  | review | Comprehensive code review including quality, tests, and architecture | /review |
50
52
  | security | Security vulnerability scan and analysis | /security |
51
53
  | ship | Pre-deployment verification checklist | /ship |
@@ -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.