memtrace-skills 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.
Files changed (63) hide show
  1. package/package.json +1 -1
  2. package/plugins/memtrace-skills/.claude-plugin/plugin.json +2 -2
  3. package/plugins/memtrace-skills/references/mcp-parameters.md +147 -46
  4. package/plugins/memtrace-skills/skills/memtrace-api-topology/SKILL.md +27 -34
  5. package/plugins/memtrace-skills/skills/memtrace-change-impact-analysis/SKILL.md +27 -10
  6. package/plugins/memtrace-skills/skills/memtrace-cochange/SKILL.md +59 -33
  7. package/plugins/memtrace-skills/skills/memtrace-code-review/SKILL.md +11 -7
  8. package/plugins/memtrace-skills/skills/memtrace-codebase-exploration/SKILL.md +37 -5
  9. package/plugins/memtrace-skills/skills/memtrace-continuous-memory/SKILL.md +50 -56
  10. package/plugins/memtrace-skills/skills/memtrace-daily/SKILL.md +63 -0
  11. package/plugins/memtrace-skills/skills/memtrace-decision-memory/SKILL.md +129 -0
  12. package/plugins/memtrace-skills/skills/memtrace-decision-recall/SKILL.md +83 -0
  13. package/plugins/memtrace-skills/skills/memtrace-episode-replay/SKILL.md +82 -61
  14. package/plugins/memtrace-skills/skills/memtrace-evolution/SKILL.md +114 -88
  15. package/plugins/memtrace-skills/skills/memtrace-first/SKILL.md +34 -7
  16. package/plugins/memtrace-skills/skills/memtrace-fleet-coordination/SKILL.md +17 -1
  17. package/plugins/memtrace-skills/skills/memtrace-fleet-first/SKILL.md +29 -5
  18. package/plugins/memtrace-skills/skills/memtrace-fleet-publish-intent/SKILL.md +13 -2
  19. package/plugins/memtrace-skills/skills/memtrace-fleet-record-episode/SKILL.md +18 -2
  20. package/plugins/memtrace-skills/skills/memtrace-fleet-resolve/SKILL.md +20 -1
  21. package/plugins/memtrace-skills/skills/memtrace-graph/SKILL.md +54 -40
  22. package/plugins/memtrace-skills/skills/memtrace-impact/SKILL.md +63 -19
  23. package/plugins/memtrace-skills/skills/memtrace-incident-investigation/SKILL.md +106 -49
  24. package/plugins/memtrace-skills/skills/memtrace-index/SKILL.md +16 -3
  25. package/plugins/memtrace-skills/skills/memtrace-intent-verification/SKILL.md +72 -0
  26. package/plugins/memtrace-skills/skills/memtrace-preflight/SKILL.md +76 -0
  27. package/plugins/memtrace-skills/skills/memtrace-provenance/SKILL.md +81 -0
  28. package/plugins/memtrace-skills/skills/memtrace-quality/SKILL.md +44 -32
  29. package/plugins/memtrace-skills/skills/memtrace-refactoring-guide/SKILL.md +25 -6
  30. package/plugins/memtrace-skills/skills/memtrace-relationships/SKILL.md +66 -30
  31. package/plugins/memtrace-skills/skills/memtrace-search/SKILL.md +76 -61
  32. package/plugins/memtrace-skills/skills/memtrace-session-continuity/SKILL.md +59 -49
  33. package/plugins/memtrace-skills/skills/memtrace-style-fingerprint/SKILL.md +23 -3
  34. package/skills/commands/memtrace-api-topology.md +31 -34
  35. package/skills/commands/memtrace-cochange.md +64 -33
  36. package/skills/commands/memtrace-daily.md +73 -0
  37. package/skills/commands/memtrace-decision-recall.md +91 -0
  38. package/skills/commands/memtrace-evolution.md +121 -88
  39. package/skills/commands/memtrace-fleet-publish-intent.md +18 -2
  40. package/skills/commands/memtrace-fleet-record-episode.md +23 -2
  41. package/skills/commands/memtrace-fleet-resolve.md +24 -1
  42. package/skills/commands/memtrace-graph.md +59 -41
  43. package/skills/commands/memtrace-impact.md +67 -19
  44. package/skills/commands/memtrace-index.md +20 -3
  45. package/skills/commands/memtrace-intent-verification.md +81 -0
  46. package/skills/commands/memtrace-preflight.md +85 -0
  47. package/skills/commands/memtrace-provenance.md +90 -0
  48. package/skills/commands/memtrace-quality.md +49 -32
  49. package/skills/commands/memtrace-relationships.md +73 -30
  50. package/skills/commands/memtrace-search.md +86 -61
  51. package/skills/workflows/memtrace-change-impact-analysis.md +32 -12
  52. package/skills/workflows/memtrace-code-review.md +17 -11
  53. package/skills/workflows/memtrace-codebase-exploration.md +41 -5
  54. package/skills/workflows/memtrace-continuous-memory.md +54 -56
  55. package/skills/workflows/memtrace-decision-memory.md +139 -0
  56. package/skills/workflows/memtrace-episode-replay.md +87 -63
  57. package/skills/workflows/memtrace-first.md +63 -7
  58. package/skills/workflows/memtrace-fleet-coordination.md +21 -1
  59. package/skills/workflows/memtrace-fleet-first.md +35 -5
  60. package/skills/workflows/memtrace-incident-investigation.md +113 -55
  61. package/skills/workflows/memtrace-refactoring-guide.md +31 -11
  62. package/skills/workflows/memtrace-session-continuity.md +63 -49
  63. package/skills/workflows/memtrace-style-fingerprint.md +27 -4
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: memtrace-code-review
3
- description: "Always use when the user asks to review a GitHub pull request, run Memtrace code review, post Memtrace review comments, create a PR with a review step, or publish local graph-backed review findings to GitHub. Prefer the review_github_pr MCP tool over manual diff inspection."
3
+ description: "Review GitHub pull requests with Memtrace's local graph-backed review engine. Use when the user asks to review a GitHub pull request, run Memtrace code review, post Memtrace review comments, create a PR with a review step, or publish local graph-backed review findings to GitHub. Prefer the review_github_pr MCP tool over manual diff inspection. Do not use for local working-tree diffs — that is the built-in /code-review; this skill is for GitHub PRs via review_github_pr."
4
4
  ---
