Universal 2-tier persistent rolling memory system for AI coding agents.
Compatible with Google Antigravity, Anthropic Claude Code, Cursor IDE, Windsurf / Cascade, OpenAI Codex, and any LLM.
🇬🇧 English • 🇪🇸 Español • 📖 Spanish File (README.es.md)
When developing software alongside AI coding assistants, two major problems arise:
- Amnesia and Regressions: The agent forgets yesterday's hard-learned lessons. If a library conflicted with Docker, an API route changed, or a database column required an explicit type, the agent tends to make the exact same mistake again in subsequent sessions.
- Context Degradation from Bloated Files: Allowing notes or documentation to grow unchecked into 2,000–3,000 line behemoths saturates the model's attention window (context window). The AI becomes slow, ignores crucial instructions, and starts hallucinating.
This architecture divides project memory into two strictly calibrated tiers:
- 🔥 Hot Memory (
memory.md): An ultra-lean file (< 400 lines) at the project root. It contains current system state, permanent architectural decisions, and an active session log strictly capped at 2 to 3 active blocks. - 🧊 Cold Storage (
docs/CHANGELOG_HISTORY.md): A permanent historical archive where older blocks are automatically prepended and stored intact as soon as a 4th block is created.
# Project Memory - [Project Name]
## 1. Current System State
- Tech stack, database engine, running ports, and build status.
- Passing test suites and verified dependencies.
## 2. Architecture Decisions & Critical Patches (Permanent Lessons)
- Rule A: Hard-won discovery that must NEVER be reverted.
- Rule B: Framework collision, library patch, or mandatory security convention.
## 3. Active Session Log (STRICTLY 2 TO 3 BLOCKS)
### [2026-09-12] - Block 186: [Feature Title]
### [2026-09-12] - Block 187: [Feature Title]You have 3 easy ways to install and use this skill in any workspace:
From your cloned repository directory:
# Install in the current project
node scripts/install-memory.js
# Or install in any target project path
node scripts/install-memory.js "C:\Path\To\Your\Project"The script automatically detects your stack (package.json, requirements.txt, Cargo.toml, go.mod, etc.) and configures:
memory.mddocs/CHANGELOG_HISTORY.mdAGENTS.mdandGEMINI.md(Antigravity & generic models)CLAUDE.md(Claude Code).cursorrules(Cursor IDE).windsurfrules(Windsurf IDE).agents/rules/memory-directive.md(Antigravity unconditionaltrigger: always_onrule)
Copy this repository into your project under:
your-project/
└── .agents/
└── skills/
└── agent-memory-skill/
├── SKILL.md
├── scripts/
└── templates/
Antigravity automatically discovers the skill and invokes it on demand when needed.
Simply write in your chat with any AI (Antigravity, Claude Code, Cursor, ChatGPT):
"Please install and configure the skill
agent-memory-skillfrom https://github.com/RonnyIA/agent-memory-skill to initializememory.mdand agent directives in this project."
The AI will read SKILL.md and execute the entire setup autonomously.
| Environment / Model | Injected / Created File | Enforcement Mechanism |
|---|---|---|
| Google Antigravity | .agents/rules/memory-directive.md |
Injected into <user_rules> via trigger: always_on. |
| Antigravity / Generic LLMs | AGENTS.md and GEMINI.md |
Root directives with mandatory memory reading rules. |
| Claude Code (Anthropic) | CLAUDE.md |
Auto-prepended to the top of the startup file. |
| Cursor IDE | .cursorrules |
Injected into Cursor's workspace context prompt. |
| Windsurf / Cascade | .windsurfrules |
Injected into Cascade's persistent instructions. |
All utilities are written in pure Node.js with zero external packages:
| Script | Command | Purpose |
|---|---|---|
| Universal Installer | node scripts/install-memory.js [path] |
Scans stack, initializes memory, and sets up AI agent rules. |
| Automatic Rotator | node scripts/rotate-memory.js [path] |
If memory.md has 3+ blocks, moves the oldest to docs/CHANGELOG_HISTORY.md. |
| Hygiene Auditor | node scripts/check-memory.js [path] |
Audits 3 required sections and enforces the 2-3 block limit. Ideal for Git hooks/CI. |
Distributed under the MIT License. Free to use, modify, and distribute across personal and commercial projects.
Puedes consultar la guía completa en español aquí (README.es.md).
Haz clic aquí para una vista rápida en Español
- Amnesia y Regresiones: El agente olvida las lecciones de ayer y repite errores ya resueltos.
- Degradación por Archivos Gigantes: Los archivos de notas descontrolados saturan la ventana de contexto de la IA.
- 🔥 Memoria Caliente (
memory.md): Archivo ágil (< 400 líneas) en la raíz con el estado actual, decisiones críticas y estrictamente de 2 a 3 bloques activos. - 🧊 Memoria Fría (
docs/CHANGELOG_HISTORY.md): Historial permanente donde se archivan los bloques antiguos sin recortar.
node scripts/install-memory.js "C:\Ruta\A\Tu\Proyecto"Configura automáticamente directivas para Antigravity (always_on), Claude Code (CLAUDE.md), Cursor (.cursorrules), Windsurf (.windsurfrules) y cualquier LLM.
Para más detalles, revisa README.es.md.