agentleFS
sagullapallisagullapalli/claude-code-setup/.claude/skills/memory-workflow/SKILL.md

memory-workflow

Skill4 starsChanged 10 months agoMITView on GitHub

Templates and examples for memory file management. STAR format template, what to record vs not record, good/bad examples. Use when updating memory or at session start/end.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Problem: No rationale, no links.

    line 136
  2. Distinctive:

    Lessons: Keep last 5-10 most relevant

    line 153
  3. Very specific:

    If memory exceeds target, move detailed content to docs/ and keep pointers.

    line 156

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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 Workflow

Templates and detailed guidance for maintaining agent memory files.

For mandatory protocol, see: .claude/rules/memory-protocol.md


STAR Format Template

For bugs, issues, and significant learnings:

### [Title] (Date)
**Situation**: [Context - what was the problem/scenario]
**Task**: [Goal - what needed to be accomplished]
**Action**: [Steps taken to resolve/implement]
**Result**: [Outcome and verification]
**Fix**: [File:line reference or specific change made]
**Pattern**: [Reusable lesson/gotcha for future work]
**Full details**: [Link to detailed doc in docs/ or docs/archive/]

Example

### Phase 2A Bug #2: Message History Empty (2025-12-03)
**Situation**: GET /sessions/{id}/messages returned 0 messages despite active conversations
**Task**: Fix chat history endpoint to show all messages
**Action**: Manually append user message + extend agent events to `runner_session.events` before save
**Result**: All 6 messages retrieved (3 user + 3 assistant), history working
**Fix**: `agent_service.py:209-215` - `events.append(user_msg)` + `events.extend(result)`
**Pattern**: ADK `run_async()` only RETURNS events, doesn't modify `session.events` (manual append required)
**Full details**: [docs/archive/handoffs/SESSION_HANDOFF_BUGFIX.md]

What to Record

DO Record

CategoryExamples
Project configGCP project ID, region, stack
Current statusPhase, what's complete, what's pending
Key decisions1-2 line rationale + link to docs
Critical pathsFile paths, commands, gotchas
Lessons learnedSTAR format entries
Doc pointersLinks with brief description

DON'T Record

CategoryWhere It Goes Instead
Full implementation detailsdocs/
Step-by-step guidesdocs/
Duplicate info from docsJust link to docs
General technical patterns.claude/skills/

Memory File Structure

# Agent Name - Role

Last updated: YYYY-MM-DD

## Project Config
- GCP Project: [project-id]
- Region: europe-west1
- Stack: Python/FastAPI/Google ADK

## Current Status
- Phase: [current phase]
- Complete: [bullet list]
- Pending: [bullet list]
- See: [link to detailed phase doc]

## Key Decisions
| Decision | Rationale | Details |
|----------|-----------|---------|
| [What] | [1-2 line why] | [link to ADR] |

## Critical Commands
```bash
# Start backend
cd backend && uvicorn main:app --reload

# Run tests
pytest backend/tests/ -v

Lessons Learned

[STAR format entries]

Documentation Map

TopicDocumentContents
[topic][path][brief description]

---

## Good vs Bad Examples

### Bad: Too Detailed
```markdown
## Session Storage Implementation
We implemented GCS session storage by first creating a bucket using
terraform with the following configuration... [500 more lines]

Problem: This belongs in docs/, not memory.

Good: Contextualized Index

## Session Storage
- Decision: GCS CloudStorageMemory (not Firestore)
- Rationale: Simpler, cheaper, ADK-native
- Full details: [docs/adr/002-gcs-session-storage.md]

Why it works: Brief context + pointer to full doc.

Bad: No Context

## Decisions
- Use GCS
- Use Cloud Run

Problem: No rationale, no links.

Good: With Rationale

## Key Decisions
| Decision | Rationale | Details |
|----------|-----------|---------|
| GCS over Firestore | Simpler, ADK-native, 10x cheaper | [ADR-002] |
| Cloud Run over GKE | Managed, auto-scaling, no K8s overhead | [ADR-003] |

Size Guidelines

  • Target: 10-15k characters (2.5-3.75k tokens)
  • Max sections: 6-8 major sections
  • Lessons: Keep last 5-10 most relevant
  • Archive old lessons: Move to docs/archive/lessons/ if needed

If memory exceeds target, move detailed content to docs/ and keep pointers.

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.