memory-sync

Guided workflow for maintaining strategic redundancy between Serena memories and project documentation. Use after significant code changes, phase completions, or when new architectural patterns are discovered.

16 stars

Best use case

memory-sync is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Guided workflow for maintaining strategic redundancy between Serena memories and project documentation. Use after significant code changes, phase completions, or when new architectural patterns are discovered.

Teams using memory-sync should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/memory-sync/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/memory-sync/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/memory-sync/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How memory-sync Compares

Feature / Agentmemory-syncStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Guided workflow for maintaining strategic redundancy between Serena memories and project documentation. Use after significant code changes, phase completions, or when new architectural patterns are discovered.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Memory Sync: Maintaining Strategic Redundancy

## Overview

This skill helps maintain the "strategic redundancy" pattern between Serena memories (optimized for code navigation) and documentation (optimized for human comprehension). Use this skill after significant changes to ensure both remain accurate and useful.

**Key Principle**: Memories are concise, token-efficient summaries for immediate context; docs are comprehensive references for deep understanding.

---

# Process

## 🔍 Phase 1: Assess What Changed

### 1.1 Review Recent Changes

First, understand what has changed since the last sync:

```bash
# Check recent commits
git log --oneline -10

# Check uncommitted changes
git status
git diff

# Check what files were modified
git diff --name-only HEAD~5..HEAD
```

### 1.2 Identify Change Categories

Categorize the changes:

**Architecture Changes** → Affect `project_overview.md`, `codebase_structure.md`, `critical_implementation_patterns.md`
- New layers or components added
- Protocol flow changes
- Session management patterns
- Critical implementation patterns discovered

**Convention Changes** → Affect `code_style_and_conventions.md`
- New naming patterns
- Error message format changes
- Commit message conventions
- Code organization rules

**Workflow Changes** → Affect `suggested_commands.md`, `task_completion_checklist.md`
- New build commands
- Testing procedure updates
- Dependency management changes
- New development tools

**Status Changes** → Affect `project_overview.md`
- Phase completions
- Milestone achievements
- New features complete

**Technology Changes** → Affect `tech_stack.md`
- New dependencies
- Version upgrades
- Platform support changes

---

## 📝 Phase 2: Update Memories

For each affected memory, follow this process:

### 2.1 Read Current Memory

```bash
# Use Serena to read the memory
read_memory(memory_file_name="<memory_name>")
```

### 2.2 Compare with Current Code

Use Serena's symbolic tools to verify accuracy:

```bash
# Example: Check if codebase_structure matches reality
list_dir(relative_path="internal", recursive=true)
get_symbols_overview(relative_path="internal/dap/client.go")

# Example: Verify critical patterns still apply
find_symbol(name_path="Client/waitForResponse", include_body=true)
```

### 2.3 Update Memory (Token-Efficient)

**Guidelines for memory updates:**
- Keep concise (1-2 pages max)
- Focus on "what you need to know NOW"
- Use bullet points and code snippets
- Remove outdated information
- Add new critical patterns

```bash
# Update the memory
write_memory(
  memory_name="<memory_name>",
  content="<updated_content>"
)
```

### 2.4 Memory-Specific Update Patterns

**project_overview.md**:
- Update implementation status
- Add new architectural insights
- Update phase completion status
- Revise key capabilities if changed

**critical_implementation_patterns.md**:
- Add newly discovered patterns
- Update code examples if APIs changed
- Mark deprecated patterns
- Highlight gotchas from recent debugging

**code_style_and_conventions.md**:
- Add new naming conventions
- Update error message examples
- Revise file organization rules
- Add new commit types if introduced

**suggested_commands.md**:
- Add new build/test commands
- Update command sequences
- Add new dependency management steps
- Revise platform-specific commands

**codebase_structure.md**:
- Update directory tree if structure changed
- Revise layer descriptions
- Update file counts and key files
- Add new packages or modules

**tech_stack.md**:
- Update dependency versions
- Add new dependencies
- Update build system changes
- Revise platform support

**task_completion_checklist.md**:
- Add new quality checks
- Update test commands
- Revise documentation requirements
- Add new special considerations

---

## 📚 Phase 3: Flag Documentation Updates

