memtrace 0.7.25 → 0.8.1
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.
- package/README.md +209 -287
- package/install.js +9 -6
- package/installer/package.json +1 -1
- package/installer/skills/commands/memtrace-api-topology.md +31 -34
- package/installer/skills/commands/memtrace-cochange.md +64 -33
- package/installer/skills/commands/memtrace-daily.md +73 -0
- package/installer/skills/commands/memtrace-decision-recall.md +91 -0
- package/installer/skills/commands/memtrace-evolution.md +121 -88
- package/installer/skills/commands/memtrace-fleet-publish-intent.md +18 -2
- package/installer/skills/commands/memtrace-fleet-record-episode.md +23 -2
- package/installer/skills/commands/memtrace-fleet-resolve.md +24 -1
- package/installer/skills/commands/memtrace-graph.md +59 -41
- package/installer/skills/commands/memtrace-impact.md +67 -19
- package/installer/skills/commands/memtrace-index.md +20 -3
- package/installer/skills/commands/memtrace-intent-verification.md +81 -0
- package/installer/skills/commands/memtrace-preflight.md +85 -0
- package/installer/skills/commands/memtrace-provenance.md +90 -0
- package/installer/skills/commands/memtrace-quality.md +49 -32
- package/installer/skills/commands/memtrace-relationships.md +73 -30
- package/installer/skills/commands/memtrace-search.md +86 -61
- package/installer/skills/workflows/memtrace-change-impact-analysis.md +32 -12
- package/installer/skills/workflows/memtrace-code-review.md +17 -11
- package/installer/skills/workflows/memtrace-codebase-exploration.md +41 -5
- package/installer/skills/workflows/memtrace-continuous-memory.md +54 -56
- package/installer/skills/workflows/memtrace-decision-memory.md +139 -0
- package/installer/skills/workflows/memtrace-episode-replay.md +87 -63
- package/installer/skills/workflows/memtrace-first.md +63 -7
- package/installer/skills/workflows/memtrace-fleet-coordination.md +21 -1
- package/installer/skills/workflows/memtrace-fleet-first.md +35 -5
- package/installer/skills/workflows/memtrace-incident-investigation.md +113 -55
- package/installer/skills/workflows/memtrace-refactoring-guide.md +31 -11
- package/installer/skills/workflows/memtrace-session-continuity.md +63 -49
- package/installer/skills/workflows/memtrace-style-fingerprint.md +27 -4
- package/package.json +7 -7
- package/skills/commands/memtrace-api-topology.md +31 -34
- package/skills/commands/memtrace-cochange.md +64 -33
- package/skills/commands/memtrace-daily.md +73 -0
- package/skills/commands/memtrace-decision-recall.md +91 -0
- package/skills/commands/memtrace-evolution.md +121 -88
- package/skills/commands/memtrace-fleet-publish-intent.md +18 -2
- package/skills/commands/memtrace-fleet-record-episode.md +23 -2
- package/skills/commands/memtrace-fleet-resolve.md +24 -1
- package/skills/commands/memtrace-graph.md +59 -41
- package/skills/commands/memtrace-impact.md +67 -19
- package/skills/commands/memtrace-index.md +20 -3
- package/skills/commands/memtrace-intent-verification.md +81 -0
- package/skills/commands/memtrace-preflight.md +85 -0
- package/skills/commands/memtrace-provenance.md +90 -0
- package/skills/commands/memtrace-quality.md +49 -32
- package/skills/commands/memtrace-relationships.md +73 -30
- package/skills/commands/memtrace-search.md +86 -61
- package/skills/workflows/memtrace-change-impact-analysis.md +32 -12
- package/skills/workflows/memtrace-code-review.md +17 -11
- package/skills/workflows/memtrace-codebase-exploration.md +41 -5
- package/skills/workflows/memtrace-continuous-memory.md +54 -56
- package/skills/workflows/memtrace-decision-memory.md +139 -0
- package/skills/workflows/memtrace-episode-replay.md +87 -63
- package/skills/workflows/memtrace-first.md +63 -7
- package/skills/workflows/memtrace-fleet-coordination.md +21 -1
- package/skills/workflows/memtrace-fleet-first.md +35 -5
- package/skills/workflows/memtrace-incident-investigation.md +113 -55
- package/skills/workflows/memtrace-refactoring-guide.md +31 -11
- package/skills/workflows/memtrace-session-continuity.md +63 -49
- package/skills/workflows/memtrace-style-fingerprint.md +27 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-fleet-coordination
|
|
3
|
-
description: "
|
|
3
|
+
description: "Resolve fleet conflicts between coordinated agents: what conflict class A/B/C means, how a Class C destructive overlap gets decided (by an agent judge or a human), how to be the judge (fleet_submit_verdict), how to read your directive after a decision, and how branch-scoping isolates fleets. Use when the user says 'two agents are changing the same thing', 'resolve this conflict', 'who should proceed', 'a decision is waiting', or asks you to act as a mediator between agents. This skill explains the conflict model and decision loop; for just the verdict/directive/resolution tool calls on a specific escalation, use memtrace-fleet-resolve."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__fleet_record_episode
|
|
6
6
|
- mcp__memtrace__fleet_submit_verdict
|
|
@@ -8,6 +8,10 @@ allowed-tools:
|
|
|
8
8
|
- mcp__memtrace__fleet_list_escalations
|
|
9
9
|
- mcp__memtrace__fleet_resolve_escalation
|
|
10
10
|
- mcp__memtrace__fleet_get_node_state
|
|
11
|
+
metadata:
|
|
12
|
+
author: "Syncable <support@syncable.dev>"
|
|
13
|
+
version: "1.0.0"
|
|
14
|
+
category: development
|
|
11
15
|
---
|
|
12
16
|
|
|
13
17
|
# Fleet Coordination
|
|
@@ -52,6 +56,8 @@ fleet_submit_verdict({
|
|
|
52
56
|
Verdict kinds: `reconcile {merge_plan}` · `recommend {winner, rationale, confidence}`
|
|
53
57
|
· `defer_to_human {question}`.
|
|
54
58
|
|
|
59
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
60
|
+
|
|
55
61
|
The referee then decides the outcome:
|
|
56
62
|
- **Auto-apply** only when safe: the clear machine case, or ≥2 independent agents
|
|
57
63
|
agree — and **never** for a destructive *removal* (delete/move), which always
|
|
@@ -85,3 +91,17 @@ one session branch and conflicts stay real and resolvable.
|
|
|
85
91
|
`fleet_get_node_state({repo_id, node})` — recent episodes, active intents, dominant
|
|
86
92
|
intent, and conflict density for one symbol. Use it to understand pressure on a
|
|
87
93
|
hot symbol before you pile on.
|
|
94
|
+
|
|
95
|
+
## Output
|
|
96
|
+
|
|
97
|
+
`fleet_record_episode` on a destructive overlap, then `fleet_get_escalation` once decided:
|
|
98
|
+
|
|
99
|
+
```jsonc
|
|
100
|
+
// fleet_record_episode
|
|
101
|
+
{ "conflict_class": "C", "escalation_id": "01J…",
|
|
102
|
+
"mediation_request": { /* every agent's assignment + the contested symbols */ } }
|
|
103
|
+
|
|
104
|
+
// fleet_get_escalation — poll until your_directive ≠ "wait"
|
|
105
|
+
{ "your_directive": "defer",
|
|
106
|
+
"resolution": "recommend: agent-b — rebase the fix onto the signature change" }
|
|
107
|
+
```
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-fleet-first
|
|
3
|
-
description: "
|
|
3
|
+
description: "Coordinate fleets of coding agents sharing one repo+branch: declare typed intents, classify edit episodes, and resolve conflicts before they collide. Use FIRST when more than one coding agent works the same repo+branch at once (a 'fleet'), before reading code, planning a refactor, or making an edit — triggered by 'I'm about to edit X', 'rename Y across the codebase', joining a running fleet/session branch, coordinating with other agents, or prose hand-offs. Do not grep for 'who else is touching this' and do not skip fleet_publish_intent because 'it's a small change'. Fleet coordination is branch-scoped: pass your session branch so your fleet coordinates and stays isolated from agents on other branches. Skip ONLY for genuinely solo sessions or pure docs-only edits where coordination has zero value."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__fleet_status
|
|
6
|
+
- mcp__memtrace__fleet_branch_context
|
|
6
7
|
- mcp__memtrace__fleet_preflight
|
|
7
8
|
- mcp__memtrace__fleet_publish_intent
|
|
8
9
|
- mcp__memtrace__fleet_record_episode
|
|
9
10
|
- mcp__memtrace__fleet_get_escalation
|
|
10
11
|
- mcp__memtrace__fleet_submit_verdict
|
|
12
|
+
- mcp__memtrace__fleet_get_node_state
|
|
13
|
+
metadata:
|
|
14
|
+
author: "Syncable <support@syncable.dev>"
|
|
15
|
+
version: "1.0.0"
|
|
16
|
+
category: development
|
|
11
17
|
---
|
|
12
18
|
|
|
13
19
|
# Fleet First
|
|
@@ -52,15 +58,24 @@ branch* is how a group of agents opts into one coordinating fleet.
|
|
|
52
58
|
Always include **`assignment`** — your natural-language task. When a conflict
|
|
53
59
|
happens, that's what the judge (another agent) or a human reads to reconcile.
|
|
54
60
|
|
|
55
|
-
## Check the fleet first (once per session)
|
|
61
|
+
## Check the fleet first (once per session and after idle)
|
|
56
62
|
|
|
63
|
+
Set a stable identity before any fleet call:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
MEMTRACE_AGENT_ID=<your-agent-id> # required in fleet / hosted environments
|
|
57
67
|
```
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
fleet_branch_context({repo_id, branch, agent_id})
|
|
71
|
+
→ you, peers[], pending_escalations, recent_peer_episodes, graph_revision
|
|
58
72
|
fleet_status() → live_intents, active_agents, pending_escalations, mediator_mode
|
|
59
73
|
```
|
|
60
74
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
Call **`fleet_branch_context`** at session start and after idle periods so you do not
|
|
76
|
+
confuse peer WIP with settled graph truth. If fleet tools respond, coordination is
|
|
77
|
+
active — follow this skill for every edit. An empty peer list is **not** permission
|
|
78
|
+
to skip: it just means you're the first agent in this window.
|
|
64
79
|
|
|
65
80
|
## The protocol, step by step
|
|
66
81
|
|
|
@@ -125,8 +140,23 @@ degrades to "a human reviews a suggestion," never a silent bad merge.
|
|
|
125
140
|
- `touched` is a list of qualified symbol identities (e.g. `"module::Symbol"`).
|
|
126
141
|
- Always include `branch` (your session branch) and `assignment` (your task).
|
|
127
142
|
|
|
143
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
144
|
+
|
|
128
145
|
## When to skip
|
|
129
146
|
|
|
130
147
|
Skip the protocol only for a genuinely **solo** session (you're the only agent and
|
|
131
148
|
no one else shares your branch) or **pure docs-only** edits where coordination has
|
|
132
149
|
zero value. Everything else in a fleet goes through the protocol.
|
|
150
|
+
|
|
151
|
+
## Output
|
|
152
|
+
|
|
153
|
+
Key return shapes (fields documented above):
|
|
154
|
+
|
|
155
|
+
```jsonc
|
|
156
|
+
// fleet_record_episode →
|
|
157
|
+
{ "conflict_class": "C", "escalation_id": "…", "mediation_request": { /* every agent's assignment */ } }
|
|
158
|
+
// fleet_get_escalation →
|
|
159
|
+
{ "your_directive": "wait | proceed | defer | review", "resolution": "free text (read on review)" }
|
|
160
|
+
// fleet_status →
|
|
161
|
+
{ "live_intents": [ /* … */ ], "active_agents": [ /* … */ ], "pending_escalations": [ /* … */ ], "mediator_mode": "…" }
|
|
162
|
+
```
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-incident-investigation
|
|
3
|
-
description: "
|
|
3
|
+
description: "Investigate source-code bugs, incidents, regressions, production issues, and failures to root cause with Memtrace symbol search, impact, call graph, and temporal history. Use when the user asks about root cause analysis, what broke, or what changed when debugging a failure. Do not start with Grep, Glob, rg, find, or manual file search for code causes. For plain what-changed questions without a failure, use memtrace-evolution."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__get_evolution
|
|
6
|
-
- mcp__memtrace__get_timeline
|
|
7
|
-
- mcp__memtrace__detect_changes
|
|
8
6
|
- mcp__memtrace__get_impact
|
|
9
7
|
- mcp__memtrace__get_symbol_context
|
|
10
|
-
- mcp__memtrace__find_code
|
|
11
|
-
- mcp__memtrace__find_symbol
|
|
12
|
-
- mcp__memtrace__analyze_relationships
|
|
13
|
-
- mcp__memtrace__list_indexed_repositories
|
|
14
8
|
- mcp__memtrace__get_cochange_context
|
|
9
|
+
- mcp__memtrace__get_timeline
|
|
15
10
|
- mcp__memtrace__get_episode_replay
|
|
11
|
+
- mcp__memtrace__find_symbol
|
|
12
|
+
- mcp__memtrace__list_indexed_repositories
|
|
13
|
+
metadata:
|
|
14
|
+
author: "Syncable <support@syncable.dev>"
|
|
15
|
+
version: "1.0.0"
|
|
16
|
+
category: development
|
|
16
17
|
user-invocable: true
|
|
17
18
|
---
|
|
18
19
|
|
|
19
20
|
## Overview
|
|
20
21
|
|
|
21
|
-
Root cause investigation workflow for incidents, regressions, and production issues. Uses
|
|
22
|
+
Root cause investigation workflow for incidents, regressions, and production issues. Uses `get_evolution` to list changes near the incident time, then traces blast radius and execution flows to identify the likely cause.
|
|
22
23
|
|
|
23
24
|
## Steps
|
|
24
25
|
|
|
@@ -29,97 +30,154 @@ Determine:
|
|
|
29
30
|
- **Lookback window** — how far back to search? Start with 24 hours, expand if needed.
|
|
30
31
|
- **Repo(s)** — which services are affected? Call `list_indexed_repositories` to get repo_ids.
|
|
31
32
|
|
|
32
|
-
### 2.
|
|
33
|
+
### 2. List changes near the incident
|
|
34
|
+
|
|
35
|
+
Call `get_evolution`:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"repo_id": "<affected-repo>",
|
|
40
|
+
"from": "<incident_time minus lookback, e.g. 24h before>",
|
|
41
|
+
"to": "<incident_time ISO-8601>",
|
|
42
|
+
"mode": "recent",
|
|
43
|
+
"limit": 100
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Why `recent` mode?** Returns a chronological per-episode changelog. Focus on episodes whose `reference_time` is closest to the incident — especially those with high `nodes_added` + `nodes_removed` or that touch files in the failure area.
|
|
48
|
+
|
|
49
|
+
Paginate with `cursor` if `next_cursor` is present in the response.
|
|
50
|
+
|
|
51
|
+
**Success criteria:** A list of episodes in the window, with touched files and change counts for each.
|
|
52
|
+
|
|
53
|
+
### 3. Identify hotspot files and symbols
|
|
33
54
|
|
|
34
|
-
Call `get_evolution` with:
|
|
35
|
-
- `mode: "recent"` — temporal proximity weighting: `impact × exp(−0.5 × Δhours)`
|
|
36
|
-
- `from` — lookback start (e.g., 24 hours before incident)
|
|
37
|
-
- `to` — the incident timestamp
|
|
38
|
-
- `repo_id` — the affected repo
|
|
55
|
+
Call `get_evolution` again on the same window with `mode: "compound"`:
|
|
39
56
|
|
|
40
|
-
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"repo_id": "<affected-repo>",
|
|
60
|
+
"from": "<same as step 2>",
|
|
61
|
+
"to": "<same as step 2>",
|
|
62
|
+
"mode": "compound"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
41
65
|
|
|
42
|
-
|
|
66
|
+
Review `top_changed_files` and `top_touched_symbols`. Cross-reference with the failure area (endpoint, module, error stack).
|
|
43
67
|
|
|
44
|
-
|
|
68
|
+
**Decision:** Prioritize symbols/files that appear in both the recent episode list (step 2) and the compound hotspots (step 3).
|
|
45
69
|
|
|
46
|
-
|
|
47
|
-
- Flags changes to rarely-modified code (high in_degree, low change frequency)
|
|
48
|
-
- A core utility that hasn't changed in 90 days suddenly changing near an incident is a strong signal
|
|
70
|
+
### 4. Check for unexpected changes to stable code
|
|
49
71
|
|
|
50
|
-
|
|
72
|
+
For hotspot symbols from step 3, resolve each with `find_symbol`:
|
|
51
73
|
|
|
52
|
-
|
|
74
|
+
```json
|
|
75
|
+
{ "repo_id": "<affected-repo>", "name": "<symbol>", "limit": 10 }
|
|
76
|
+
```
|
|
53
77
|
|
|
54
|
-
|
|
78
|
+
Then call `get_timeline` — stable code that suddenly changed is suspect:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{ "repo_id": "<affected-repo>", "scope_path": "<from find_symbol>", "file_path": "<from find_symbol>" }
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 5. Assess the blast radius
|
|
85
|
+
|
|
86
|
+
For the top 3–5 symbols, call `get_impact`:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{ "repo_id": "<affected-repo>", "target": "<symbol>", "direction": "upstream" }
|
|
90
|
+
```
|
|
55
91
|
- How many downstream consumers were affected?
|
|
56
92
|
- What execution flows pass through this symbol?
|
|
57
93
|
|
|
58
94
|
**Decision:** Prioritize symbols where the blast radius overlaps with the reported failure area.
|
|
59
95
|
|
|
60
|
-
###
|
|
96
|
+
### 6. Trace execution flows
|
|
61
97
|
|
|
62
98
|
Use `get_symbol_context` on the top suspects to see which processes (HTTP handlers, background jobs, etc.) they participate in.
|
|
63
99
|
|
|
64
100
|
**Decision:** If the incident is in a specific endpoint/flow, focus on suspects that are members of that process.
|
|
65
101
|
|
|
66
|
-
###
|
|
102
|
+
### 7. Build the full timeline for the suspect
|
|
67
103
|
|
|
68
|
-
Once you have a primary suspect, call `get_timeline` with
|
|
69
|
-
- What changed in each
|
|
104
|
+
Once you have a primary suspect, call `get_timeline` with `repo_id`, `scope_path`, and `file_path`:
|
|
105
|
+
- What changed in each episode?
|
|
70
106
|
- When was the last "stable" version?
|
|
71
107
|
- Was the change a modification, or was it newly added?
|
|
72
108
|
|
|
73
|
-
###
|
|
109
|
+
### 8. Correlate adds vs removes per episode
|
|
74
110
|
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
111
|
+
From the step 2 `recent` response, inspect each episode's `nodes_added` and `nodes_removed`:
|
|
112
|
+
- High `nodes_added` — new code introduced (potential new bugs)
|
|
113
|
+
- High `nodes_removed` — deleted code (potential missing functionality)
|
|
114
|
+
- Both moderate — changed behaviour (potential regressions)
|
|
79
115
|
|
|
80
|
-
###
|
|
116
|
+
### 9. Check historical coupling (cochange)
|
|
81
117
|
|
|
82
118
|
For the primary suspect, call `get_cochange_context`:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{ "repo_id": "<affected-repo>", "target": "<symbol>", "limit": 10 }
|
|
122
|
+
```
|
|
83
123
|
- Which symbols historically co-change with this one?
|
|
84
124
|
- If the blast radius from `get_impact` doesn't explain the failure area, check cochange partners — the coupling may be behavioral, not structural.
|
|
85
125
|
|
|
86
126
|
**Decision:** If a cochange partner is in the failure area but has no direct call relationship to the suspect, it's a hidden dependency — investigate both.
|
|
87
127
|
|
|
88
|
-
###
|
|
128
|
+
### 10. Replay the sub-commit implementation history (if needed)
|
|
129
|
+
|
|
130
|
+
If the suspect's episode isn't clear, call `get_episode_replay`:
|
|
89
131
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"repo_id": "<affected-repo>",
|
|
135
|
+
"episode_index": 0,
|
|
136
|
+
"symbol": "<suspect>",
|
|
137
|
+
"mode": "graph_summary"
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
- Look for `attempted_and_reverted` hints — approaches tried and rolled back within the episode often explain why the committed state looks the way it does.
|
|
94
142
|
|
|
95
143
|
## Report: Root Cause Analysis
|
|
96
144
|
|
|
97
145
|
1. **Incident Timeline** — when it started, what was observed
|
|
98
|
-
2. **Most Likely Cause** —
|
|
99
|
-
3. **Supporting Evidence** —
|
|
146
|
+
2. **Most Likely Cause** — episodes and symbols closest to the incident with blast radius confirmation
|
|
147
|
+
3. **Supporting Evidence** — timeline sparsity (stable code suddenly changed?), blast radius overlap, process membership overlap
|
|
100
148
|
4. **Change History** — full timeline of the suspect symbol
|
|
101
149
|
5. **Affected Scope** — all processes and downstream consumers impacted
|
|
102
150
|
6. **Remediation** — revert the change, fix forward, or mitigate
|
|
103
151
|
|
|
104
|
-
##
|
|
152
|
+
## Tool selection guide for incidents
|
|
153
|
+
|
|
154
|
+
| Phase | Tool / mode | Why |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| Initial triage | `get_evolution` `recent` | Per-episode changelog near the incident |
|
|
157
|
+
| Hotspot identification | `get_evolution` `compound` | Top changed files and symbols in the window |
|
|
158
|
+
| Scope assessment | `get_impact` | Blast radius of suspect symbols |
|
|
159
|
+
| Hidden coupling | `get_cochange_context` | Behavioral coupling not in the call graph |
|
|
160
|
+
| Symbol history | `get_timeline` | Full version history of a suspect |
|
|
161
|
+
| Sub-commit intent | `get_episode_replay` | What was tried before the committed state |
|
|
162
|
+
| Quick window check | `get_evolution` `overview` | Totals only — use before narrowing the window |
|
|
163
|
+
|
|
164
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
165
|
+
|
|
166
|
+
## Output
|
|
167
|
+
|
|
168
|
+
The deliverable is the RCA report above. Abridged example (3 of 6 sections filled):
|
|
105
169
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
| Anomaly detection | `get_evolution` `novel` | Catches unexpected changes to stable code |
|
|
110
|
-
| Scope assessment | `get_impact` | Ranks by structural significance (blast radius) |
|
|
111
|
-
| Hidden coupling | `get_cochange_context` | Surfaces behavioral coupling not in the call graph |
|
|
112
|
-
| Direction analysis | `get_evolution` `directional` | Separates added/removed/modified |
|
|
113
|
-
| Sub-commit intent | `get_episode_replay` | Reveals what was tried before the committed state |
|
|
114
|
-
| Quick summary | `get_evolution` `overview` | Fast module-level scan before deep-diving |
|
|
170
|
+
- **Most Likely Cause** — episode `2026-07-01T14:22Z` modified `AuthService::validateToken`; upstream blast radius reaches the failing `/api/login` process
|
|
171
|
+
- **Supporting Evidence** — symbol was stable for 90 days before this episode; cochange partner `token_cache.rs` changed in the same window despite no call edge
|
|
172
|
+
- **Remediation** — revert the episode, or fix forward with an expiry guard
|
|
115
173
|
|
|
116
|
-
## Common
|
|
174
|
+
## Common mistakes
|
|
117
175
|
|
|
118
176
|
| Mistake | Reality |
|
|
119
|
-
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
177
|
+
|---|---|
|
|
178
|
+
| Omitting `from` or passing `days` | Always pass `from` (e.g. `"24 hours ago"`) — never `days` |
|
|
179
|
+
| Using `mode: "novel"` or `"directional"` | Not implemented — use `compound` + `get_timeline` + `get_cochange_context` |
|
|
180
|
+
| Only looking at the most recent commit | The root cause may be from an earlier episode whose effects were delayed |
|
|
123
181
|
| Not checking blast radius overlap | A change is only a suspect if its blast radius reaches the failure area |
|
|
124
182
|
| Stopping at call graph analysis | `get_cochange_context` finds hidden coupling — symbols that move together without calling each other |
|
|
125
183
|
| Reading only committed code | `get_episode_replay` reveals tried-and-reverted approaches that explain the current implementation |
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-refactoring-guide
|
|
3
|
-
description: "
|
|
3
|
+
description: "Build a phased, risk-scored refactoring plan from Memtrace complexity, dead-code, bridge, and impact analysis. Use when the user wants to refactor source code, reduce complexity, clean technical debt, split large functions, extract modules, reorganize code, or choose refactoring priorities. Do not use Grep or manual reference search to plan refactors; Memtrace provides complexity, dead-code, relationships, and impact context."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__find_most_complex_functions
|
|
6
6
|
- mcp__memtrace__find_dead_code
|
|
7
7
|
- mcp__memtrace__find_bridge_symbols
|
|
8
|
-
- mcp__memtrace__find_central_symbols
|
|
9
|
-
- mcp__memtrace__get_symbol_context
|
|
10
|
-
- mcp__memtrace__get_impact
|
|
11
8
|
- mcp__memtrace__get_evolution
|
|
9
|
+
- mcp__memtrace__get_impact
|
|
10
|
+
- mcp__memtrace__get_symbol_context
|
|
12
11
|
- mcp__memtrace__analyze_relationships
|
|
13
12
|
- mcp__memtrace__list_communities
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
metadata:
|
|
14
|
+
author: "Syncable <support@syncable.dev>"
|
|
15
|
+
version: "1.0.0"
|
|
16
|
+
category: development
|
|
16
17
|
user-invocable: true
|
|
17
18
|
---
|
|
18
19
|
|
|
@@ -27,7 +28,7 @@ Guided refactoring workflow — identifies refactoring candidates using structur
|
|
|
27
28
|
Run these three tools in parallel to build a candidate list:
|
|
28
29
|
|
|
29
30
|
**a) Complexity hotspots:**
|
|
30
|
-
Call `find_most_complex_functions` with `
|
|
31
|
+
Call `find_most_complex_functions` with `top_n: 20`
|
|
31
32
|
|
|
32
33
|
**b) Dead code:**
|
|
33
34
|
Call `find_dead_code` to find unused symbols
|
|
@@ -37,7 +38,9 @@ Call `find_bridge_symbols` to find chokepoints with too much responsibility
|
|
|
37
38
|
|
|
38
39
|
### 2. Score candidates by volatility
|
|
39
40
|
|
|
40
|
-
Call `get_evolution` with
|
|
41
|
+
Call `get_evolution` with `from: "90d ago"` and `mode: "compound"`.
|
|
42
|
+
|
|
43
|
+
Review `top_touched_symbols` and `top_changed_files`:
|
|
41
44
|
- Symbols that are BOTH complex AND frequently changing are the highest priority
|
|
42
45
|
- Complex but stable code can wait — it's not causing active pain
|
|
43
46
|
- Volatile but simple code may be fine — frequent changes to simple code is normal
|
|
@@ -63,9 +66,11 @@ Also call `get_symbol_context` to check:
|
|
|
63
66
|
### 4. Understand the neighbourhood
|
|
64
67
|
|
|
65
68
|
For each refactoring target, call `analyze_relationships`:
|
|
66
|
-
- `find_callees` — what does it depend on?
|
|
67
|
-
- `find_callers` — what depends on it?
|
|
68
|
-
- `class_hierarchy` — is it part of an inheritance chain?
|
|
69
|
+
- `find_callees` — what does it depend on? These become candidates for extraction
|
|
70
|
+
- `find_callers` — what depends on it? These need updating after refactoring
|
|
71
|
+
- `class_hierarchy` — is it part of an inheritance chain? Liskov concerns
|
|
72
|
+
|
|
73
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
69
74
|
|
|
70
75
|
### 5. Check community boundaries
|
|
71
76
|
|
|
@@ -106,6 +111,21 @@ For each item, include:
|
|
|
106
111
|
| Bridge symbol with many dependents | Extract interface first, then refactor implementation behind it |
|
|
107
112
|
| Symbol in cross-repo API | Coordinate with consumers; backward-compatible changes only |
|
|
108
113
|
|
|
114
|
+
## Output
|
|
115
|
+
|
|
116
|
+
A phased plan (Phases 1–3). One worked entry:
|
|
117
|
+
|
|
118
|
+
| Field | Example |
|
|
119
|
+
|---|---|
|
|
120
|
+
| Target | `process_payment` — `src/billing/processor.py`, complexity 38 |
|
|
121
|
+
| Why | Complex + volatile (14 changes/90d in `top_touched_symbols`) + 23-symbol blast radius |
|
|
122
|
+
| First move | Extract validation branch to `validate_payment_request`; keep callers untouched |
|
|
123
|
+
| Risk | High — upstream spans 3 processes incl. `checkout_flow`; incremental migration |
|
|
124
|
+
|
|
125
|
+
Acceptance criteria:
|
|
126
|
+
- Every plan item cites complexity, volatility, and blast radius — no gut-feel picks.
|
|
127
|
+
- High/Critical-risk items include a test plan naming affected callers/processes.
|
|
128
|
+
|
|
109
129
|
## Common Mistakes
|
|
110
130
|
|
|
111
131
|
| Mistake | Reality |
|
|
@@ -1,98 +1,112 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-session-continuity
|
|
3
|
-
description: "
|
|
3
|
+
description: "Catch up on everything that changed in an indexed source-code repo since the last session, using stored session anchors and Memtrace change memory. Use when the user asks to continue, catch up, resume, see what changed while away, recover prior context, or orient at session start without guessing timestamps. Do not use git log, Grep, or manual file search for catch-up; Memtrace provides session anchors and change memory."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__get_changes_since
|
|
6
6
|
- mcp__memtrace__list_indexed_repositories
|
|
7
7
|
- mcp__memtrace__get_evolution
|
|
8
|
+
metadata:
|
|
9
|
+
author: "Syncable <support@syncable.dev>"
|
|
10
|
+
version: "1.0.0"
|
|
11
|
+
category: development
|
|
8
12
|
user-invocable: true
|
|
9
13
|
---
|
|
10
14
|
|
|
11
15
|
## Overview
|
|
12
16
|
|
|
13
|
-
Session continuity for agents.
|
|
17
|
+
Session continuity for agents. Store a timestamp from your last session and call `get_changes_since` to see exactly what happened since then — then drill into details with `get_evolution` if needed.
|
|
14
18
|
|
|
15
|
-
**Core principle:**
|
|
19
|
+
**Core principle:** Persist a `since` timestamp (or the `until` from your last catch-up call). Never invent a `days` parameter.
|
|
16
20
|
|
|
17
21
|
## Steps
|
|
18
22
|
|
|
19
23
|
### 1. Find or bootstrap the session anchor
|
|
20
24
|
|
|
21
|
-
Look for a stored
|
|
25
|
+
Look for a stored anchor from your last session:
|
|
22
26
|
|
|
23
27
|
```json
|
|
24
28
|
{
|
|
25
|
-
"
|
|
26
|
-
"
|
|
29
|
+
"repo_id": "memdb",
|
|
30
|
+
"since": "2026-04-13T10:43:00Z"
|
|
27
31
|
}
|
|
28
32
|
```
|
|
29
33
|
|
|
30
|
-
If you have no anchor yet (first run), call `list_indexed_repositories`.
|
|
34
|
+
If you have no anchor yet (first run), call `list_indexed_repositories`. Use `last_episode_time` from the repo entry as a bootstrap `since` value, or ask the user how far back to look.
|
|
31
35
|
|
|
32
36
|
### 2. Call `get_changes_since`
|
|
33
37
|
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"repo_id": "memdb",
|
|
41
|
+
"since": "2026-04-13T10:43:00Z"
|
|
42
|
+
}
|
|
34
43
|
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
)
|
|
41
|
-
```
|
|
44
|
+
|
|
45
|
+
Optional: pass `until` to cap the upper bound (defaults to now).
|
|
46
|
+
|
|
47
|
+
**Required param is `since`** — not `last_episode_id`, not `days`. Same time formats as `get_evolution.from` (`"7d ago"`, ISO-8601, etc.).
|
|
48
|
+
|
|
49
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
42
50
|
|
|
43
51
|
### 3. Interpret the response
|
|
44
52
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
| `
|
|
48
|
-
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
53
|
+
Response shape: see [Output](#output) below. Act on `totals.episode_count`:
|
|
54
|
+
|
|
55
|
+
| `totals.episode_count` | Action |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `0` | Nothing changed — safe to proceed |
|
|
58
|
+
| `1–20` | Review each episode's `touched_files` and change counts |
|
|
59
|
+
| Many episodes | Scan `touched_files` for overlap with your task; drill down with `get_evolution` |
|
|
51
60
|
|
|
52
61
|
### 4. Decide whether changes are relevant
|
|
53
62
|
|
|
54
63
|
```
|
|
55
|
-
|
|
56
|
-
├──
|
|
57
|
-
│ ├── YES →
|
|
58
|
-
│ └── NO → safe to continue
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
├── Check by_module — does any changed module overlap with your task area?
|
|
62
|
-
│ ├── YES → get_evolution(mode: compound) scoped to that window for detail
|
|
63
|
-
│ └── NO → ignore, update anchor
|
|
64
|
+
episodes returned
|
|
65
|
+
├── Any touched_files overlap your current task area?
|
|
66
|
+
│ ├── YES → call get_evolution(from: since, mode: compound) for hotspots
|
|
67
|
+
│ └── NO → safe to continue
|
|
68
|
+
└── Need per-commit detail?
|
|
69
|
+
└── get_evolution(from: since, mode: recent, limit: 100)
|
|
64
70
|
```
|
|
65
71
|
|
|
66
|
-
### 5. Always persist the
|
|
72
|
+
### 5. Always persist the new anchor
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
Store the `until` value from the response (or the latest episode's `reference_time`) for next session:
|
|
69
75
|
|
|
70
76
|
```json
|
|
71
77
|
{
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
"last_reference_time": "2026-04-13T14:22:00Z"
|
|
75
|
-
}
|
|
78
|
+
"repo_id": "memdb",
|
|
79
|
+
"since": "2026-04-13T14:22:00Z"
|
|
76
80
|
}
|
|
77
81
|
```
|
|
78
82
|
|
|
79
|
-
##
|
|
83
|
+
## Output
|
|
80
84
|
|
|
81
|
-
`get_changes_since`
|
|
85
|
+
`get_changes_since` returns:
|
|
82
86
|
|
|
83
|
-
|
|
|
84
|
-
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
87
|
+
| Field | Meaning |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `episodes[]` | Each episode since `since`, with `touched_files`, `nodes_added/removed`, `reference_time` |
|
|
90
|
+
| `totals.episode_count` | How many episodes in the window — `0` means nothing changed |
|
|
91
|
+
| `since` / `until` | The resolved window boundaries |
|
|
88
92
|
|
|
89
|
-
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"since": "2026-04-13T10:43:00Z",
|
|
96
|
+
"until": "2026-04-13T14:22:00Z",
|
|
97
|
+
"episodes": [
|
|
98
|
+
{ "reference_time": "2026-04-13T12:05:00Z", "touched_files": ["src/engine/page_cache.rs"], "nodes_added": 4, "nodes_removed": 1 }
|
|
99
|
+
],
|
|
100
|
+
"totals": { "episode_count": 1 }
|
|
101
|
+
}
|
|
102
|
+
```
|
|
90
103
|
|
|
91
|
-
## Common
|
|
104
|
+
## Common mistakes
|
|
92
105
|
|
|
93
106
|
| Mistake | Reality |
|
|
94
|
-
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
|
107
|
+
|---|---|
|
|
108
|
+
| Passing `last_episode_id` or `days` | `get_changes_since` requires `since` — a timestamp string |
|
|
109
|
+
| Using `get_evolution` without `from` | Always pass `from` (e.g. `"7d ago"`) — never omit it or use `days` |
|
|
110
|
+
| Expecting `status`, `by_module`, or `session_anchor` in the response | Not in the current shape — use `episodes[]` and `totals` |
|
|
111
|
+
| Discarding the stored `since` timestamp | Without it, next session reverts to guessing |
|
|
112
|
+
| Calling this repeatedly within one session | Call once at session start; reuse the result for the rest of the session |
|