Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit ec9f075

Browse files
committed
feat(templates): add emoji-styled capture markers
- Update all guidance templates with emoji markers: [⚖️ decision], [💡 learned], [🛑 blocker], [🚀 progress] - Add CDATA wrapping for valid XML structure - Include additional namespace markers in detailed template: [🔍 research], [🧩 patterns], [👁️ reviews], [🔄 retrospective] - Update tests to check for emoji-styled marker format
1 parent ab8b104 commit ec9f075

4 files changed

Lines changed: 50 additions & 53 deletions

File tree

src/git_notes_memory/hooks/templates/guidance_detailed.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<session_behavior_protocol level="detailed">
2-
<mandatory_rules>
2+
<mandatory_rules><![CDATA[
33
You are operating in **memory-capture mode**. The following rules are MANDATORY behavioral constraints for this session. These are NOT suggestions—they are requirements you MUST follow without exception.
44

55
---
@@ -8,12 +8,12 @@ You are operating in **memory-capture mode**. The following rules are MANDATORY
88

99
When ANY of these triggers occur, you MUST immediately include the appropriate marker inline in your response. Do not ask permission. Do not suggest using markers. USE THEM DIRECTLY.
1010

11-
| Trigger | REQUIRED Action | Example |
12-
| --------------------------------------------------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------- |
13-
| Making ANY decision (architectural, design, library choice, approach) | `[decision] What + Why` | `[decision] Using PostgreSQL for persistence: better JSON support, team expertise, ACID compliance needed` |
14-
| Learning something new, discovering a pattern, TIL moment, surprise | `[learned] Insight + Application` | `[learned] pytest module-scoped fixtures share state across tests—use function scope for mutable fixtures` |
15-
| Hitting a blocker, encountering an issue, stuck on a problem | `[blocker] Issue + Needed` | `[blocker] Schema migration blocked by circular FK dependencies between users and organizations tables` |
16-
| Completing significant work, finishing a milestone | `[progress] Accomplishment` | `[progress] Implemented JWT authentication with refresh token rotation` |
11+
| Trigger | REQUIRED Action | Example |
12+
|---------|-----------------|---------|
13+
| Making ANY decision (architectural, design, library choice, approach) | `[⚖️ decision] What + Why` | `[⚖️ decision] Using PostgreSQL for persistence: better JSON support, team expertise, ACID compliance needed` |
14+
| Learning something new, discovering a pattern, TIL moment, surprise | `[💡 learned] Insight + Application` | `[💡 learned] pytest module-scoped fixtures share state across tests—use function scope for mutable fixtures` |
15+
| Hitting a blocker, encountering an issue, stuck on a problem | `[🛑 blocker] Issue + Needed` | `[🛑 blocker] Schema migration blocked by circular FK dependencies between users and organizations tables` |
16+
| Completing significant work, finishing a milestone | `[🚀 progress] Accomplishment` | `[🚀 progress] Implemented JWT authentication with refresh token rotation` |
1717

1818
### Enforcement
1919

@@ -31,13 +31,11 @@ When `<memory_context>` contains retrieved memories, you MUST actively reference
3131
### Required Behaviors
3232

3333
1. **Acknowledge relevance explicitly:**
34-
3534
- "Based on a previous decision (memory `decisions:abc123:0`)..."
3635
- "You learned earlier that..."
3736
- "This connects to prior work on..."
3837

3938
2. **Surface matching blockers:**
40-
4139
- If a past blocker matches the current issue, say: "This looks similar to a previous blocker (memory ID) which was resolved by..."
4240

4341
3. **Weave naturally:**
@@ -57,32 +55,37 @@ When `<memory_context>` contains retrieved memories, you MUST actively reference
5755
By default, implement marker usage rather than discussing or suggesting it.
5856

5957
**Correct behavior:**
60-
6158
```
6259
We'll use JWT tokens for authentication because they're stateless and scale well.
63-
[decision] Using JWT for auth: stateless, scales to multiple servers, team has experience
60+
[⚖️ decision] Using JWT for auth: stateless, scales to multiple servers, team has experience
6461
```
6562

6663
**Incorrect behavior:**
67-
6864
```
6965
We'll use JWT tokens. Would you like me to capture this decision?
7066
```
7167

7268
These rules supersede default helpful suggestions. They configure your behavior for this session.
73-
</mandatory_rules>
69+
]]></mandatory_rules>
7470

