--- name: continuous-learning description: Extract patterns and instincts from the current session — what worked, what didn't, what should be remembered. Produces actionable learnings that improve future sessions. disable-model-invocation: true --- # Continuous Learning Extract learnings from the current session to improve future work. ## Context Recent git history: !`git log --oneline -10 2>/dev/null || echo "No git history"` Project rules: !`head -30 RULES.md 2>/dev/null || echo "No RULES.md"` ## Steps ### 1. Review the session Analyze what happened in this session: - **Tasks completed**: What was accomplished? - **Approaches tried**: What methods were used? - **Errors encountered**: What went wrong and how was it fixed? - **User corrections**: Where did the user redirect or correct the approach? - **Surprises**: What was unexpected about the codebase or requirements? ### 2. Extract instincts An **instinct** is a pattern that should influence future behavior. Categories: #### Project-specific instincts Patterns unique to this codebase: - Code conventions not captured in RULES.md - Hidden dependencies between modules - "Gotchas" that aren't obvious from reading the code - User preferences for how work should be done #### Approach instincts What worked or didn't work: - Tools/agents that were effective for specific tasks - Sequences of actions that solved problems efficiently - Dead ends that should be avoided next time #### Communication instincts How the user prefers to interact: - Level of detail they want in explanations - Whether they prefer to be asked or just shown solutions - How they respond to different types of suggestions ### 3. Classify each instinct For each instinct, determine: | Field | Description | |-------|-------------| | **Pattern** | What was observed (specific, not vague) | | **Context** | When this applies (file types, tasks, situations) | | **Action** | What to do differently next time | | **Confidence** | How certain (low/medium/high) based on how many times observed | | **Scope** | Project-only or applicable to all projects | ### 4. Decide where to store Based on scope and type: | Learning Type | Store In | |---------------|----------| | User preference | Memory (type: feedback) | | Project convention | `RULES.md` or `RECOMMENDATIONS.md` | | Codebase gotcha | Code comment or `RECOMMENDATIONS.md` | | Tool/agent effectiveness | Memory (type: feedback) | | Communication preference | Memory (type: user or feedback) | | Temporary state | Don't store — it's ephemeral | ### 5. Output ```markdown # Session Learnings ## Summary [1-2 sentences: what was accomplished, overall assessment] ## Instincts Extracted ### 1. [Pattern name] - **Observed**: [what happened] - **Context**: [when this applies] - **Action**: [what to do next time] - **Confidence**: [low/medium/high] - **Store in**: [memory type / RULES.md / RECOMMENDATIONS.md / skip] ### 2. ... ## Recommendations - [Changes to RULES.md if any patterns should become rules] - [Changes to RECOMMENDATIONS.md if decisions should be recorded] - [New memory entries to create] ## Anti-Learnings [Things that seemed like patterns but were actually one-off situations — don't generalize these] ``` ### 6. Anti-patterns - **Over-generalizing** — Don't turn a one-time fix into a permanent rule - **Storing ephemera** — Don't save things like "currently debugging X" - **Ignoring negative results** — Failed approaches are as valuable as successful ones - **Redundant storage** — Don't save what's already in RULES.md or git history - **Low-confidence instincts** — If you've only seen it once, note it but don't enforce it