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

Commit 7ef9ecb

Browse files
committed
fix(commands): update status command to use correct git notes syntax
- Change 'git notes --list' to 'git notes list' - Use actual API methods from IndexService and config - Add memory capture reminder sections to all commands - Update Python snippets to use uv run
1 parent 6c55abb commit 7ef9ecb

5 files changed

Lines changed: 334 additions & 217 deletions

File tree

commands/capture.md

Lines changed: 75 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: Capture a memory (decision, learning, context, preference, or pattern) to the git-backed memory system
3-
argument-hint: "[type] content to capture"
2+
description: Capture a memory (decision, learning, blocker, progress, etc.) to the git-backed memory system
3+
argument-hint: "[namespace] <summary> -- <content>"
44
allowed-tools: ["Bash", "Write", "Read", "AskUserQuestion"]
55
---
66

@@ -17,83 +17,122 @@ You will help the user capture a memory. The memory will be stored as a git note
1717
**Arguments format**: `$ARGUMENTS`
1818

1919
Parse the arguments:
20-
1. If first word is a known type (`decision`, `learning`, `context`, `preference`, `pattern`), use it as the memory type
21-
2. Everything else is the memory content
22-
3. If no type specified, auto-detect based on content patterns:
23-
- Contains "decided", "chose", "will use" → `decision`
24-
- Contains "learned", "discovered", "TIL", "found out" → `learning`
25-
- Contains "remember", "note that", "keep in mind" → `context`
26-
- Contains "prefer", "always", "never", "should" → `preference`
27-
- Contains "pattern", "recurring", "often" → `pattern`
28-
- Default → `context`
20+
1. If first word matches a known namespace, use it as the namespace
21+
2. Look for `--` separator: text before is summary, text after is content
22+
3. If no `--` separator, use the entire text as both summary (truncated) and content
23+
24+
**Valid namespaces**: `decisions`, `learnings`, `blockers`, `progress`, `reviews`, `patterns`, `retrospective`, `inception`, `elicitation`, `research`
25+
26+
If no namespace specified, auto-detect based on content patterns:
27+
- Contains "decided", "chose", "will use" → `decisions`
28+
- Contains "learned", "discovered", "TIL", "found out" → `learnings`
29+
- Contains "blocked", "stuck", "cannot", "impediment" → `blockers`
30+
- Contains "completed", "finished", "milestone" → `progress`
31+
- Contains "pattern", "recurring", "often" → `patterns`
32+
- Default → `learnings`
2933

3034
### Step 2: Validate Content
3135

3236
If `$ARGUMENTS` is empty or very short (< 10 characters):
3337
- Use AskUserQuestion to prompt for the memory content
3438
- Question: "What would you like to capture?"
35-
- Options: provide example prompts for each memory type
39+
- Provide examples for each memory type
3640

3741
### Step 3: Capture the Memory
3842

3943
Use Bash to invoke the Python library:
4044

4145
```bash
42-
python3 -c "
46+
uv run python3 -c "
4347
from git_notes_memory import get_capture_service
4448
4549
capture = get_capture_service()
46-
memory = capture.capture_$TYPE(
50+
result = capture.capture(
51+
namespace='$NAMESPACE',
52+
summary='''$SUMMARY''',
4753
content='''$CONTENT''',
48-
source='command',
4954
)
50-
print(f'✅ Captured as {memory.namespace}: {memory.id[:8]}...')
51-
print(f' Summary: {memory.title or memory.content[:60]}...')
55+
56+
if result.success:
57+
print(f'Captured as {result.memory.namespace}: {result.memory.id[:16]}...')
58+
print(f'Summary: {result.memory.summary}')
59+
if result.warning:
60+
print(f'Warning: {result.warning}')
61+
else:
62+
print(f'Capture failed')
5263
"
5364
```
5465

5566
Replace:
56-
- `$TYPE` with the memory type method: `capture_decision`, `capture_learning`, `capture_context`, `capture_preference`, `capture_pattern`
57-
- `$CONTENT` with the user's content (escape quotes properly)
67+
- `$NAMESPACE` with the detected namespace
68+
- `$SUMMARY` with a one-line summary (max 100 chars, escape quotes)
69+
- `$CONTENT` with the full content (escape quotes)
5870

