Add slash commands, an opt-in enforce hook, and user directives on top of the consolidated catalogue#57
Conversation
Adds four /mt-* slash commands (onboard, preflight, recall, impact), an opt-in PreToolUse enforce hook shipped as hooks.json.example (not auto-registered), an advisory Stop backstop, and two directive docs. All sit on top of the consolidated skills catalogue without changing any skill. See the PR description for the full gap analysis.
|
Mention Blocks like a regular teammate with your question or request: @blocks review this pull request Run |
There was a problem hiding this comment.
Pull request overview
This PR extends the plugins/memtrace-skills plugin with additional user-facing artifacts on top of the existing consolidated skill catalogue: plugin-level directive docs, four /mt-* slash-command entrypoints, and an opt-in Claude Code hook example (PreToolUse gate + Stop backstop).
Changes:
- Add
MEMTRACE.mdandINSTALLABLE-DIRECTIVE.mdto document the “graph before grep” doctrine and provide a copy/paste directive forCLAUDE.md/ rules-based setups. - Add four slash command definitions under
plugins/memtrace-skills/commands/(mt-onboard,mt-preflight,mt-recall,mt-impact). - Add an opt-in hook bundle under
plugins/memtrace-skills/hooks/(PreToolUse enforcement + Stop hook backstop) plushooks.json.example.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/memtrace-skills/MEMTRACE.md | Adds the plugin’s top-level doctrine and an intent-family map for skill routing |
| plugins/memtrace-skills/INSTALLABLE-DIRECTIVE.md | Adds a portable directive block for users to paste into CLAUDE.md or rules loaders |
| plugins/memtrace-skills/hooks/memtrace-enforce-pretooluse.sh | Adds a PreToolUse hook that denies recursive code search in indexed repos (opt-in) |
| plugins/memtrace-skills/hooks/memtrace-enforce-stop.sh | Adds a Stop hook backstop to nudge graph/decision/history workflows (opt-in) |
| plugins/memtrace-skills/hooks/hooks.json.example | Provides an example Claude Code hooks config wiring the new scripts |
| plugins/memtrace-skills/commands/mt-onboard.md | Adds a slash command for graph-based repo onboarding / overview |
| plugins/memtrace-skills/commands/mt-preflight.md | Adds a slash command for pre-edit symbol safety checks |
| plugins/memtrace-skills/commands/mt-recall.md | Adds a slash command for decision-memory recall before refactors |
| plugins/memtrace-skills/commands/mt-impact.md | Adds a slash command for blast-radius/impact analysis of a symbol |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - MCP server-instructions: the always-injected form of reflex 1, leading with the | ||
| routing doctrine rather than a version banner (see `SERVER-INSTRUCTIONS.md`). |
| This installable block is the always-in-context form of the same doctrine that | ||
| `MEMTRACE.md` states in full and that `SERVER-INSTRUCTIONS.md` injects via the MCP | ||
| server. Installing it is belt-and-suspenders: the hook enforces deterministically |
|
|
||
| | Family | When it fires | Entry | | ||
| |---|---|---| | ||
| | Discovery and structure | locate code, traverse a symbol's edges, map a repo, run graph algorithms, see the API surface | `memtrace-first` (router) then search / relationships / codebase-exploration / graph / api-topology | |
| | Family | When it fires | Entry | | ||
| |---|---|---| | ||
| | Discovery and structure | locate code, traverse a symbol's edges, map a repo, run graph algorithms, see the API surface | `memtrace-first` (router) then search / relationships / codebase-exploration / graph / api-topology | | ||
| | Pre-edit safety and impact | what breaks if I change this; a gate before editing one symbol; a risk-rated plan for a multi-symbol change | impact -> preflight -> change-impact-analysis (a ladder by scope) | |
| |---|---|---| | ||
| | Discovery and structure | locate code, traverse a symbol's edges, map a repo, run graph algorithms, see the API surface | `memtrace-first` (router) then search / relationships / codebase-exploration / graph / api-topology | | ||
| | Pre-edit safety and impact | what breaks if I change this; a gate before editing one symbol; a risk-rated plan for a multi-symbol change | impact -> preflight -> change-impact-analysis (a ladder by scope) | | ||
| | History and temporal | what changed over a range, one episode's diff, historical coupling, root-cause a failure, catch up at session start | evolution / episode-replay / cochange / incident-investigation / session-continuity / daily | |
| | History and temporal | what changed over a range, one episode's diff, historical coupling, root-cause a failure, catch up at session start | evolution / episode-replay / cochange / incident-investigation / session-continuity / daily | | ||
| | Decision memory | why does this exist, was this decided or banned, a symbol's lineage, whether a decision held, where it was implemented | `memtrace-decision-memory` (router over recall_decision / why_is_this_here / governing_contracts / verify_intent / get_arc) | | ||
| | Docs | how does Memtrace work, install or config, what a tool does, read a docs page | `memtrace-docs` (router over search_docs / ask_docs / read_doc) | | ||
| | Fleet coordination | more than one agent shares a repo and branch: declare intent, record edits, resolve a conflict | `memtrace-fleet` (concept) then the publish-intent / record-episode / resolve leaves | |
| | Decision memory | why does this exist, was this decided or banned, a symbol's lineage, whether a decision held, where it was implemented | `memtrace-decision-memory` (router over recall_decision / why_is_this_here / governing_contracts / verify_intent / get_arc) | | ||
| | Docs | how does Memtrace work, install or config, what a tool does, read a docs page | `memtrace-docs` (router over search_docs / ask_docs / read_doc) | | ||
| | Fleet coordination | more than one agent shares a repo and branch: declare intent, record edits, resolve a conflict | `memtrace-fleet` (concept) then the publish-intent / record-episode / resolve leaves | | ||
| | Code health and quality | dead code and complexity hotspots, a refactor plan, a GitHub PR review, empirical style norms | quality / refactoring-guide / code-review / style-fingerprint | |
| | Docs | how does Memtrace work, install or config, what a tool does, read a docs page | `memtrace-docs` (router over search_docs / ask_docs / read_doc) | | ||
| | Fleet coordination | more than one agent shares a repo and branch: declare intent, record edits, resolve a conflict | `memtrace-fleet` (concept) then the publish-intent / record-episode / resolve leaves | | ||
| | Code health and quality | dead code and complexity hotspots, a refactor plan, a GitHub PR review, empirical style norms | quality / refactoring-guide / code-review / style-fingerprint | | ||
| | Indexing and lifecycle | index a repo once, or watch it for live re-index | index / continuous-memory | |
What the consolidated catalogue already covers, and what is still openI read the new consolidated catalogue (the published 27-skill set). It lands the core of what I raised in #51, and lands it well: Skills (already covered)
That is the whole skill-consolidation half of the proposal, already in your release. Two skill-level items remain OPTIONAL, not gaps:
Commands (open: nothing shipped)The catalogue has skills but no
Each self-locates its Hooks (open: reflex is prose only)Every umbrella now SAYS "do not grep, use the graph," but nothing enforces it. A deterministic PreToolUse hook can redirect recursive code-search ( Directives (open, partly filed)The prose layer, four pieces:
Eval: how I scored activation qualityI scored each
The point for your release: your published descriptions already sit in that same strong band (the ones I read carry explicit triggers plus the anti-grep clause), which is the corroboration that the consolidation was the right move, not a critique of it. The rubric and the per-skill before/after are in the fuller write-up if useful. How I checked nothing regressesEvery merge in the write-up is paired with a behavior-preservation row: one line per source skill tying each trigger to a clause in the surviving description, so no activation trigger is dropped. That table is the load-bearing part, and it is why the merges lose nothing. |
Your new consolidated catalogue already lands the skill consolidation from #51: umbrellas that route internally, descriptions that point at the graph instead of grep. This PR does not touch any of that. It adds the artifact classes the catalogue does not yet include, each sitting on top of your skills without changing them. Full gap analysis (what your release already covers vs what is open) and the activation-scoring numbers are in the write-up I shared.
What this PR adds
commands/four slash commands (/mt-onboard,/mt-preflight,/mt-recall,/mt-impact), each a one-keystroke entry into a common workflow, self-locating itsrepo_idfrom the working directory so it runs with no manual edit.hooks/an OPT-IN PreToolUse hook that redirects recursive code-search (rg,grep -r,git grep,ugrep) tofind_code/find_symbolin an indexed repo, plus an advisory Stop backstop. It fails open on daemon-down, an opt-out flag, or a path outside any indexed repo. It ships ashooks.json.example, NOT auto-registered: I flag it opt-in on purpose, since auto-registering it changes grep behavior for every user, the same silent-default concern I raised in memtrace install mutates user-global Claude Code config (~/.claude/) with no consent prompt, no documented mutation list, no opt-out, and a non-restoring uninstall #25. Rename it tohooks.jsonto enable.MEMTRACE.md,INSTALLABLE-DIRECTIVE.md): the "graph before grep" reflex, one as plugin-level guidance and one as a paste-into-CLAUDE.mdblock for users who want the reflex in their own context.What this PR does NOT do
It does not modify your consolidated skills, does not re-run the merges you already shipped, and does not touch the MCP server-instruction block (the reorder is #55, server-side). The progressive-disclosure option and the three further "aggressive tier" merges (27 to 24) are described in the write-up as options, not applied here.
Happy to split this into one PR per component, or to drop any piece you would rather not carry. Thanks again for the tool.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.