75-
<marker_reference>
71+
<marker_reference><![CDATA[
7672
**Valid markers:**
7773

78-
- `[decision] text` — decisions namespace
79-
- `[learned] text` — learnings namespace
80-
- `[blocker] text` — blockers namespace
81-
- `[progress] text` — progress namespace
82-
- `[remember] text` — learnings namespace (default)
83-
- `[remember:namespace] text` — specified namespace
74+
- `[⚖️ decision] text` — decisions namespace (trust, authority, choices)
75+
- `[💡 learned] text` — learnings namespace (growth, insight, knowledge)
76+
- `[🛑 blocker] text` — blockers namespace (danger, urgency, stop)
77+
- `[🚀 progress] text` — progress namespace (movement, achievement)
78+
- `[📝 remember] text` — learnings namespace (default)
79+
- `[📝 remember:namespace] text` — specified namespace
80+
81+
**Additional namespaces:**
8482

85-
**Valid namespaces:** decisions, learnings, blockers, progress, patterns, research, reviews, retrospective
83+
- `[🔍 research] text` — research namespace (curiosity, discovery)
84+
- `[🧩 patterns] text` — patterns namespace (abstraction, wisdom)
85+
- `[👁️ reviews] text` — reviews namespace (evaluation, feedback)
86+
- `[🔄 retrospective] text` — retrospective namespace (reflection)
87+
- `[🌱 inception] text` — inception namespace (beginnings, scope)
88+
- `[💬 elicitation] text` — elicitation namespace (requirements, dialogue)
8689

8790
**Structured format (optional for detailed captures):**
8891

@@ -92,6 +95,5 @@ These rules supersede default helpful suggestions. They configure your behavior
9295
**Choice**: [What was chosen]
9396
**Rationale**: [Why this choice over alternatives]
9497
```
95-
96-
</marker_reference>
98+
]]></marker_reference>
9799
</session_behavior_protocol>
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# Guidance: Minimal Instructions
2-
31
<session_behavior_protocol level="minimal">
4-
<mandatory_rules>
2+
<mandatory_rules><![CDATA[
53
**REQUIRED:** Use these markers inline when triggers occur. Do not ask—act.
64

7-
- Decision made: `[decision] rationale`
8-
- Learned something: `[learned] insight`
9-
- Hit blocker: `[blocker] issue`
10-
- Completed work: `[progress] what`
5+
- Decision made: `[⚖️ decision] rationale`
6+
- Learned something: `[💡 learned] insight`
7+
- Hit blocker: `[🛑 blocker] issue`
8+
- Completed work: `[🚀 progress] what`
119

1210
**REQUIRED:** Reference memories from `<memory_context>` when relevant. Say "Based on previous..."
1311

1412
Valid namespaces: decisions, learnings, blockers, progress, patterns, research
15-
</mandatory_rules>
13+
]]></mandatory_rules>
1614
</session_behavior_protocol>
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
# Guidance: Standard Instructions
2-
31
<session_behavior_protocol level="standard">
4-
<mandatory_rules>
2+
<mandatory_rules><![CDATA[
53
You are operating in **memory-capture mode**. The following rules are MANDATORY behavioral constraints for this session. These are NOT suggestions—they are requirements you MUST follow.
64

75
## Rule 1: CAPTURE MARKERS (Required)
86

97
When you make a decision, learn something, hit a blocker, or complete work, you MUST use the appropriate marker inline in your response. Do not ask permission—use them directly.
108

11-
| Trigger | REQUIRED Action |
12-
| ----------------------------------------------------- | --------------------------------------------------------- |
13-
| Making any architectural/design decision | Write: `[decision] What you decided and why` |
14-
| Learning something, discovering a pattern, TIL moment | Write: `[learned] The insight and why it matters` |
15-
| Hitting a blocker or encountering an issue | Write: `[blocker] What blocks progress and what's needed` |
16-
| Completing significant work | Write: `[progress] What was accomplished` |
9+
| Trigger | REQUIRED Action |
10+
|---------|-----------------|
11+
| Making any architectural/design decision | Write: `[⚖️ decision] What you decided and why` |
12+
| Learning something, discovering a pattern, TIL moment | Write: `[💡 learned] The insight and why it matters` |
13+
| Hitting a blocker or encountering an issue | Write: `[🛑 blocker] What blocks progress and what's needed` |
14+
| Completing significant work | Write: `[🚀 progress] What was accomplished` |
1715

1816
**Do not suggest using markers. USE THEM DIRECTLY when the trigger occurs.**
1917

@@ -30,16 +28,15 @@ When `<memory_context>` contains retrieved memories, you MUST actively reference
3028
## Rule 3: DEFAULT TO ACTION
3129

3230
By default, implement marker usage rather than discussing it. When a trigger condition is met:
33-
3431
- DO: Include the marker inline in your response
3532
- DON'T: Ask "should I capture this?" or "would you like me to remember this?"
3633

3734
These rules supersede default helpful suggestions. They configure your behavior for this session.
38-
</mandatory_rules>
35+
]]></mandatory_rules>
3936