5971
### Step 4: Confirm to User
6072

6173
Show the result:
6274
```
63-
Memory captured!
75+
Memory captured!
6476
65-
**Type**: decision
66-
**ID**: abc12345...
77+
**Namespace**: decisions
78+
**ID**: decisions:abc123:0
6779
**Summary**: Use PostgreSQL for the main database...
6880
6981
This memory will be available for recall in future sessions.
7082
Use `/memory:recall` to retrieve it.
7183
```
7284

73-
## Memory Types Reference
74-
75-
| Type | Use For | Example |
76-
|------|---------|---------|
77-
| `decision` | Architectural or design decisions | "Use PostgreSQL for JSONB support" |
78-
| `learning` | New knowledge or discoveries | "pytest fixtures can be module-scoped" |
79-
| `context` | Project-specific information | "This project uses tabs for indentation" |
80-
| `preference` | User preferences | "Prefer functional style over classes" |
81-
| `pattern` | Recurring patterns | "Error handling follows Result pattern" |
85+
## Namespace Reference
86+
87+
| Namespace | Use For | Example |
88+
|-----------|---------|---------|
89+
| `decisions` | Architectural or design decisions | "Use PostgreSQL for JSONB support" |
90+
| `learnings` | New knowledge or discoveries | "pytest fixtures can be module-scoped" |
91+
| `blockers` | Obstacles and impediments | "API rate limiting blocking progress" |
92+
| `progress` | Milestones and completions | "Completed Phase 1 implementation" |
93+
| `reviews` | Code review findings | "Found SQL injection in auth module" |
94+
| `patterns` | Recurring patterns | "Error handling follows Result pattern" |
95+
| `retrospective` | Post-mortems and retrospectives | "Project completed successfully" |
96+
| `inception` | Problem statements and scope | "Building a memory plugin for Claude" |
97+
| `elicitation` | Requirements clarifications | "Must support offline mode" |
98+
| `research` | External findings | "Evaluated 3 embedding models" |
99+
100+
## Convenience Methods
101+
102+
For structured captures, the library also provides:
103+
- `capture_decision(spec, summary, context, rationale, alternatives)` - Decisions with rationale
104+
- `capture_blocker(spec, summary, description, impact)` - Blockers with impact
105+
- `capture_learning(summary, insight, context)` - Learnings with context
106+
- `capture_progress(spec, summary, milestone, details)` - Progress updates
107+
- `capture_pattern(summary, pattern_type, evidence, confidence)` - Patterns
108+
- `capture_review(spec, summary, findings, verdict)` - Code reviews
82109

83110
## Error Handling
84111

85112
If the capture fails:
86113
1. Check if we're in a git repository: `git rev-parse --git-dir`
87-
2. Check if the library is installed: `python3 -c "import git_notes_memory"`
114+
2. Check if the library is installed: `uv run python3 -c "import git_notes_memory"`
88115
3. Show helpful error message with recovery action
89116

90117
## Examples
91118

92-
**User**: `/memory:capture decision Use Redis for session storage due to built-in expiration`
93-
**Action**: Capture as decision type
119+
**User**: `/memory:capture decisions Use Redis for session storage -- Due to built-in expiration and cluster support`
120+
**Action**: Capture as decisions namespace with structured content
94121

95122
**User**: `/memory:capture TIL you can use pytest -k to filter tests by name`
96-
**Action**: Auto-detect as learning (contains "TIL")
123+
**Action**: Auto-detect as learnings (contains "TIL"), content becomes both summary and body
97124

