# Audit Memory

> Audit an existing agent memory store read-only for schema or index drift, broken or one-way local relationships, review-due content, source freshness, duplicate or conflicting facts, and advisory capacity limits. Use only for memory-health verification; do not create, import, refresh, or edit memory, and route ordinary repository documentation audits to audit-docs.

- Skill: `valentinnikolaev/audit-memory` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add valentinnikolaev/audit-memory`
- Raw SKILL.md: https://api.skillmd.com/api/skills/valentinnikolaev/audit-memory/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: ValentinNikolaev (https://skillmd.com/u/valentinnikolaev)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/valentinnikolaev/audit-memory

---


<!-- GENERATED BY generate_skill_wrappers.py; DO NOT EDIT MANUALLY. -->
## Generated Codex skill — do not edit manually

This complete skill and its bundled resources are generated from `agent-plugins/skills/audit-memory/SKILL.md`. Manual changes in this directory will be overwritten the next time the generator runs. Edit the canonical skill instead.

# Audit Memory

Audit memory without changing files, sources, indexes, or external state.

## Load the Contract and Resolve Scope

1. Read [references/memory-contract.md](references/memory-contract.md) completely before auditing. Apply its schema, index grammar, relationship, provenance, date, authorization, and limit rules.
2. Use the user-supplied memory root, project root, or file list first. If none is supplied, inspect only plausible roots inside the current project.
3. Ask for explicit consent before reading a global store, sibling project, unrelated repository, or any root outside the user's selected project. Never silently combine stores.
4. When several roots remain plausible, report the candidates and ask the user to select one.
5. Record inaccessible paths, unsupported host schemas, missing repositories, and unavailable source checks as limitations.

## Normalize Audit Settings

Apply user-supplied thresholds instead of hardcoded values. Forward supported values to the validator:

- `--stale-days <N>` for content review age
- `--source-stale-days <N>` for source retrieval review age
- `--file-limit <N>` for advisory file capacity
- `--index-line-limit <N>` for advisory index size
- `--warning-ratio <R>` and `--critical-ratio <R>` for capacity thresholds
- `--enforce-limits` only when local policy makes capacity limits hard

Use the contract defaults only when neither the user nor local policy supplies a value. State every assumed value. Treat capacity thresholds as advisory unless the host documents a hard limit.

## Run Deterministic Validation

Run the bundled validator against each authorized root:

```text
python scripts/validate_memory.py <memory-root> [threshold options]
```

Use `--format json` when structured output helps. Verify validator findings against the files before reporting them. Do not repair failures during an audit.

## Review Meaning and Freshness

1. Treat age alone as `review due`, not proof that content is stale. Do not infer staleness from unrelated repository activity.
2. Call a memory stale only when current repository or source evidence contradicts it, supersedes it, or proves that a load-bearing claim is obsolete. Cite both the memory and contradicting evidence.
3. Treat an old matching `provenance[].retrieved_at` value as source review due. Do not claim source drift unless the current authorized source was compared successfully.
4. Compare filenames, names, descriptions, source identities, and distinctive claims for duplicates. Report conflicting durable claims separately; do not silently choose a winner.
5. Treat one-way local `related` links as contract drift because family relationships are symmetric. Treat external references through `provenance` or body links as evidence, not local relationships.

## Report

Group verified findings as:

- `critical`: broken required index targets, missing local related files, invalid required schema that prevents reliable retrieval, or proven dangerous stale guidance.
- `warning`: contract drift, duplicate or conflicting canonical facts, proven stale content, or documented hard-limit pressure.
- `info`: review-due content or sources, advisory capacity pressure, and other human-review signals.

Include scanned roots and files, effective settings, findings with `file:line` evidence, skipped checks, parse failures, inaccessible sources, and other limitations. If no finding remains, say only that no issues were detected in the checks completed.

Do not edit memory, refresh sources, rewrite indexes, or stage repository changes.

