universal-agent-memory 0.5.2 โ†’ 0.5.3

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.
@@ -1,11 +1,24 @@
1
1
  <!--
2
- CLAUDE.md Universal Template - v7.0
2
+ CLAUDE.md Universal Template - v8.0
3
3
 
4
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
5
+ - Context Field integration (code field + inhibition-style directives)
6
+ - Inhibition > Instruction: "Do not X" creates blockers, "Do X" creates preferences
7
+ - 4-line code field for 100% assumption stating, 89% bug detection
8
+ - Simplified setup (auto-works, no clicking required)
9
+ - Database protection (never delete existing data)
10
+
11
+ CODE FIELD ATTRIBUTION:
12
+ The Code Field prompt technique is based on research from:
13
+ https://github.com/NeoVertex1/context-field
14
+
15
+ Context Field is experimental research on context field prompts and cognitive
16
+ regime shifts in large language models. The code_field.md prompt produces:
17
+ - 100% assumption stating (vs 0% baseline)
18
+ - 89% bug detection in code review (vs 39% baseline)
19
+ - 100% refusal of impossible requests (vs 0% baseline)
20
+
21
+ License: Research shared for exploration and reuse with attribution.
9
22
 
10
23
  Core Variables:
11
24
  {{PROJECT_NAME}}, {{PROJECT_PATH}}, {{DEFAULT_BRANCH}}, {{STRUCTURE_DATE}}
@@ -50,6 +63,39 @@
50
63
 
51
64
  ---
52
65
 
66
+ ## ๐Ÿ”’ CODE FIELD - MANDATORY FOR ALL CODE
67
+
68
+ **Before writing ANY code, apply these constraints:**
69
+
70
+ ```
71
+ Do not write code before stating assumptions.
72
+ Do not claim correctness you haven't verified.
73
+ Do not handle only the happy path.
74
+ Under what conditions does this work?
75
+ ```
76
+
77
+ ### Code Generation Protocol
78
+
79
+ **BEFORE CODE** (required):
80
+ - State assumptions about input, environment, dependencies
81
+ - Enumerate edge cases and failure modes
82
+ - Define explicit scope ("This handles X, not Y")
83
+ - Ask: "What would break this? What would a malicious caller do?"
84
+
85
+ **IN CODE**:
86
+ - Comments explain *why*, not *what*
87
+ - Edge cases handled OR explicitly rejected with clear errors
88
+ - Error paths as considered as happy paths
89
+ - Smaller than your first instinct
90
+
91
+ **AFTER CODE** (required):
92
+ - "What this handles" section
93
+ - "What this does NOT handle" section
94
+ - Known limitations documented
95
+ - Conditions for correctness stated
96
+
97
+ ---
98
+
53
99
  ## โšก SESSION START PROTOCOL
54
100
 
55
101
  **EXECUTE IMMEDIATELY before any response:**
@@ -64,6 +110,22 @@ uam agent status # Check other active agents
64
110
 
65
111
  ---
66
112
 
113
+ ## ๐Ÿ›‘ CRITICAL INHIBITIONS
114
+
115
+ **These are BLOCKERS, not suggestions. Do not proceed without satisfying them.**
116
+
117
+ | Inhibition | Rationale |
118
+ |------------|-----------|
119
+ | Do not begin work without querying memory | Context prevents duplicate work |
120
+ | Do not commit to {{DEFAULT_BRANCH}} | All changes require worktree + PR |
121
+ | Do not claim work without overlap check | Prevents merge conflicts |
122
+ | Do not create PR with failing tests | Broken code must not merge |
123
+ | Do not complete task without storing learnings | Memory enables endless context |
124
+ | Do not write code without stating assumptions | Prevents hidden bugs |
125
+ | Do not handle only the happy path | Edge cases are where bugs live |
126
+
127
+ ---
128
+
67
129
  ## ๐Ÿค– MULTI-AGENT COORDINATION PROTOCOL
