Skill: lupinweng/local-agent-memory-v1 (version 1.0.0)

--- name: local-agent-memory-v1 description: Build, maintain, or improve a layered local memory system for OpenClaw-style agents using markdown files instead of database-backed memory. Use when creating or refining `MEMORY.md`, `memory/YYYY-MM-DD.md`, `memory/semantic/`, `memory/procedural/`, heartbeat-based memory consolidation, skeptical memory rules, strict write discipline, long-term memory governance, or file-based agent memory workflows in local/Termux/workspace-based setups. --- # Local Agent Memory v1 Build or refine a reliable file-based memory system for an agent. ## Core workflow 1. Create or inspect these layers: - `memory/YYYY-MM-DD.md` - `memory/semantic/` - `memory/procedural/` - `MEMORY.md` 2. Keep `MEMORY.md` lightweight and routing-oriented. 3. Put stable facts in semantic files. 4. Put repeatable methods in procedural files. 5. Treat memory as a hint/index layer, not unquestionable truth. 6. Re-verify current facts before taking real actions based on remembered information. 7. Write destination files first, then update `MEMORY.md` only if the change deserves long-term indexing. ## Decision rules ### Use daily memory for - new events - one-off attempts - temporary troubleshooting detail - anything not yet proven reusable ### Use semantic memory for - stable user preferences - durable environment facts - platform constraints - lasting architecture or governance decisions ### Use procedural memory for - repeatable workflows - checklists - maintenance routines - methods likely to be reused across sessions ## Maintenance pattern Run a lightweight dream/consolidation pass when memory starts to sprawl: - read `MEMORY.md` - read recent daily logs - identify repeated facts or workflows - extract stable facts into semantic memory - extract repeatable methods into procedural memory - prune low-value or duplicated summary lines from `MEMORY.md` Run a deeper pass for large daily logs or when the topic tree needs restructuring. ## Guardrails - Do not let `MEMORY.md` become a diary. - Do not promote everything that looks interesting. - Do not rely on stale remembered facts for real actions. - Do not mix memory maintenance with unrelated code changes unless the user asked for both. - Prefer a few clear topic files over many overlapping files. ## References Read these only as needed: - `references/architecture.md` for the memory model and core disciplines - `references/setup.md` for minimum structure and topic layout - `references/maintenance.md` for governance and consolidation rules

path: references/architecture.md
content: # Local Agent Memory Architecture

## Core model

Use a layered file-based memory system:
- `memory/YYYY-MM-DD.md` for raw daily history
- `memory/semantic/` for stable facts and preferences
- `memory/procedural/` for repeatable workflows
- `MEMORY.md` as a lightweight index and routing layer

## Key disciplines

### Skeptical memory
Treat memory as a hint/index layer, not unquestionable truth.
If remembered information would cause a real action, re-check current files, paths, versions, scripts, or environment first.

### Strict write discipline
Write the destination topic file first.
Confirm success.
Only then update `MEMORY.md` if the information deserves long-term indexing.

### Lightweight summary
Keep `MEMORY.md` short and routing-oriented.
Put detail in topic files, not in the top-level summary.

### Consolidation
Use lightweight heartbeat-scale dream passes for routine cleanup.
Use deeper passes occasionally for heavy daily logs.


path: references/maintenance.md
content: # Maintenance and Governance

## What belongs in long-term memory

Promote information when it is:
- stable across future tasks
- likely to matter across sessions
- a reusable workflow
- a durable operating or platform constraint

## What should stay in daily logs

Keep information in daily memory when it is:
- one-off
- noisy
- temporary
- historical detail without future value

## Heartbeat maintenance

During background maintenance:
1. Read `MEMORY.md`
2. Read recent daily logs
3. Look for repeated facts or workflows
4. Extract stable facts into semantic memory
5. Extract repeatable methods into procedural memory
6. Prune low-value lines from `MEMORY.md`

## Guardrails

- Do not mix memory maintenance with unrelated code edits
- Do not auto-migrate the whole memory tree without explicit direction
- Do not act on stale remembered facts without re-verification


path: references/setup.md
content: # Setup and Topic Layout

## Minimum structure

```text
MEMORY.md
HEARTBEAT.md
memory/
  YYYY-MM-DD.md
  semantic/
  procedural/
```

## Recommended semantic topics

- user preferences and context
- assistant identity and style
- environment and platform facts
- memory governance
- operating constitution

## Recommended procedural topics

- local memory workflow
- dream maintenance workflow
- deep dream pass workflow

## Setup rule

Start small.
Do not try to build perfect taxonomy immediately.
Only split topics when real repeated patterns appear.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)