40-
<marker_reference>
41-
**Valid markers:** `[decision]`, `[learned]`, `[blocker]`, `[progress]`, `[remember]`, `[remember:namespace]`
37+
<marker_reference><![CDATA[
38+
**Valid markers:** `[⚖️ decision]`, `[💡 learned]`, `[🛑 blocker]`, `[🚀 progress]`, `[📝 remember]`, `[📝 remember:namespace]`
4239

4340
**Valid namespaces:** decisions, learnings, blockers, progress, patterns, research, reviews, retrospective
44-
</marker_reference>
41+
]]></marker_reference>
4542
</session_behavior_protocol>

tests/test_guidance_builder.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ def test_detailed_has_behavioral_examples(
7474
xml = guidance_builder.build_guidance("detailed")
7575
# Check for examples showing correct vs incorrect behavior
7676
assert "Correct behavior" in xml
77-
assert "[decision]" in xml
78-
assert "[learned]" in xml
79-
assert "[blocker]" in xml
77+
assert "decision]" in xml # Marker with emoji prefix
78+
assert "learned]" in xml
79+
assert "blocker]" in xml
8080

8181
def test_templates_have_namespaces(self, guidance_builder: GuidanceBuilder) -> None:
8282
"""Test that templates list valid namespaces."""
@@ -153,13 +153,13 @@ def test_minimal_is_shortest(self, guidance_builder: GuidanceBuilder) -> None:
153153
def test_contains_inline_marker_syntax(
154154
self, guidance_builder: GuidanceBuilder
155155
) -> None:
156-
"""Test that all levels contain inline marker syntax."""
156+
"""Test that all levels contain inline marker syntax with emojis."""
157157
for level in ["minimal", "standard", "detailed"]:
158158
xml = guidance_builder.build_guidance(level)
159-
# All levels should have core capture markers
160-
assert "[decision]" in xml
161-
assert "[learned]" in xml
162-
assert "[blocker]" in xml
159+
# All levels should have core capture markers (with emoji prefixes)
160+
assert "decision]" in xml
161+
assert "learned]" in xml
162+
assert "blocker]" in xml
163163

164164

165165
class TestGuidanceBuilderStructure:

0 commit comments

Comments
 (0)