68
130
 
69
131
  ### Before Claiming Any Work
@@ -98,21 +160,10 @@ uam agent announce \
98
160
  | `high` | Wait or split work | Same file, different sections |
99
161
  | `critical` | STOP - request handoff | Same file, same sections |
100
162
 
101
- ### Parallel Work Patterns
102
-
103
- ```bash
104
- # CORRECT: Independent droids can run in parallel
105
- Task(subagent_type: "code-quality-guardian", ...)
106
- Task(subagent_type: "security-auditor", ...) # Runs concurrently
107
- Task(subagent_type: "performance-optimizer", ...) # Runs concurrently
108
-
109
- # CORRECT: Coordinate merge order for overlapping changes
110
- # Agent A finishes first โ†’ merges first
111
- # Agent B rebases โ†’ merges second
112
- ```
113
-
114
163
  ### Agent Capability Routing
115
164
 
165
+ Route tasks to specialized droids for optimal results:
166
+
116
167
  | Task Type | Route To | Capabilities |
117
168
  |-----------|----------|--------------|
118
169
  | TypeScript/JavaScript | `typescript-node-expert` | typing, async, node |
@@ -122,6 +173,8 @@ Task(subagent_type: "performance-optimizer", ...) # Runs concurrently
122
173
  | Documentation | `documentation-expert` | jsdoc, readme, api-docs |
123
174
  | Code quality | `code-quality-guardian` | complexity, naming, solid |
124
175
 
176
+ **Missing expert?** Generate one: `uam droids add <name> --capabilities "..." --triggers "..."`
177
+
125
178
  ---
126
179
 
127
180
  ## ๐Ÿ“‹ MANDATORY DECISION LOOP
@@ -131,41 +184,50 @@ Task(subagent_type: "performance-optimizer", ...) # Runs concurrently
131
184
  โ”‚ EXECUTE FOR EVERY TASK โ”‚
132
185
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
133
186
  โ”‚ โ”‚
134
- โ”‚ 1. MEMORY โ”‚ uam memory query "<keywords>" โ”‚
187
+ โ”‚ 1. MEMORY โ”‚ Do not begin without: uam memory query "<keywords>"โ”‚
135
188
  โ”‚ โ”‚ Check for relevant past context โ”‚
136
189
  โ”‚ โ”‚
137
- โ”‚ 2. AGENTS โ”‚ uam agent overlaps --resource "<files>" โ”‚
190
+ โ”‚ 2. AGENTS โ”‚ Do not claim without: uam agent overlaps โ”‚
138
191
  โ”‚ โ”‚ If overlap: coordinate or wait โ”‚
139
192
  โ”‚ โ”‚
140
193
  โ”‚ 3. SKILLS โ”‚ Check {{SKILLS_PATH}} for applicable skill โ”‚
194
+ โ”‚ โ”‚ Missing skill? Generate: uam droids add โ”‚
141
195
  โ”‚ โ”‚ Invoke BEFORE implementing โ”‚
142
196
  โ”‚ โ”‚
143
- โ”‚ 4. WORKTREE โ”‚ {{WORKTREE_CREATE_CMD}} <slug> โ”‚
197
+ โ”‚ 4. WORKTREE โ”‚ Do not commit to {{DEFAULT_BRANCH}} โ”‚
198
+ โ”‚ โ”‚ {{WORKTREE_CREATE_CMD}} <slug> โ”‚
144
199
  โ”‚ โ”‚ cd {{WORKTREE_DIR}}/NNN-<slug>/ โ”‚
145
- โ”‚ โ”‚ NEVER commit to {{DEFAULT_BRANCH}} โ”‚
146
200
  โ”‚ โ”‚
