memory-bank-defrag

Defragment and re-actualize a project memory bank against recent git commits.

4|Updated Aug 8, 2026
One-click install
npx skills add https://github.com/alexeyshishin/as-skill --skill memory-bank-defrag-alexeyshishin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-bank-defrag
Source: https://github.com/alexeyshishin/as-skill/tree/main/domains/core/skills/memory-bank-defrag
Command: npx skills add https://github.com/alexeyshishin/as-skill --skill memory-bank-defrag-alexeyshishin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Project knowledge bases (.assistant/ docs, auto-memory files, READMEs) drift out of sync with the actual codebase: stale facts linger, amendment-on-amendment patches pile up, and resolved questions stay open. This Skill reconciles the memory bank with what actually changed in the repo since the last defrag. ## Core Features & Use Cases - Baseline-aware diffing: Finds the last defrag commit via a Memory-Defrag: trailer, processes only commits since then, and no-ops quietly when nothing changed. - Patch folding and staleness correction: Collapses amendment chains into clean current-state docs, closes resolved questions, fixes dangling references, and captures new durable facts — verified against live code. - Unattended scheduled runs: Opens a pull request (never pushes to main) and posts a Mattermost webhook notification so a human reviews the knowledge-base diff. - Use Case: A team runs this nightly in CI; after a week of feature commits, it folds five amendment blocks in the decisions doc, closes two answered open questions, corrects a renamed config path, and opens a PR for review. ## Quick Start Ask the assistant to defragment the project memory bank and actualize the .assistant knowledge base against recent commits.

Frequently Asked Questions about memory-bank-defrag

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

FAQPage Schema
How do I keep a project knowledge base in sync with code changes?

Run a memory bank defrag that diffs commits since the last baseline, verifies each recorded fact against the live repo, and folds stale patches into clean current-state docs. The skill shows a diff for review before committing.

How does the skill detect what changed since the last defrag?

It searches git history for a Memory-Defrag trailer on the previous defrag commit, falling back to a conventional subject line or a user-supplied baseline ref. If no commits exist since baseline, it no-ops without edits.

Can memory bank defrag run unattended on a schedule?

Yes. In unattended mode it creates a dated branch, commits with the baseline trailer, and opens a pull request for human review — never pushing to main. On a no-op day it does nothing and stays quiet.

Does the defrag skill modify source code or raw records?

No. It only edits documentation and knowledge files: .assistant docs, README/AGENTS/CLAUDE files, and auto-memory. Raw evidence like meeting transcripts and chat dumps is never overwritten.

Why did the scheduled defrag run produce no pull request?

The no-op guard fired: there were no substantive commits since the last defrag baseline, or changes were purely cosmetic like formatting or lockfile churn. A quiet run with no branch or PR is the correct outcome.