graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
feat(plugins): read Claude/Grok/Codex plugins and MCP in place
Cursor Agent5d0e0e603eef
diff --git a/README.md b/README.mdindex 0e19979e..54cd0722 100644--- a/README.md+++ b/README.md@@ -118,7 +118,11 @@ curl -fsSL https://github.com/justrach/codegraff/releases/latest/download/instal```From a checkout, just run `./install.sh`. The binary lands in `~/bin` by default-(override with `HARNESS_DIR`):+(override with `HARNESS_DIR`). The installer appends that directory to your+`~/.zshrc` (and `~/.bashrc` / fish config when those are your shell or already+exist), so a new terminal finds `graff` — the usual "it installed but+`graff: command not found`" miss. Skip with `HARNESS_NO_PATH=1`. Open a new tab+or `source ~/.zshrc` once after install:| tool | purpose || --------- | ------- |@@ -509,6 +513,7 @@ gateway rollouts appear without a restart./agents list agent types: builtin personas + .harness/agents/*.md/skills [add|remove <name>]list SKILL.md playbooks + companion tools; add/remove enables or disables one+/plugins list Claude/Grok/Codex plugin trees graff is reading in place/hooks list lifecycle hooks and the built-in codedb guard/doctor read-only health check: goal/todo invariants, and why steering will or will not be appended/btw <question> ask one side question about this conversation: no tools, billed, never added to the session@@ -571,8 +576,10 @@ accepted findings.A skill is a markdown playbook graff loads only when a task calls for it. Dropone in `.harness/skills/<name>/SKILL.md` (or `~/.harness/skills/` for everyproject), give it `name` and `description` frontmatter, and write the-instructions in the body. Skills already written for Claude Code work as they-are: `.claude/skills/` is read too.+instructions in the body. Skills already written for Claude Code, Grok, or+Codex work as they are: `.claude/skills/`, `~/.grok/skills/`, plugin+`skills/` trees, and `~/.agents/skills/` are read in place (not copied).+`/plugins` lists the plugin trees. `GRAFF_NO_PLUGINS=1` skips them.Only the name and description enter the system prompt, so a large skill librarycosts one line each. The model calls the `skill` tool to pull a body in when it@@ -587,7 +594,11 @@ and `/skills add <name>` brings it back. See### MCP serversGraff speaks both MCP transports directly: local stdio servers and remote-Streamable HTTP servers. Smolify (`https://app.smol.ly/mcp`) is available as a+Streamable HTTP servers. Servers already configured for Claude, Cursor, or+Grok are read in place (plugin `.mcp.json`, `~/.claude.json`,+`~/.cursor/mcp.json`, `.cursor/mcp.json`) and fill names graff does not+already define; they still need `/mcp trust` or `--yolo`. `/plugins` shows+which plugin trees contributed. Smolify (`https://app.smol.ly/mcp`) is available as acore documentation service; it needs no Node bridge or project configuration.Its public-read schemas are bundled locally, so startup makes no Smolifyrequest. The anonymous transport initializes only after an approved tool call,@@ -1241,8 +1252,9 @@ rules in `AGENTS.md` and the harness picks them up like any real coding agent.`install.sh` compiles `graff` (ReleaseFast) and installs it to `~/bin` (overridewith `HARNESS_DIR=`); it builds the current checkout, or clones the repo if runstandalone. It detects the platform (Windows → WSL hint), checks for the pinned-Zig 0.17 development build,-and ends with a PATH check. Alternatively, run in place:+Zig 0.17 development build, and appends the install dir to `~/.zshrc` /+`~/.bashrc` so `graff` is on PATH in the next terminal (`HARNESS_NO_PATH=1`+skips). Alternatively, run in place:```shzig build run # or: ./zig-out/bin/graffdiff --git a/docs/adr/0007-plugins-are-read-in-place.md b/docs/adr/0007-plugins-are-read-in-place.mdnew file mode 100644index 00000000..378f2c0b--- /dev/null+++ b/docs/adr/0007-plugins-are-read-in-place.md@@ -0,0 +1,40 @@+# 0007. Plugins and foreign MCP are read in place++Status: accepted 2026-08-18++## Context++Grok-build feels like it "just works" with Claude/Codex/Cursor because it+**reads their trees where they already live**. graff's first-run `adopt` copies+MCP and skills into `~/.codegraff/` once, then ignores anything installed+after that marker. A skill cannot see a plugin that was never copied. MCP+added to `~/.claude.json` after the first `graff` session never connected.++Copying also duplicates secrets and drifts from the other harness's live+config.++## Decision++- Discover plugin roots in place: `~/.claude/plugins/`, `~/.grok/plugins/`,+ `~/.codex/plugins/`, `~/.codegraff/plugins/`, and the project+ `.claude/.grok/.codex/.harness/plugins/` trees (including Claude's+ `plugins/cache/…` layout). A directory is a plugin if it has+ `.claude-plugin/plugin.json`, `.grok-plugin/plugin.json`, `plugin.json`,+ `.mcp.json`, `skills/`, or `agents/`. Skip `marketplaces/`. Cap 32.+- Skills from those trees (and `~/.agents/skills`, `~/.grok/skills`,+ `~/.codex/skills`) join the existing on-demand `skill` catalog. Bodies still+ load only when the model calls `skill`. Project `.harness/skills` still wins.+- Plugin `agents/` join the fleet after personal `~/.harness/agents` and+ before project `.harness/agents`.+- Plugin `.mcp.json` plus Claude/Cursor/Grok MCP files (`~/.claude.json`,+ `~/.cursor/mcp.json`, `.cursor/mcp.json`, …) fill **missing** server names+ only. graff's `~/.codegraff/mcp.json` and `.mcp.json` still win. Consent is+ unchanged (`/mcp trust` / `--yolo`).+- `GRAFF_NO_PLUGINS=1` disables the scan. `/plugins` lists origin. Do not+ vendor grok-build. Do not auto-run plugin hooks.++## Consequences++- A plugin installed after first-run adopt is visible next session.+- Project plugin MCP is not more trusted than project `.mcp.json`; it is less.+- Revisit if a user needs to disable one plugin without `GRAFF_NO_PLUGINS`.diff --git a/docs/adr/README.md b/docs/adr/README.mdindex 4942224f..8ec5736a 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -17,6 +17,7 @@ record only when you need the evidence or the edge cases.| [0004](0004-peer-speech-is-a-working-set.md) | Peer speech is pull: a one-line `[peer]` wake in history, bodies in the inbox ring; compact drops spent injects and never treats them as the human. || [0005](0005-standing-goal-lives-in-the-prefix.md) | Standing goal is one prefix line; the user-message essay injects on change only, never every N turns. || [0006](0006-workspace-switch-is-a-tool.md) | Mid-session worktree switch is a real `workspace` tool; a skill cannot move file-tool cwd. |+| [0007](0007-plugins-are-read-in-place.md) | Claude/Grok/Codex plugins and MCP are read in place; skills stay on-demand; MCP stays consent-gated. |## When to write onediff --git a/docs/skills.md b/docs/skills.mdindex 01a13709..375f0495 100644--- a/docs/skills.md+++ b/docs/skills.md@@ -19,7 +19,11 @@ Two kinds of thing are called "skills" in graff, and `/skills` lists both:| bundled in the binary | every install || `~/.claude/skills/` | you, every project (compatibility) || `~/.harness/skills/` | you, every project |+| `~/.grok/skills/`, `~/.codex/skills/`, `~/.agents/skills/` | you, every project (other harnesses, in place) |+| `~/.claude/plugins/*/skills/` (and Grok/Codex/graff plugin trees) | you, every project (ADR 0007) || `.claude/skills/` | this project (compatibility) |+| `.grok/skills/`, `.codex/skills/` | this project |+| `.claude/plugins/*/skills/` (and project plugin trees) | this project || `.harness/skills/` | this project |Later rows win: a project skill shadows a personal skill of the same name,diff --git a/src/command_catalog.zig b/src/command_catalog.zigindex e974da04..07eb306f 100644--- a/src/command_catalog.zig+++ b/src/command_catalog.zig@@ -51,6 +51,7 @@ pub const commands = [_]Item{.{ .name = "/trajectory", .desc = "show this session's agent tree — turns + spawned subagents" },.{ .name = "/agents", .desc = "list agent types — builtin personas + .harness/agents/*.md" },.{ .name = "/skills", .usage = "/skills [add|remove <name>]", .desc = "list SKILL.md playbooks + companion tools; add/remove enables or disables one" },+ .{ .name = "/plugins", .desc = "list Claude/Grok/Codex plugin trees graff is reading in place" },.{ .name = "/hooks", .desc = "list lifecycle hooks and the built-in codedb guard" },.{ .name = "/doctor", .desc = "read-only health check: goal/todo invariants, and why steering will or will not be appended" },.{ .name = "/btw", .usage = "/btw <question>", .desc = "ask one side question about this conversation — no tools, billed, never added to the session" },diff --git a/src/commands_session.zig b/src/commands_session.zigindex e128262a..d2ee58cc 100644--- a/src/commands_session.zig+++ b/src/commands_session.zig@@ -33,6 +33,7 @@ const exec = @import("exec.zig");const execTool = exec.execTool;const commands_sandbox = @import("commands_sandbox.zig"); // #554 /snapshot + /rewind <id>const workspace_switch = @import("workspace_switch.zig");+const plugins = @import("plugins.zig");const fleet = @import("fleet.zig");const promoteAgents = fleet.promoteAgents;@@ -88,6 +89,7 @@ pub fn tryHandle(root: *Agent, keys: *Keys, arena: Allocator, line: []const u8,// id — a numeric /rewind falls through to the conversation rewind below.if (try commands_sandbox.tryHandle(root, arena, line, out)) return true;if (try workspace_switch.slashCommand(root, arena, line, out)) return true;+ if (try plugins.slashCommand(root.io, arena, root.home, line, out)) return true;if (std.mem.eql(u8, line, "/clear")) {root.messages = std.json.Array.init(arena);root.last_context_tokens = 0;diff --git a/src/fleet.zig b/src/fleet.zigindex 6ae10ef8..2fc149a6 100644--- a/src/fleet.zig+++ b/src/fleet.zig@@ -22,6 +22,7 @@ const telemetry_mod = @import("telemetry.zig");const learning_privacy = @import("learning_privacy.zig");const Telemetry = telemetry_mod.Telemetry;const http = @import("http.zig");+const plugins = @import("plugins.zig");// ── Agent types (the MAP-Elites niches) ─────────────────────────────────────@@ -125,6 +126,15 @@ pub fn loadAgentTypes(io: Io, arena: Allocator, home: ?[]const u8) []const Agentconst personal = std.fmt.allocPrint(arena, "{s}/{s}", .{ h, agents_dir }) catch "";if (personal.len > 0) loadAgentDir(io, arena, &list, personal);}+ const plugs = plugins.discover(io, arena, home, Io.Dir.cwd());+ for (plugs) |p| {+ if (!p.personal or !p.agents) continue;+ loadAgentDir(io, arena, &list, std.fmt.allocPrint(arena, "{s}/agents", .{p.path}) catch continue);+ }+ for (plugs) |p| {+ if (p.personal or !p.agents) continue;+ loadAgentDir(io, arena, &list, std.fmt.allocPrint(arena, "{s}/agents", .{p.path}) catch continue);+ }loadAgentDir(io, arena, &list, agents_dir);// A verified learning ref is the highest-precedence project policy. The// loader fails closed: incomplete/corrupt learning state contributes nodiff --git a/src/help.zig b/src/help.zigindex 2845f91d..ba9586e3 100644--- a/src/help.zig+++ b/src/help.zig@@ -32,7 +32,7 @@ pub const sections = [_]Section{.{ .title = "the model", .names = &.{ "/model", "/models", "/effort", "/reasoning", "/fast", "/thinking", "/keepcontext", "/fallback", "/routes" } },.{ .title = "working autonomously", .names = &.{ "/goal", "/loop", "/review", "/plan", "/todo", "/jobs", "/ultracode", "/strict", "/yolo", "/never" } },.{ .title = "talking to other graffs", .names = &.{ "/tell", "/peek" }, .blurb = peers_blurb },- .{ .title = "your setup", .names = &.{ "/login", "/key", "/cost", "/usage", "/privacy", "/mcp", "/import-claude", "/skills", "/agents", "/hooks", "/tools", "/fleet" } },+ .{ .title = "your setup", .names = &.{ "/login", "/key", "/cost", "/usage", "/privacy", "/mcp", "/import-claude", "/skills", "/plugins", "/agents", "/hooks", "/tools", "/fleet" } },.{ .title = "context & history", .names = &.{ "/compact", "/btw", "/doctor", "/debug", "/trace", "/trajectory" } },.{ .title = "shell & images", .names = &.{ "/bash", "/image", "/images", "/paste" } },.{ .title = "look & feel", .names = &.{ "/theme", "/animation", "/title" } },diff --git a/src/mcp.zig b/src/mcp.zigindex eaf97f65..9cc364df 100644--- a/src/mcp.zig+++ b/src/mcp.zig@@ -218,7 +218,7 @@ pub const Registry = struct {/// (no tool calls in flight).pub fn trustWorkspace(reg: *Registry, config_path: []const u8) !usize {const a = reg.arena();- const merged = mcp_config.load(reg.io, a, Io.Dir.cwd(), config_path, reg.global_config_path);+ const merged = mcp_config.load(reg.io, a, Io.Dir.cwd(), config_path, reg.global_config_path, reg.home);var servers: std.ArrayList(*Server) = .empty;try servers.appendSlice(a, reg.servers);@@ -253,7 +253,7 @@ pub const Registry = struct {/// best-effort (any read/parse failure contributes nothing).pub fn pendingWorkspace(reg: *Registry, config_path: []const u8) usize {const a = reg.arena();- const merged = mcp_config.load(reg.io, a, Io.Dir.cwd(), config_path, reg.global_config_path);+ const merged = mcp_config.load(reg.io, a, Io.Dir.cwd(), config_path, reg.global_config_path, reg.home);var n: usize = 0;var it = merged.servers.iterator();while (it.next()) |entry| {diff --git a/src/mcp_boot.zig b/src/mcp_boot.zigindex ddd6bcf7..03c79d4a 100644--- a/src/mcp_boot.zig+++ b/src/mcp_boot.zig@@ -88,7 +88,7 @@ pub fn init(gpa: Allocator, io: Io, config_path: []const u8, global_path: ?[]conerrdefer reg.deinit();const a = reg.arena();- const merged = mcp_config.load(io, a, Io.Dir.cwd(), config_path, global_path);+ const merged = mcp_config.load(io, a, Io.Dir.cwd(), config_path, global_path, home);if (!merged.found) {reg.arena_state.deinit(); // nothing was started; no transports to tear downreturn null;diff --git a/src/mcp_cli.zig b/src/mcp_cli.zigindex 099208ad..5014d80a 100644--- a/src/mcp_cli.zig+++ b/src/mcp_cli.zig@@ -177,7 +177,7 @@ pub fn mcpCommand(io: Io, gpa: Allocator, arena: Allocator, home: []const u8, en}if (args.len == 0 or std.mem.eql(u8, args[0], "list")) {- const merged = mcp_config.load(io, arena, Io.Dir.cwd(), mcp_config_path, global_path);+ const merged = mcp_config.load(io, arena, Io.Dir.cwd(), mcp_config_path, global_path, home);try mcp_config.reportInvalid(merged, &out.interface, mcp_config_path, global_path, "", "");if (merged.servers.count() == 0) {try out.interface.writeAll("no MCP servers configured. Add one with `graff mcp add <name> -- <command> [args...]`,\nor list servers for every project in ~/" ++ mcp_config.global_rel_path ++ ".\n");@@ -224,7 +224,7 @@ pub fn mcpCommand(io: Io, gpa: Allocator, arena: Allocator, home: []const u8, enelse url: {// Global servers are loginable too — the merged set is the same one// the session connects from.- const merged = mcp_config.load(io, arena, Io.Dir.cwd(), mcp_config_path, global_path);+ const merged = mcp_config.load(io, arena, Io.Dir.cwd(), mcp_config_path, global_path, home);// Say which file is broken before claiming the server is missing:// "not configured" for a server that IS configured, in a file that// does not parse, sends the user looking in the wrong place.diff --git a/src/mcp_config.zig b/src/mcp_config.zigindex 56708ff3..63ec590e 100644--- a/src/mcp_config.zig+++ b/src/mcp_config.zig@@ -7,6 +7,8 @@//! schema and is merged with the project file at every read site, with PROJECT//! ENTRIES WINNING on a name conflict: a repository's own config must never be//! silently shadowed by whatever the user happens to have set up globally.+//! Names neither file defines are filled from in-place plugin trees and other+//! harness configs (ADR 0007) — still below this merge, still consent-gated.//!//! The file lives under `~/.codegraff/`, this repo's home-scoped convention//! (see models_cache.zig and router_catalog.zig), rather than inventing a new@@ -22,6 +24,7 @@ const std = @import("std");const Io = std.Io;const Value = std.json.Value;const Allocator = std.mem.Allocator;+const plugins = @import("plugins.zig");/// Home-relative location of the user-level config.pub const global_rel_path = ".codegraff/mcp.json";@@ -36,7 +39,7 @@ pub const unsupported_rel_path = ".mcpconfig.json";/// The merged `mcpServers` set plus the provenance callers need to describe it.pub const Merged = struct {- /// Every server graff should consider: global first, then project on top.+ /// Every server graff should consider: plugins/foreign, then global, then project.servers: std.json.ObjectMap = .empty,/// The workspace half on its own, so `graff mcp list` can tag an entry the/// project does not define as `(global)`.@@ -102,7 +105,7 @@ fn readServers(io: Io, arena: Allocator, dir: Io.Dir, path: []const u8, found: */// handle it is opened through. Never fails: a missing or malformed file simply/// contributes nothing. Values stay arena-allocated, like the rest of the MCP/// config handling.-pub fn load(io: Io, arena: Allocator, dir: Io.Dir, project_path: []const u8, global_path: ?[]const u8) Merged {+pub fn load(io: Io, arena: Allocator, dir: Io.Dir, project_path: []const u8, global_path: ?[]const u8, home: []const u8) Merged {var merged: Merged = .{};const global = if (global_path) |p|readServers(io, arena, dir, p, &merged.found, &merged.invalid_global)@@ -116,6 +119,9 @@ pub fn load(io: Io, arena: Allocator, dir: Io.Dir, project_path: []const u8, glowhile (global_it.next()) |entry| merged.servers.put(arena, entry.key_ptr.*, entry.value_ptr.*) catch return merged;var project_it = merged.project.iterator();while (project_it.next()) |entry| merged.servers.put(arena, entry.key_ptr.*, entry.value_ptr.*) catch return merged;+ // Plugin / Claude / Cursor / Grok configs fill names still missing. They+ // never beat a graff file. `home` empty keeps tests off the real $HOME.+ plugins.mergeMcp(io, arena, home, dir, &merged.servers, &merged.found);return merged;}@@ -157,7 +163,7 @@ const TestEnv = struct {/// Both halves are read through the tmp dir handle, so no test touches `$HOME`/// or the real workspace.fn loadTmp(arena: Allocator, dir: Io.Dir) Merged {- return load(testing.io, arena, dir, ".mcp.json", "global.json");+ return load(testing.io, arena, dir, ".mcp.json", "global.json", "");}test "global MCP path prefers the env override and otherwise lives under ~/.codegraff" {diff --git a/src/plugins.zig b/src/plugins.zignew file mode 100644index 00000000..4e554ba9--- /dev/null+++ b/src/plugins.zig@@ -0,0 +1,382 @@+//! In-place plugins and foreign-harness MCP (ADR 0007).+//!+//! Grok-build's trick is that it never copies Claude/Codex/Cursor trees into+//! its own folders: it reads `skills/`, `agents/`, and `.mcp.json` where the+//! other harness already installed them. graff's first-run `adopt` copies once+//! and then ignores anything added later. This module is the live scan.+//!+//! Skills stay on-demand (`skill` tool / `/skills`). MCP still needs `/mcp+//! trust` or `--yolo`. Plugin hooks are not run. GRAFF_NO_PLUGINS=1 disables.++const std = @import("std");+const Io = std.Io;+const Value = std.json.Value;+const Allocator = std.mem.Allocator;++const plugin_cap = 32;+const walk_depth: u8 = 4;+const visit_cap = 256;+const file_cap: std.Io.Limit = .limited(1 << 20);+const reserved = "smolify";++pub const Plugin = struct {+ name: []const u8,+ path: []const u8,+ origin: []const u8,+ personal: bool,+ skills: bool = false,+ agents: bool = false,+ mcp: bool = false,+};++fn off() bool {+ return disabled;+}++/// Set from `GRAFF_NO_PLUGINS` at session start. Default off so tests stay hermetic+/// without linking libc getenv.+pub var disabled: bool = false;++pub fn applyEnv(environ_map: anytype) void {+ disabled = environ_map.get("GRAFF_NO_PLUGINS") != null;+}++fn exists(io: Io, path: []const u8) bool {+ return (Io.Dir.cwd().statFile(io, path, .{}) catch null) != null;+}++fn join(arena: Allocator, a: []const u8, b: []const u8) []const u8 {+ return std.fmt.allocPrint(arena, "{s}/{s}", .{ a, b }) catch "";+}++fn skipped(name: []const u8) bool {+ return std.mem.eql(u8, name, "marketplaces") or+ std.mem.eql(u8, name, ".git") or+ std.mem.eql(u8, name, "node_modules");+}++fn existsJoin(io: Io, a: []const u8, b: []const u8) bool {+ var buf: [std.fs.max_path_bytes]u8 = undefined;+ const p = std.fmt.bufPrint(&buf, "{s}/{s}", .{ a, b }) catch return false;+ return exists(io, p);+}++fn isPlugin(io: Io, path: []const u8) bool {+ return existsJoin(io, path, ".claude-plugin/plugin.json") or+ existsJoin(io, path, ".grok-plugin/plugin.json") or+ existsJoin(io, path, "plugin.json") or+ existsJoin(io, path, ".mcp.json") or+ existsJoin(io, path, "skills") or+ existsJoin(io, path, "agents");+}++fn walk(io: Io, arena: Allocator, list: *std.ArrayList(Plugin), path: []const u8, origin: []const u8, personal: bool, depth: u8, visits: *usize) void {+ if (list.items.len >= plugin_cap or visits.* >= visit_cap) return;+ var dir = Io.Dir.cwd().openDir(io, path, .{ .iterate = true }) catch return;+ defer dir.close(io);+ if (isPlugin(io, path)) {+ const skills_p = join(arena, path, "skills");+ const agents_p = join(arena, path, "agents");+ const mcp_p = join(arena, path, ".mcp.json");+ list.append(arena, .{+ .name = arena.dupe(u8, std.fs.path.basename(path)) catch return,+ .path = path,+ .origin = origin,+ .personal = personal,+ .skills = exists(io, skills_p),+ .agents = exists(io, agents_p),+ .mcp = exists(io, mcp_p),+ }) catch {};+ return; // do not treat a plugin's skills/ as a nested plugin+ }+ if (depth == 0) return;+ visits.* += 1;+ var it = dir.iterate();+ while (it.next(io) catch null) |entry| {+ if (entry.kind != .directory and entry.kind != .sym_link) continue;+ if (skipped(entry.name)) continue;+ const child = join(arena, path, entry.name);+ if (child.len == 0) continue;+ walk(io, arena, list, child, origin, personal, depth - 1, visits);+ if (list.items.len >= plugin_cap) return;+ }+}++const Spec = struct { rel: []const u8, origin: []const u8 };++const user_roots = [_]Spec{+ .{ .rel = ".claude/plugins", .origin = "claude" },+ .{ .rel = ".grok/plugins", .origin = "grok" },+ .{ .rel = ".codex/plugins", .origin = "codex" },+ .{ .rel = ".codegraff/plugins", .origin = "graff" },+ .{ .rel = ".harness/plugins", .origin = "harness" },+};++const project_roots = [_]Spec{+ .{ .rel = ".claude/plugins", .origin = "claude" },+ .{ .rel = ".grok/plugins", .origin = "grok" },+ .{ .rel = ".codex/plugins", .origin = "codex" },+ .{ .rel = ".harness/plugins", .origin = "harness" },+};++/// Every plugin tree under the usual Claude/Grok/Codex/graff folders.+/// `project` is the workspace root (cwd in production, a tmp dir in tests).+pub fn discover(io: Io, arena: Allocator, home: ?[]const u8, project: Io.Dir) []const Plugin {+ if (off()) return &.{};+ var list: std.ArrayList(Plugin) = .empty;+ var visits: usize = 0;+ if (home) |h| if (h.len > 0) {+ for (user_roots) |spec| {+ walk(io, arena, &list, join(arena, h, spec.rel), spec.origin, true, walk_depth, &visits);+ }+ };+ var buf: [std.fs.max_path_bytes]u8 = undefined;+ const n = project.realPath(io, &buf) catch 0;+ if (n > 0) {+ const root = arena.dupe(u8, buf[0..n]) catch "";+ if (root.len > 0) {+ for (project_roots) |spec| {+ walk(io, arena, &list, join(arena, root, spec.rel), spec.origin, false, walk_depth, &visits);+ }+ }+ }+ return list.items;+}++pub fn skillDirs(io: Io, arena: Allocator, home: ?[]const u8, project: Io.Dir, personal: bool) []const []const u8 {+ var out: std.ArrayList([]const u8) = .empty;+ for (discover(io, arena, home, project)) |p| {+ if (p.personal != personal or !p.skills) continue;+ const d = join(arena, p.path, "skills");+ if (d.len > 0) out.append(arena, d) catch {};+ }+ return out.items;+}++pub fn agentDirs(io: Io, arena: Allocator, home: ?[]const u8, project: Io.Dir, personal: bool) []const []const u8 {+ var out: std.ArrayList([]const u8) = .empty;+ for (discover(io, arena, home, project)) |p| {+ if (p.personal != personal or !p.agents) continue;+ const d = join(arena, p.path, "agents");+ if (d.len > 0) out.append(arena, d) catch {};+ }+ return out.items;+}++fn pathEq(a: []const u8, b: []const u8) bool {+ return std.mem.eql(u8, std.mem.trimEnd(u8, a, "/"), std.mem.trimEnd(u8, b, "/"));+}++fn putServers(arena: Allocator, servers: *std.json.ObjectMap, found: *bool, v: ?Value) void {+ const obj = if (v) |x| (if (x == .object) x.object else return) else return;+ var it = obj.iterator();+ while (it.next()) |e| {+ if (std.mem.eql(u8, e.key_ptr.*, reserved)) continue;+ if (servers.get(e.key_ptr.*) != null) continue;+ if (e.value_ptr.* != .object) continue;+ servers.put(arena, e.key_ptr.*, e.value_ptr.*) catch continue;+ found.* = true;+ }+}++fn ingest(arena: Allocator, servers: *std.json.ObjectMap, found: *bool, text: []const u8, cwd: ?[]const u8) void {+ const parsed = std.json.parseFromSliceLeaky(Value, arena, text, .{ .allocate = .alloc_always }) catch return;+ if (parsed != .object) return;+ putServers(arena, servers, found, parsed.object.get("mcpServers"));+ if (cwd) |c| {+ const projects = parsed.object.get("projects") orelse return;+ if (projects != .object) return;+ var it = projects.object.iterator();+ while (it.next()) |e| {+ if (!pathEq(e.key_ptr.*, c)) continue;+ if (e.value_ptr.* != .object) continue;+ putServers(arena, servers, found, e.value_ptr.object.get("mcpServers"));+ }+ }+}++fn takeAbs(io: Io, arena: Allocator, servers: *std.json.ObjectMap, found: *bool, path: []const u8, cwd: ?[]const u8) void {+ const text = Io.Dir.cwd().readFileAlloc(io, path, arena, file_cap) catch return;+ ingest(arena, servers, found, text, cwd);+}++fn takeRel(io: Io, arena: Allocator, dir: Io.Dir, servers: *std.json.ObjectMap, found: *bool, rel: []const u8) void {+ const text = dir.readFileAlloc(io, rel, arena, file_cap) catch return;+ ingest(arena, servers, found, text, null);+}++/// Fill names that graff's own global/project files do not already define.+/// Later-wins stays with those files: this only inserts missing names.+pub fn mergeMcp(io: Io, arena: Allocator, home: []const u8, dir: Io.Dir, servers: *std.json.ObjectMap, found: *bool) void {+ if (off()) return;+ const plugs = discover(io, arena, if (home.len > 0) home else null, dir);+ for (plugs) |p| takeAbs(io, arena, servers, found, join(arena, p.path, ".mcp.json"), null);++ var buf: [std.fs.max_path_bytes]u8 = undefined;+ const n = dir.realPath(io, &buf) catch 0;+ const cwd = if (n > 0) buf[0..n] else null;+ if (home.len > 0) {+ takeAbs(io, arena, servers, found, join(arena, home, ".claude.json"), cwd);+ takeAbs(io, arena, servers, found, join(arena, home, ".claude/settings.json"), null);+ takeAbs(io, arena, servers, found, join(arena, home, ".claude/settings.local.json"), null);+ takeAbs(io, arena, servers, found, join(arena, home, ".cursor/mcp.json"), null);+ takeAbs(io, arena, servers, found, join(arena, home, ".grok/mcp.json"), null);+ if (@import("builtin").os.tag == .macos)+ takeAbs(io, arena, servers, found, join(arena, home, "Library/Application Support/Claude/claude_desktop_config.json"), null)+ else+ takeAbs(io, arena, servers, found, join(arena, home, ".config/Claude/claude_desktop_config.json"), null);+ }+ takeRel(io, arena, dir, servers, found, ".cursor/mcp.json");+ takeRel(io, arena, dir, servers, found, ".claude/settings.json");+ takeRel(io, arena, dir, servers, found, ".claude/settings.local.json");+ takeRel(io, arena, dir, servers, found, ".grok/mcp.json");+}++/// `/plugins` — list discovered plugin trees and where they came from.+pub fn slashCommand(io: Io, arena: Allocator, home: []const u8, line: []const u8, out: *Io.Writer) !bool {+ if (!(std.mem.eql(u8, line, "/plugins") or std.mem.startsWith(u8, line, "/plugins "))) return false;+ if (off()) {+ try out.writeAll("plugins disabled (GRAFF_NO_PLUGINS). unset it and restart to scan Claude/Grok/Codex trees.\n");+ try out.flush();+ return true;+ }+ const list = discover(io, arena, if (home.len > 0) home else null, Io.Dir.cwd());+ if (list.len == 0) {+ try out.writeAll("no plugins discovered. graff reads Claude/Grok/Codex plugin trees in place (skills/, agents/, .mcp.json). nothing to copy; GRAFF_NO_PLUGINS=1 disables.\n");+ try out.flush();+ return true;+ }+ try out.print("{d} plugin(s) (in-place, not copied):\n", .{list.len});+ for (list) |p| {+ try out.print(" {s} [{s}/{s}]", .{ p.name, p.origin, if (p.personal) "user" else "project" });+ if (p.skills) try out.writeAll(" skills");+ if (p.agents) try out.writeAll(" agents");+ if (p.mcp) try out.writeAll(" mcp");+ try out.print(" {s}\n", .{p.path});+ }+ try out.writeAll("skills load on demand (skill tool / /skills). MCP still needs /mcp trust or --yolo.\n");+ try out.flush();+ return true;+}++const testing = std.testing;++fn tmpBase(io: Io, tmp: *testing.TmpDir, arena: Allocator) ![]const u8 {+ var buf: [std.fs.max_path_bytes]u8 = undefined;+ const n = try tmp.dir.realPath(io, &buf);+ return arena.dupe(u8, buf[0..n]);+}++test "discover: a Claude plugin.json tree is a plugin; marketplaces are not" {+ var tmp = testing.tmpDir(.{});+ defer tmp.cleanup();+ var arena_state = std.heap.ArenaAllocator.init(testing.allocator);+ defer arena_state.deinit();+ const arena = arena_state.allocator();+ const io = testing.io;+ const base = try tmpBase(io, &tmp, arena);+ const home = join(arena, base, "home");+ const plug = join(arena, home, ".claude/plugins/demo");+ try Io.Dir.cwd().createDirPath(io, join(arena, plug, ".claude-plugin"));+ try Io.Dir.cwd().createDirPath(io, join(arena, plug, "skills/demo-skill"));+ try Io.Dir.cwd().createDirPath(io, join(arena, home, ".claude/plugins/marketplaces/skip-me"));+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, plug, ".claude-plugin/plugin.json"), .data = "{\"name\":\"demo\"}" });+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, plug, "skills/demo-skill/SKILL.md"), .data = "---\nname: demo-skill\ndescription: d\n---\nbody\n" });+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, home, ".claude/plugins/marketplaces/skip-me/plugin.json"), .data = "{}" });++ const list = discover(io, arena, home, tmp.dir);+ try testing.expectEqual(@as(usize, 1), list.len);+ try testing.expectEqualStrings("demo", list[0].name);+ try testing.expectEqualStrings("claude", list[0].origin);+ try testing.expect(list[0].personal);+ try testing.expect(list[0].skills);+ try testing.expect(!list[0].mcp);+ const dirs = skillDirs(io, arena, home, tmp.dir, true);+ try testing.expectEqual(@as(usize, 1), dirs.len);+ try testing.expect(std.mem.endsWith(u8, dirs[0], "demo/skills"));+}++test "discover: walks Claude plugins/cache two levels down" {+ var tmp = testing.tmpDir(.{});+ defer tmp.cleanup();+ var arena_state = std.heap.ArenaAllocator.init(testing.allocator);+ defer arena_state.deinit();+ const arena = arena_state.allocator();+ const io = testing.io;+ const base = try tmpBase(io, &tmp, arena);+ const home = join(arena, base, "home");+ const nested = join(arena, home, ".claude/plugins/cache/official/pack/1.0.0");+ try Io.Dir.cwd().createDirPath(io, join(arena, nested, "agents"));+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, nested, "plugin.json"), .data = "{\"name\":\"pack\"}" });+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, nested, "agents/reviewer.md"), .data = "---\nname: pack-reviewer\n---\nbe careful\n" });++ const list = discover(io, arena, home, tmp.dir);+ try testing.expectEqual(@as(usize, 1), list.len);+ try testing.expectEqualStrings("1.0.0", list[0].name);+ try testing.expect(list[0].agents);+ const agents = agentDirs(io, arena, home, tmp.dir, true);+ try testing.expectEqual(@as(usize, 1), agents.len);+}++test "mergeMcp: plugin and Cursor MCP fill missing names; graff config wins" {+ var tmp = testing.tmpDir(.{});+ defer tmp.cleanup();+ var arena_state = std.heap.ArenaAllocator.init(testing.allocator);+ defer arena_state.deinit();+ const arena = arena_state.allocator();+ const io = testing.io;+ const base = try tmpBase(io, &tmp, arena);+ const home = join(arena, base, "home");+ const plug = join(arena, home, ".grok/plugins/tools");+ try Io.Dir.cwd().createDirPath(io, plug);+ try Io.Dir.cwd().createDirPath(io, join(arena, home, ".cursor"));+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, plug, ".mcp.json"), .data = "{\"mcpServers\":{\"from-plugin\":{\"command\":\"p\"},\"shared\":{\"command\":\"plugin-loses\"}}}" });+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, home, ".cursor/mcp.json"), .data = "{\"mcpServers\":{\"from-cursor\":{\"url\":\"https://cursor.example/mcp\"}}}" });++ var servers: std.json.ObjectMap = .empty;+ try servers.put(arena, "shared", .{ .object = blk: {+ var o: std.json.ObjectMap = .empty;+ try o.put(arena, "command", .{ .string = "graff-wins" });+ break :blk o;+ } });+ var found = false;+ mergeMcp(io, arena, home, tmp.dir, &servers, &found);+ try testing.expect(found);+ try testing.expect(servers.get("from-plugin") != null);+ try testing.expect(servers.get("from-cursor") != null);+ try testing.expectEqualStrings("graff-wins", servers.get("shared").?.object.get("command").?.string);+}++test "mergeMcp: ~/.claude.json project-scoped servers match this cwd" {+ var tmp = testing.tmpDir(.{});+ defer tmp.cleanup();+ var arena_state = std.heap.ArenaAllocator.init(testing.allocator);+ defer arena_state.deinit();+ const arena = arena_state.allocator();+ const io = testing.io;+ const base = try tmpBase(io, &tmp, arena);+ const home = join(arena, base, "home");+ try Io.Dir.cwd().createDirPath(io, home);+ const head = "{\"mcpServers\":{\"root\":{\"command\":\"r\"}},\"projects\":{\"";+ const tail = "\":{\"mcpServers\":{\"here\":{\"command\":\"h\"}}},\"/other\":{\"mcpServers\":{\"nope\":{\"command\":\"x\"}}}}}";+ const payload = try std.fmt.allocPrint(arena, "{s}{s}{s}", .{ head, base, tail });+ try Io.Dir.cwd().writeFile(io, .{ .sub_path = join(arena, home, ".claude.json"), .data = payload });++ var servers: std.json.ObjectMap = .empty;+ var found = false;+ mergeMcp(io, arena, home, tmp.dir, &servers, &found);+ try testing.expect(found);+ try testing.expect(servers.get("root") != null);+ try testing.expect(servers.get("here") != null);+ try testing.expect(servers.get("nope") == null);+}++test "slashCommand: /plugins lists origin and refuses unrelated lines" {+ var aw: Io.Writer.Allocating = .init(testing.allocator);+ defer aw.deinit();+ var arena_state = std.heap.ArenaAllocator.init(testing.allocator);+ defer arena_state.deinit();+ try testing.expect(!(try slashCommand(testing.io, arena_state.allocator(), "", "/skills", &aw.writer)));+ try testing.expect(try slashCommand(testing.io, arena_state.allocator(), "", "/plugins", &aw.writer));+ try testing.expect(std.mem.indexOf(u8, aw.writer.buffered(), "plugin") != null);+}diff --git a/src/repl_model_commands.zig b/src/repl_model_commands.zigindex 9f7cde0a..0917cdd4 100644--- a/src/repl_model_commands.zig+++ b/src/repl_model_commands.zig@@ -115,8 +115,8 @@ pub fn runCommand(self: *Model, line: []const u8) void {self.push(.info, "`/loop` schedules repeated runs in the main session, not the chat repl") catch {};} else if (eqlAny(cmd, &.{ "/trace", "/trajectory" })) {self.push(.info, "trace/trajectory logging is a main-session feature") catch {};- } else if (eqlAny(cmd, &.{ "/save", "/resume", "/sessions", "/workspace", "/ws" })) {- self.push(.info, "the chat repl is ephemeral — session save/resume/list/workspace lives in the main `graff` session") catch {};+ } else if (eqlAny(cmd, &.{ "/save", "/resume", "/sessions", "/workspace", "/ws", "/plugins" })) {+ self.push(.info, "the chat repl is ephemeral — session save/resume/list/workspace/plugins lives in the main `graff` session") catch {};} else if (std.mem.eql(u8, cmd, "/images")) {self.push(.info, "/images opens image URLs from tool output (e.g. a `gh issue view` result); the chat repl runs no tools — use the main `graff` session for it") catch {};} else if (eqlAny(cmd, &.{ "/image", "/paste" })) {diff --git a/src/repl_util.zig b/src/repl_util.zigindex 0123de63..653c9245 100644--- a/src/repl_util.zig+++ b/src/repl_util.zig@@ -19,7 +19,7 @@ pub const HELP_CHAT =\\ /plan /strict /yolo /keepcontext /title modes\\ /rename <name> /animation enso|braille|dragon\\ /bash /save /resume /sessions /workspace /trace /trajectory- \\ /agents /skills /hooks /mcp /loop /review /image /paste /key+ \\ /agents /skills /plugins /hooks /mcp /loop /review /image /paste /key\\\\Type a message and press enter to send it to the model. Toggles accept\\[on|off] or flip when bare. Commands needing the agent loop explain so.diff --git a/src/session_settings.zig b/src/session_settings.zigindex 3fe8a086..e2c8d506 100644--- a/src/session_settings.zig+++ b/src/session_settings.zig@@ -18,6 +18,7 @@ const main_mod = @import("main.zig");const agent_mod = @import("agent.zig");const http = @import("http.zig");const http_stall = @import("http_stall.zig");+const plugins = @import("plugins.zig");const ws = @import("ws.zig");const agent_ws = @import("agent_ws.zig"); // codex_ws_idle_ms override (#codex-ws)const agent_request = @import("agent_request.zig"); // GRAFF_REQ_STATS → g_req_stats (token-diet measurement)@@ -62,6 +63,7 @@ pub fn applyEnvKnobs(arena: Allocator, environ_map: anytype) !void {// user-installed companion at the same trust level as the skills// auto-detection above it, NOT arbitrary workspace config.main_mod.g_path_env = try arena.dupe(u8, environ_map.get("PATH") orelse "");+ plugins.applyEnv(environ_map);main_mod.g_codedb_guard = environ_map.get("GRAFF_NO_CODEDB_GUARD") == null; // issue #626 guard, opt-out via envmain_mod.g_force_stall_once = environ_map.get("GRAFF_FORCE_STALL_ONCE") != null; // #134 test seammain_mod.g_force_drop_once = environ_map.get("GRAFF_FORCE_DROP_ONCE") != null; // #132/#133 test seamdiff --git a/src/session_settings_tests.zig b/src/session_settings_tests.zigindex 257c7a00..97ef4706 100644--- a/src/session_settings_tests.zig+++ b/src/session_settings_tests.zig@@ -23,6 +23,7 @@ const no_local_tools = @import("no_local_tools.zig");const http = @import("http.zig");const ws = @import("ws.zig");const agent_ws = @import("agent_ws.zig");+const plugins = @import("plugins.zig");const Knob = struct { name: []const u8, value: []const u8 };@@ -48,6 +49,7 @@ const knobs = [_]Knob{.{ .name = "GRAFF_WS_DEBUG", .value = "1" },.{ .name = "GRAFF_WS_FORCE_FAIL_ONCE", .value = "1" },.{ .name = "GRAFF_WS_FORCE_FAIL_COUNT", .value = "3" },+ .{ .name = "GRAFF_NO_PLUGINS", .value = "1" },};/// A stand-in for the process environment that records which names were asked@@ -89,6 +91,7 @@ const Saved = struct {ws_debug: bool,ws_fail_once: bool,ws_fail_count: u8,+ plugins_off: bool,fn capture() Saved {return .{@@ -109,6 +112,7 @@ const Saved = struct {.ws_debug = ws.g_debug,.ws_fail_once = ws.g_force_connect_failure_once,.ws_fail_count = ws.g_force_connect_failure_count,+ .plugins_off = plugins.disabled,};}@@ -130,6 +134,7 @@ const Saved = struct {ws.g_debug = s.ws_debug;ws.g_force_connect_failure_once = s.ws_fail_once;ws.g_force_connect_failure_count = s.ws_fail_count;+ plugins.disabled = s.plugins_off;}};@@ -169,6 +174,7 @@ test "applyEnvKnobs actually applies the values it reads" {provider_mod.g_context_override = null;provider_mod.g_compact_pct_override = null;tool_handle.threshold_bytes = tool_handle.default_threshold_bytes;+ plugins.disabled = false;var asked: [knobs.len]bool = @splat(false);try session_settings.applyEnvKnobs(arena_state.allocator(), RecordingEnv{ .asked = &asked });@@ -187,4 +193,5 @@ test "applyEnvKnobs actually applies the values it reads" {try std.testing.expectEqual(@as(usize, 8192), tool_handle.threshold_bytes);try std.testing.expect(ws.g_force_connect_failure_once);try std.testing.expectEqual(@as(u8, 3), ws.g_force_connect_failure_count);+ try std.testing.expect(plugins.disabled);}diff --git a/src/session_start.zig b/src/session_start.zigindex 7fc3f065..be02598f 100644--- a/src/session_start.zig+++ b/src/session_start.zig@@ -401,7 +401,7 @@ pub fn initRegistryConsent(io: Io, gpa: Allocator, arena: Allocator, out: *Io.Wr// can carry chatter. With a global config `mcp_count > 0` in every project,// so an unguarded line here would corrupt the head of every --json run.const quiet = json_mode or flags.oneshot_prompt != null or environ_map.get("GRAFF_REPL_DEBUG") == null;- const merged = mcp_config.load(io, arena, Io.Dir.cwd(), mcp_config_path, global_path);+ const merged = mcp_config.load(io, arena, Io.Dir.cwd(), mcp_config_path, global_path, home);// #416: resolve eager-vs-deferred BEFORE anything connects, so the first// catalog render already knows which servers pay their schemas up front.mcp_schema_gate.configure(arena, merged, environ_map);diff --git a/src/skill_docs.zig b/src/skill_docs.zigindex d2ed4374..3bf8ad60 100644--- a/src/skill_docs.zig+++ b/src/skill_docs.zig@@ -6,8 +6,8 @@//! when they're on PATH). This module is the document-shaped kind, same layout//! Claude Code uses: `<dir>/<name>/SKILL.md` (or `<dir>/<name>.md`) with//! `name:`/`description:` frontmatter and a markdown body. Discovery is tiered-//! like fleet.zig's agent personas — bundled < personal < project — and-//! disclosure is progressive: only the descriptions ride in the system prompt+//! like fleet.zig's agent personas — bundled < personal < plugins < project —+//! and disclosure is progressive: only the descriptions ride in the system prompt//! (promptCatalog), while bodies stay on disk until the `skill` tool loads one//! (execSkill). Bundled skills teach writing more (skill-creator), MCP//! config (mcp-config), long-horizon control (jspace), and mid-session@@ -23,17 +23,20 @@ const tools = @import("tools.zig");const ToolOutput = tools.ToolOutput;// Only the settings-file location, never the approval session (#422 ratchet).const policy = @import("harness_policy.zig");+const plugins = @import("plugins.zig");pub const Source = enum {builtin,personal,project,+ plugin,pub fn label(self: Source) []const u8 {return switch (self) {.builtin => "bundled",.personal => "personal",.project => "project",+ .plugin => "plugin",};}};@@ -63,7 +66,7 @@ const desc_cap = 160; // per-skill description budget in the system prompt — t/// a schema.ToolSpec) so schema.zig's catalog needs one entry and no import/// cycle. The description must stay free of characters needing JSON escapes.pub const tool_name = "skill";-pub const tool_desc = "Load a skill: the full instructions for one kind of task, kept out of your context until you need them. The system prompt lists only skill names and descriptions, so call this to read the body BEFORE doing work a skill covers, then follow it. Omit name to list every available skill. Skills come from .harness/skills/ (this project), ~/.harness/skills/ (yours), .claude/skills/, plus bundled skill-creator, mcp-config, jspace, and workspace.";+pub const tool_desc = "Load a skill: the full instructions for one kind of task, kept out of your context until you need them. The system prompt lists only skill names and descriptions, so call this to read the body BEFORE doing work a skill covers, then follow it. Omit name to list every available skill. Skills come from .harness/skills/, ~/.harness/skills/, .claude/skills/, Claude/Grok/Codex plugin trees, plus bundled skill-creator, mcp-config, jspace, and workspace.";pub const tool_schema =\\{"type": "object", "properties": {"name": {"type": "string", "description": "Skill name to load; omit to list every available skill"}}};@@ -153,17 +156,21 @@ fn scan(io: Io, arena: Allocator, home: ?[]const u8) []const Skill {return list.items;}-/// bundled < ~/.claude/skills < ~/.harness/skills < .claude/skills <-/// .harness/skills. Each tier shadows the previous by name, so a project skill-/// wins over a personal one and both win over a bundled one.+/// bundled < personal dirs < user plugins < .claude/.grok/.codex/skills <+/// project plugins < .harness/skills. Each later tier shadows the previous by+/// name. Plugin trees are read in place (ADR 0007), not copied.fn collect(io: Io, arena: Allocator, home: ?[]const u8) std.ArrayList(Skill) {var list: std.ArrayList(Skill) = .empty;list.appendSlice(arena, &builtins) catch {};- if (home) |h| for ([_][]const u8{ compat_dir, ".codegraff/skills", project_dir }) |dir| {+ if (home) |h| for ([_][]const u8{ compat_dir, ".codegraff/skills", project_dir, ".grok/skills", ".codex/skills", ".agents/skills" }) |dir| {const path = std.fmt.allocPrint(arena, "{s}/{s}", .{ h, dir }) catch continue;loadDir(io, arena, &list, path, .personal);};+ for (plugins.skillDirs(io, arena, home, Io.Dir.cwd(), true)) |d| loadDir(io, arena, &list, d, .plugin);loadDir(io, arena, &list, compat_dir, .project);+ loadDir(io, arena, &list, ".grok/skills", .project);+ loadDir(io, arena, &list, ".codex/skills", .project);+ for (plugins.skillDirs(io, arena, home, Io.Dir.cwd(), false)) |d| loadDir(io, arena, &list, d, .plugin);loadDir(io, arena, &list, project_dir, .project);return list;}diff --git a/src/test_hooks.zig b/src/test_hooks.zigindex c6286e16..071a4b8c 100644--- a/src/test_hooks.zig+++ b/src/test_hooks.zig@@ -127,6 +127,7 @@ const peer_context_compact_test = @import("peer_context_compact_test.zig");const peer_inbox = @import("peer_inbox.zig"); // Claude-style list/inbox pullconst peer_target = @import("peer_target.zig"); // exact DM / goal targetingconst workspace_switch = @import("workspace_switch.zig"); // ADR 0006 mid-session worktree switch+const plugins = @import("plugins.zig"); // ADR 0007 in-place plugin / foreign MCP discovery// #345: the global-vs-project MCP config merge. mcp.zig does reference its// decls, but the hook makes the coverage explicit rather than contingent on@@ -259,6 +260,7 @@ test {_ = peer_inbox;_ = peer_target;_ = workspace_switch;+ _ = plugins;_ = shutdown_trace;_ = credential_store;_ = engine_events;