brainstorming
MUST USE when the user wants new features, behavior changes, refactoring with new capabilities, or architecture decisions and no…
Use in long or noisy sessions to persist durable state across session boundaries via state.md. Also generates project-map.md when asked to map the project. Triggers on: user explicitly asks to "save state", "compress context", "map this project", "generate project map", "create
$ npx -y skills add REPOZY/superpowers-optimized --skill context-management --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/context-managementContext preview
The summary Claude sees to decide when to auto-load this skill.
Use in long or noisy sessions to persist durable state across session boundaries via state.md. Also generates project-map.md when asked to map the project. Triggers on: user explicitly asks to "save state", "compress context", "map this project", "generate project map", "create
name: context-management description: > Use in long or noisy sessions to persist durable state across session boundaries via state.md. Also generates project-map.md when asked to map the project. Triggers on: user explicitly asks to "save state", "compress context", "map this project", "generate project map", "create project map", cross-session handoff needed, or repeated failures indicate context is getting stale.
| User said | Go to | |---|---| | "map this project" / "generate project map" / "create project map" / "update project map" | [Project Map](#project-map) section | | "save state" / "compress context" / session ending with ongoing work | [Procedure](#procedure) section | | Starting a task on a project with existing history | Grep `session-log.md` first, then proceed |
Do not default to `state.md` for a map request. Do not default to `project-map.md` for a save-state request.
---
Claude Code automatically compresses context within a session. This skill has two complementary responsibilities:
1. **Cross-session persistence** — `state.md` preserves decisions and progress for the *current task* when a session ends mid-work. 2. **Accumulated project memory** — `session-log.md` builds a searchable history of decisions, rejected approaches, and hard-won facts across sessions. Written manually via this skill — only when there is something worth preserving.
Before diving in, grep `session-log.md` for history relevant to the current task.
**Step 1 — Extract keywords.** Take the 2-3 most distinctive nouns from the task description. Avoid generic words ("fix", "update", "file") — use domain nouns ("hook", "auth", "deploy", "staleness").
**Step 2 — Grep each keyword individually first:**
grep -i "<keyword1>" session-log.md | tail -20 grep -i "<keyword2>" session-log.md | tail -20
Check the hit count before reading results. This tells you whether to narrow or widen before committing to any output.
**Step 3 — Adjust based on hit count:**
**Step 4 — Surface what matters.** If relevant entries are found, state them explicitly before proceeding: what was decided, what was rejected, what constraints apply. Don't silently absorb them — make them visible so the user can confirm or override.
1. Extract durable artifacts only:
**state.md vs plan.md:**
If a plan exists, state.md should say "Executing plan at docs/.../plan.md, currently on Task 3" — not copy the full task list.
2. Write `state.md` at the project root with concise sections:
3. **Check for superseded entries before appending.** Grep `session-log.md` for 2-3 keywords from the current decision:
grep -i "<keyword>" session-log.md
Read any matching `[saved]` entries and ask: does the new decision *directly contradict* an old one? If yes, append `[superseded by YYYY-MM-DD]` to the old entry's header line — do not delete it. If the old entry is merely related but not contradicted, leave it unchanged. This is a judgment call, not a mechanical keyword match.
4. Append a `[saved]` entry to `session-log.md`:
**What belongs here vs state.md:**
**Never include in a [saved] entry:**
**Hard limits per component — enforce while writing, not after:**
If a decision doesn't fit in 25 words, the explanation belongs in a design doc. Cut the explanation, not the decision.
Total entry backstop: 250 words / 1500 chars. If exceeded, a bullet violated its limit — find it and cut it. Typical single-topic sessions should targe
The production-grade fork of obra/superpowers — same trusted workflow, dramatically leaner, safer, and more intelligent.
MUST USE when the user wants new features, behavior changes, refactoring with new capabilities, or architecture decisions and no…
Creates minimal, high-signal CLAUDE.md and AGENTS.md context files based on empirical best practices. Invoke on /init command,…
Use BEFORE brainstorming when facing a complex architectural, technology, or design decision where the options are not yet…
MUST USE when updating, migrating, or auditing project dependencies: upgrading packages, fixing security vulnerabilities (CVEs),…
Use when 2+ tasks are independent and can run concurrently without file or state conflicts or sequential dependencies. Triggers…
Maintains a project-specific known-issues.md mapping recurring errors to their solutions. Consulted automatically by…