98125
**User**: `/memory:capture This project requires Python 3.10+`
99-
**Action**: Auto-detect as context (general information)
126+
**Action**: Auto-detect as learnings (general information)
127+
128+
## Memory Capture Reminder
129+
130+
After successfully capturing a memory, remind the user:
131+
132+
```
133+
💡 **Pro tip**: You can capture memories inline using markers:
134+
- `[remember] <insight>` - Captures a learning
135+
- `[capture] <decision>` - Captures any type of memory
136+
- `@memory <content>` - Same as [capture]
137+
138+
These markers work anywhere in your message and are automatically processed.

commands/recall.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You will help the user recall memories relevant to their current context or quer
1717
**Arguments format**: `$ARGUMENTS`
1818

1919
Parse the arguments:
20-
1. Extract `--namespace=<ns>` if present (one of: `decisions`, `learnings`, `context`, `preferences`, `patterns`)
20+
1. Extract `--namespace=<ns>` if present (one of: `decisions`, `learnings`, `blockers`, `progress`, `reviews`, `patterns`, `retrospective`, `inception`, `elicitation`, `research`)
2121
2. Extract `--limit=<n>` if present (default: 5)
2222
3. Everything else is the search query
2323
4. If no query provided, use recent conversation context
@@ -34,31 +34,32 @@ If query is empty:
3434
Use Bash to invoke the Python library:
3535

3636
```bash
37-
python3 -c "
37+
uv run python3 -c "
3838
from git_notes_memory import get_recall_service
3939
4040
recall = get_recall_service()
4141
results = recall.search(
4242
query='''$QUERY''',
4343
namespace=$NAMESPACE, # None for all namespaces
44-
limit=$LIMIT,
44+
k=$LIMIT,
4545
)
4646
4747
if not results:
4848
print('No relevant memories found.')
4949
else:
5050
print(f'## Recalled Memories ({len(results)} results)\n')
5151
for i, r in enumerate(results, 1):
52-
print(f'### {i}. {r.namespace.title()}: {r.title or r.content[:50]}')
53-
print(f'**Relevance**: {r.score:.2f} | **Captured**: {r.created_at[:10]}')
52+
# Use summary (not title) and timestamp (not created_at)
53+
print(f'### {i}. {r.namespace.title()}: {r.summary[:50]}')
54+
print(f'**Relevance**: {r.score:.2f} | **Captured**: {r.timestamp.strftime(\"%Y-%m-%d\")}')
5455
print(f'> {r.content[:200]}...\n')
5556
"
5657
```
5758

5859
Replace:
5960
- `$QUERY` with the search query
6061
- `$NAMESPACE` with `'$ns'` or `None`
61-
- `$LIMIT` with the limit number
62+
- `$LIMIT` with the limit number (default 5)
6263

6364
### Step 4: Present Results
6465

@@ -67,15 +68,15 @@ Format the output as:
6768
```
6869
## Recalled Memories (3 results)
6970
70-
### 1. Decision: Use PostgreSQL for main database
71+
### 1. Decisions: Use PostgreSQL for main database
7172
**Relevance**: 0.92 | **Captured**: 2024-01-15
7273
> Due to JSONB support and strong ecosystem for Python...
7374
74-
### 2. Learning: Connection pooling best practices
75+
### 2. Learnings: Connection pooling best practices
7576
**Relevance**: 0.85 | **Captured**: 2024-01-10
7677
> Always use connection pooling in production to prevent...
7778
78-
### 3. Context: Database schema location
79+
### 3. Progress: Database schema completed
7980
**Relevance**: 0.78 | **Captured**: 2024-01-08
8081
> Database migrations are in migrations/ directory...
8182
```
@@ -96,8 +97,9 @@ No relevant memories found for your query.
9697
|-----------|----------|
9798
| `decisions` | Architectural and design decisions |
9899
| `learnings` | Knowledge and discoveries |
99-
| `context` | Project-specific information |
100-
| `preferences` | User preferences and style |
100+
| `blockers` | Obstacles and impediments |
101+
| `progress` | Milestones and completions |
102+
| `reviews` | Code review findings |
101103
| `patterns` | Recurring patterns and idioms |
102104

103105
## Examples
@@ -113,3 +115,15 @@ No relevant memories found for your query.
113115

114116
**User**: `/memory:recall`
115117
**Action**: Extract context from recent conversation and search
118+
119+
## Memory Capture Reminder
120+
121+
After showing recalled memories, if the conversation reveals new insights worth preserving, remind the user:
122+
123+
```
124+
💡 **Capture tip**: If you discover something worth remembering, use:
125+
- `[remember] <insight>` - Inline capture of learnings
126+
- `/memory:capture <namespace> <content>` - Explicit capture with namespace
127+
```
128+
129+
Consider whether the current context or findings should be captured for future recall.

0 commit comments

Comments
 (0)