universal-agent-memory 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -289
- package/dist/cli/generate.d.ts +7 -0
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +89 -2
- package/dist/cli/generate.js.map +1 -1
- package/dist/cli/memory.js +102 -8
- package/dist/cli/memory.js.map +1 -1
- package/dist/generators/claude-md.js +18 -5
- package/dist/generators/claude-md.js.map +1 -1
- package/dist/utils/merge-claude-md.d.ts +20 -7
- package/dist/utils/merge-claude-md.d.ts.map +1 -1
- package/dist/utils/merge-claude-md.js +252 -59
- package/dist/utils/merge-claude-md.js.map +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.template.md +91 -130
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
CLAUDE.md Universal Template -
|
|
2
|
+
CLAUDE.md Universal Template - v7.0
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- Dynamic task routing (P1)
|
|
10
|
-
- Capability-based agent routing (P2)
|
|
11
|
-
- Modular conditional sections (P3)
|
|
4
|
+
CHANGES IN THIS VERSION:
|
|
5
|
+
- All project-specific content uses Handlebars placeholders
|
|
6
|
+
- No hardcoded project data (Pay2U removed)
|
|
7
|
+
- Simplified memory references (agent-managed, not user-managed)
|
|
8
|
+
- Template variables documented inline
|
|
12
9
|
|
|
13
10
|
Core Variables:
|
|
14
11
|
{{PROJECT_NAME}}, {{PROJECT_PATH}}, {{DEFAULT_BRANCH}}, {{STRUCTURE_DATE}}
|
|
@@ -59,8 +56,7 @@
|
|
|
59
56
|
|
|
60
57
|
```bash
|
|
61
58
|
uam task ready # Check existing work
|
|
62
|
-
|
|
63
|
-
sqlite3 {{MEMORY_DB_PATH}} "SELECT * FROM session_memories WHERE session_id='current' ORDER BY id DESC LIMIT 5;"
|
|
59
|
+
uam memory query "recent context" # Check memory for context
|
|
64
60
|
uam agent status # Check other active agents
|
|
65
61
|
```
|
|
66
62
|
|
|
@@ -135,81 +131,60 @@ Task(subagent_type: "performance-optimizer", ...) # Runs concurrently
|
|
|
135
131
|
│ EXECUTE FOR EVERY TASK │
|
|
136
132
|
├─────────────────────────────────────────────────────────────────┤
|
|
137
133
|
│ │
|
|
138
|
-
│ 1. MEMORY │
|
|
139
|
-
│ │
|
|
140
|
-
│ │ Check session_memories for current context │
|
|
134
|
+
│ 1. MEMORY │ uam memory query "<keywords>" │
|
|
135
|
+
│ │ Check for relevant past context │
|
|
141
136
|
│ │
|
|
142
|
-
│ 2. AGENTS │ uam agent overlaps --resource "<files>"
|
|
137
|
+
│ 2. AGENTS │ uam agent overlaps --resource "<files>" │
|
|
143
138
|
│ │ If overlap: coordinate or wait │
|
|
144
139
|
│ │
|
|
145
|
-
│ 3. SKILLS │ Check {{SKILLS_PATH}}
|
|
140
|
+
│ 3. SKILLS │ Check {{SKILLS_PATH}} for applicable skill │
|
|
146
141
|
│ │ Invoke BEFORE implementing │
|
|
147
142
|
│ │
|
|
148
|
-
│ 4. WORKTREE │ {{WORKTREE_CREATE_CMD}} <slug>
|
|
149
|
-
│ │ cd {{WORKTREE_DIR}}/NNN-<slug>/
|
|
150
|
-
│ │ NEVER commit to {{DEFAULT_BRANCH}}
|
|
143
|
+
│ 4. WORKTREE │ {{WORKTREE_CREATE_CMD}} <slug> │
|
|
144
|
+
│ │ cd {{WORKTREE_DIR}}/NNN-<slug>/ │
|
|
145
|
+
│ │ NEVER commit to {{DEFAULT_BRANCH}} │
|
|
151
146
|
│ │
|
|
152
|
-
│ 5. WORK │ Implement → Test → {{WORKTREE_PR_CMD}}
|
|
147
|
+
│ 5. WORK │ Implement → Test → {{WORKTREE_PR_CMD}} │
|
|
153
148
|
│ │
|
|
154
|
-
│ 6. MEMORY │
|
|
155
|
-
│ │
|
|
156
|
-
│ │ Store lessons in long-term (importance 7+) │
|
|
149
|
+
│ 6. MEMORY │ Store important learnings for future sessions │
|
|
150
|
+
│ │ uam memory store "lesson" --importance 7+ │
|
|
157
151
|
│ │
|
|
158
|
-
│ 7. VERIFY │ ☐ Memory ☐ Worktree ☐ PR ☐ Skills ☐ Agents
|
|
152
|
+
│ 7. VERIFY │ ☐ Memory ☐ Worktree ☐ PR ☐ Skills ☐ Agents │
|
|
159
153
|
│ │
|
|
160
154
|
└─────────────────────────────────────────────────────────────────┘
|
|
161
155
|
```
|
|
162
156
|
|
|
163
157
|
---
|
|
164
158
|
|
|
165
|
-
## 🧠
|
|
159
|
+
## 🧠 MEMORY SYSTEM
|
|
160
|
+
|
|
161
|
+
**Memory is managed automatically.** Query for context, store important learnings.
|
|
166
162
|
|
|
167
163
|
```
|
|
168
164
|
┌─────────────────────────────────────────────────────────────────┐
|
|
169
|
-
│ L1: WORKING │
|
|
170
|
-
│ L2: SESSION │
|
|
171
|
-
│ L3: SEMANTIC │ {{LONG_TERM_BACKEND}}│
|
|
172
|
-
│ L4: KNOWLEDGE │
|
|
165
|
+
│ L1: WORKING │ Recent actions │ {{SHORT_TERM_LIMIT}} max │ Auto-managed │
|
|
166
|
+
│ L2: SESSION │ Current session │ Per session │ Auto-managed │
|
|
167
|
+
│ L3: SEMANTIC │ Long-term learnings │ {{LONG_TERM_BACKEND}} │ Store lessons │
|
|
168
|
+
│ L4: KNOWLEDGE │ Entity relationships │ SQLite │ Auto-managed │
|
|
173
169
|
└─────────────────────────────────────────────────────────────────┘
|
|
174
170
|
```
|
|
175
171
|
|
|
176
|
-
###
|
|
177
|
-
|
|
178
|
-
| Question | YES → Layer |
|
|
179
|
-
|----------|-------------|
|
|
180
|
-
| Just did this (last few minutes)? | L1: Working |
|
|
181
|
-
| Session-specific decision/context? | L2: Session |
|
|
182
|
-
| Reusable learning for future? | L3: Semantic |
|
|
183
|
-
| Entity relationships? | L4: Knowledge Graph |
|
|
184
|
-
|
|
185
|
-
### Memory Commands
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
# L1: Working Memory
|
|
189
|
-
sqlite3 {{MEMORY_DB_PATH}} "INSERT INTO memories (timestamp,type,content) VALUES (datetime('now'),'action','...');"
|
|
190
|
-
|
|
191
|
-
# L2: Session Memory (NEW)
|
|
192
|
-
sqlite3 {{MEMORY_DB_PATH}} "INSERT INTO session_memories (session_id,timestamp,type,content,importance) VALUES ('current',datetime('now'),'decision','...',7);"
|
|
193
|
-
|
|
194
|
-
# L3: Semantic Memory
|
|
195
|
-
{{MEMORY_STORE_CMD}} lesson "..." --tags t1,t2 --importance 8
|
|
196
|
-
|
|
197
|
-
# L4: Knowledge Graph
|
|
198
|
-
sqlite3 {{MEMORY_DB_PATH}} "INSERT INTO entities (type,name,first_seen,last_seen,mention_count) VALUES ('file','x.ts',datetime('now'),datetime('now'),1);"
|
|
199
|
-
sqlite3 {{MEMORY_DB_PATH}} "INSERT INTO relationships (source_id,target_id,relation,timestamp) VALUES (1,2,'depends_on',datetime('now'));"
|
|
200
|
-
```
|
|
172
|
+
### When to Store Memories
|
|
201
173
|
|
|
202
|
-
|
|
174
|
+
| Situation | Action |
|
|
175
|
+
|-----------|--------|
|
|
176
|
+
| Learned something reusable | `uam memory store "lesson" --importance 8` |
|
|
177
|
+
| Fixed a tricky bug | `uam memory store "bug fix" --tags bug-fix --importance 7` |
|
|
178
|
+
| Discovered a gotcha | `uam memory store "gotcha" --tags gotcha --importance 9` |
|
|
179
|
+
| Completed a task | Memory auto-updates |
|
|
203
180
|
|
|
204
|
-
|
|
205
|
-
- **Action**: Summarize → session_memories, Extract lessons → semantic memory
|
|
206
|
-
- **Dedup**: Skip if content_hash exists OR similarity > 0.92
|
|
181
|
+
### When to Query Memories
|
|
207
182
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
183
|
+
| Situation | Action |
|
|
184
|
+
|-----------|--------|
|
|
185
|
+
| Starting new work | `uam memory query "relevant keywords"` |
|
|
186
|
+
| Debugging | `uam memory query "similar error"` |
|
|
187
|
+
| Understanding patterns | `uam memory query "how we did X"` |
|
|
213
188
|
|
|
214
189
|
---
|
|
215
190
|
|
|
@@ -273,49 +248,49 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
|
|
|
273
248
|
| code file for editing | check overlaps → skills → worktree |
|
|
274
249
|
| review/check/look | query memory first |
|
|
275
250
|
| ANY code change | tests required |
|
|
276
|
-
{{#if SKILL_TRIGGERS}}
|
|
277
|
-
{{{SKILL_TRIGGERS}}}
|
|
278
|
-
{{/if}}
|
|
279
251
|
|
|
280
252
|
---
|
|
281
253
|
|
|
282
254
|
## 📁 REPOSITORY STRUCTURE
|
|
283
255
|
|
|
284
|
-
{{#if REPOSITORY_STRUCTURE}}
|
|
285
256
|
```
|
|
286
257
|
{{PROJECT_NAME}}/
|
|
287
258
|
{{{REPOSITORY_STRUCTURE}}}
|
|
288
259
|
```
|
|
289
|
-
{{/if}}
|
|
290
|
-
|
|
291
|
-
{{#if PATH_MIGRATIONS}}
|
|
292
|
-
### Path Migrations
|
|
293
|
-
{{{PATH_MIGRATIONS}}}
|
|
294
|
-
{{/if}}
|
|
295
260
|
|
|
296
261
|
---
|
|
297
262
|
|
|
298
263
|
{{#if ARCHITECTURE_OVERVIEW}}
|
|
299
264
|
## 🏗️ Architecture
|
|
265
|
+
|
|
300
266
|
{{{ARCHITECTURE_OVERVIEW}}}
|
|
301
|
-
{{/if}}
|
|
302
267
|
|
|
303
|
-
|
|
304
|
-
### Database
|
|
305
|
-
{{{DATABASE_ARCHITECTURE}}}
|
|
268
|
+
---
|
|
306
269
|
{{/if}}
|
|
307
270
|
|
|
308
271
|
{{#if CORE_COMPONENTS}}
|
|
309
272
|
## 🔧 Components
|
|
273
|
+
|
|
310
274
|
{{{CORE_COMPONENTS}}}
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
{{/if}}
|
|
278
|
+
|
|
279
|
+
{{#if DATABASE_ARCHITECTURE}}
|
|
280
|
+
## 🗄️ Database
|
|
281
|
+
|
|
282
|
+
{{{DATABASE_ARCHITECTURE}}}
|
|
283
|
+
|
|
284
|
+
---
|
|
311
285
|
{{/if}}
|
|
312
286
|
|
|
313
287
|
{{#if AUTH_FLOW}}
|
|
314
288
|
## 🔐 Authentication
|
|
289
|
+
|
|
315
290
|
{{{AUTH_FLOW}}}
|
|
316
|
-
{{/if}}
|
|
317
291
|
|
|
318
292
|
---
|
|
293
|
+
{{/if}}
|
|
319
294
|
|
|
320
295
|
## 📋 Quick Reference
|
|
321
296
|
|
|
@@ -326,11 +301,6 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
|
|
|
326
301
|
```
|
|
327
302
|
{{/if}}
|
|
328
303
|
|
|
329
|
-
{{#if PROJECT_URLS}}
|
|
330
|
-
### URLs
|
|
331
|
-
{{{PROJECT_URLS}}}
|
|
332
|
-
{{/if}}
|
|
333
|
-
|
|
334
304
|
{{#if KEY_WORKFLOWS}}
|
|
335
305
|
### Workflows
|
|
336
306
|
```
|
|
@@ -338,34 +308,25 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
|
|
|
338
308
|
```
|
|
339
309
|
{{/if}}
|
|
340
310
|
|
|
341
|
-
{{#if ESSENTIAL_COMMANDS}}
|
|
342
311
|
### Commands
|
|
343
312
|
```bash
|
|
344
|
-
{{
|
|
345
|
-
|
|
313
|
+
{{#if TEST_COMMAND}}
|
|
314
|
+
# Tests
|
|
315
|
+
{{TEST_COMMAND}}
|
|
346
316
|
{{/if}}
|
|
347
317
|
|
|
348
|
-
|
|
318
|
+
{{#if BUILD_COMMAND}}
|
|
319
|
+
# Build
|
|
320
|
+
{{BUILD_COMMAND}}
|
|
321
|
+
{{/if}}
|
|
349
322
|
|
|
350
|
-
{{#if
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
### Proactive Invocation (AUTO-TRIGGER)
|
|
354
|
-
|
|
355
|
-
| Trigger | Invoke | Purpose |
|
|
356
|
-
|---------|--------|---------|
|
|
357
|
-
| TS/JS change | `typescript-node-expert` | Strict typing, async |
|
|
358
|
-
| CLI work | `cli-design-expert` | UX, help, errors |
|
|
359
|
-
| Before commit | `code-quality-guardian` | Quality gate |
|
|
360
|
-
| Before commit | `security-auditor` | Security gate |
|
|
361
|
-
| Perf-critical | `performance-optimizer` | Optimization |
|
|
362
|
-
| New features | `documentation-expert` | Docs accuracy |
|
|
363
|
-
|
|
364
|
-
### Available Skills
|
|
365
|
-
| Skill | Purpose | Use When |
|
|
366
|
-
|-------|---------|----------|
|
|
367
|
-
{{{DISCOVERED_SKILLS}}}
|
|
323
|
+
{{#if LINT_COMMAND}}
|
|
324
|
+
# Linting
|
|
325
|
+
{{LINT_COMMAND}}
|
|
368
326
|
{{/if}}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
369
330
|
|
|
370
331
|
{{#if LANGUAGE_DROIDS}}
|
|
371
332
|
### Language Droids
|
|
@@ -374,13 +335,11 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
|
|
|
374
335
|
{{{LANGUAGE_DROIDS}}}
|
|
375
336
|
{{/if}}
|
|
376
337
|
|
|
377
|
-
{{#if
|
|
378
|
-
###
|
|
379
|
-
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
| `/code-review` | Full parallel review pipeline |
|
|
383
|
-
| `/pr-ready` | Validate branch, create PR |
|
|
338
|
+
{{#if DISCOVERED_SKILLS}}
|
|
339
|
+
### Skills
|
|
340
|
+
| Skill | Purpose | When to Use |
|
|
341
|
+
|-------|---------|-------------|
|
|
342
|
+
{{{DISCOVERED_SKILLS}}}
|
|
384
343
|
{{/if}}
|
|
385
344
|
|
|
386
345
|
{{#if MCP_PLUGINS}}
|
|
@@ -392,55 +351,55 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
|
|
|
392
351
|
|
|
393
352
|
---
|
|
394
353
|
|
|
395
|
-
{{#if
|
|
354
|
+
{{#if HAS_INFRA}}
|
|
396
355
|
## 🏭 Infrastructure Workflow
|
|
356
|
+
|
|
397
357
|
{{{INFRA_WORKFLOW}}}
|
|
358
|
+
|
|
359
|
+
---
|
|
398
360
|
{{/if}}
|
|
399
361
|
|
|
400
|
-
{{#if TEST_ENFORCEMENT}}
|
|
401
|
-
## 🧪 Testing Requirements
|
|
402
|
-
{{{TEST_ENFORCEMENT}}}
|
|
403
|
-
{{else}}
|
|
404
362
|
## 🧪 Testing Requirements
|
|
363
|
+
|
|
405
364
|
1. Create worktree
|
|
406
365
|
2. Update/create tests
|
|
407
366
|
3. Run `{{TEST_COMMAND}}`
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
{{/if}}
|
|
411
|
-
|
|
412
|
-
{{#if UI_ENFORCEMENT}}
|
|
413
|
-
## 🎨 UI Requirements
|
|
414
|
-
{{{UI_ENFORCEMENT}}}
|
|
367
|
+
{{#if LINT_COMMAND}}
|
|
368
|
+
4. Run `{{LINT_COMMAND}}`
|
|
415
369
|
{{/if}}
|
|
370
|
+
5. Create PR
|
|
416
371
|
|
|
417
372
|
---
|
|
418
373
|
|
|
419
374
|
{{#if TROUBLESHOOTING}}
|
|
420
375
|
## 🔧 Troubleshooting
|
|
376
|
+
|
|
421
377
|
{{{TROUBLESHOOTING}}}
|
|
378
|
+
|
|
379
|
+
---
|
|
422
380
|
{{/if}}
|
|
423
381
|
|
|
424
382
|
{{#if KEY_CONFIG_FILES}}
|
|
425
383
|
## ⚙️ Config Files
|
|
384
|
+
|
|
426
385
|
| File | Purpose |
|
|
427
386
|
|------|---------|
|
|
428
387
|
{{{KEY_CONFIG_FILES}}}
|
|
429
|
-
{{/if}}
|
|
430
388
|
|
|
431
389
|
---
|
|
390
|
+
{{/if}}
|
|
432
391
|
|
|
433
392
|
## ✅ Completion Checklist
|
|
434
393
|
|
|
435
394
|
```
|
|
436
395
|
☐ Tests pass
|
|
437
396
|
☐ Lint/typecheck pass
|
|
438
|
-
☐ Worktree used (not
|
|
439
|
-
☐ Memory updated
|
|
397
|
+
☐ Worktree used (not {{DEFAULT_BRANCH}})
|
|
398
|
+
☐ Memory updated (if learned something)
|
|
440
399
|
☐ PR created
|
|
441
400
|
☐ Parallel reviews passed
|
|
442
401
|
{{#if HAS_INFRA}}
|
|
443
|
-
☐
|
|
402
|
+
☐ Infrastructure plan verified
|
|
444
403
|
{{/if}}
|
|
445
404
|
☐ No secrets in code
|
|
446
405
|
```
|
|
@@ -480,7 +439,7 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
|
|
|
480
439
|
│ └─ Repeat until 100% working │
|
|
481
440
|
│ │
|
|
482
441
|
│ 5. COMPLETE │
|
|
483
|
-
│ ├─
|
|
442
|
+
│ ├─ Store learnings: uam memory store "what I learned" │
|
|
484
443
|
│ ├─ Close related tasks/issues │
|
|
485
444
|
│ └─ Announce completion │
|
|
486
445
|
│ │
|
|
@@ -511,9 +470,10 @@ gh run view <run-id>
|
|
|
511
470
|
|
|
512
471
|
---
|
|
513
472
|
|
|
514
|
-
{{#if
|
|
473
|
+
{{#if PREPOPULATED_KNOWLEDGE}}
|
|
515
474
|
## 📊 Project Knowledge
|
|
516
475
|
|
|
476
|
+
{{#if RECENT_ACTIVITY}}
|
|
517
477
|
### Recent Activity
|
|
518
478
|
{{{RECENT_ACTIVITY}}}
|
|
519
479
|
{{/if}}
|
|
@@ -532,5 +492,6 @@ gh run view <run-id>
|
|
|
532
492
|
### Hot Spots
|
|
533
493
|
{{{HOT_SPOTS}}}
|
|
534
494
|
{{/if}}
|
|
495
|
+
{{/if}}
|
|
535
496
|
|
|
536
497
|
</coding_guidelines>
|