Standardized workflow for discovering, reading, writing, and compacting the project's memory file (memory.instructions.md) to persist context across AI chat sessions, with a permanent Knowledge Base for cross-session decisions and lessons learned.
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/memory-manager/SKILL.mdThis skill provides a standardized protocol for managing the project's persistent memory file (memory.instructions.md). It ensures that AI agents can reliably save and restore context across chat sessions, regardless of which instruction directory the project uses. This skill is agent-agnostic — any agent in the ecosystem can invoke it.
The memory file is divided into two distinct zones:
For performance, the active memory path can be recorded in the project's AGENTS.md file as a fast-path shortcut. See AGENTS.md Integration below for details.
⚠️ DIRECTIVE: This workflow MUST be executed before ANY read or write operation. Never hardcode or assume the memory file path.
Before performing a recursive search, check if the active memory path is already recorded in the project's AGENTS.md file (located at the project root).
AGENTS.md at the project root (if it exists).## Memory Configuration section containing an Active Memory Path entry.AGENTS.md (see Workflow 3, Step 5).AGENTS.md does not exist OR no Memory Configuration section is found: Proceed to Step 1 (recursive search) as normal.memory.instructions.md across ALL subdirectories within the project, prioritizing the following instruction roots and their subfolders:
.agents/instructions/ (and subfolders)instructions/ (and subfolders at the project root)grep_search searching for filename memory.instructions.md or glob patterns like **/memory.instructions.md) to scan across subfolders, ignoring build/vendor folders (node_modules, .git, dist).instructions/ folder at the project root and initialize a new memory.instructions.md file inside it using the Initial Memory Template below.Note: If the fast path (Step 0) was skipped or failed, and a file is found via recursive search, offer to record the path in
AGENTS.mdduring Workflow 3 (Write Mode, Step 5).
# Project Memory Log
> Active Location: [path_where_this_file_is_created]
> This file is managed by the `memory-manager` skill.
> It persists context across AI chat sessions to prevent knowledge loss.
> Do NOT manually edit this file unless necessary.
---
## 🧠 Knowledge Base
> This section accumulates cross-session knowledge that must survive compaction.
> Updated during Compaction Mode (Workflow 4). Do NOT delete entries here.
### Architecture & Patterns
<!-- Proven patterns and architectural decisions. Add entries as bullet points. -->
### Dead-Ends (Do NOT Repeat)
<!-- Failed approaches with root cause and correct solution. Use table format:
| # | Attempted | Why It Failed | Correct Solution |
|---|-----------|---------------|------------------|
-->
### Key Metrics & Baselines
<!-- Stable metrics that serve as reference points (test counts, coverage, performance baselines). -->
---Use this workflow to load context at the beginning of a new session.
"I have read the project memory from
[discovered_path]. The Knowledge Base contains [N] architectural patterns and [N] dead-ends. The last SDLC phase was [Phase]. Recent progress includes [Milestones]. I am ready to proceed."
Use this workflow to persist progress after a significant milestone.
"Memory checkpoint has been saved to
[discovered_path]. This session's progress has been recorded for continuity in the next session."
AGENTS.md (if not already recorded):
AGENTS.md exists at the project root.## Memory Configuration section with an Active Memory Path entry already exists and matches the current locked path.AGENTS.md has no Memory Configuration section), ask the user:
"Would you like to save this memory path to
AGENTS.mdto speed up the next session?"
## Memory Configuration section in AGENTS.md using the format defined in AGENTS.md Integration below. Confirm to the user:
"The memory path has been recorded in
AGENTS.md. The next session will directly use this path without needing a recursive search."
AGENTS.md does not exist: Skip the offer. Inform the user that AGENTS.md was not found at the project root.## 📝 Session Checkpoint: [YYYY-MM-DD]
- **Active Memory Path:** [path_to_this_file]
- **Current SDLC Phase:** [e.g., Planning / Specification / Implementation / Review / Documentation]
- **Active Artifacts:**
- `[path/to/prd-*.md]` — Status: ✅ Finalized (Readiness Score: [XX]/100)
- `[path/to/spec.md]` — Status: 🔄 In Progress (Readiness Score: [XX]/100)
- `[path/to/plan.md]` — Status: ⏳ Pending
- **Achieved Milestones:**
- [Concise description of what was accomplished]
- [Another achievement, if any]
- **Dead-Ends (Do NOT Repeat):**
- **Attempted:** [Approach that was tried and failed]
- **Reason:** [Why it failed / root cause]
- **Note:** If this dead-end recurs across sessions, flag it for promotion to Knowledge Base during next compaction.
- **Updated Files:**
- `[relative/path/to/file1]` — [Brief description of change]
- `[relative/path/to/file2]` — [Brief description of change]
- **Decisions Made:**
- [Key architectural or design decision, if any]
- **Next Action / Pending:**
- [What the next agent or session should pick up]
- [Any unresolved blockers or open questions]
<!-- checkpoint-tail: [1-sentence summary for rapid context recovery by AI at session start] -->
---Use this workflow when the user requests memory cleanup or when checkpoints accumulate beyond a reasonable threshold.
⚠️ DIRECTIVE: NEVER delete checkpoints without first promoting valuable knowledge to the Knowledge Base. The Knowledge Base is the permanent record; checkpoints are ephemeral.
### Architecture & Patterns section.### Dead-Ends (Do NOT Repeat) table. Only promote if the dead-end is generalizable (not specific to a one-off session issue).### Key Metrics & Baselines section. Only promote finalized, stable metrics — not in-progress numbers."Checkpoints for Sessions 1–18 compacted on 2026-07-07. Knowledge promoted to this section."
"Memory compaction complete at
[discovered_path]. [N] checkpoints deleted, [N] entries promoted to Knowledge Base. [N] most recent checkpoints retained."
AGENTS.md, verify that the file still exists at that path. If the file was moved or renamed during compaction (unlikely but possible), update the path in AGENTS.md to reflect the new location.When promoting knowledge during compaction, append to the existing Knowledge Base sections using these formats:
Architecture & Patterns (bullet list):
- **[Pattern Name]:** [Concise description]. [Source: Session X, still valid as of YYYY-MM-DD]Dead-Ends (table row):
| [id] | [What was attempted] | [Why it failed / root cause] | [Correct solution] |Key Metrics & Baselines (bullet list):
- **[Metric Name]:** [Value] — [Context, e.g., "296 tests, 14 files, 0 fail"]The active memory path can be recorded in the project's AGENTS.md file to enable a fast path during Workflow 1 (File Discovery). This avoids a recursive search across 6–7 instruction directories on every session bootstrap.
AGENTS.md, offer to record it.AGENTS.md without asking.Add a ## Memory Configuration section to AGENTS.md. Place it after the ## Communication section or near the end of the file, before ## Agents Specific Guidelines.
## Memory Configuration
- **Active Memory Path:** `.agents/instructions/memory.instructions.md`
- **Managed by:** `memory-manager` skill
- **Last Recorded:** [YYYY-MM-DD]Active Memory Path entry. If multiple paths are found during discovery, the user chooses one, and only that one is recorded.Active Memory Path and Last Recorded fields in AGENTS.md.## Memory Configuration section must NOT alter any other content in AGENTS.md.AGENTS.md does not exist at the project root, skip the recording offer. The fast path is simply unavailable; recursive search remains the fallback..opencode/instructions/. Always run the Discovery Protocol (Step 0 fast path, then Step 1 fallback) first.Active Memory Path in AGENTS.md is still valid. Always verify the file exists before locking the path. A stale path must trigger fallback to recursive search (Step 1).## Memory Configuration section in AGENTS.md without explicitly asking the user. The fast path is a convenience, not a silent side effect.glenrioariesto/social-content-studio
f3ddfdc
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.