147
- โ”‚ 5. WORK โ”‚ Implement โ†’ Test โ†’ {{WORKTREE_PR_CMD}} โ”‚
201
+ โ”‚ 5. CODE โ”‚ Apply CODE FIELD constraints (above) โ”‚
202
+ โ”‚ โ”‚ State assumptions โ†’ Implement โ†’ Test โ”‚
148
203
  โ”‚ โ”‚
149
- โ”‚ 6. MEMORY โ”‚ Store important learnings for future sessions โ”‚
150
- โ”‚ โ”‚ uam memory store "lesson" --importance 7+ โ”‚
204
+ โ”‚ 6. PR โ”‚ Do not merge with failing tests โ”‚
205
+ โ”‚ โ”‚ {{WORKTREE_PR_CMD}} โ†’ parallel reviews โ”‚
151
206
  โ”‚ โ”‚
152
- โ”‚ 7. VERIFY โ”‚ โ˜ Memory โ˜ Worktree โ˜ PR โ˜ Skills โ˜ Agents โ”‚
207
+ โ”‚ 7. MEMORY โ”‚ Do not complete without storing learnings โ”‚
208
+ โ”‚ โ”‚ uam memory store "lesson" --importance 7+ โ”‚
153
209
  โ”‚ โ”‚
154
210
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
155
211
  ```
156
212
 
157
213
  ---
158
214
 
159
- ## ๐Ÿง  MEMORY SYSTEM
215
+ ## ๐Ÿง  ENDLESS CONTEXT - PROJECT MEMORY SYSTEM
216
+
217
+ **Your context is NOT limited to this conversation.**
160
218
 
161
- **Memory is managed automatically.** Query for context, store important learnings.
219
+ Memory persists with the project, enabling:
220
+ - Recall of decisions from weeks/months ago
221
+ - Learning from past mistakes (gotchas)
222
+ - Understanding of why code is the way it is
223
+ - Handoff between sessions without information loss
162
224
 
163
225
  ```
164
226
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
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 โ”‚
227
+ โ”‚ L1: WORKING โ”‚ Recent actions โ”‚ {{SHORT_TERM_LIMIT}} max โ”‚ SQLite โ”‚
228
+ โ”‚ L2: SESSION โ”‚ Current session โ”‚ Per session โ”‚ SQLite โ”‚
229
+ โ”‚ L3: SEMANTIC โ”‚ Long-term learnings โ”‚ {{LONG_TERM_BACKEND}} โ”‚ Vector searchโ”‚
230
+ โ”‚ L4: KNOWLEDGE โ”‚ Entity relationships โ”‚ SQLite โ”‚ Graph โ”‚
169
231
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
170
232
  ```
171
233
 
@@ -176,21 +238,21 @@ Task(subagent_type: "performance-optimizer", ...) # Runs concurrently
176
238
  | Learned something reusable | `uam memory store "lesson" --importance 8` |
177
239
  | Fixed a tricky bug | `uam memory store "bug fix" --tags bug-fix --importance 7` |
178
240
  | Discovered a gotcha | `uam memory store "gotcha" --tags gotcha --importance 9` |
179
- | Completed a task | Memory auto-updates |
241
+ | Made architectural decision | `uam memory store "decision: X because Y" --importance 8` |
180
242
 
181
243
  ### When to Query Memories
182
244
 
183
245
  | Situation | Action |
184
246
  |-----------|--------|
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"` |
247
+ | Starting ANY new work | `uam memory query "relevant keywords"` |
248
+ | Debugging unfamiliar code | `uam memory query "similar error"` |
249
+ | Understanding past decisions | `uam memory query "why we did X"` |
188
250
 
189
251
  ---
190
252
 
191
253
  ## ๐ŸŒณ WORKTREE WORKFLOW
192
254
 
193
- **ALL code changes use worktrees. NO EXCEPTIONS.**
255
+ **Do not commit to {{DEFAULT_BRANCH}}. NO EXCEPTIONS.**
194
256
 
