agentsclimarketplace

Managing memory

Skill cklxx/compound-engineering/skills/managing-memory

Use when a VERIFIED, DURABLE insight emerges — not raw events (that's recording-practices), not pattern analysis (that's running-retros). Persists one-line knowledge items to docs/memory/long-term.md, which is loaded on every session start.From its SKILL.md

Install
npx -y skills add cklxx/compound-engineering --skill managing-memory

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.8 KB, as published. Nobody here has run it

Managing Memory

Role in the loop: PERSIST distilled knowledge that survives across sessions. This is the agent's long-term brain. It does NOT log raw events (that's recording-practices) or analyze patterns (that's running-retros).

The critical distinction:

  • recording-practices writes: "2026-02-09 — nil map panic in config loader" (raw event, full detail)
  • managing-memory writes: "[2026-02-09] Always initialize maps in struct constructors — nil maps panic on write (see error-experience/2026-02-09-nil-map-panic.md)" (one-line rule, linked to evidence)

Precise Trigger Conditions

Activate this skill ONLY when ALL three conditions are met:

ConditionTest
VerifiedYou've seen this work or fail at least once, with concrete evidence
DurableThis will still be true and useful in 2+ weeks
ActionableThe knowledge tells you what to DO, not just what IS

Examples that PASS the test:

KnowledgeWhy it qualifies
"Always run go vet before commit — caught 3 bugs this week"Verified (3 bugs), durable (always true), actionable (run go vet)
"Use sync.RWMutex not sync.Mutex for read-heavy caches"Verified (caused latency spike), durable (performance principle), actionable (use RWMutex)
"API returns 500 not 404 for deleted resources — needs custom error handler"Verified (hit in prod), durable (API behavior), actionable (add handler)

Examples that FAIL the test:

KnowledgeWhy it fails
"Fixed a typo in README"Not durable, not actionable
"Go is faster than Python"Not actionable, too vague
"We should probably refactor the auth module"Not verified, no evidence
"The deploy took 5 minutes today"Not durable, not actionable

Memory File Structure

docs/memory/long-term.md:

# Long-term Memory

> Updated: YYYY-MM-DD HH:MM

## Active Memory

### Architecture & Design
- [YYYY-MM-DD] <one-line actionable knowledge>

### Conventions & Patterns
- [YYYY-MM-DD] <one-line actionable knowledge>

### Technical Decisions
- [YYYY-MM-DD] <decision> — rationale: <why> (see docs/plans/...)

### Known Pitfalls
- [YYYY-MM-DD] <pitfall> — prevention: <what to do> (see error-experience/...)

### Environment & Config
- [YYYY-MM-DD] <one-line actionable knowledge>

Operations

PERSIST — Add new knowledge

  1. Check if a similar item already exists → update it instead of duplicating
  2. Write ONE line under the appropriate section
  3. Link to evidence: (see error-experience/YYYY-MM-DD-slug.md) or (see plans/YYYY-MM-DD-slug.md)
  4. Update the Updated: timestamp at the top

Format: - [YYYY-MM-DD] <imperative actionable statement> (see <evidence link>)

Concrete example:

### Known Pitfalls
- [2026-02-09] Always initialize maps in Go struct constructors — nil map assignment panics at runtime, not compile time (see error-experience/2026-02-09-nil-map-panic.md)

If the item needs more than one line of explanation → create docs/memory/topics/<topic>.md and put a pointer in long-term.md:

### Technical Decisions
- [2026-02-09] Chose token bucket for rate limiting over sliding window — see memory/topics/rate-limiting.md

LOAD — Session startup

Executed by using-compound-engineering skill, not directly by this skill.

UPDATE — Correct existing knowledge

When knowledge changes:

- [2026-01-15] Use Redis for caching → [2026-02-09] Updated: Use in-memory cache for single-instance, Redis only for multi-instance

When knowledge was wrong:

- ~~[2026-01-15] sync.Pool is always faster for allocations~~ → [2026-02-09] Corrected: sync.Pool only helps when allocation rate is high AND objects are large

CURATE — Prune stale knowledge

Triggered by running-retros or when items exceed 50:

  1. For each item, score: recency (referenced in last 30 days?) × impact (prevented a bug or saved time?) × relevance (still applies to current codebase?)
  2. Items scoring low on ALL three → move to docs/memory/archive/YYYY-MM-archive.md
  3. Target: 30–50 active items. Below 30 is fine. Above 50 means you're not curating enough.

Key Principles

  • One line per item. If you need more, use a topic file.
  • Link to evidence. Every item traces to a plan, entry, or decision.
  • Imperative voice. "Always do X" or "Never do Y" — not "X is related to Y."
  • Curate ruthlessly. 40 sharp items beat 200 vague ones.

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.