After updating memories, identify which docs need comprehensive updates:

### 3.1 Check Documentation Impact

**For architecture changes:**
- [ ] `docs/ARCHITECTURE.md` - Update design patterns
- [ ] `docs/IMPLEMENTATION_GUIDE.md` - Update component specs
- [ ] `docs/reference/GODOT_SOURCE_ANALYSIS.md` - Add findings

**For convention changes:**
- [ ] `docs/reference/CONVENTIONS.md` - Update coding standards
- [ ] `CLAUDE.md` - Update quick reference

**For workflow changes:**
- [ ] `docs/TESTING.md` - Update test procedures
- [ ] `docs/DEPLOYMENT.md` - Update build/deploy steps
- [ ] `CLAUDE.md` - Update development commands

**For status changes:**
- [ ] `docs/PLAN.md` - Update phase status and timeline
- [ ] `README.md` - Update project status

### 3.2 Update Documentation

For each flagged document:

1. **Read the current doc**
2. **Identify sections that need updates**
3. **Update with comprehensive details** (unlike memories, docs should be thorough)
4. **Add examples and rationale** (explain WHY, not just WHAT)
5. **Maintain existing structure and formatting**

**Key Difference from Memories:**
- Docs explain the reasoning and trade-offs
- Docs provide extensive examples
- Docs are stable references, not quick summaries

---

## ✅ Phase 4: Verify Sync Completeness

### 4.1 Cross-Check Critical Information

Verify that critical information appears in both places (with appropriate detail level):

**Pattern**: Check that each critical pattern exists in:
- Memory (concise, code snippet)
- Doc (comprehensive, with rationale)

Example checks:

```bash
# Check event filtering pattern
grep -r "event filtering" .serena/memories/
grep -r "event filtering" docs/

# Check timeout protection pattern
grep -r "timeout" .serena/memories/
grep -r "timeout" docs/
```

### 4.2 Validate Memory Size

Ensure memories remain token-efficient:

```bash
# Check memory sizes (should be under ~2000 tokens each)
wc -w .serena/memories/*.md

# If any memory is too large, condense it
```

### 4.3 Document the Sync

Add a note about what was synced:

```bash
# In git commit message
git commit -m "docs: sync memories with Phase X completion

Updated memories:
- project_overview.md (phase status)
- critical_implementation_patterns.md (new timeout pattern)

Updated docs:
- ARCHITECTURE.md (event filtering section)
- PLAN.md (Phase X marked complete)"
```

---

## 🎯 Quick Reference: Update Triggers

**Must sync immediately:**
- ✅ Phase completion
- ✅ New critical pattern discovered (e.g., event filtering, timeout requirement)
- ✅ Architecture layer added/removed
- ✅ Major refactoring (5+ files changed)

**Should sync soon:**
- New tool naming convention
- Error message pattern change
- New development command
- Directory structure change

**No sync needed:**
- Bug fixes in existing code
- Test additions without new patterns
- Minor documentation typos
- Comment improvements

---

## 📋 Checklist Template

Use this checklist each time you run memory-sync:

```
Memory Sync Checklist - [Date]

Changes Assessed:
- [ ] Reviewed git log for recent changes
- [ ] Identified change categories
- [ ] Determined affected memories and docs

Memories Updated:
- [ ] project_overview.md (if status/architecture changed)
- [ ] critical_implementation_patterns.md (if new patterns)
- [ ] code_style_and_conventions.md (if conventions changed)
- [ ] suggested_commands.md (if workflow changed)
- [ ] codebase_structure.md (if structure changed)
- [ ] tech_stack.md (if dependencies changed)
- [ ] task_completion_checklist.md (if process changed)

Documentation Flagged:
- [ ] ARCHITECTURE.md (architecture changes)
- [ ] CONVENTIONS.md (convention changes)
- [ ] TESTING.md (test procedure changes)
- [ ] PLAN.md (status updates)
- [ ] CLAUDE.md (quick reference updates)
- [ ] Other: _______________

Verification:
- [ ] Cross-checked critical patterns exist in both places
- [ ] Verified memory sizes remain token-efficient
- [ ] Documented sync in git commit message

Notes:
[Add any observations or decisions made during sync]
```