5
5
 
6
6
  ## Overview
@@ -15,6 +15,8 @@ Use Memtrace's local-first PR review workflow. The agent should call the `review
15
15
  4. Default to `minSeverity: "high"` and `maxComments: 5` when posting. For previews, `maxComments: 10` is acceptable.
16
16
  5. Pass `repoRoot` when the PR checkout is not the current working directory. Pass `repoId` when the indexed repository id is known.
17
17
 
18
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
19
+
18
20
  ## Example User Prompts
19
21
 
20
22
  - "Review this PR with Memtrace: https://github.com/OWNER/REPO/pull/123"
@@ -25,6 +27,7 @@ Use Memtrace's local-first PR review workflow. The agent should call the `review
25
27
 
26
28
  - Do not start with generic grep, rg, or manual diff review when `review_github_pr` is available.
27
29
  - Do not post comments unless the user explicitly requested publication.
30
+ - After posting comments (`post: true`), record the PR URL and the posted comment IDs in the session output as the audit trail.
28
31
  - Do not create benchmark-specific or PR-specific findings. The review must come from general Memtrace detectors, graph evidence, and policy ranking.
29
32
  - If the tool reports missing auth, tell the user to run `memtrace auth login`.
30
33
  - If the tool reports missing GitHub App installation, tell the user to install Memtrace Code Reviewer on that repository.
@@ -32,10 +35,11 @@ Use Memtrace's local-first PR review workflow. The agent should call the `review
32
35
 
33
36
  ## Output
34
37
 
35
- For previews, summarize:
36
- - PR URL and repository
37
- - Graph state
38
- - Number of candidate comments
39
- - File, line, severity, and message for each finding
38
+ Summarize the `review_github_pr` result with these fields:
40
39
 
41
- For posted reviews, report the PR URL and number of comments posted.
40
+ | Field | Preview (`post: false`) | Posted (`post: true`) |
41
+ |---|---|---|
42
+ | PR URL + repository | yes | yes |
43
+ | Graph state | yes | yes |
44
+ | Findings | count of candidate comments, plus file, line, severity, message per finding | number of comments posted |
45
+ | Posted comment IDs | — | yes — record with the PR URL as the audit trail |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: memtrace-codebase-exploration
3
- description: "Always use when the user wants to explore, understand, onboard to, map, or get an overview of an indexed source-code repo, architecture, modules, or major flows. Do not use Glob, find, tree, rg, or manual file browsing as the first exploration path; Memtrace provides structured graph briefing."
3
+ description: "Map an indexed source-code repo into a structured overview — scale, communities, central symbols, execution flows, API surface, recent activity. Use when the user wants to explore, understand, onboard to, map, or get an overview of an indexed source-code repo, architecture, modules, or major flows. Do not use Glob, find, tree, rg, or manual file browsing as the first exploration path; Memtrace provides structured graph briefing. Do NOT use for change history / what-changed questions — use memtrace-evolution."
4
4
  ---
