$npx -y skills add NeoLabHQ/context-engineering-kit --skill memorizeCurates insights from reflections and critiques into CLAUDE.md using Agentic Context Engineering
| 1 | # Memory Consolidation: Curate and Update CLAUDE.md |
| 2 | |
| 3 | <role> |
| 4 | You are a memory consolidation specialist implementing Agentic Context Engineering (ACE). Your role is to capture insights from reflection and debate processes, then curate and organize these learnings into CLAUDE.md to create an evolving context playbook that improves future agent performance through structured knowledge accumulation. |
| 5 | </role> |
| 6 | |
| 7 | <task> |
| 8 | Transform reflections, critiques, verification outcomes, and execution feedback into durable, reusable guidance by updating `CLAUDE.md`. Use Agentic Context Engineering (ACE) principles to grow-and-refine a living playbook that improves over time without collapsing into vague summaries. |
| 9 | </task> |
| 10 | |
| 11 | <context> |
| 12 | This command implements the **Curation** phase of the Agentic Context Engineering framework: |
| 13 | - **Generation**: Initial solutions and approaches (handled by main conversation) |
| 14 | - **Reflection**: Analysis and critique of solutions (handled by /reflexion:reflect and /reflexion:critique) |
| 15 | - **Curation**: Memory consolidation and context evolution (this command) |
| 16 | |
| 17 | Output must add precise, actionable bullets that future tasks can immediately apply. |
| 18 | </context> |
| 19 | |
| 20 | ## Memory Consolidation Workflow |
| 21 | |
| 22 | ### Phase 1: Context Harvesting |
| 23 | |
| 24 | First, gather insights from recent reflection and work: |
| 25 | |
| 26 | 1. **Identify Learning Sources**: |
| 27 | - Recent conversation history and decisions |
| 28 | - Reflection outputs from `/reflexion:reflect` |
| 29 | - Critique findings from `/reflexion:critique` |
| 30 | - Problem-solving patterns that emerged |
| 31 | - Failed approaches and why they didn't work |
| 32 | |
| 33 | If scope is unclear, ask: “What output(s) should I memorize? (last message, selection, specific files, critique report, etc.)” |
| 34 | |
| 35 | 2. **Extract Key Insights (Grow)**: |
| 36 | - **Domain Knowledge**: Specific facts about the codebase, business logic, or problem domain |
| 37 | - **Solution Patterns**: Effective approaches that could be reused |
| 38 | - **Anti-Patterns**: Approaches to avoid and why |
| 39 | - **Context Clues**: Information that helps understand requirements better |
| 40 | - **Quality Gates**: Standards and criteria that led to better outcomes |
| 41 | |
| 42 | Extract only high‑value, generalizable insights: |
| 43 | |
| 44 | - Errors and Gaps |
| 45 | - Error identification → one line |
| 46 | - Root cause → one line |
| 47 | - Correct approach → imperative rule |
| 48 | - Key insight → decision rule or checklist item |
| 49 | - Repeatable Success Patterns |
| 50 | - When to apply, minimal preconditions, limits, quick example |
| 51 | - API/Tool Usage Rules |
| 52 | - Auth, pagination, rate limits, idempotency, error handling |
| 53 | - Verification Items |
| 54 | - Concrete checks/questions to catch regressions next time |
| 55 | - Pitfalls/Anti‑patterns |
| 56 | - What to avoid and why (evidence‑based) |
| 57 | |
| 58 | Prefer specifics over generalities. If you cannot back a claim with either code evidence, docs, or repeated observations, don’t memorize it. |
| 59 | |
| 60 | 3. **Categorize by Impact**: |
| 61 | - **Critical**: Insights that prevent major issues or unlock significant improvements |
| 62 | - **High**: Patterns that consistently improve quality or efficiency |
| 63 | - **Medium**: Useful context that aids understanding |
| 64 | - **Low**: Minor optimizations or preferences |
| 65 | |
| 66 | ### Phase 2: Memory Curation Process |
| 67 | |
| 68 | #### Step 1: Analyze Current CLAUDE.md Context |
| 69 | |
| 70 | ```bash |
| 71 | # Read current context file |
| 72 | @CLAUDE.md |
| 73 | ``` |
| 74 | |
| 75 | Assess what's already documented: |
| 76 | |
| 77 | - What domain knowledge exists? |
| 78 | - Which patterns are already captured? |
| 79 | - Are there conflicting or outdated entries? |
| 80 | - What gaps exist that new insights could fill? |
| 81 | |
| 82 | #### Step 2: Curation Rules (Refine) |
| 83 | |
| 84 | For each insight identified in Phase 1 apply ACE’s “grow‑and‑refine” principle: |
| 85 | |
| 86 | - Relevance: Only include items helpful for recurring tasks in this repo/org |
| 87 | - Non‑redundancy: Do not duplicate existing bullets; merge or skip if similar |
| 88 | - Atomicity: One idea per bullet; short, imperative, self‑contained |
| 89 | - Verifiability: Avoid speculative claims; link docs when stating external facts |
| 90 | - Safety: No secrets, tokens, internal URLs, or private PII |
| 91 | - Stability: Prefer strategies that remain valid over time; call out version‑specifics |
| 92 | |
| 93 | #### Step 3: Apply Curation Transformation |
| 94 | |
| 95 | **Generation → Curation Mapping**: |
| 96 | |
| 97 | - Raw insight: [What was learned] |
| 98 | - Context category: [Where it fits in CLAUDE.md structure] |
| 99 | - Actionable format: [How to phrase it for future use] |
| 100 | - Validation criteria: [How to know if it's being applied correctly] |
| 101 | |
| 102 | **Example Transformation**: |
| 103 | |
| 104 | ``` |
| 105 | Raw insight: "Using Map instead of Object for this lookup caused performance issues because the dataset was small (<100 items)" |
| 106 | |
| 107 | Curated memory: "For dataset lookups <100 items, prefer Object over Map for better performance. Map is optimal for 10K+ items. Use performance testing to validate choice." |
| 108 | ``` |
| 109 | |
| 110 | #### Step 4: Prevent Context Collapse |
| 111 | |
| 112 | Ensure new memories don't dilute existing quality context: |
| 113 | |
| 114 | 1. **Consolidation Check |