agentleFS
TransitionMatrixTransitionMatrix/godot-dap-mcp-server/.claude/skills/memory-sync/SKILL.md

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

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. ramboz/jig★ 7same name
    2. 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.

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
  1. Distinctive:

    Use Serena's symbolic tools to verify accuracy:

    line 83
  2. Distinctive:

    Keep concise (1-2 pages max)

    line 97
  3. Distinctive:

    Use bullet points and code snippets

    line 99
  4. Distinctive:

    Add new critical patterns

    line 101
  5. Distinctive:

    Add new architectural insights

    line 115
  6. Distinctive:

    Update phase completion status

    line 116
  7. Distinctive:

    Add newly discovered patterns

    line 120
  8. Distinctive:

    Update code examples if APIs changed

    line 121
  9. Distinctive:

    Add new naming conventions

    line 126
  10. Distinctive:

    Update error message examples

    line 127
  11. Distinctive:

    Add new commit types if introduced

    line 129
  12. Distinctive:

    Add new build/test commands

    line 132
  13. Distinctive:

    Add new dependency management steps

    line 134
  14. Distinctive:

    Update directory tree if structure changed

    line 138
  15. Distinctive:

    Update file counts and key files

    line 140
  16. Distinctive:

    Add new packages or modules

    line 141
  17. Distinctive:

    Update build system changes

    line 146
  18. Distinctive:

    Add new quality checks

    line 150
  19. Distinctive:

    Add new special considerations

    line 153
  20. Distinctive:

    After updating memories, identify which docs need comprehensive updates:

    line 159
  21. Distinctive:

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

    line 202
  22. Distinctive:

    Pattern: Check that each critical pattern exists in:

    line 204
  23. Distinctive:

    Ensure memories remain token-efficient:

    line 222
  24. Distinctive:

    Add a note about what was synced:

    line 233
  25. Distinctive:

    Test additions without new patterns

    line 266
  26. Distinctive:

    Use this checklist each time you run memory-sync:

    line 274
  27. Distinctive:

    If a memory grows beyond 2 pages, split it or condense

    line 315
  28. Distinctive:

    Remove outdated information immediately

    line 316
  29. Distinctive:

    When they diverge, it signals needed doc updates

    line 326
  30. Distinctive:

    Use symbolic search to verify code matches memories

    line 329
  31. Very specific:

    Use find_referencing_symbols to check pattern usage

    line 330
  32. Very specific:

    Use search_for_pattern to find all instances

    line 331
  33. Distinctive:

    Commit memory changes with descriptive messages

    line 334
  34. Distinctive:

    Document why memories were updated

    line 336

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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..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

# 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 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:

# 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 it

4.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_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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.