195
257
  ```bash
196
258
  # Create
@@ -247,7 +309,7 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
247
309
  | feature request | `uam task create --type feature` |
248
310
  | code file for editing | check overlaps โ†’ skills โ†’ worktree |
249
311
  | review/check/look | query memory first |
250
- | ANY code change | tests required |
312
+ | ANY code change | apply CODE FIELD, tests required |
251
313
 
252
314
  ---
253
315
 
@@ -362,12 +424,13 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
362
424
  ## ๐Ÿงช Testing Requirements
363
425
 
364
426
  1. Create worktree
365
- 2. Update/create tests
366
- 3. Run `{{TEST_COMMAND}}`
427
+ 2. Apply CODE FIELD (state assumptions first)
428
+ 3. Update/create tests
429
+ 4. Run `{{TEST_COMMAND}}`
367
430
  {{#if LINT_COMMAND}}
368
- 4. Run `{{LINT_COMMAND}}`
431
+ 5. Run `{{LINT_COMMAND}}`
369
432
  {{/if}}
370
- 5. Create PR
433
+ 6. Create PR (do not merge with failing tests)
371
434
 
372
435
  ---
373
436
 
@@ -392,12 +455,13 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
392
455
  ## โœ… Completion Checklist
393
456
 
394
457
  ```
458
+ โ˜ Memory queried before starting
459
+ โ˜ CODE FIELD applied (assumptions stated)
395
460
  โ˜ Tests pass
396
461
  โ˜ Lint/typecheck pass
397
462
  โ˜ Worktree used (not {{DEFAULT_BRANCH}})
398
- โ˜ Memory updated (if learned something)
399
- โ˜ PR created
400
- โ˜ Parallel reviews passed
463
+ โ˜ Learnings stored in memory
464
+ โ˜ PR created with parallel reviews
401
465
  {{#if HAS_INFRA}}
402
466
  โ˜ Infrastructure plan verified
403
467
  {{/if}}
@@ -434,23 +498,24 @@ Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
434
498
  โ”‚ โ”‚
435
499
  โ”‚ 4. FIX (if issues found) โ”‚
436
500
  โ”‚ โ”œโ”€ Create new worktree for fix โ”‚
437
- โ”‚ โ”œโ”€ Fix the issue โ”‚
501
+ โ”‚ โ”œโ”€ Apply CODE FIELD for fix โ”‚
438
502
  โ”‚ โ”œโ”€ GOTO step 1 (Merge) โ”‚
439
503
  โ”‚ โ””โ”€ Repeat until 100% working โ”‚
440
504
  โ”‚ โ”‚
441
505
  โ”‚ 5. COMPLETE โ”‚
442
- โ”‚ โ”œโ”€ Store learnings: uam memory store "what I learned" โ”‚
506
+ โ”‚ โ”œโ”€ Do not skip: uam memory store "what I learned" โ”‚
443
507
  โ”‚ โ”œโ”€ Close related tasks/issues โ”‚
444
508
  โ”‚ โ””โ”€ Announce completion โ”‚
445
509
  โ”‚ โ”‚
446
510
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
447
511
  ```
448
512
 
449
- **โš ๏ธ NEVER say "done" or "complete" until:**
513
+ **โš ๏ธ Do not say "done" or "complete" until:**
450
514
  - PR is merged (not just created)
451
515
  - Deployment succeeded (not just triggered)
452
516
  - Functionality verified working (not just "should work")
453
517
  - All errors/issues fixed (iterate as needed)
518
+ - Learnings stored in memory
454
519
 
455
520
  **Commands for completion:**
456
521
  ```bash
@@ -465,7 +530,7 @@ gh run view <run-id>
465
530
 
466
531
  # If issues found, fix immediately
467
532
  {{WORKTREE_CREATE_CMD}} hotfix-<issue>
468
- # ... fix, test, PR, merge, repeat
533
+ # ... apply CODE FIELD, fix, test, PR, merge, repeat
469
534
  ```
470
535
 
471
536
  ---