memory-attribution-lintlisted
Install: claude install-skill cerebrocybersolutions/libro
# memory-attribution-lint
Write-time validator + auto-injector for memory file frontmatter. Enforces an 11-key
provenance contract on `.md` files in memory directories. Closes the "where did this
memory come from?" gap by capturing source surface, tool, host, and session at write
time.
## Why provenance matters
Memory entries accumulate across sessions, tools, and surfaces. Without provenance,
stale or contradictory entries are hard to triage. The 11-key contract gives every
memory file a complete audit trail: who wrote it, from what tool, on what host, in
what session, at what time, with what confidence, and at what lifecycle stage.
## Contract
Required frontmatter keys:
| Key | Source | Auto-derived |
|---|---|---|
| name | author | NO |
| description | author | NO |
| type | author (user/feedback/project/reference) | NO |
| source_surface | env CLAUDE_SURFACE or default | YES |
| host | `socket.gethostname()` | YES |
| tool | env CLAUDE_TOOL or default `unknown` | YES |
| session_id | env CLAUDE_SESSION_ID or `unknown` | YES |
| written_at_utc | `datetime.now(timezone.utc).isoformat()` | YES |
| source_path | author declares | NO |
| confidence | author: high/med/low | NO |
| lifecycle | author: pinned/active/archived/closed/superseded/stale-by:YYYY-MM-DD | NO |
## Scripts
- `Scripts/lint.py` — validate + auto-inject; exit 0=pass, 1=blocked, 2=injected
- `Scripts/backfill.py` — bulk backfill existing memory files
- `Scripts/tests/fixtures/` — golden samples for val