Repository navigation
Description
Epic: graph-2026-10-freeze Tier: judgment Execution: runner session (launches a nested Claude via launchctl; not inside a phase, #856)
Why
sequant init adds 66 files and about 23,000 lines for a newcomer to commit, 20,686 of them in .claude/skills (measured in the 2026-10-09 stranger smoke test, #1387). The cause is one upstream decision, not init:
- The Claude Code driver starts phase agents with
settingSources: ["project"](src/lib/workflow/drivers/claude-code.ts). Fix sequant run to use Claude Agent SDK #19 AC-3 chose it as the way to load skills ("Loads .claude/skills/"), not as an isolation boundary. - So phase agents see only the project's
.claude/skills/, never user or plugin skills. An installed plugin does not help. - Phase worktrees are checked out from git, so the skills must be committed (the doctor warning, fix(run): skills preflight validates the main checkout, not the worktrees agents run in (#813 follow-up) #933, fix(run): spec runs in the main checkout, which the skills pre-flight never checks — a stale checkout silently degrades spec (#933 regression) #1193, fix(adopt): missing-skills remedies contradict each other, and the README plugin path omits the skills that runs need #1201).
- Every adopter carries a copy that drifts. Skills changed 79 times since 2026-06-01, and each change needs
sequant syncin every project. Cleaning up untracked files silently deletes uncommitted skills.
#1209 made a minimal install cheaper but kept the commit requirement. Customization no longer needs committed skills: .claude/.local/skills/<name>/overrides.md already survives updates.
The candidate change
The Agent SDK's query() accepts plugins: [{ type: "local", path }] (docs: code.claude.com/docs/en/agent-sdk/plugins.md). The npm package already ships plugin/ (package.json files), so every install has a plugin directory at node_modules/sequant/plugin with skills/, hooks/ and the MCP launcher. Phase agents could load skills from there, the installed version, with nothing committed but the manifest.
Documented caveats: plugin skills are namespaced (/sequant:spec, not /spec), and the docs don't say whether settingSources: ["project"] filters a programmatically loaded plugin.
Spike (no merge needed)
In a scratch repo with no .claude/skills/, run one phase through a local driver change that passes plugins: [{ type: "local", path: <package>/plugin }]. Launch it outside any Claude session (launchctl submit, per #856). Answer each question below with evidence, and record the decision it implies.
Acceptance Criteria
- AC-1: Whether a plugin passed through
pluginsloads undersettingSources: ["project"], and whether a phase agent can invoke its namespaced skill (/sequant:spec <N>) to completion, including theSEQUANT_PHASEmarker. Evidence: the phase transcript excerpt and the SDK version, pasted in a comment. - AC-2: What else the loaded plugin brings into the phase agent: whether its hooks fire, and fire twice in a repo that also has
.claude/hooks/; and whether its MCP server starts, which would bypass the fix(mcp): phase agents receive the user's entire Claude Desktop config — capability over-grant + literal secrets in argv #936 phase-MCP allowlist. Evidence: hook log lines and the agent's MCP server list from the same run. - AC-3: Every place that invokes a skill by bare name and would need the
sequant:prefix, split intosrc/(phase prompts,phase-registry.ts) and skill text (which is frozen while the plugin directory review is open). Evidence: a grep and the list, in a comment. - AC-4: A recorded decision with its migration: (a) load skills from the package by default and make committed
.claude/skills/an opt-in override; (b) keep the commit model; or (c) a hybrid. Cover how existing projects with committed skills behave. Evidence: an ADR marked Proposed, plus follow-up issues for the chosen path.
Constraints
- Plugin freeze (since 2026-10-08): no merge may touch
plugin/,.claude/skills/ortemplates/skills/. The spike needs no merge. A rollout that edits skill text waits for the freeze to lift. - The Codex and opencode drivers read skills differently; the spike covers the Claude Code driver only and notes the others.
Related: #19, #933, #1201, #1209, #1387.
May touch
docs/adr/ (one new Proposed ADR), docs/adr/README.md, a local, unmerged driver change for the spike. The merge is docs-only.
Non-Goals
- Rolling out the change (it edits skill text; queued for after the freeze).
- Any edit under
plugin/,.claude/skills/ortemplates/skills/(plugin freeze, I-1 of the graph doc).
Activity
admarble commentedon Oct 9, 2026
Prior art: this root was found in July and patched site by site since. #813 (2026-07-26) named this exact cause: the user-scope plugin "bundles all skills" yet did not resolve
/specfor the phase agent, because ofsettingSources: ["project"](#19 AC-3). It chose a fail-fast preflight. Every issue since has patched a symptom of the same decision:doctorreported success with skills untrackedsyncsilently runs old committed skillsIf the spike lands on option (a), add to AC-4: list which of those guards (preflight, freshness check, doctor's skills-committed and untracked warnings) become dead code, and remove or narrow them in the follow-ups, so the fix doesn't leave seven layers of patches behind it.
docs(#1390): graph-2026-10-freeze founding doc, issue graph and as-fi…
admarble commentedon Oct 10, 2026
Spike evidence: AC-1, AC-2, AC-3 (runner session, 2026-10-10)
Setup. A local, unmerged driver change in a scratch worktree of
origin/main@c8762a2c:SEQUANT_SPIKE_PLUGINis set,query()getsplugins: [{ type: "local", path }]and the phase prompt's/specis rewritten to/sequant:spec.runSkillsPreflight. Without that, the run stops before spawning.system/initmessage is dumped to a file.The fixture is clones of a private fixture repo with
.claude/skills/removed (git rm, committed locally). The run wasnode <worktree>/dist/bin/cli.js run <N> --phases spec, launched bylaunchctl submitoutside any Claude session (#856).The plugin path is a copy of the repo's
plugin/(the treepackage.jsonfilesships). The only change is two probe hooks that append to a log, one onSessionStartand one prepended toPreToolUse.Versions:
@anthropic-ai/claude-agent-sdk0.3.289, Claude Codeclaude_code_version2.1.289 (from the init message), sequant 2.19.0 + spike diff.AC-1: yes, the plugin loads under
settingSources: ["project"]and/sequant:specruns to completionRun A2 used fixture issue 23, freshly filed so spec couldn't reuse an earlier plan:
init.pluginslists{"name":"sequant","source":"sequant@inline","version":"2.19.0"}.init.skillslists all 19sequant:*skills, and no barespec/exec/qa.… Run the /sequant:spec 23 workflow.The agent's first tool call wasSkill {"skill":"sequant:spec","args":"23"}, loaded from…/plugin/skills/spec.<!-- SEQUANT_PHASE: {"phase":"spec","status":"completed","timestamp":"2026-10-10T03:55:46Z"} -->and<!-- SEQUANT_SPEC: {"phases":["exec","qa"],"qualityLoop":false} -->.✔ #23 spec 3m 21s,1 passed.So
settingSources: ["project"]does not filter a programmatically loaded plugin.AC-2: plugin hooks fire and stack with repo hooks; the plugin's MCP server starts and bypasses the #936 allowlist
SessionStartfired once per session. PluginPreToolUsefired once per tool call (A2: 6 tool calls, 6 firings)..claude/settings.jsonregistering aPreToolUseprobe in.claude/hooks/. Both fired on every tool call:sequant inittoday),pre-tool.shandpost-tool.shwould run twice per tool call. The guard rules would block twice, and the timing and token logs would double-count.init.mcp_serversincludes{"name":"plugin:sequant:sequant","status":"connected","source":"plugin"}, launched fromplugin/.mcp.json(node mcp-launch.mjs [email protected]). It sits next to the driver-passedsequant(source: "dynamic"). It does not come throughgetPhaseMcpServersConfig, so the fix(mcp): phase agents receive the user's entire Claude Desktop config — capability over-grant + literal secrets in argv #936 allowlist doesn't see it.init.mcp_serversalready had the user's claude.ai connectors:claude.ai Gmailandclaude.ai Claude Docsconnected, and Drive, Calendar and Figma atneeds-auth. The fix(mcp): phase agents receive the user's entire Claude Desktop config — capability over-grant + literal secrets in argv #936 allowlist governs onlyoptions.mcpServers, so phase agents runningbypassPermissionson issue text currently hold the user's connected claude.ai tools. This is out of scope here, so it's raised separately.AC-3: bare-name invocations that would need
sequant:src/(not frozen):src/lib/workflow/phase-registry.ts:178,202,222,240,257,274,289,309,326: every phase prompt (Run the /spec {issue} workflow.and so on). This is the load-bearing one.src/lib/assess-comment-parser.ts:376-379: detects workflow lines withline.includes("/spec"),"/exec","/test","/qa"./sequant:specdoes not contain/spec, so a namespaced recommendation would be missed. This is a consumer as well as a producer.src/commands/init.ts:1314-1316: the "Next steps" text (/spec 123,/exec 123,/qa 123), which fix(onboarding): first-run papercuts from a stranger smoke test — doctor contradicts the README install, init omits the commit step, warning count and phase timer are off #1387 is also editing.src/lib/system.ts:107,114,120: skill name lists ("/test","/exec","/fullsolve", …).phase-executor.ts:1317,qa-stagnation.ts:122,282,run-reflect.ts:175,upstream/report.ts,bin/cli.ts:684,869.Skill text (frozen):
Skill(skill: "<name>")calls, all infullsolve/SKILL.md(:352spec,:465/:499exec,:571/:602test,:640/:690qa). Only 2 calls repo-wide are alreadysequant:-qualified./<skill>mentions across 19SKILL.mdfiles. Most are prose; the agent acts on them when it chains skills. Top files: fullsolve 93, qa 71, loop 45, exec 34, test 34.Name collision, measured: the plugin-only phase agent's
init.skillsalso lists Claude Code built-ins namedverifyandloop. Any bare/verifyor/loopleft in the prompts or skill text would go to the built-in, not sequant's (the #562 class). With committed skills (baseline run C),init.skillsshows oneloopand oneverifyentry. The project defines both, so the names collide today too; which source wins was not measured.AC-4 (the ADR) follows in a docs-only PR.
docs(#1388): ADR-0012 uses AC-4's option letters (a) and lists the gu…
admarble commentedon Oct 10, 2026
AC-4 follow-ups filed for ADR-0012 option (a), which the owner accepted on 2026-10-10. The ADR stays Proposed until #1397 verifies the skills-only view.
doctorreports each skill's source, and the fix(doctor/run):doctorandrun --dry-runreport success when nothing would work #1257 and fix(run): skills freshness is read from the working tree, but phases use committed skills — an uncommitted sync names the wrong version and silently runs old skills #1354 guards narrow to committed skills.initwriting.claude/skills/(after the freeze).Raised separately from the spike baseline: #1396 (phase agents receive claude.ai connectors outside #936).
docs(#1388): ADR-0012 (Proposed) — load phase skills from the install…
admarble commentedon Oct 10, 2026
All ACs met. AC-1–3: spike evidence in the comment above. AC-4: ADR-0012 (Proposed) merged in #1392, with option (a) accepted by the owner on 2026-10-10. Follow-ups #1397–#1400 are filed, and #1397 gates the rest.