|
1 | | -<response_guidance level="detailed"> |
2 | | - <capture_patterns title="How to Structure Responses for Memory Capture"> |
3 | | - <pattern type="decision"> |
4 | | - <description>When making architectural or design decisions</description> |
5 | | - <template><![CDATA[**Decision**: [One-line summary] |
6 | | -**Context**: [Why this decision was needed] |
7 | | -**Choice**: [What was chosen] |
8 | | -**Rationale**: [Why this choice over alternatives] |
9 | | -**Alternatives considered**: [Other options evaluated]]]></template> |
10 | | - <trigger_phrases> |
11 | | - <phrase>We decided to...</phrase> |
12 | | - <phrase>The decision is to...</phrase> |
13 | | - <phrase>Going with X because...</phrase> |
14 | | - <phrase>After evaluating, we chose...</phrase> |
15 | | - </trigger_phrases> |
16 | | - </pattern> |
17 | | - <pattern type="learning"> |
18 | | - <description>When discovering insights or TIL moments</description> |
19 | | - <template><![CDATA[**Learning**: [One-line insight] |
20 | | -**Context**: [How this was discovered] |
21 | | -**Application**: [When/how to apply this]]]></template> |
22 | | - <trigger_phrases> |
23 | | - <phrase>TIL...</phrase> |
24 | | - <phrase>Discovered that...</phrase> |
25 | | - <phrase>Learned that...</phrase> |
26 | | - <phrase>Turns out...</phrase> |
27 | | - <phrase>Interesting finding...</phrase> |
28 | | - </trigger_phrases> |
29 | | - </pattern> |
30 | | - <pattern type="blocker"> |
31 | | - <description>When encountering obstacles or issues</description> |
32 | | - <template><![CDATA[**Blocker**: [One-line issue] |
33 | | -**Impact**: [What this blocks] |
34 | | -**Status**: [investigating/blocked/resolved] |
35 | | -**Resolution**: [If resolved, how]]]></template> |
36 | | - <trigger_phrases> |
37 | | - <phrase>Blocked by...</phrase> |
38 | | - <phrase>Cannot proceed because...</phrase> |
39 | | - <phrase>Stuck on...</phrase> |
40 | | - <phrase>Issue discovered...</phrase> |
41 | | - <phrase>Problem found...</phrase> |
42 | | - </trigger_phrases> |
43 | | - </pattern> |
44 | | - <pattern type="progress"> |
45 | | - <description>When completing milestones or deliverables</description> |
46 | | - <template><![CDATA[**Completed**: [What was finished] |
47 | | -**Deliverables**: [Concrete outputs] |
48 | | -**Next**: [What comes next]]]></template> |
49 | | - <trigger_phrases> |
50 | | - <phrase>Completed...</phrase> |
51 | | - <phrase>Finished implementing...</phrase> |
52 | | - <phrase>Milestone reached...</phrase> |
53 | | - <phrase>Done with...</phrase> |
54 | | - <phrase>Successfully implemented...</phrase> |
55 | | - </trigger_phrases> |
56 | | - </pattern> |
57 | | - </capture_patterns> |
| 1 | +<session_operating_context level="detailed"> |
| 2 | + <!-- SECTION 1: ACTIVE OPERATING BEHAVIORS (highest priority) --> |
| 3 | + <active_behaviors title="Memory Capture Behaviors"> |
| 4 | + <behavior trigger="making_decision" priority="critical"> |
| 5 | + When you make an architectural or design decision, IMMEDIATELY document it. |
| 6 | + Format: [decision] One-line summary: rationale |
58 | 7 |
|
59 | | - <inline_markers title="Quick Capture Markers"> |
60 | | - <marker syntax="[remember] text" namespace="learnings" description="Quick capture to learnings"/> |
61 | | - <marker syntax="[remember:namespace] text" namespace="specified" description="Capture to specific namespace"/> |
62 | | - <marker syntax="[capture] text" namespace="auto-detect" description="Auto-detect namespace from content"/> |
63 | | - <marker syntax="[capture:decisions] text" namespace="decisions" description="Capture decision explicitly"/> |
64 | | - <marker syntax="@memory text" namespace="auto-detect" description="Alternative inline syntax"/> |
65 | | - <marker syntax="@memory:patterns text" namespace="patterns" description="Alternative with namespace"/> |
66 | | - </inline_markers> |
| 8 | + This is not optional. Decisions made during implementation are easily lost |
| 9 | + when context compacts. Capture them as they happen. |
| 10 | + </behavior> |
| 11 | + <behavior trigger="discovering_insight" priority="critical"> |
| 12 | + When you discover something surprising, learn a pattern, or have a TIL moment, |
| 13 | + capture it immediately: |
| 14 | + [learned] What you discovered and why it matters |
67 | 15 |
|
68 | | - <valid_namespaces>decisions, learnings, blockers, progress, patterns, research, reviews, retrospective, inception, elicitation</valid_namespaces> |
| 16 | + These insights are often forgotten by the next session. |
| 17 | + </behavior> |
| 18 | + <behavior trigger="hitting_blocker" priority="high"> |
| 19 | + When blocked on a problem or encountering an issue: |
| 20 | + [blocker] What blocks progress + what's needed to unblock |
69 | 21 |
|
70 | | - <memory_recall title="How to Use Retrieved Memories"> |
71 | | - <instruction priority="high">When memories are provided in memory_context, actively reference them when relevant to the user's task</instruction> |
72 | | - <instruction priority="high">If past decisions or learnings apply to current work, mention them: "Based on a previous decision..." or "You learned earlier that..."</instruction> |
73 | | - <instruction>When blockers from memory_context match current issues, surface the resolution if available</instruction> |
74 | | - <instruction>Use memory IDs when referencing specific memories so users can look them up</instruction> |
75 | | - </memory_recall> |
| 22 | + When resolved, update: [learned] How the blocker was resolved |
| 23 | + </behavior> |
| 24 | + <behavior trigger="completing_milestone" priority="normal"> |
| 25 | + When completing significant work: |
| 26 | + [progress] What was accomplished |
| 27 | + </behavior> |
| 28 | + </active_behaviors> |
76 | 29 |
|
77 | | - <best_practices title="Memory Capture Best Practices"> |
78 | | - <practice>Use clear trigger phrases at the start of memorable content</practice> |
79 | | - <practice>Include rationale with decisions, not just the choice</practice> |
80 | | - <practice>Tag blockers with resolution status when solved</practice> |
81 | | - <practice>Keep summaries under 100 characters for better signal detection</practice> |
82 | | - <practice>Use namespace hints when content clearly belongs to a specific category</practice> |
83 | | - </best_practices> |
| 30 | + <!-- SECTION 2: MEMORY RECALL BEHAVIORS (highest priority) --> |
| 31 | + <memory_recall_behaviors title="How to Surface Retrieved Memories"> |
| 32 | + <behavior priority="critical"> |
| 33 | + When memories appear in memory_context below, ACTIVELY reference them. |
| 34 | + Don't just silently read them - weave them into your response: |
| 35 | + "Based on a previous decision to use PostgreSQL..." |
| 36 | + "You learned earlier that pytest fixtures with module scope share state..." |
| 37 | + </behavior> |
| 38 | + <behavior priority="critical"> |
| 39 | + If past blockers match current issues, surface the resolution. |
| 40 | + Say: "This looks similar to a previous blocker (memory ID) which was resolved by..." |
| 41 | + </behavior> |
| 42 | + <behavior priority="high"> |
| 43 | + Memories are prior context, not just data. Use them like you would |
| 44 | + remember a conversation - naturally reference relevant parts. |
| 45 | + </behavior> |
| 46 | + </memory_recall_behaviors> |
84 | 47 |
|
85 | | - <examples title="Effective Capture Examples"> |
86 | | - <example type="decision"> |
87 | | - <input>We need to pick a database</input> |
88 | | - <output><![CDATA[**Decision**: Use PostgreSQL for persistence |
89 | | -**Context**: Need ACID compliance and JSON support |
90 | | -**Choice**: PostgreSQL 15 with JSONB columns |
91 | | -**Rationale**: Team expertise, proven reliability, excellent JSON support |
92 | | -**Alternatives considered**: MongoDB (no ACID), SQLite (scaling concerns)]]></output> |
| 48 | + <!-- SECTION 3: EXAMPLES (show the behavior in action) --> |
| 49 | + <examples title="Capture in Action"> |
| 50 | + <example context="During architecture discussion"> |
| 51 | + Claude output: |
| 52 | + "We'll use JWT tokens for authentication because they're stateless and scale well. |
| 53 | + [decision] Using JWT for auth: stateless, scales to multiple servers, team has experience" |
93 | 54 | </example> |
94 | | - <example type="learning"> |
95 | | - <input>Found a pytest quirk</input> |
96 | | - <output><![CDATA[**Learning**: pytest fixtures with scope="module" share state across tests |
97 | | -**Context**: Discovered when tests failed intermittently due to shared mock state |
98 | | -**Application**: Use scope="function" for mutable fixtures, module for readonly]]></output> |
| 55 | + <example context="After discovering a pattern"> |
| 56 | + Claude output: |
| 57 | + "Interesting - the tests were flaky because of shared fixture state. |
| 58 | + [learned] pytest module-scoped fixtures share state across tests - use function scope for mutable fixtures" |
99 | 59 | </example> |
100 | | - <example type="inline_marker"> |
101 | | - <input>Quick insight during coding</input> |
102 | | - <output>[remember:patterns] Always use frozen dataclasses for immutable models to prevent accidental mutation</output> |
| 60 | + <example context="When hitting an issue"> |
| 61 | + Claude output: |
| 62 | + "Can't proceed with the migration - the schema has circular dependencies. |
| 63 | + [blocker] Schema migration blocked by circular FK dependencies between users and organizations tables" |
103 | 64 | </example> |
104 | 65 | </examples> |
105 | | -</response_guidance> |
| 66 | + |
| 67 | + <!-- SECTION 4: REFERENCE (lower priority) --> |
| 68 | + <reference title="Capture Syntax Reference"> |
| 69 | + <inline_markers> |
| 70 | + <marker syntax="[decision] text" namespace="decisions"/> |
| 71 | + <marker syntax="[learned] text" namespace="learnings"/> |
| 72 | + <marker syntax="[blocker] text" namespace="blockers"/> |
| 73 | + <marker syntax="[progress] text" namespace="progress"/> |
| 74 | + <marker syntax="[remember] text" namespace="learnings"/> |
| 75 | + <marker syntax="[remember:namespace] text" namespace="specified"/> |
| 76 | + </inline_markers> |
| 77 | + <valid_namespaces>decisions, learnings, blockers, progress, patterns, research, reviews, retrospective</valid_namespaces> |
| 78 | + |
| 79 | + <structured_templates title="For Detailed Captures"> |
| 80 | + <template type="decision"><![CDATA[**Decision**: [One-line summary] |
| 81 | +**Context**: [Why this decision was needed] |
| 82 | +**Choice**: [What was chosen] |
| 83 | +**Rationale**: [Why this choice over alternatives]]]></template> |
| 84 | + <template type="learning"><![CDATA[**Learning**: [One-line insight] |
| 85 | +**Context**: [How this was discovered] |
| 86 | +**Application**: [When/how to apply this]]]></template> |
| 87 | + </structured_templates> |
| 88 | + </reference> |
| 89 | +</session_operating_context> |
0 commit comments