memory-sync
Skill4 starsChanged 12 months agoMITView on GitHub
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.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- TheElephantCoder/agent-harnesstheir own version, first seen Sep 20, 2026
- ramboz/jigtheir own version, first seen Jun 22, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ramboz/jig★ 7same name
- TheElephantCoder/agent-harness★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- phase-prepSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
34 rules. About 0 are common, 32 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈32
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 83
Use Serena's symbolic tools to verify accuracy:
- Distinctive: line 97
Keep concise (1-2 pages max)
- Distinctive: line 99
Use bullet points and code snippets
- Distinctive: line 101
Add new critical patterns
- Distinctive: line 115
Add new architectural insights
- Distinctive: line 116
Update phase completion status
- Distinctive: line 120
Add newly discovered patterns
- Distinctive: line 121
Update code examples if APIs changed
- Distinctive: line 126
Add new naming conventions
- Distinctive: line 127
Update error message examples
- Distinctive: line 129
Add new commit types if introduced
- Distinctive: line 132
Add new build/test commands
- Distinctive: line 134
Add new dependency management steps
- Distinctive: line 138
Update directory tree if structure changed
- Distinctive: line 140
Update file counts and key files
- Distinctive: line 141
Add new packages or modules
- Distinctive: line 146
Update build system changes
- Distinctive: line 150
Add new quality checks
- Distinctive: line 153
Add new special considerations
- Distinctive: line 159
After updating memories, identify which docs need comprehensive updates:
- Distinctive: line 202
Verify that critical information appears in both places (with appropriate detail level):
- Distinctive: line 204
Pattern: Check that each critical pattern exists in:
- Distinctive: line 222
Ensure memories remain token-efficient:
- Distinctive: line 233
Add a note about what was synced:
- Distinctive: line 266
Test additions without new patterns
- Distinctive: line 274
Use this checklist each time you run memory-sync:
- Distinctive: line 315
If a memory grows beyond 2 pages, split it or condense
- Distinctive: line 316
Remove outdated information immediately
- Distinctive: line 326
When they diverge, it signals needed doc updates
- Distinctive: line 329
Use symbolic search to verify code matches memories
- Very specific: line 330
Use find_referencing_symbols to check pattern usage
- Very specific: line 331
Use search_for_pattern to find all instances
- Distinctive: line 334
Commit memory changes with descriptive messages
- Distinctive: line 336
Document why memories were updated
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
# 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..HEAD1.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
# 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:
# 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
# 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 patternsdocs/IMPLEMENTATION_GUIDE.md- Update component specsdocs/reference/GODOT_SOURCE_ANALYSIS.md- Add findings
For convention changes:
docs/reference/CONVENTIONS.md- Update coding standardsCLAUDE.md- Update quick reference
For workflow changes:
docs/TESTING.md- Update test proceduresdocs/DEPLOYMENT.md- Update build/deploy stepsCLAUDE.md- Update development commands
For status changes:
docs/PLAN.md- Update phase status and timelineREADME.md- Update project status
3.2 Update Documentation
For each flagged document:
- Read the current doc
- Identify sections that need updates
- Update with comprehensive details (unlike memories, docs should be thorough)
- Add examples and rationale (explain WHY, not just WHAT)
- 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:
# 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:
# Check memory sizes (should be under ~2000 tokens each)
wc -w .serena/memories/*.md
# If any memory is too large, condense it4.3 Document the Sync
Add a note about what was synced:
# 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_symbolsto check pattern usage - Use
search_for_patternto find all instances
Version Control Your Memories:
- Commit memory changes with descriptive messages
- Review memory diffs before committing
- Document why memories were updated
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

