ragtime-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ragtime-cli might be problematic. Click here for more details.
- ragtime_cli-0.1.0.dist-info/METADATA +220 -0
- ragtime_cli-0.1.0.dist-info/RECORD +21 -0
- ragtime_cli-0.1.0.dist-info/WHEEL +5 -0
- ragtime_cli-0.1.0.dist-info/entry_points.txt +3 -0
- ragtime_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
- ragtime_cli-0.1.0.dist-info/top_level.txt +1 -0
- src/__init__.py +0 -0
- src/cli.py +773 -0
- src/commands/audit.md +151 -0
- src/commands/handoff.md +176 -0
- src/commands/pr-graduate.md +187 -0
- src/commands/recall.md +175 -0
- src/commands/remember.md +168 -0
- src/commands/save.md +10 -0
- src/commands/start.md +206 -0
- src/config.py +101 -0
- src/db.py +167 -0
- src/indexers/__init__.py +0 -0
- src/indexers/docs.py +129 -0
- src/mcp_server.py +590 -0
- src/memory.py +379 -0
src/commands/audit.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Audit local memories for duplicates, conflicts, and stale data
|
|
3
|
+
allowed-tools: Bash, mcp__ragtime__search, mcp__ragtime__list_memories, mcp__ragtime__forget, mcp__ragtime__update_status, AskUserQuestion
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Audit
|
|
7
|
+
|
|
8
|
+
Periodic cleanup of local memories. This is a **human-in-the-loop** review - no automatic deletions.
|
|
9
|
+
|
|
10
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
11
|
+
CUSTOMIZABLE: Add project-specific audit rules, adjust the report format,
|
|
12
|
+
add custom namespace checks, etc.
|
|
13
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
14
|
+
|
|
15
|
+
## Namespaces to Audit
|
|
16
|
+
|
|
17
|
+
- `app` - Codebase knowledge (architecture, decisions)
|
|
18
|
+
- `team` - Team conventions (standards, processes)
|
|
19
|
+
- `user-*` - Developer preferences
|
|
20
|
+
- `branch-*` - Branch-specific context and decisions
|
|
21
|
+
|
|
22
|
+
## Step 1: Gather All Memories
|
|
23
|
+
|
|
24
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
25
|
+
RAGTIME CORE - DO NOT MODIFY
|
|
26
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
mcp__ragtime__list_memories:
|
|
30
|
+
limit: 100
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For each namespace:
|
|
34
|
+
```
|
|
35
|
+
mcp__ragtime__list_memories:
|
|
36
|
+
namespace: "{namespace}"
|
|
37
|
+
limit: 50
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════ -->
|
|
41
|
+
|
|
42
|
+
## Step 2: Identify Issues
|
|
43
|
+
|
|
44
|
+
Group memories by topic and identify:
|
|
45
|
+
|
|
46
|
+
| Issue | Description |
|
|
47
|
+
|-------|-------------|
|
|
48
|
+
| **DUPLICATES** | Memories saying essentially the same thing |
|
|
49
|
+
| **CONFLICTS** | Memories that contradict each other |
|
|
50
|
+
| **STALE** | References to code/features that no longer exist |
|
|
51
|
+
| **ORPHANED** | Branch memories for deleted/merged branches |
|
|
52
|
+
| **LOW_VALUE** | Vague memories that aren't useful |
|
|
53
|
+
|
|
54
|
+
## Step 3: Check for Stale Branches
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# List branch memory folders
|
|
58
|
+
ls -la .claude/memory/branches/
|
|
59
|
+
|
|
60
|
+
# For each, check if branch still exists
|
|
61
|
+
for dir in .claude/memory/branches/*/; do
|
|
62
|
+
branch_slug=$(basename "$dir")
|
|
63
|
+
# Check if branch exists on remote
|
|
64
|
+
if ! git branch -a | grep -q "$branch_slug"; then
|
|
65
|
+
echo "⚠️ Potentially stale: $branch_slug"
|
|
66
|
+
fi
|
|
67
|
+
done
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Also run:
|
|
71
|
+
```bash
|
|
72
|
+
ragtime prune --dry-run
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Step 4: Present Report
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
## Memory Audit Report
|
|
79
|
+
|
|
80
|
+
### App Namespace ({count} memories)
|
|
81
|
+
- Potential duplicates: {n}
|
|
82
|
+
- Potential conflicts: {n}
|
|
83
|
+
- Possibly stale: {n}
|
|
84
|
+
|
|
85
|
+
### Team Namespace ({count} memories)
|
|
86
|
+
- Potential duplicates: {n}
|
|
87
|
+
|
|
88
|
+
### Branch Namespaces
|
|
89
|
+
- Active branches: {n}
|
|
90
|
+
- Stale (unmerged) folders: {n}
|
|
91
|
+
- Ready to prune: {n}
|
|
92
|
+
|
|
93
|
+
───────────────────────────────────────────
|
|
94
|
+
|
|
95
|
+
### Issues Found:
|
|
96
|
+
|
|
97
|
+
**1. Possible Duplicate:**
|
|
98
|
+
- "Auth uses JWT tokens" (app, abc123)
|
|
99
|
+
- "JWT auth with 15-min expiry" (app, def456)
|
|
100
|
+
→ Action: Merge into one?
|
|
101
|
+
|
|
102
|
+
**2. Possible Conflict:**
|
|
103
|
+
- "Use tabs for indentation" (team, ghi789)
|
|
104
|
+
- "Use 2-space indentation" (team, jkl012)
|
|
105
|
+
→ Action: Which is correct?
|
|
106
|
+
|
|
107
|
+
**3. Stale Branch:**
|
|
108
|
+
- branches/old-feature/ (branch deleted)
|
|
109
|
+
→ Action: Prune with `ragtime prune`?
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Step 5: Get User Approval
|
|
113
|
+
|
|
114
|
+
For each issue found, ask:
|
|
115
|
+
|
|
116
|
+
- "Should I merge these duplicates?"
|
|
117
|
+
- "Which of these conflicting memories is correct?"
|
|
118
|
+
- "Should I mark this as abandoned?"
|
|
119
|
+
- "Run `ragtime prune` to clean stale branches?"
|
|
120
|
+
|
|
121
|
+
Only make changes the user explicitly approves.
|
|
122
|
+
|
|
123
|
+
## Step 6: Execute Approved Actions
|
|
124
|
+
|
|
125
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
126
|
+
RAGTIME CORE - DO NOT MODIFY
|
|
127
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
128
|
+
|
|
129
|
+
**Delete a memory:**
|
|
130
|
+
```
|
|
131
|
+
mcp__ragtime__forget:
|
|
132
|
+
memory_id: "{id}"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Mark as abandoned:**
|
|
136
|
+
```
|
|
137
|
+
mcp__ragtime__update_status:
|
|
138
|
+
memory_id: "{id}"
|
|
139
|
+
status: "abandoned"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Prune stale branches:**
|
|
143
|
+
```bash
|
|
144
|
+
ragtime prune
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════ -->
|
|
148
|
+
|
|
149
|
+
## Suggested Cadence
|
|
150
|
+
|
|
151
|
+
Run monthly or when memories feel cluttered.
|
src/commands/handoff.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Save current context to branch memory for session continuity
|
|
3
|
+
allowed-tools: Bash, Read, Write, mcp__ragtime__remember
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Save Context for Handoff
|
|
7
|
+
|
|
8
|
+
Capture the current session's context into the branch's `context.md` so the next session (or another developer) can pick up seamlessly.
|
|
9
|
+
|
|
10
|
+
The context lives permanently in `.claude/memory/branches/{branch}/context.md` - no cleanup needed.
|
|
11
|
+
|
|
12
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
13
|
+
CUSTOMIZABLE: Adjust the context template, add project-specific sections,
|
|
14
|
+
modify the commit message format, etc.
|
|
15
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
16
|
+
|
|
17
|
+
## Step 1: Gather Current State
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
BRANCH=$(git branch --show-current)
|
|
21
|
+
ISSUE_NUM=$(echo "$BRANCH" | grep -oE '[0-9]+' | head -1)
|
|
22
|
+
DEVNAME=$(gh api user --jq '.login' 2>/dev/null || git config user.name | tr ' ' '-' | tr '[:upper:]' '[:lower:]')
|
|
23
|
+
TIMESTAMP=$(date +%Y-%m-%d)
|
|
24
|
+
|
|
25
|
+
echo "Branch: $BRANCH"
|
|
26
|
+
echo "Issue: #$ISSUE_NUM"
|
|
27
|
+
echo "Developer: $DEVNAME"
|
|
28
|
+
|
|
29
|
+
# Get recent commits on this branch
|
|
30
|
+
echo ""
|
|
31
|
+
echo "=== Recent Commits ==="
|
|
32
|
+
git log main..HEAD --oneline 2>/dev/null || git log -10 --oneline
|
|
33
|
+
|
|
34
|
+
# Get current changes
|
|
35
|
+
echo ""
|
|
36
|
+
echo "=== Uncommitted Changes ==="
|
|
37
|
+
git status --short
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Step 2: Summarize Session Context
|
|
41
|
+
|
|
42
|
+
Based on the conversation, create a summary that includes:
|
|
43
|
+
|
|
44
|
+
1. **What This Branch Does** - High-level purpose
|
|
45
|
+
2. **Current State** - What's been done, recent commits
|
|
46
|
+
3. **What's Left To Do** - Remaining tasks, in priority order
|
|
47
|
+
4. **Testing Status** - What's been tested, what hasn't
|
|
48
|
+
5. **Known Issues / Lessons Learned** - Gotchas for the next session
|
|
49
|
+
6. **Architecture Decisions** - Why things were done a certain way
|
|
50
|
+
7. **Next Steps** - Specific instructions for resuming
|
|
51
|
+
|
|
52
|
+
## Step 3: Write to Branch Context
|
|
53
|
+
|
|
54
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
55
|
+
RAGTIME CORE - DO NOT MODIFY
|
|
56
|
+
The file path and frontmatter format must match ragtime's expectations.
|
|
57
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
58
|
+
|
|
59
|
+
Write to `.claude/memory/branches/{branch-slug}/context.md`:
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
---
|
|
63
|
+
id: context
|
|
64
|
+
namespace: branch-{branch}
|
|
65
|
+
type: context
|
|
66
|
+
status: active
|
|
67
|
+
added: '{date}'
|
|
68
|
+
author: {devname}
|
|
69
|
+
issue: '#{issue_num}'
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Branch: {branch}
|
|
73
|
+
|
|
74
|
+
### What This Branch Does
|
|
75
|
+
|
|
76
|
+
{summary}
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## CURRENT STATE (as of {date})
|
|
81
|
+
|
|
82
|
+
{current state details}
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## WHAT'S LEFT TO DO
|
|
87
|
+
|
|
88
|
+
{prioritized task list}
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## TESTING STATUS
|
|
93
|
+
|
|
94
|
+
### Tested and Working:
|
|
95
|
+
{list}
|
|
96
|
+
|
|
97
|
+
### Not Yet Tested:
|
|
98
|
+
{list}
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## KNOWN ISSUES / LESSONS LEARNED
|
|
103
|
+
|
|
104
|
+
{numbered list}
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## ARCHITECTURE DECISIONS
|
|
109
|
+
|
|
110
|
+
{bullet points}
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## NEXT STEPS FOR NEW SESSION
|
|
115
|
+
|
|
116
|
+
{specific instructions}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════ -->
|
|
120
|
+
|
|
121
|
+
<!-- CUSTOMIZABLE: Add project-specific sections to the context template -->
|
|
122
|
+
|
|
123
|
+
## Step 4: Index the Context
|
|
124
|
+
|
|
125
|
+
After writing the file, ensure it's indexed:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
mcp__ragtime__remember:
|
|
129
|
+
content: "{summary of context for search}"
|
|
130
|
+
namespace: "branch-{branch}"
|
|
131
|
+
type: "context"
|
|
132
|
+
issue: "#{issue_num}"
|
|
133
|
+
source: "handoff"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Step 5: Commit and Push
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
BRANCH=$(git branch --show-current)
|
|
140
|
+
BRANCH_SLUG=$(echo "$BRANCH" | tr '/' '-')
|
|
141
|
+
ISSUE_NUM=$(echo "$BRANCH" | grep -oE '[0-9]+' | head -1)
|
|
142
|
+
|
|
143
|
+
# Block pushes to main/master
|
|
144
|
+
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
|
|
145
|
+
echo "❌ ERROR: Cannot push directly to $BRANCH"
|
|
146
|
+
exit 1
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
git add ".claude/memory/branches/$BRANCH_SLUG/context.md"
|
|
150
|
+
git commit -m "docs(context): update branch context for session continuity
|
|
151
|
+
|
|
152
|
+
Relates to #$ISSUE_NUM
|
|
153
|
+
|
|
154
|
+
Co-Authored-By: Claude <noreply@anthropic.com>"
|
|
155
|
+
|
|
156
|
+
git push -u origin "$BRANCH"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Step 6: Confirm Handoff Complete
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
✅ Handoff Complete
|
|
163
|
+
|
|
164
|
+
- Context saved to: .claude/memory/branches/{branch}/context.md
|
|
165
|
+
- Committed and pushed to remote
|
|
166
|
+
- Ready for next session or another developer
|
|
167
|
+
|
|
168
|
+
To resume: Start a new session and say "continue on this branch"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Notes
|
|
172
|
+
|
|
173
|
+
- The context.md file lives permanently with the branch - no cleanup needed
|
|
174
|
+
- Each `/handoff` overwrites the previous context.md (it's always current state)
|
|
175
|
+
- On `/start`, Claude reads the branch's context.md to resume
|
|
176
|
+
- When syncing from teammate branches, their context.md comes along too
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Graduate branch knowledge to app after PR merge
|
|
3
|
+
allowed-tools: Bash, mcp__ragtime__search, mcp__ragtime__graduate, mcp__ragtime__update_status, mcp__ragtime__remember, AskUserQuestion
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PR Graduate: Curate Branch Knowledge
|
|
7
|
+
|
|
8
|
+
After a PR is merged, review branch memories and decide what becomes permanent app knowledge.
|
|
9
|
+
|
|
10
|
+
**This is a human-in-the-loop process** - you curate which memories graduate.
|
|
11
|
+
|
|
12
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
13
|
+
CUSTOMIZABLE: Adjust the curation workflow, add project-specific
|
|
14
|
+
graduation criteria, modify the summary format, etc.
|
|
15
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
16
|
+
|
|
17
|
+
## Process Overview
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
For EACH branch memory:
|
|
21
|
+
|
|
22
|
+
✅ Graduate → Copy to app namespace with high confidence
|
|
23
|
+
📚 Keep → Leave in branch (reference/history)
|
|
24
|
+
❌ Abandon → Mark as abandoned (noise, superseded)
|
|
25
|
+
|
|
26
|
+
Branch memories are preserved - nothing is deleted.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Step 1: Get the Branch
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
BRANCH=$(git branch --show-current)
|
|
33
|
+
BRANCH_SLUG=$(echo "$BRANCH" | tr '/' '-')
|
|
34
|
+
ISSUE_NUM=$(echo "$BRANCH" | grep -oE '[0-9]+' | head -1)
|
|
35
|
+
|
|
36
|
+
echo "Branch: $BRANCH"
|
|
37
|
+
echo "Issue: #$ISSUE_NUM"
|
|
38
|
+
|
|
39
|
+
# Check if PR was merged
|
|
40
|
+
gh pr list --head "$BRANCH" --state merged --json number,title
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Step 2: Gather Branch Memories
|
|
44
|
+
|
|
45
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
46
|
+
RAGTIME CORE - DO NOT MODIFY
|
|
47
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
mcp__ragtime__search:
|
|
51
|
+
query: "decisions patterns architecture"
|
|
52
|
+
namespace: "branch-{branch}"
|
|
53
|
+
limit: 50
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════ -->
|
|
57
|
+
|
|
58
|
+
## Step 3: Present Memories for Curation
|
|
59
|
+
|
|
60
|
+
Display each memory with options:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
───────────────────────────────────────────
|
|
64
|
+
📋 BRANCH MEMORY CURATION
|
|
65
|
+
───────────────────────────────────────────
|
|
66
|
+
|
|
67
|
+
Branch: {branch}
|
|
68
|
+
Total memories found: {count}
|
|
69
|
+
|
|
70
|
+
For each memory, choose:
|
|
71
|
+
✅ Graduate - Promote to app knowledge (high confidence)
|
|
72
|
+
📚 Keep - Leave in branch for reference
|
|
73
|
+
❌ Abandon - Mark as noise/superseded
|
|
74
|
+
|
|
75
|
+
───────────────────────────────────────────
|
|
76
|
+
|
|
77
|
+
**Memory 1 of {count}:**
|
|
78
|
+
|
|
79
|
+
"{memory content preview - first 200 chars}..."
|
|
80
|
+
|
|
81
|
+
Type: {type} | Added: {date}
|
|
82
|
+
|
|
83
|
+
What should happen to this memory?
|
|
84
|
+
1. ✅ Graduate to app
|
|
85
|
+
2. 📚 Keep in branch
|
|
86
|
+
3. ❌ Mark as abandoned
|
|
87
|
+
4. 👀 Show full content
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Step 4: Process Each Memory
|
|
91
|
+
|
|
92
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
93
|
+
RAGTIME CORE - DO NOT MODIFY
|
|
94
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
95
|
+
|
|
96
|
+
### If ✅ Graduate:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
mcp__ragtime__graduate:
|
|
100
|
+
memory_id: "{id}"
|
|
101
|
+
confidence: "high"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This creates a copy in `app/` namespace and marks the original as graduated.
|
|
105
|
+
|
|
106
|
+
### If 📚 Keep:
|
|
107
|
+
|
|
108
|
+
No action needed - memory stays in branch namespace for reference.
|
|
109
|
+
|
|
110
|
+
### If ❌ Abandon:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
mcp__ragtime__update_status:
|
|
114
|
+
memory_id: "{id}"
|
|
115
|
+
status: "abandoned"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════ -->
|
|
119
|
+
|
|
120
|
+
## Step 5: Handle Context Document
|
|
121
|
+
|
|
122
|
+
The branch's `context.md` is a full document, not individual memories:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
The context.md contains the full development context.
|
|
126
|
+
|
|
127
|
+
Options:
|
|
128
|
+
1. **Extract key insights** - I'll identify valuable patterns to graduate
|
|
129
|
+
2. **Keep as reference** - Leave it in branch history
|
|
130
|
+
3. **Skip** - Context was just for session continuity
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
If extracting: Identify the most valuable insights and present for approval before graduating.
|
|
134
|
+
|
|
135
|
+
## Step 6: Summary
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
───────────────────────────────────────────
|
|
139
|
+
✅ PR GRADUATION COMPLETE
|
|
140
|
+
───────────────────────────────────────────
|
|
141
|
+
|
|
142
|
+
Branch: {branch}
|
|
143
|
+
|
|
144
|
+
Memories processed: {total}
|
|
145
|
+
✅ Graduated to app: {count}
|
|
146
|
+
📚 Kept in branch: {count}
|
|
147
|
+
❌ Marked abandoned: {count}
|
|
148
|
+
|
|
149
|
+
Graduated knowledge now searchable via:
|
|
150
|
+
/recall {topic} --namespace app
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Quick Mode
|
|
154
|
+
|
|
155
|
+
For simpler PRs, offer quick mode:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
Found {count} branch memories.
|
|
159
|
+
|
|
160
|
+
Options:
|
|
161
|
+
1. **Review each** - Curate one by one (recommended)
|
|
162
|
+
2. **Quick mode** - I'll propose which to graduate
|
|
163
|
+
3. **Graduate all** - Promote everything
|
|
164
|
+
4. **Keep all** - Leave everything in branch
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Quick mode generates a proposal:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
## Quick Mode Proposal
|
|
171
|
+
|
|
172
|
+
**Recommend Graduate:**
|
|
173
|
+
- "Auth uses JWT with 15-min expiry" ← architecture insight
|
|
174
|
+
- "Redis chosen for session storage" ← key decision
|
|
175
|
+
|
|
176
|
+
**Recommend Keep:**
|
|
177
|
+
- "Debugging: token refresh issue" ← development context
|
|
178
|
+
|
|
179
|
+
Approve? (yes/edit/review-each)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Notes
|
|
183
|
+
|
|
184
|
+
- Branch memories stay forever (history) - only status changes
|
|
185
|
+
- Graduated memories get `source: "pr-graduate"` and high confidence
|
|
186
|
+
- Abandoned memories are excluded from default searches
|
|
187
|
+
- Use `/recall --namespace branch-{name}` to see branch history
|
src/commands/recall.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search the local memory system for knowledge
|
|
3
|
+
allowed-arguments: search query and optional filters (e.g., /recall auth patterns, /recall --namespace app)
|
|
4
|
+
allowed-tools: mcp__ragtime__search, mcp__ragtime__list_memories, AskUserQuestion
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Recall
|
|
8
|
+
|
|
9
|
+
Search the local memory system for stored knowledge.
|
|
10
|
+
|
|
11
|
+
**Usage:**
|
|
12
|
+
- `/recall auth patterns` - Search for auth-related patterns
|
|
13
|
+
- `/recall #301 decisions` - Decisions related to issue #301
|
|
14
|
+
- `/recall --namespace team` - All team conventions
|
|
15
|
+
- `/recall` - Interactive search mode
|
|
16
|
+
|
|
17
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
18
|
+
CUSTOMIZABLE: Modify query parsing, add project-specific filters,
|
|
19
|
+
adjust result formatting, etc.
|
|
20
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
21
|
+
|
|
22
|
+
## Query Syntax
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
/recall [modifiers] <search terms> [filters]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Modifiers:**
|
|
29
|
+
- `all:` - Include all confidence levels (default: high + medium only)
|
|
30
|
+
- `pre-merge:` - Include unmerged branch memories from teammates
|
|
31
|
+
|
|
32
|
+
**Filters:**
|
|
33
|
+
- `#301` or `--issue 301` - Filter by issue number
|
|
34
|
+
- `@auth` or `--component auth` - Filter by component
|
|
35
|
+
- `--type decision` - Filter by memory type
|
|
36
|
+
- `--namespace app` - Filter by namespace
|
|
37
|
+
- `--status active` - Filter by status
|
|
38
|
+
|
|
39
|
+
<!-- CUSTOMIZABLE: Add your own filter shortcuts -->
|
|
40
|
+
|
|
41
|
+
## Step 1: Parse the Query
|
|
42
|
+
|
|
43
|
+
**If `$ARGUMENTS` provided:**
|
|
44
|
+
- Parse modifiers, search terms, and filters
|
|
45
|
+
|
|
46
|
+
**If no arguments:**
|
|
47
|
+
- Ask: "What are you looking for?"
|
|
48
|
+
- Optionally ask for filters
|
|
49
|
+
|
|
50
|
+
## Step 2: Build the Search
|
|
51
|
+
|
|
52
|
+
Construct filters based on parsed query:
|
|
53
|
+
|
|
54
|
+
- Default: exclude `status: "abandoned"` and `confidence: "low"`
|
|
55
|
+
- If `all:` modifier: include everything
|
|
56
|
+
- If `pre-merge:` modifier: include `status: "pre-merge"`
|
|
57
|
+
|
|
58
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════
|
|
59
|
+
RAGTIME CORE - DO NOT MODIFY
|
|
60
|
+
These commands must match ragtime's expected format.
|
|
61
|
+
═══════════════════════════════════════════════════════════════════════════ -->
|
|
62
|
+
|
|
63
|
+
Execute the search:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
mcp__ragtime__search:
|
|
67
|
+
query: "{search terms}"
|
|
68
|
+
namespace: "{namespace if specified}"
|
|
69
|
+
type: "{type if specified}"
|
|
70
|
+
component: "{component if specified}"
|
|
71
|
+
limit: 20
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For listing without semantic search:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
mcp__ragtime__list_memories:
|
|
78
|
+
namespace: "{namespace}"
|
|
79
|
+
type: "{type}"
|
|
80
|
+
status: "{status}"
|
|
81
|
+
component: "{component}"
|
|
82
|
+
limit: 20
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
<!-- ═══════════════════════════════════════════════════════════════════════════ -->
|
|
86
|
+
|
|
87
|
+
## Step 3: Present Results
|
|
88
|
+
|
|
89
|
+
Format results clearly:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
## 🧠 Recall: "{search terms}"
|
|
93
|
+
|
|
94
|
+
Found {count} memories:
|
|
95
|
+
|
|
96
|
+
### High Confidence
|
|
97
|
+
───────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
**Auth uses JWT with 15-min expiry**
|
|
100
|
+
- Type: architecture | Component: auth
|
|
101
|
+
- Added: 2026-01-15 | Source: pr-graduate
|
|
102
|
+
|
|
103
|
+
**Sessions stored in Redis, not cookies**
|
|
104
|
+
- Type: decision | Component: auth
|
|
105
|
+
- Added: 2026-01-10 | Source: meeting
|
|
106
|
+
|
|
107
|
+
### Medium Confidence
|
|
108
|
+
───────────────────────────────────────────
|
|
109
|
+
|
|
110
|
+
**Consider rate limiting on auth endpoints**
|
|
111
|
+
- Type: pattern | Component: auth
|
|
112
|
+
- Added: 2026-01-20 | Source: remember
|
|
113
|
+
|
|
114
|
+
───────────────────────────────────────────
|
|
115
|
+
|
|
116
|
+
Showing {count} of {total} results.
|
|
117
|
+
Refine with: /recall auth --type decision
|
|
118
|
+
Include low confidence: /recall all: auth
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Pre-Merge Results
|
|
122
|
+
|
|
123
|
+
If pre-merge memories are found, show them separately with a warning:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
### ⚠️ Pre-Merge (from teammate branches)
|
|
127
|
+
───────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
**New auth middleware pattern** (pre-merge)
|
|
130
|
+
- From: origin/jm/feature-auth
|
|
131
|
+
- Type: architecture | Component: auth
|
|
132
|
+
- ⚠️ Not yet merged - may change
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Step 4: Offer Actions
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
What would you like to do?
|
|
140
|
+
|
|
141
|
+
1. **Use this context** - I'll incorporate these into our work
|
|
142
|
+
2. **Refine search** - Try different filters
|
|
143
|
+
3. **View details** - See full content of a specific memory
|
|
144
|
+
4. **Done** - Just wanted to see what we know
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Example Queries
|
|
148
|
+
|
|
149
|
+
| Query | What it finds |
|
|
150
|
+
|-------|---------------|
|
|
151
|
+
| `/recall auth` | All auth-related memories (high/medium confidence) |
|
|
152
|
+
| `/recall #301 decisions` | Decisions made during issue #301 |
|
|
153
|
+
| `/recall --namespace team` | All team conventions |
|
|
154
|
+
| `/recall --component shifts --type architecture` | Shifts architecture |
|
|
155
|
+
| `/recall pre-merge: auth` | Include teammate WIP auth knowledge |
|
|
156
|
+
| `/recall all: validation` | Include low-confidence validation memories |
|
|
157
|
+
|
|
158
|
+
## No Results Handling
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
No memories found for "{query}" with current filters.
|
|
162
|
+
|
|
163
|
+
Suggestions:
|
|
164
|
+
- Try broader terms: /recall {simpler query}
|
|
165
|
+
- Include all confidence: /recall all: {query}
|
|
166
|
+
- Check different namespace: /recall --namespace team {query}
|
|
167
|
+
- Include pre-merge: /recall pre-merge: {query}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Notes
|
|
171
|
+
|
|
172
|
+
- Results are sorted by relevance (semantic similarity)
|
|
173
|
+
- Default excludes low confidence and abandoned memories
|
|
174
|
+
- Use `all:` modifier to see everything
|
|
175
|
+
- Pre-merge memories are from `(unmerged)` folders synced from teammate branches
|