memtrace 0.7.25 → 0.8.0
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,11 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-style-fingerprint
|
|
3
|
-
description: "
|
|
3
|
+
description: "Pull the codebase's empirical style norm from Memtrace and match it when writing or editing source code in an indexed repo. Use when choosing between competing idioms (ternary vs if-else, arrow vs function declaration, const vs let, await vs .then, early-return vs nested-return), matching naming case, or when the user asks what the convention here is. Do not re-derive style from training priors or maintain a markdown style guide for the project; the fingerprint is sampled live from the actual code."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__get_style_fingerprint
|
|
6
6
|
- mcp__memtrace__get_codebase_briefing
|
|
7
|
-
- mcp__memtrace__find_code
|
|
8
7
|
- mcp__memtrace__list_indexed_repositories
|
|
8
|
+
metadata:
|
|
9
|
+
author: "Syncable <support@syncable.dev>"
|
|
10
|
+
version: "1.0.0"
|
|
11
|
+
category: development
|
|
9
12
|
user-invocable: true
|
|
10
13
|
---
|
|
11
14
|
|
|
@@ -15,7 +18,7 @@ Every indexed Memtrace repository carries an empirical **style fingerprint** —
|
|
|
15
18
|
|
|
16
19
|
The fingerprint is **descriptive, not prescriptive**. It reports what the codebase actually does, not what a style guide says it should do. If the codebase deviates from a popular convention for some reason, the fingerprint captures the deviation and you should match the deviation — that's the whole point. For prescriptive bug/security/perf rules, use `find_code_review_issues` instead.
|
|
17
20
|
|
|
18
|
-
##
|
|
21
|
+
## Best Fit
|
|
19
22
|
|
|
20
23
|
| Situation | Action |
|
|
21
24
|
|---|---|
|
|
@@ -28,11 +31,13 @@ The fingerprint is **descriptive, not prescriptive**. It reports what the codeba
|
|
|
28
31
|
|
|
29
32
|
If the repo is not indexed in Memtrace, this workflow does not apply — fall back to your default behavior.
|
|
30
33
|
|
|
34
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
35
|
+
|
|
31
36
|
## Steps
|
|
32
37
|
|
|
33
38
|
### 1. Get the codebase's overall norm
|
|
34
39
|
|
|
35
|
-
Call `get_style_fingerprint(repo_id)` with no `file_path
|
|
40
|
+
Call `get_style_fingerprint(repo_id)` with no `file_path` (`repo_id` comes from `list_indexed_repositories` if not already known). The response includes:
|
|
36
41
|
|
|
37
42
|
- `histogram` — raw counts (e.g. `ternary_count: 1005, if_stmt_count: 8087`)
|
|
38
43
|
- `ratios` — computed shares for each competing pair (e.g. `ternary_share: 0.11`)
|
|
@@ -81,6 +86,24 @@ You should already be reading the briefing at session start (per `memtrace-codeb
|
|
|
81
86
|
| `delta_from_codebase_norm` shows your target file already diverges from the norm | Don't amplify the divergence with your edits — match the codebase, not the outlier file |
|
|
82
87
|
| `file_fingerprint` is empty (file has no functions yet, or is a config file) | Use the language slice or repo aggregate; this is creation territory |
|
|
83
88
|
|
|
89
|
+
## Output
|
|
90
|
+
|
|
91
|
+
Repo-mode `get_style_fingerprint` (field meanings in Steps 1–2):
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"histogram": { "ternary_count": 1005, "if_stmt_count": 8087 },
|
|
96
|
+
"ratios": { "ternary_share": 0.11, "naming_variables_snake_share": 0.89 },
|
|
97
|
+
"dominant_idioms": [
|
|
98
|
+
{ "dimension": "ternary_share", "ratio": 0.11, "interpretation": "strongly prefers if-else over ternaries" }
|
|
99
|
+
],
|
|
100
|
+
"function_count": 4211,
|
|
101
|
+
"sample_threshold": 20
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
File mode adds `file_fingerprint`, `codebase_fingerprint`, `language`, `language_fingerprint`, and `delta_from_language_norm` (entries: `dimension`, `file_ratio`, `codebase_ratio`, `abs_delta`, `note`).
|
|
106
|
+
|
|
84
107
|
## Anti-patterns — do not do these
|
|
85
108
|
|
|
86
109
|
- **Reading the repo aggregate when editing a single-language file.** If the codebase is 70% TS / 30% Python, the repo aggregate mixes both. The `language_fingerprint` (when available) or `codebase_fingerprint.ratios` filtered by the file's language is what you should match. Cross-applying TS norms to a Python file is the failure mode this whole tool exists to prevent.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memtrace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Code intelligence graph — MCP server + AI agent skills + visualization UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"fs-extra": "^11.0.0"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@memtrace/darwin-arm64": "0.
|
|
43
|
-
"@memtrace/linux-x64": "0.
|
|
44
|
-
"@memtrace/linux-arm64": "0.
|
|
45
|
-
"@memtrace/win32-x64": "0.
|
|
46
|
-
"@memtrace/linux-x64-noavx2": "0.
|
|
47
|
-
"@memtrace/win32-x64-noavx2": "0.
|
|
42
|
+
"@memtrace/darwin-arm64": "0.8.0",
|
|
43
|
+
"@memtrace/linux-x64": "0.8.0",
|
|
44
|
+
"@memtrace/linux-arm64": "0.8.0",
|
|
45
|
+
"@memtrace/win32-x64": "0.8.0",
|
|
46
|
+
"@memtrace/linux-x64-noavx2": "0.8.0",
|
|
47
|
+
"@memtrace/win32-x64-noavx2": "0.8.0"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=18"
|
|
@@ -1,65 +1,62 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-api-topology
|
|
3
|
-
description: "
|
|
3
|
+
description: "Map API endpoints, outbound HTTP calls, and cross-repo service topology in indexed source code. Use when the user asks about API endpoints, HTTP routes, fetch/client calls, REST surface, service dependencies, cross-repo dependencies, or API topology. Do not use Grep, Glob, rg, find, or manual file search for routes or HTTP calls; Memtrace maps endpoints and call edges from the indexed AST graph."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__get_api_topology
|
|
6
6
|
- mcp__memtrace__find_api_endpoints
|
|
7
7
|
- mcp__memtrace__find_api_calls
|
|
8
8
|
- mcp__memtrace__get_symbol_context
|
|
9
9
|
- mcp__memtrace__link_repositories
|
|
10
|
+
metadata:
|
|
11
|
+
author: "Syncable <support@syncable.dev>"
|
|
12
|
+
version: "1.0.0"
|
|
13
|
+
category: development
|
|
10
14
|
user-invocable: true
|
|
11
15
|
---
|
|
12
16
|
|
|
13
17
|
## Overview
|
|
14
18
|
|
|
15
|
-
Map
|
|
19
|
+
Map HTTP API surface — endpoints, outbound calls, cross-repo topology.
|
|
16
20
|
|
|
17
21
|
## Quick Reference
|
|
18
22
|
|
|
19
|
-
| Tool |
|
|
20
|
-
|
|
21
|
-
| `find_api_endpoints` |
|
|
22
|
-
| `find_api_calls` |
|
|
23
|
-
| `get_api_topology` |
|
|
24
|
-
| `link_repositories` | Manually link repos for cross-repo edge detection |
|
|
25
|
-
|
|
26
|
-
> **Parameter types:** MCP parameters are strictly typed. Numbers (`limit`, `depth`, `min_size`, `last_n`, etc.) must be JSON numbers — not strings. Use `limit: 20`, never `limit: "20"`. Passing a string yields `MCP error -32602: invalid type: string, expected usize`.
|
|
23
|
+
| Tool | Required | Key optional |
|
|
24
|
+
|------|----------|--------------|
|
|
25
|
+
| `find_api_endpoints` | `repo_id` | `method`, `path_contains`, `limit`, `branch` |
|
|
26
|
+
| `find_api_calls` | `repo_id` | `method`, `path_contains`, `limit`, `branch` |
|
|
27
|
+
| `get_api_topology` | — | `repo_id`, `min_confidence`, `include_external` |
|
|
27
28
|
|
|
29
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
28
30
|
|
|
29
31
|
## Steps
|
|
30
32
|
|
|
31
|
-
### 1.
|
|
32
|
-
|
|
33
|
-
Use `find_api_endpoints`:
|
|
34
|
-
- `repo_id` — required
|
|
35
|
-
- Returns: method, path, handler function, framework detected
|
|
36
|
-
|
|
37
|
-
### 2. Discover outbound calls
|
|
33
|
+
### 1–3. Endpoints, calls, topology
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
```json
|
|
36
|
+
{ "repo_id": "memdb" }
|
|
37
|
+
{ "repo_id": "memdb", "method": "GET", "path_contains": "/users" }
|
|
38
|
+
{ "min_confidence": 0.7 }
|
|
39
|
+
```
|
|
42
40
|
|
|
43
|
-
###
|
|
41
|
+
### 4. Deep-dive an endpoint handler
|
|
44
42
|
|
|
45
|
-
Use
|
|
46
|
-
- Which services call which endpoints
|
|
47
|
-
- Confidence scores for each detected link
|
|
48
|
-
- Service-to-service dependency direction
|
|
43
|
+
Use handler **symbol name** — not symbol ID:
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
```json
|
|
46
|
+
{ "repo_id": "memdb", "symbol": "handleGetUsers" }
|
|
47
|
+
```
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
## Output
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
| Result | Carries |
|
|
52
|
+
|--------|---------|
|
|
53
|
+
| Endpoint entry (`find_api_endpoints`) | HTTP method, route path, handler symbol name (feed to `get_symbol_context` as `symbol`) |
|
|
54
|
+
| Call entry (`find_api_calls`) | HTTP method, target path, calling symbol |
|
|
55
|
+
| Topology edge (`get_api_topology`) | caller repo → handler repo, confidence 0.0–1.0 (edges below `min_confidence` dropped) |
|
|
58
56
|
|
|
59
57
|
## Common Mistakes
|
|
60
58
|
|
|
61
59
|
| Mistake | Reality |
|
|
62
60
|
|---------|---------|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
| Not using `link_repositories` | If auto-linking missed a connection, use this to manually establish cross-repo edges |
|
|
61
|
+
| `get_symbol_context(symbol_id=...)` | Use **`symbol`** (name) + `repo_id` |
|
|
62
|
+
| Cross-repo links with one repo indexed | Index all services; use `link_repositories` if needed |
|
|
@@ -1,66 +1,93 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: memtrace-cochange
|
|
3
|
-
description: "
|
|
3
|
+
description: "Find files that historically co-change with a target symbol or file, ranked by co-occurrence across git episodes. Use when the user asks about historical coupling, co-change, what changes with this, hidden dependencies, or what else needs to move for source code. Do not use git log, git diff, Grep, or manual file search to correlate changes; Memtrace queries co-change and temporal graph data directly."
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__get_cochange_context
|
|
6
6
|
- mcp__memtrace__find_symbol
|
|
7
7
|
- mcp__memtrace__get_impact
|
|
8
|
+
- mcp__memtrace__replay_history
|
|
9
|
+
metadata:
|
|
10
|
+
author: "Syncable <support@syncable.dev>"
|
|
11
|
+
version: "1.0.0"
|
|
12
|
+
category: development
|
|
8
13
|
user-invocable: true
|
|
9
14
|
---
|
|
10
15
|
|
|
11
16
|
## Overview
|
|
12
17
|
|
|
13
|
-
Find
|
|
18
|
+
Find **files** that historically co-change with a target symbol or file path — ranked by co-occurrence frequency across git episodes. Surfaces **behavioral coupling** the static call graph cannot see.
|
|
14
19
|
|
|
15
20
|
`get_impact` answers "who calls this?" (structural).
|
|
16
|
-
`get_cochange_context` answers "what always
|
|
17
|
-
|
|
18
|
-
They are complementary. A
|
|
21
|
+
`get_cochange_context` answers "what files always move when this moves?" (historical, file-level).
|
|
22
|
+
|
|
23
|
+
They are complementary. A file with no call-graph edges to the target can still be a strong cochange partner if it's always modified alongside it in every commit.
|
|
24
|
+
|
|
25
|
+
> **Parameter types:** Numbers (`limit`, `window_days`, etc.) must be JSON numbers — not strings.
|
|
26
|
+
|
|
27
|
+
## Required parameters
|
|
28
|
+
|
|
29
|
+
| Parameter | Required | Default | Notes |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| `repo_id` | yes | — | |
|
|
32
|
+
| `target` | yes | — | Symbol name **or** file path substring — **not** `symbol` |
|
|
33
|
+
| `limit` | no | **10** | Max cochanged files returned |
|
|
34
|
+
| `window_days` | no | **30** | Lookback from `as_of` |
|
|
35
|
+
| `as_of` | no | now | Window anchor |
|
|
36
|
+
| `branch` | no | any branch | |
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"repo_id": "memdb",
|
|
41
|
+
"target": "execute",
|
|
42
|
+
"limit": 10,
|
|
43
|
+
"window_days": 30
|
|
44
|
+
}
|
|
45
|
+
```
|
|
19
46
|
|
|
20
|
-
|
|
47
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
48
|
+
|
|
49
|
+
## Output
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"cochanged_files": [
|
|
54
|
+
{
|
|
55
|
+
"file_path": "src/order/types.rs",
|
|
56
|
+
"cochange_count": 8,
|
|
57
|
+
"last_cochanged_at": "2026-04-13T10:43:00Z"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"target_files": ["src/order/service.rs"]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
21
63
|
|
|
64
|
+
There is **no** `cochanges[]` with symbol names — results are **file-level**.
|
|
22
65
|
|
|
23
66
|
## Steps
|
|
24
67
|
|
|
25
|
-
### 1. Identify the target
|
|
68
|
+
### 1. Identify the target
|
|
26
69
|
|
|
27
|
-
Use `find_symbol` if
|
|
70
|
+
Use `find_symbol` if needed. Pass the symbol **`name`** or a **`file_path`** as `target`.
|
|
28
71
|
|
|
29
72
|
### 2. Call `get_cochange_context`
|
|
30
73
|
|
|
31
|
-
|
|
32
|
-
get_cochange_context(
|
|
33
|
-
repo_id: "...",
|
|
34
|
-
symbol: "execute", // exact symbol name
|
|
35
|
-
limit: 20 // default 20, increase for broader view
|
|
36
|
-
)
|
|
37
|
-
```
|
|
74
|
+
See required parameters above.
|
|
38
75
|
|
|
39
76
|
### 3. Interpret results
|
|
40
77
|
|
|
41
|
-
|
|
42
|
-
- `name` — symbol name
|
|
43
|
-
- `kind` — Function / Method / Class / Struct
|
|
44
|
-
- `file_path` — where it lives
|
|
45
|
-
- `cochange_count` — how many episodes it shared with the target
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
High cochange_count = strong historical coupling
|
|
49
|
-
→ If you modify the target, you will likely need to touch this too
|
|
50
|
-
→ Or it may be the real root cause you should investigate first
|
|
51
|
-
```
|
|
78
|
+
High `cochange_count` on a file → strong historical coupling. When you modify the target, review those files too — even without direct call-graph edges.
|
|
52
79
|
|
|
53
80
|
### 4. Cross-reference with call graph
|
|
54
81
|
|
|
55
|
-
For
|
|
82
|
+
For symbols in cochanged files, optionally run `get_impact(target=...)`:
|
|
56
83
|
|
|
57
84
|
| Structural coupling | Historical coupling | Interpretation |
|
|
58
85
|
|---|---|---|
|
|
59
|
-
| Yes | Yes | Core
|
|
60
|
-
| No | Yes | Hidden coupling — only
|
|
61
|
-
| Yes | No | Called
|
|
86
|
+
| Yes | Yes | Core dependency — highest risk |
|
|
87
|
+
| No | Yes | Hidden coupling — history-only |
|
|
88
|
+
| Yes | No | Called often but changed independently |
|
|
62
89
|
|
|
63
|
-
##
|
|
90
|
+
## Use Cases
|
|
64
91
|
|
|
65
92
|
- **Before modifying a symbol** — get blast awareness beyond what `get_impact` shows
|
|
66
93
|
- **Incident investigation** — when `get_impact` doesn't explain the blast radius, check cochange history
|
|
@@ -72,5 +99,9 @@ For the top cochange partners, optionally run `get_impact` to see if the couplin
|
|
|
72
99
|
| Mistake | Reality |
|
|
73
100
|
|---------|---------|
|
|
74
101
|
| Only using `get_impact` for blast radius | Structural coupling misses behavioral coupling — always pair with cochange |
|
|
75
|
-
| Ignoring
|
|
76
|
-
| Using cochange as a dependency map | It's not a dependency graph —
|
|
102
|
+
| Ignoring cochanged files with no call-graph edges | A rarely-called file with high `cochange_count` is a strong coupling signal |
|
|
103
|
+
| Using cochange as a dependency map | It's a change correlation, not a dependency graph — files can cochange without any direct relationship |
|
|
104
|
+
| Passing `symbol:` | Required param is **`target`** |
|
|
105
|
+
| Expecting `cochanges[]` with symbol names | Response is **`cochanged_files[]`** (file paths) |
|
|
106
|
+
| Using `limit: 20` as default | API default is **10** |
|
|
107
|
+
| Empty results with 0 git episodes | Run `replay_history` during indexing to populate co-change data |
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memtrace-daily
|
|
3
|
+
description: "Orient at the start of a coding session, review what recently changed in a repository, and self-audit after completing work. Use when the user wants the daily briefing (what changed in the last 24h with complexity deltas), hotspots (complexity × churn refactor priorities), or a session review (clean/review/risky verdicts per editing session). For catching up after time away or resuming a prior session, use memtrace-session-continuity; daily is the last-24h briefing + hotspots + self-audit. Do not reconstruct recent activity from git log; Memtrace diffs the graph at save granularity."
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- mcp__memtrace__get_daily_briefing
|
|
6
|
+
- mcp__memtrace__find_hotspots
|
|
7
|
+
- mcp__memtrace__review_agent_sessions
|
|
8
|
+
- mcp__memtrace__preflight_check
|
|
9
|
+
metadata:
|
|
10
|
+
author: "Syncable <support@syncable.dev>"
|
|
11
|
+
version: "1.0.0"
|
|
12
|
+
category: development
|
|
13
|
+
user-invocable: true
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
Session bookends: orient before you start, audit before you finish. All
|
|
19
|
+
three tools read the bi-temporal version history — every save is a change
|
|
20
|
+
event with complexity deltas, so "what happened" includes "did it make the
|
|
21
|
+
code better or worse".
|
|
22
|
+
|
|
23
|
+
## Quick Reference
|
|
24
|
+
|
|
25
|
+
| Tool | Purpose |
|
|
26
|
+
|------|---------|
|
|
27
|
+
| `get_daily_briefing` | Last 24h diffed at graph level: changed functions with complexity deltas, new functions, new endpoints, per-module distribution |
|
|
28
|
+
| `find_hotspots` | Functions ranked by complexity × recent changes — the ordered refactor priority list |
|
|
29
|
+
| `review_agent_sessions` | Editing sessions clustered by actor, judged clean / review / risky |
|
|
30
|
+
|
|
31
|
+
> **Parameter types:** MCP parameters are strictly typed. Numbers
|
|
32
|
+
|
|
33
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
34
|
+
> (`window_hours`, `window_days`, `top_n`) must be JSON numbers.
|
|
35
|
+
|
|
36
|
+
## Steps
|
|
37
|
+
|
|
38
|
+
### 1. Orient at session start
|
|
39
|
+
|
|
40
|
+
`get_daily_briefing` with `repo_id`. Read the summary first:
|
|
41
|
+
- `net_cyclomatic_delta` positive → recent work added complexity; check
|
|
42
|
+
whether your task touches the same area before piling on.
|
|
43
|
+
- `changed` rows with large positive deltas → recently-destabilised code;
|
|
44
|
+
prefer `preflight_check` before editing anything in that list.
|
|
45
|
+
|
|
46
|
+
### 2. When the task is refactoring or cleanup
|
|
47
|
+
|
|
48
|
+
`find_hotspots` — work the list top-down. A hotspot you simplify pays off
|
|
49
|
+
on every future change; a complex-but-untouched function can wait.
|
|
50
|
+
|
|
51
|
+
### 3. Self-audit before declaring work done
|
|
52
|
+
|
|
53
|
+
`review_agent_sessions` and find YOUR session (newest, your agent id):
|
|
54
|
+
- `clean` — done; state the verdict in your summary.
|
|
55
|
+
- `review` — re-read your top_changes rows; justify each complexity
|
|
56
|
+
increase or simplify it.
|
|
57
|
+
- `risky` — do not hand off yet. You added >30 net cyclomatic or touched
|
|
58
|
+
a >50-complexity function; extract helpers / flatten nesting first,
|
|
59
|
+
then re-run the review.
|
|
60
|
+
|
|
61
|
+
## The standard a session should meet
|
|
62
|
+
|
|
63
|
+
Net complexity delta ≤ 0 unless the task genuinely required new branching
|
|
64
|
+
(new feature with new cases). "I left the code simpler than I found it"
|
|
65
|
+
is verifiable here — verify it.
|
|
66
|
+
|
|
67
|
+
## Output
|
|
68
|
+
|
|
69
|
+
| Tool | Returns |
|
|
70
|
+
|------|---------|
|
|
71
|
+
| `get_daily_briefing` | summary with `net_cyclomatic_delta`; `changed` rows (function + complexity delta); new functions, new endpoints, per-module distribution |
|
|
72
|
+
| `find_hotspots` | ranked list of functions scored by complexity × recent changes |
|
|
73
|
+
| `review_agent_sessions` | per-session verdict (`clean` / `review` / `risky`) with `top_changes` rows and net cyclomatic delta |
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memtrace-decision-recall
|
|
3
|
+
description: "Recall ranked decisions, bans, and conventions from Cortex decision memory by free-text query. Use when the user asks what was decided, what was chosen or rejected, whether there's a convention/ban/policy on something, or before re-picking a library, pattern, or approach that may already be settled. Do not reconstruct past decisions from git log or guesswork. To verify whether a known decision held, use memtrace-intent-verification; for symbol-scoped decision lineage/contracts, use memtrace-provenance."
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- mcp__memtrace__recall_decision
|
|
6
|
+
- mcp__memtrace__verify_intent
|
|
7
|
+
- mcp__memtrace__get_arc
|
|
8
|
+
metadata:
|
|
9
|
+
author: "Syncable <support@syncable.dev>"
|
|
10
|
+
version: "1.0.0"
|
|
11
|
+
category: development
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
`recall_decision` is the **free-text entry point** to decision memory. Given a query,
|
|
17
|
+
it returns the statistically-ranked set of decisions/conversations that bear on it —
|
|
18
|
+
including **bans** ("never use X", "don't do Y"), which are recorded as decisions.
|
|
19
|
+
Use it before re-litigating a settled choice or contradicting a convention.
|
|
20
|
+
|
|
21
|
+
This is the one decision-memory tool that takes plain text. The ranked decisions it
|
|
22
|
+
returns carry the `decision_id`s the other tools (`verify_intent`, `get_arc`) need.
|
|
23
|
+
|
|
24
|
+
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
|
|
25
|
+
|
|
26
|
+
## Quick Reference
|
|
27
|
+
|
|
28
|
+
| Tool | Purpose |
|
|
29
|
+
|------|---------|
|
|
30
|
+
| `recall_decision` | Ranked decisions/bans for a free-text query (the entry point) |
|
|
31
|
+
| `verify_intent` | Given a returned `decision_id` — did it still hold? (see `memtrace-intent-verification`) |
|
|
32
|
+
| `get_arc` | Given a returned `decision_id` — what implemented it? (see `memtrace-intent-verification`) |
|
|
33
|
+
|
|
34
|
+
> **Honesty contract:** an empty or unknown query returns an explicit **CannotProve**,
|
|
35
|
+
> never a fabricated decision. CannotProve means "no recorded decision on this" — it is
|
|
36
|
+
> *unknown*, not *approved*. Don't treat it as a green light.
|
|
37
|
+
|
|
38
|
+
## Steps
|
|
39
|
+
|
|
40
|
+
### 1. Query in the user's own terms
|
|
41
|
+
|
|
42
|
+
`recall_decision(query)` — `query` is free text. Use the noun phrase of the thing in
|
|
43
|
+
question: a library (`"redis vs in-memory cache"`), a pattern (`"error handling
|
|
44
|
+
strategy"`), a subsystem (`"auth tokens"`), or the exact thing you're about to do.
|
|
45
|
+
|
|
46
|
+
### 2. Read the ranked result
|
|
47
|
+
|
|
48
|
+
Results come back ranked (lexical + semantic lanes, RRF-fused) with an `id`, a
|
|
49
|
+
`kind`, and a score per hit. **`decision`-kind hits are ranked first**; lower-ranked
|
|
50
|
+
`conversation` hits are supporting context (the verbatim turns around the decision).
|
|
51
|
+
For anything you mean to chain (step 4), use a hit whose `kind` is `decision` — its
|
|
52
|
+
`id` is the `decision_id` the other tools require.
|
|
53
|
+
|
|
54
|
+
### 3. Act on what's there
|
|
55
|
+
|
|
56
|
+
| Result | Action |
|
|
57
|
+
|---|---|
|
|
58
|
+
| A matching decision | Honor it. Quote it back to the user before doing anything that contradicts it. |
|
|
59
|
+
| A **ban** ("never/don't …") | Do **not** reintroduce the banned approach without explicit user sign-off. |
|
|
60
|
+
| Several competing/old hits | Run `verify_intent(decision_id)` on the top one to see if it still holds before relying on it. |
|
|
61
|
+
| **CannotProve** | No recorded decision. Don't invent one — fall back to `memtrace-first` and/or ask the user. |
|
|
62
|
+
|
|
63
|
+
### 4. Chain into the id-based tools when you need more
|
|
64
|
+
|
|
65
|
+
The `id` of a `kind: "decision"` hit feeds `verify_intent` (did it hold?) and
|
|
66
|
+
`get_arc` (what implemented it?). Don't pass a `conversation` hit's id — those tools
|
|
67
|
+
require a Decision node and will honestly return CannotProve. See
|
|
68
|
+
`memtrace-intent-verification`.
|
|
69
|
+
|
|
70
|
+
## Decision Points
|
|
71
|
+
|
|
72
|
+
| Situation | Action |
|
|
73
|
+
|-----------|--------|
|
|
74
|
+
| About to choose a library/pattern/approach | `recall_decision` FIRST — you may be undoing a deliberate choice or ban |
|
|
75
|
+
| User asks "did we decide X?" / "what's our convention on Y?" | `recall_decision("X" / "Y")` |
|
|
76
|
+
| You suspect a "don't do this" rule exists | `recall_decision` — bans are decisions and will surface |
|
|
77
|
+
| Recall returns a decision you're about to contradict | Surface it to the user verbatim; don't silently override |
|
|
78
|
+
| Recall returns CannotProve | Treat as unknown, not approval; do not fabricate a rationale |
|
|
79
|
+
|
|
80
|
+
## Output
|
|
81
|
+
|
|
82
|
+
`recall_decision` returns ranked hits — `kind: "decision"` first, `conversation` hits below as supporting context — or an explicit **CannotProve**:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
[
|
|
86
|
+
{ "id": "…", "kind": "decision", "score": 0.91 },
|
|
87
|
+
{ "id": "…", "kind": "conversation", "score": 0.44 }
|
|
88
|
+
]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Only a `decision`-kind hit's `id` is a `decision_id` usable with `verify_intent` / `get_arc`. An empty or unknown query returns CannotProve, never fabricated hits.
|