universal-agent-memory 1.0.2 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-agent-memory",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Universal AI agent memory system - CLAUDE.md templates, memory, worktrees for Claude Code, Factory.AI, VSCode, OpenCode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,14 +1,22 @@
1
1
  <!--
2
- CLAUDE.md Universal Template - v10.2
2
+ CLAUDE.md Universal Template - v10.3
3
3
 
4
4
  CHANGES IN THIS VERSION:
5
+ - Added 5 new generic patterns (16-20) from deep failure analysis
6
+ - Pattern 16: Task-First Execution (TFE) - prevents analysis without output
7
+ - Pattern 17: Constraint Extraction (CE) - catches format/structure requirements
8
+ - Pattern 18: Multi-Tool Pipeline (MTP) - chains tools for complex tasks
9
+ - Pattern 19: Enhanced Impossible Task Refusal (ITR+) - refuses impossible immediately
10
+ - Pattern 20: Adversarial Thinking (AT) - attack mindset for bypass tasks
11
+ - Enhanced CRITICAL REMINDERS with 5 new items (12-16)
12
+ - Total patterns now: 20 (up from 15)
13
+
14
+ PREVIOUS (v10.2):
5
15
  - Added 4 new generic patterns (12-15) from Terminal-Bench 2.0 analysis
6
16
  - Pattern 12: Output Existence Verification (OEV) - 37% of failures fixed
7
17
  - Pattern 13: Iterative Refinement Loop (IRL) - helps partial success tasks
8
18
  - Pattern 14: Output Format Validation (OFV) - fixes wrong output issues
9
19
  - Pattern 15: Exception Recovery (ER) - handles runtime errors
10
- - Enhanced CRITICAL REMINDERS with output verification
11
- - Task completion now requires output file verification
12
20
 
13
21
  PREVIOUS (v10.1):
14
22
  - Pipeline-only infrastructure policy (--pipeline-only flag)
@@ -180,7 +188,7 @@ For operations that need to run once (migrations, data fixes, cleanups):
180
188
 
181
189
  ## 🎯 UNIVERSAL AGENT PATTERNS
182
190
 
183
- **Fifteen patterns proven to improve LLM agent reliability. Apply to ALL task execution.**
191
+ **Twenty patterns proven to improve LLM agent reliability. Apply to ALL task execution.**
184
192
 
185
193
  ### Pattern 1: Environment Isolation
186
194
  Code installed during execution may NOT persist across phases (agent → test → deploy).
@@ -329,6 +337,79 @@ When code throws exceptions:
329
337
  3. Re-run and verify
330
338
  4. Don't give up after first exception
331
339
 
340
+ ### Pattern 16: Task-First Execution (TFE)
341
+ **CRITICAL: Prevents regression where agent analyzes but forgets to create outputs**
342
+
343
+ BEFORE any analysis or exploration:
344
+ 1. **Parse task for REQUIRED OUTPUTS** (files, artifacts, states)
345
+ 2. **Create MINIMAL WORKING versions immediately** (touch files, create stubs)
346
+ 3. **THEN refine to full implementation**
347
+ 4. **Never finish a turn without outputs existing**
348
+
349
+ ```bash
350
+ # Create placeholders FIRST
351
+ touch /app/output.json /app/model.pt /app/cli.py
352
+ # Then implement and overwrite with real content
353
+ ```
354
+
355
+ ### Pattern 17: Constraint Extraction (CE)
356
+ Agent misses specific constraints buried in task descriptions.
357
+
358
+ BEFORE implementing:
359
+ 1. **Parse for constraint keywords**: "exactly", "only", "single", "must be", "no more than"
360
+ 2. **Extract format constraints**: file types, line counts, size limits, response formats
361
+ 3. **Create constraint checklist**
362
+ 4. **Validate EACH constraint before completion**
363
+
364
+ ```
365
+ Task: "Create single .rs file that outputs Fibonacci"
366
+ CONSTRAINTS:
367
+ ☐ Single file (not multiple)
368
+ ☐ Extension: .rs
369
+ ☐ Output: Fibonacci numbers
370
+ ```
371
+
372
+ ### Pattern 18: Multi-Tool Pipeline (MTP)
373
+ Complex tasks need multiple tools chained together.
374
+
375
+ 1. **Decompose task into stages** (input → transform → output)
376
+ 2. **Identify tool for EACH stage** (don't implement from scratch if tool exists)
377
+ 3. **Verify tools available**: `which tool || pip install package`
378
+ 4. **Chain in pipeline**
379
+
380
+ ```
381
+ Task: "Find best chess move from board image"
382
+ Pipeline: image → tesseract/vision → FEN → stockfish → move
383
+ ```
384
+
385
+ ### Pattern 19: Enhanced Impossible Task Refusal (ITR+)
386
+ Pattern 5 identifies impossible tasks but agent still attempts them.
387
+
388
+ **Impossibility markers → REFUSE IMMEDIATELY:**
389
+ - Compression below Shannon limit (e.g., "GPT-2 in 5KB" - weights are 500MB+)
390
+ - Pre-trained weights required but none provided
391
+ - Exhaustive search in exponential space
392
+ - Undecidable problems
393
+
394
+ ```bash
395
+ # If impossible, create explanation file and STOP
396
+ echo "IMPOSSIBLE: Task requires X but constraint limits to Y < X" > /app/IMPOSSIBLE.md
397
+ # Do NOT attempt partial solutions
398
+ ```
399
+
400
+ ### Pattern 20: Adversarial Thinking (AT)
401
+ Security bypass/attack tasks require "attacker mindset".
402
+
403
+ 1. **Detect**: Keywords "bypass", "break", "exploit", "circumvent", "evade"
404
+ 2. **Flip perspective**: Not "how to use correctly" but "how to break it"
405
+ 3. **Enumerate attack vectors** (case variation, encoding, null bytes, context breaking)
406
+ 4. **Test each vector until one works**
407
+
408
+ ```
409
+ DEFENSIVE: "How do I use this filter?"
410
+ ADVERSARIAL: "How do I craft input that bypasses the filter?"
411
+ ```
412
+
332
413
  ---
333
414
 
334
415
  ## ⚡ SESSION START PROTOCOL
@@ -984,3 +1065,18 @@ gh run view <run-id>
984
1065
  - Don't explain why it's missing
985
1066
  - Don't ask for clarification
986
1067
  - Just make the file exist with valid content
1068
+
1069
+ 12. **TASK-FIRST**: Create required output files BEFORE analyzing.
1070
+ Touch placeholders immediately, then refine with real content.
1071
+
1072
+ 13. **EXTRACT CONSTRAINTS**: Before implementing, list ALL constraints from task:
1073
+ Keywords: "exactly", "only", "single", "must be", formats, limits.
1074
+
1075
+ 14. **MULTI-TOOL PIPELINE**: For complex tasks, identify ALL tools needed.
1076
+ Don't implement from scratch if existing tools exist.
1077
+
1078
+ 15. **REFUSE IMPOSSIBLE**: If task violates information theory (compress 500MB to 5KB),
1079
+ REFUSE immediately. Create IMPOSSIBLE.md explaining why. Don't attempt.
1080
+
1081
+ 16. **ADVERSARIAL MINDSET**: For bypass/exploit tasks, think like an attacker.
1082
+ Enumerate attack vectors (encoding, null bytes, case variation). Test each.