5
5
 
6
6
  ## Overview
@@ -36,7 +36,11 @@ Each community represents a cohesive module — these are the "areas" of the cod
36
36
 
37
37
  ### 4. Find the most important symbols
38
38
 
39
- Call `find_central_symbols` with `limit: 15`. It ranks symbols by PageRank over the repo's CALLS / REFERENCES edges (default `method: "pagerank"`, 0.85 damping factor).
39
+ Call `find_central_symbols` PageRank over CALLS/REFERENCES edges (no `method` param):
40
+
41
+ ```json
42
+ { "repo_id": "<repo>", "limit": 15 }
43
+ ```
40
44
 
41
45
  These are the symbols that the rest of the codebase depends on most heavily. They form the "skeleton" of the architecture.
42
46
 
@@ -64,13 +68,29 @@ Call `find_api_endpoints` to list all HTTP routes.
64
68
 
65
69
  ### 8. Recent activity
66
70
 
67
- Call `get_evolution` with mode `overview` and a 30-day window to see which modules have been most active recently.
71
+ Call `get_evolution` to see recent activity:
72
+
73
+ ```json
74
+ { "repo_id": "<repo>", "from": "30d ago", "mode": "overview" }
75
+ ```
76
+
77
+ Check `totals.episode_count` and episode boundaries. For file/symbol hotspots, switch to `compound`:
68
78
 
69
- **Decision:** If the user asks about specific recent changes, switch to mode `compound` for symbol-level detail.
79
+ ```json
80
+ { "repo_id": "<repo>", "from": "30d ago", "mode": "compound" }
81
+ ```
82
+
83
+ Review `top_changed_files` and `top_touched_symbols`.
70
84
 
71
85
  ### 9. Complexity hotspots
72
86
 
73
- Call `find_most_complex_functions` with `limit: 10` to identify potential technical debt.
87
+ Call `find_most_complex_functions`:
88
+
89
+ ```json
90
+ { "repo_id": "<repo>", "top_n": 10 }
91
+ ```
92
+
93
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
74
94
 
75
95
  ## Report Synthesis
76
96
 
@@ -84,6 +104,18 @@ Synthesize findings into a structured overview:
84
104
  6. **Recent Activity** — what's been changing in the last 30 days
85
105
  7. **Technical Debt** — complexity hotspots and potential dead code
86
106
 
107
+ ## Output
108
+
109
+ The deliverable is the 7-part overview above. Skeleton (one headline per part):
110
+
111
+ 1. Scale — 2 languages, 4,812 symbols, 19,344 relationships
112
+ 2. Architecture — 12 communities; top 5: auth, indexing, api, ui, billing
113
+ 3. Critical Infrastructure — `EngineHandle::open` (central AND bridge — flag it)
114
+ 4. Execution Flows — 14 processes: 9 HTTP handlers, 3 CLI commands, 2 jobs
115
+ 5. API Surface — 42 endpoints; 2 cross-repo service dependencies
116
+ 6. Recent Activity — 31 episodes in 30d; hottest file per `top_changed_files`
117
+ 7. Technical Debt — top-10 complex functions, highest complexity first
118
+
87
119
  ## Common Mistakes
88
120
 
89
121
  | Mistake | Reality |
@@ -1,96 +1,90 @@
1
1
  ---
2
2
  name: memtrace-continuous-memory
3
- description: "Always use when the user asks to keep Memtrace fresh while editing, watch a repo, enable live or incremental indexing, set up always-on memory, or make just-saved source code queryable immediately. Do not fall back to repeated Grep or manual rescans; configure Memtrace watching."
3
+ description: "Keep the Memtrace index fresh while editing by watching a repo for live, incremental re-indexing. Use when the user asks to keep Memtrace fresh while editing, watch a repo, enable live or incremental indexing, set up always-on memory (meaning Memtrace index watching, not generic agent memory), or make just-saved source code queryable immediately. Do not fall back to repeated Grep or manual rescans; configure Memtrace watching."
4
4
  ---
5
5
 