---

## 💡 Tips for Effective Memory Sync

**Keep Memories Lean:**
- If a memory grows beyond 2 pages, split it or condense
- Remove outdated information immediately
- Focus on "what changed recently" not "complete history"

**Use Code Examples Wisely:**
- Memories: Small, focused snippets (5-10 lines)
- Docs: Complete, annotated examples (20+ lines)

**Maintain Single Source of Truth:**
- Docs are authoritative for "how things should work"
- Memories reflect "how things actually work now"
- When they diverge, it signals needed doc updates

**Leverage Serena Tools:**
- Use symbolic search to verify code matches memories
- Use `find_referencing_symbols` to check pattern usage
- Use `search_for_pattern` to find all instances

**Version Control Your Memories:**
- Commit memory changes with descriptive messages
- Review memory diffs before committing
- Document why memories were updated

Related Skills

moai-foundation-memory

16
from diegosouzapw/awesome-omni-skill

Persistent memory across sessions using MCP Memory Server for user preferences, project context, and learned patterns

memorylane

16
from diegosouzapw/awesome-omni-skill

Zero-config persistent memory for Claude with automatic cost savings. Use when you need to remember project context, reduce API token costs, track learned patterns, manage memories across sessions, or curate/clean up memories. Automatically compresses context 6x and saves 84% on API costs. Keywords: memory, remember, recall, context, cost savings, reduce tokens, learn, patterns, insights, curate, clean up memories, review memories.

memory-management

16
from diegosouzapw/awesome-omni-skill

Guide for managing Claude Code memory effectively. Use when setting up project memory, optimizing CLAUDE.md files, configuring rules directories, or establishing cross-session knowledge patterns. Covers memory hierarchy, best practices, and context optimization.

memory

16
from diegosouzapw/awesome-omni-skill

Manages memory, SSOT files, and Plans.md operations. Use when user mentions メモリ, memory, SSOT, decisions.md, patterns.md, マージ, merge, Plans.md, 移行, migrate. Do NOT load for: 実装作業, レビュー, 一時的なメモ, セッション中の作業記録.

memory-conventions

16
from diegosouzapw/awesome-omni-skill

This skill should be used when persisting context between sessions, saving project state, loading previous session context, or managing longitudinal memory beyond beads issue tracking.

memory-capture

16
from diegosouzapw/awesome-omni-skill

Capture and organize memories, decisions, and learnings to a memories.md file. Use when you want to save context for future sessions.

memory-bank

16
from diegosouzapw/awesome-omni-skill

Persistent project documentation system that maintains context across sessions. Creates structured Memory Bank files to preserve project knowledge, decisions, and progress.

heir-sync-management

16
from diegosouzapw/awesome-omni-skill

Master-Heir synchronization, contamination prevention, and promotion workflows

context-memory

16
from diegosouzapw/awesome-omni-skill

Advanced context and memory management system for AI agents. Provides persistent memory across sessions through daily logs (memory/YYYY-MM-DD.md), long-term curated memory (MEMORY.md), conversation archives with semantic search, and automatic behavioral learning from user satisfaction tracking. Use when you need to: (1) Remember information across sessions, (2) Archive conversations before context loss, (3) Search past discussions, (4) Track and learn from user satisfaction patterns, (5) Maintain session continuity, (6) Implement proactive memory maintenance. Includes conversation-archiver.py and satisfaction-tracker.py scripts, session startup routines, and periodic reflection workflows.

codegen-sync

16
from diegosouzapw/awesome-omni-skill

Verifies TypeScript codegen is in sync with Elixir protocol definitions. Use this skill after modifying Elixir structs, protocol messages, or RPC types in lib/opal/ to regenerate and verify the TypeScript client SDK types.

asyncredux-connector-pattern

16
from diegosouzapw/awesome-omni-skill

Implement the Connector pattern for separating smart and dumb widgets. Covers creating StoreConnector widgets, implementing VmFactory and Vm classes, building view-models, and optimizing rebuilds with view-model equality.

Asyncio Programming

16
from diegosouzapw/awesome-omni-skill

Master asynchronous programming with asyncio, async/await, concurrent operations, and async frameworks