maintaining-memory

Locate and fix drifted, duplicate, or stale agent memory records.

26|3|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/davidlee/spec-driver --skill maintaining-memory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maintaining-memory
Source: https://github.com/davidlee/spec-driver/tree/main/.spec-driver/skills/maintaining-memory
Command: npx skills add https://github.com/davidlee/spec-driver --skill maintaining-memory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents agents from inheriting stale, wrong, or drifted memories by ensuring memory records are corrected whenever reality changes or guidance becomes inaccurate.

Core Features & Use Cases

  • Memory drift detection: Identify impacted memories by path, commands, and domain tags, including renamed concepts via regex matching.
  • Fast validation with provenance checks: Open candidate memories, compare their assertions against referenced sources, and fix or downgrade confidence when provenance is missing or stale.
  • Minimal corrective edits with lifecycle hygiene: Update scope, ranking, de-duplicate overlaps, and aggressively move incorrect records to superseded/archived/obsolete to avoid harmful guidance.
  • Retrieval quality control: Verify before/after ranking using the same list query parameters to ensure corrected memories surface first in the intended context.

Quick Start

Run maintaining-memory when you change a workflow, move or rename files, or notice an agent acting on an outdated memory, then re-list the affected context to confirm the corrected memory ranks above stale results.

Frequently Asked Questions about maintaining-memory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix stale agent memory after renaming files or changing workflow commands?

To fix stale agent memory, run maintaining-memory to locate impacted records via path and domain tags, validate assertions against current sources, and apply minimal corrective edits to scope and ranking metadata.

What is memory drift in spec-driven development and how is it detected?

Memory drift occurs when agent memories become outdated after workflow or file changes. It is detected by locating impacted memories through path matching, command changes, and domain tags, including renamed concepts via regex matching.

How do I de-duplicate overlapping agent memories in scoped retrieval contexts?

De-duplicate overlapping memories by validating each candidate against provenance sources, resolving links when referenced bodies change, and enforcing lifecycle transitions like superseded or archived to eliminate redundant guidance.

Can I verify retrieval ranking quality after correcting outdated agent memories?

Yes, you verify retrieval ranking quality by running the same list query parameters before and after corrections to ensure updated memories surface first in the intended scoped retrieval context.

What's the best way to handle missing or stale provenance in agent memory records?

Handle missing or stale provenance by comparing memory assertions against referenced sources, downgrading confidence when provenance is invalid, and moving incorrect records to obsolete or archived lifecycle states.

When should I run memory maintenance on agent guidance records?

Run memory maintenance whenever you change workflows, move or rename files, update invariants, add overlapping memories across scoped contexts, or notice an agent acting on outdated guidance.