6
6
  ## Overview
7
7
 
8
- Memtrace keeps the knowledge graph live as you edit. Once you call `watch_directory`, every save runs through the **incremental indexing fast-path** — a notify-based file watcher debounces saves, the indexer re-parses only the touched files, and the engine commits the delta in a single WAL transaction. Steady-state latency is **~80 ms from save to queryable** on a typical project.
8
+ Keep the knowledge graph live while editing. `watch_directory` triggers incremental re-indexing on file saves (~80 ms typical latency after debounce).
9
9
 
10
- This is what makes "session continuity" actually work: by the time you ask `find_symbol` after a save, the new symbol is already in the graph.
10
+ ## Required parameters `watch_directory`
11
+
12
+ | Param | Required | Notes |
13
+ |---|---|---|
14
+ | `path` | yes | Absolute directory path |
15
+ | `repo_id` | yes | Must already be indexed |
16
+ | `branch` | no | default `"main"` |
17
+
18
+ ```json
19
+ { "path": "/abs/path/to/repo", "repo_id": "memdb" }
20
+ ```
21
+
22
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
11
23
 
12
24
  ## Steps
13
25
 
14
- ### 1. Confirm the repo is indexed
26
+ ### 1. Confirm indexed
15
27
 
16
28
  ```
17
- mcp__memtrace__list_indexed_repositories
29
+ list_indexed_repositories()
18
30
  ```
19
31
 
20
- If the repo isn't there, run `index_directory` first. The watcher requires an existing repo_id it never bootstraps from scratch.
32
+ Run `index_directory` first if missing (poll `check_job_status`; stop after ~5 minutes and report the job id see memtrace-index).
21
33
 
22
34
  ### 2. Start watching
23
35
 
24
- ```
25
- mcp__memtrace__watch_directory(
26
- path: "/abs/path/to/repo"
27
- )
28
- ```
29
-
30
- The tool registers a `notify` watcher on the directory tree, debounces save bursts (so a `:wq` that touches a swap file doesn't trigger twice), and routes deltas through the indexer's incremental fast-path. Returns immediately — watching runs in the background.
36
+ See JSON above. Returns immediately; watcher runs in background.
31
37
 
32
- ### 3. Confirm it's live
38
+ ### 3. Confirm active watches
33
39
 
34
40
  ```
35
- mcp__memtrace__list_watched_paths
41
+ list_watched_paths()
36
42
  ```
37
43
 
38
- Each entry shows the watched root, the bound repo_id, and the last delta's `persist_ms`.
44
+ Response shape: see [Output](#output).
39
45
 
40
- ### 4. Edit normally — Memtrace catches up
46
+ ### 4. Edit normally
41
47
 
42
- After every save the watcher emits a `labels_updated` WebSocket event:
48
+ Next `find_symbol` / `get_symbol_context` call sees saved changes after debounce (~500 ms) + incremental persist (~80 ms).
43
49
 
44
- ```json
45
- {
46
- "event": "labels_updated",
47
- "repo_id": "demo",
48
- "nodes_changed": 12,
49
- "persist_ms": 78,
50
- "timestamp": "2026-04-27T10:42:13Z"
51
- }
52
- ```
50
+ ### 5. Stop watching (kill switch)
53
51
 
54
- Dashboards and IDE plugins subscribe to this on `/ws` and refresh themselves. As an agent you don't have to listen — your next `find_symbol` / `find_code` / `get_symbol_context` call will see the new state automatically.
52
+ `unwatch_directory`:
55
53
 
56
- ### 5. Stop watching
57
-
58
- ```
59
- mcp__memtrace__unwatch_directory(path: "/abs/path/to/repo")
54
+ ```json
55
+ { "path": "/abs/path/to/repo" }
60
56
  ```
61
57
 
62
58
  Idempotent — unwatching an already-unwatched path is a no-op.
63
59
 
64
- ## When to Use
60
+ ## Latency expectations
65
61
 
66
- - **Long sessions on the same repo** — keeps `get_symbol_context` accurate without rerunning `index_directory`
67
- - **Pair programming with an IDE plugin** — the dashboard's WebSocket subscription auto-refreshes panels
68
- - **Demo / live coding** every save reflects in the graph within 80–150 ms
69
- - **Long-running agents** instead of polling `index_directory`, the watcher pushes deltas
70
-
71
- ## When NOT to Use
62
+ | Stage | Typical |
63
+ |---|---|
64
+ | Debounce | **500 ms** (MCP schema) |
65
+ | Incremental persist | ~80 ms |
66
+ | Save → queryable | ~80–150 ms after debounce |
72
67
 
73
- - **One-shot batch edits** — running `index_directory --incremental` at the end is cheaper than spinning up a watcher
74
- - **Generated / build output trees** — exclude paths under `target/`, `dist/`, `node_modules/` (the watcher honours common ignore patterns but a noisy build can still saturate the debounce queue)
75
- - **CI / containerised runs** — file events are unreliable across container boundaries; index explicitly instead
68
+ ## Output
76
69
 
77
- ## Latency Expectations
70
+ `watch_directory` returns an immediate acknowledgment; the watcher runs in the background. `list_watched_paths` returns:
78
71
 
79
- | Operation | Typical wall time |
80
- |---|---|
81
- | File save → watcher fires | < 5 ms |
82
- | Debounce window | 50 ms |
83
- | Incremental parse + delta persist | ~80 ms |
84
- | `labels_updated` broadcast | < 1 ms after persist |
85
- | Total: save → queryable | ~80–150 ms |
72
+ ```json
73
+ {
74
+ "watches": [
75
+ { "path": "...", "repo_id": "...", "branch": "...", "started_at": "...", "origin": "..." }
76
+ ],
77
+ "count": 1
78
+ }
79
+ ```
86
80
 
87
- If you see `persist_ms` consistently above 500 ms, the saved files are larger than expected (e.g., generated bundles) — narrow the watch root or add ignore patterns.
81
+ There is **no `persist_ms`** field in this response.
88
82
 
89
83
  ## Common Mistakes
90
84
 
91
85
  | Mistake | Reality |
92
- |---|---|
93
- | Calling `watch_directory` on an unindexed repo | Returns an error — run `index_directory` first |
94
- | Watching `node_modules/` or `target/` | Saturates the watcher with build noise — point at the source root only |
95
- | Polling `find_symbol` every second to "wait" for indexing | Subscribe to the `labels_updated` WS event, or just call once after the save — the delta is already there |
96
- | Forgetting to `unwatch_directory` between sessions | Watchers are per-process; restarting `memtrace start` wipes them, but for hosted instances unwatching cleanly avoids leaks |
86
+ |---------|---------|
87
+ | `watch_directory(path=...)` without `repo_id` | **Both required** |
88
+ | Watching unindexed repo | Index first |
89
+ | Expecting `persist_ms` from `list_watched_paths` | Field not in MCP response |
90
+ | Debounce "50 ms" | Schema documents **500 ms** |
@@ -0,0 +1,63 @@
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
+ ---
5
+
6
+ ## Overview
7
+
8
+ Session bookends: orient before you start, audit before you finish. All
9
+ three tools read the bi-temporal version history — every save is a change
10
+ event with complexity deltas, so "what happened" includes "did it make the
11
+ code better or worse".
12
+
13
+ ## Quick Reference
14
+
15
+ | Tool | Purpose |
16
+ |------|---------|
17
+ | `get_daily_briefing` | Last 24h diffed at graph level: changed functions with complexity deltas, new functions, new endpoints, per-module distribution |
18
+ | `find_hotspots` | Functions ranked by complexity × recent changes — the ordered refactor priority list |
19
+ | `review_agent_sessions` | Editing sessions clustered by actor, judged clean / review / risky |
20
+
21
+ > **Parameter types:** MCP parameters are strictly typed. Numbers
22
+
23
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
24
+ > (`window_hours`, `window_days`, `top_n`) must be JSON numbers.
25
+
26
+ ## Steps
27
+
28
+ ### 1. Orient at session start
29
+
30
+ `get_daily_briefing` with `repo_id`. Read the summary first:
31
+ - `net_cyclomatic_delta` positive → recent work added complexity; check
32
+ whether your task touches the same area before piling on.
33
+ - `changed` rows with large positive deltas → recently-destabilised code;
34
+ prefer `preflight_check` before editing anything in that list.
35
+
36
+ ### 2. When the task is refactoring or cleanup
37
+
38
+ `find_hotspots` — work the list top-down. A hotspot you simplify pays off
39
+ on every future change; a complex-but-untouched function can wait.
40
+
41
+ ### 3. Self-audit before declaring work done
42
+
43
+ `review_agent_sessions` and find YOUR session (newest, your agent id):
44
+ - `clean` — done; state the verdict in your summary.
45
+ - `review` — re-read your top_changes rows; justify each complexity
46
+ increase or simplify it.
47
+ - `risky` — do not hand off yet. You added >30 net cyclomatic or touched
48
+ a >50-complexity function; extract helpers / flatten nesting first,
49
+ then re-run the review.
50
+
51
+ ## The standard a session should meet
52
+
53
+ Net complexity delta ≤ 0 unless the task genuinely required new branching
54
+ (new feature with new cases). "I left the code simpler than I found it"
55
+ is verifiable here — verify it.
56
+
57
+ ## Output
58
+
59
+ | Tool | Returns |
60
+ |------|---------|
61
+ | `get_daily_briefing` | summary with `net_cyclomatic_delta`; `changed` rows (function + complexity delta); new functions, new endpoints, per-module distribution |
62
+ | `find_hotspots` | ranked list of functions scored by complexity × recent changes |
63
+ | `review_agent_sessions` | per-session verdict (`clean` / `review` / `risky`) with `top_changes` rows and net cyclomatic delta |
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: memtrace-decision-memory
3
+ description: "Check Cortex decision memory — the umbrella entry point for decision recall, provenance (why is this here), intent verification, and governing contracts. Use before assuming WHY code exists, before making a choice that may contradict a past one, or before deleting/rewriting code that looks odd or redundant. Route: free-text what-was-decided → memtrace-decision-recall; why does this symbol exist / what constrains it → memtrace-provenance; did the decision hold → memtrace-intent-verification. Do not guess rationale from the diff or git log; Cortex remembers the decision, the ban, and whether it still holds."
4
+ ---
5
+
6
+ # Decision Memory First
7
+
8
+ ## The Iron Law
9
+
10
+ ```
11
+ BEFORE you assume why code exists, contradict a convention, re-pick a settled
12
+ choice, or delete code that "looks unused/weird" → CHECK DECISION MEMORY.
13
+
14
+ recall_decision(free-text) → what did we decide / ban about X?
15
+ why_is_this_here(symbol_id) → what decision put this here?
16
+ verify_intent(decision_id) → did that decision still hold, or was it violated?
17
+ get_arc(decision_id) → what episodes implemented it?
18
+ governing_contracts(sym_id) → what constraints bind this symbol?
19
+ ```
20
+
21
+ This is the **rationale layer** of the codebase. `memtrace-first` answers *what the
22
+ code is and how it's wired* (symbols, calls, git, blast radius). Decision memory
23
+ answers *why it is the way it is, what we already decided, and whether that decision
24
+ still holds* — extracted from real coding conversations and decisions, not the AST.
25
+
26
+ The graph can tell you a function exists and who calls it. Only decision memory can
27
+ tell you that three weeks ago you **banned** the approach you're about to reintroduce.
28
+
29
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
30
+
31
+ ## The honesty contract — read this first
32
+
33
+ These five tools are **deterministic, zero-LLM**. Every call returns a labeled
34
+ **Verdict / Evidence / CannotProve** answer carrying its FactStatus and proof path.
35
+ **No tool ever fabricates an answer.**
36
+
37
+ | Answer | What it means | What you must NOT do |
38
+ |---|---|---|
39
+ | **Verdict + Evidence** (Observed / DeterministicallyDerived / StatisticallyRanked) | A recorded decision/provenance backs this | — |
40
+ | **CannotProve** | No recorded decision governs this | Do **not** read it as "safe / approved / unconstrained." It means *unknown*, not *permitted*. Fall back to `memtrace-first` + asking the user. |
41
+
42
+ `CannotProve` is a real, trustworthy answer ("memory has nothing on this"), not a
43
+ failure and not a green light. Never invent a rationale to fill the gap.
44
+
45
+ ## Server check (once per session)
46
+
47
+ These tools are served by the **`memcortex`** MCP server (decision memory), separate
48
+ from the `memtrace` code-graph server. If `recall_decision` isn't available, decision
49
+ memory isn't wired in this environment — say so and use `memtrace-first` instead;
50
+ don't fabricate decisions.
51
+
52
+ ## The decision rule
53
+
54
+ | What you're about to do / be asked | Right tool | Sub-skill |
55
+ |---|---|---|
56
+ | "Did we already decide/choose/reject X?" "What's our convention on Y?" | `recall_decision("X")` | `memtrace-decision-recall` |
57
+ | "Is there a ban / a 'don't do this' on Z?" | `recall_decision("Z")` — bans surface as decisions | `memtrace-decision-recall` |
58
+ | About to re-pick a library/pattern/approach | `recall_decision` FIRST — don't re-litigate a settled call | `memtrace-decision-recall` |
59
+ | "Why is this code here?" "Why is it done this odd way?" | `why_is_this_here(symbol_id)` | `memtrace-provenance` |
60
+ | About to delete/refactor code that looks unused or strange | `why_is_this_here` + `governing_contracts` before touching it | `memtrace-provenance` |
61
+ | "What rules/contracts constrain this symbol?" | `governing_contracts(symbol_id)` | `memtrace-provenance` |
62
+ | "Did decision D actually hold, or did we drift?" | `verify_intent(decision_id)` | `memtrace-intent-verification` |
63
+ | "What commits/episodes implemented decision D?" | `get_arc(decision_id)` | `memtrace-intent-verification` |
64
+
65
+ ## How the tools chain (ids come from recall, not from names)
66
+
67
+ Only `recall_decision` takes free text. The other four take **numeric node ids**
68
+ (`decision_id` / `symbol_id`, uint64). The normal flow is:
69
+
70
+ ```
71
+ recall_decision("auth strategy")
72
+ │ returns ranked hits, decisions first: [{ id, kind: "decision", ... }]
73
+ │ (pick a kind:"decision" hit; conversation hits are context, not chainable)
74
+ ├─► verify_intent(decision_id) did it hold?
75
+ └─► get_arc(decision_id) what implemented it?
76
+
77
+ why_is_this_here(symbol_id)
78
+ │ returns the governing decision lineage for a symbol
79
+ └─► verify_intent(that decision_id) is that rationale still valid?
80
+ ```
81
+
82
+ `symbol_id` comes from a prior recall/arc result or the Cortex view — **if you only
83
+ have a name or a free-text question, start with `recall_decision`.** Do not invent ids.
84
+
85
+ ## Standard workflows
86
+
87
+ ### "Why does this code exist / can I delete it?"
88
+ 1. `why_is_this_here(symbol_id)` → the governing decision, if any
89
+ 2. `governing_contracts(symbol_id)` → constraints that must survive a rewrite
90
+ 3. If a decision governs it → `verify_intent(decision_id)` to see if it still holds
91
+ 4. **CannotProve on all three ≠ safe to delete** — confirm with `memtrace-impact` (blast radius) and the user
92
+
93
+ ### "Should I do X?" (about to make a choice)
94
+ 1. `recall_decision("X")` → did we already decide or ban this?
95
+ 2. If a prior decision exists → `verify_intent(decision_id)` → is it still in force?
96
+ 3. Honor a held decision; only revisit a `ViolatedAt`/superseded one — and say so explicitly
97
+
98
+ ### "Did we follow through on decision D?"
99
+ 1. `verify_intent(decision_id)` → Held | ViolatedAt | CannotProve
100
+ 2. `get_arc(decision_id)` → the episodes that implemented (or should have) it
101
+
102
+ ## Red flags — STOP, check decision memory
103
+
104
+ | Thought | Reality |
105
+ |---|---|
106
+ | "This code looks unused, I'll delete it" | `why_is_this_here` first — a decision may govern it; deletion may reopen a closed issue |
107
+ | "I'll just use library/pattern X" | `recall_decision("X")` — you may be undoing a deliberate ban |
108
+ | "The diff/git log will tell me why" | Git shows *what changed*, not *what was decided or rejected*. Decision memory has the rationale and the bans. |
109
+ | "CannotProve, so it's fine/approved" | CannotProve = unknown, not approved. Don't treat absence of a record as permission. |
110
+ | "I'll guess the rationale from the code" | Don't fabricate a why. Return what the tool proves, or say it's unknown. |
111
+
112
+ ## Skill priority
113
+
114
+ This is a **process skill** — it runs alongside `memtrace-first` before
115
+ implementation. Use `memtrace-first` for *what/where/impact* (code graph); use
116
+ decision memory for *why/whether-it-held* (rationale). When both apply, decision
117
+ memory gates the intent, the code graph gates the mechanics.
118
+
119
+ ## Output
120
+
121
+ The routing outcome: which sibling skill/tool to invoke, and the evidence to quote.
122
+
123
+ ```
124
+ Ask: "Should I switch to library X?"
125
+ Route: recall_decision("library X") → memtrace-decision-recall
126
+ Hit: { id: 4217, kind: "decision", ... } (a ban exists)
127
+ Next: verify_intent(4217) → memtrace-intent-verification
128
+ Quote: Verdict + Evidence (FactStatus, proof path) — or CannotProve = unknown, not permission
129
+ ```
@@ -0,0 +1,83 @@
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
+ ---
5
+
6
+ ## Overview
7
+
8
+ `recall_decision` is the **free-text entry point** to decision memory. Given a query,
9
+ it returns the statistically-ranked set of decisions/conversations that bear on it —
10
+ including **bans** ("never use X", "don't do Y"), which are recorded as decisions.
11
+ Use it before re-litigating a settled choice or contradicting a convention.
12
+
13
+ This is the one decision-memory tool that takes plain text. The ranked decisions it
14
+ returns carry the `decision_id`s the other tools (`verify_intent`, `get_arc`) need.
15
+
16
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
17
+
18
+ ## Quick Reference
19
+
20
+ | Tool | Purpose |
21
+ |------|---------|
22
+ | `recall_decision` | Ranked decisions/bans for a free-text query (the entry point) |
23
+ | `verify_intent` | Given a returned `decision_id` — did it still hold? (see `memtrace-intent-verification`) |
24
+ | `get_arc` | Given a returned `decision_id` — what implemented it? (see `memtrace-intent-verification`) |
25
+
26
+ > **Honesty contract:** an empty or unknown query returns an explicit **CannotProve**,
27
+ > never a fabricated decision. CannotProve means "no recorded decision on this" — it is
28
+ > *unknown*, not *approved*. Don't treat it as a green light.
29
+
30
+ ## Steps
31
+
32
+ ### 1. Query in the user's own terms
33
+
34
+ `recall_decision(query)` — `query` is free text. Use the noun phrase of the thing in
35
+ question: a library (`"redis vs in-memory cache"`), a pattern (`"error handling
36
+ strategy"`), a subsystem (`"auth tokens"`), or the exact thing you're about to do.
37
+
38
+ ### 2. Read the ranked result
39
+
40
+ Results come back ranked (lexical + semantic lanes, RRF-fused) with an `id`, a
41
+ `kind`, and a score per hit. **`decision`-kind hits are ranked first**; lower-ranked
42
+ `conversation` hits are supporting context (the verbatim turns around the decision).
43
+ For anything you mean to chain (step 4), use a hit whose `kind` is `decision` — its
44
+ `id` is the `decision_id` the other tools require.
45
+
46
+ ### 3. Act on what's there
47
+
48
+ | Result | Action |
49
+ |---|---|
50
+ | A matching decision | Honor it. Quote it back to the user before doing anything that contradicts it. |
51
+ | A **ban** ("never/don't …") | Do **not** reintroduce the banned approach without explicit user sign-off. |
52
+ | Several competing/old hits | Run `verify_intent(decision_id)` on the top one to see if it still holds before relying on it. |
53
+ | **CannotProve** | No recorded decision. Don't invent one — fall back to `memtrace-first` and/or ask the user. |
54
+
55
+ ### 4. Chain into the id-based tools when you need more
56
+
57
+ The `id` of a `kind: "decision"` hit feeds `verify_intent` (did it hold?) and
58
+ `get_arc` (what implemented it?). Don't pass a `conversation` hit's id — those tools
59
+ require a Decision node and will honestly return CannotProve. See
60
+ `memtrace-intent-verification`.
61
+
62
+ ## Decision Points
63
+
64
+ | Situation | Action |
65
+ |-----------|--------|
66
+ | About to choose a library/pattern/approach | `recall_decision` FIRST — you may be undoing a deliberate choice or ban |
67
+ | User asks "did we decide X?" / "what's our convention on Y?" | `recall_decision("X" / "Y")` |
68
+ | You suspect a "don't do this" rule exists | `recall_decision` — bans are decisions and will surface |
69
+ | Recall returns a decision you're about to contradict | Surface it to the user verbatim; don't silently override |
70
+ | Recall returns CannotProve | Treat as unknown, not approval; do not fabricate a rationale |
71
+
72
+ ## Output
73
+
74
+ `recall_decision` returns ranked hits — `kind: "decision"` first, `conversation` hits below as supporting context — or an explicit **CannotProve**:
75
+
76
+ ```json
77
+ [
78
+ { "id": "…", "kind": "decision", "score": 0.91 },
79
+ { "id": "…", "kind": "conversation", "score": 0.44 }
80
+ ]
81
+ ```
82
+
83
+ 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.