Skip to content

fix(plugin): ship a slim ./plugin folder — the repo-root plugin pulls ~700 MB of dev dependencies into every install and fails directory review limits #1265

Closed

Description

@admarble

Tier: judgment Found: 2026-10-01, checking the plugin ahead of directory resubmission (the Console form we submitted through on 2026-08-30 is retired).

Problem. The plugin is the whole dev repo: .claude-plugin/marketplace.json has "source": "./".

  • Every install and update fetches about 700 MB that nothing uses. Claude Code runs the dependency install "only when the plugin's root directory contains both a package.json and a supported lockfile", as npm ci --ignore-scripts with dev deps included, and "you can't turn the automatic install off. No setting or environment variable disables it" (loading docs).
  • Directory review would hold it (pre-submission checklist):
    • 1,079 files, against a limit of 512.
    • 6 non-image files over 256 KiB.
    • "Dependencies install from a lockfile".
    • 4 tracked symlinks.
  • Shipped content has drifted from its sources.

Upstream offers no escape hatch (verified in the marketplace reference and the loading docs):

  • There is no exclude or ignore field.
  • git-subdir is for "some other repository"; a same-repo subfolder uses a relative path.
  • sparsePaths only trims the user's marketplace clone.
  • Moving package.json would break the CLI.

So the layout is the lever.

Design history. source: "./" dates from the first plugin commit (ba84547, #185). #476 confirmed it on layout grounds only. #988 picked "(a) keep ./" over "(b) point source at the prepared dist directory" because (a) was smaller. Install size was never weighed.

Decision

"source": "./plugin": a committed folder holding .claude-plugin/plugin.json, skills/, hooks/ (with hooks.json), .mcp.json, memory/constitution.md, README.md and LICENSE, and no package.json.

  • Identity is unchanged. The install id is <entry name>@<marketplace name>, so sequant@sequant survives the move.
  • Not symlinks. The loader rejects a "symlink that leads outside the plugin", so the folder holds real files.
  • Generated, not hand-copied. plugin/hooks/ comes from templates/hooks/, plugin/memory/ from templates/memory/, and plugin/skills/ from templates/skills/ (root skills/ is identical today).
  • Root copies. The root memory/constitution.md stays as this repo's own constitution. The root .mcp.json stays, because it is also this repo's project MCP config. Root skills/ and hooks/ are retired once nothing reads them.
  • scripts/prepare-marketplace.ts is not a usable base. Its dist output has no hooks.json (no hooks would register), no memory/, and a flat .mcp.json shape. Retire it, or rebuild it to emit plugin/.

AC

  • AC-1: marketplace.json lists "source": "./plugin", and installing from the marketplace creates no node_modules in the plugin cache. Evidence: a gate test in plugin-install-test.yml that installs into an isolated CLAUDE_CONFIG_DIR + CLAUDE_CODE_PLUGIN_CACHE_DIR and asserts <cache>/sequant/sequant/*/node_modules is absent, mutation-verified by adding package.json + package-lock.json to plugin/
  • AC-2: plugin/ has ≤ 512 files, no non-image file over 256 KiB, and no symlinks, .DS_Store or Thumbs.db. Evidence: a gate test in plugin-install-test.yml that counts and stats plugin/, mutation-verified by adding a 300 KiB text file
  • AC-3: plugin/hooks/*.sh, plugin/skills/** and plugin/memory/constitution.md are byte-identical to their templates/ sources, and the sync script regenerates them. Evidence: a gate test in the hook-sync / skill-sync suite, mutation-verified by editing one line of plugin/hooks/post-tool.sh
  • AC-9: Owner decision 2026-10-01: before plugin/memory/constitution.md is generated, templates/memory/constitution.md gains the producer-parity row that only the root copy has today ("One producer per artifact; a second producer needs a parity test on every field and a recorded reason", feat(spec): Design Review stops on recurrence and lists producers; spec can halt before exec when the AC's lever is wrong #1250), and the DoD/drift checks pass with it. Evidence: diff <(grep -n 'One producer per artifact' memory/constitution.md | cut -d: -f2-) <(grep -n 'One producer per artifact' templates/memory/constitution.md | cut -d: -f2-) is empty, plus npx vitest run scripts/check-constitution-dod.test.ts
  • AC-4: plugin/README.md (≥ 40 words outside code blocks) and plugin/LICENSE exist. The README discloses everything the plugin runs, sends or fetches: npx sequant@<version> from npm, the git/gh calls in hooks and skills, the opt-in CLAUDE_HOOKS_WEBHOOK_URL curl, and the files it writes. Evidence: test -f plugin/LICENSE, plus QA checks the disclosure list against plugin/hooks/*.sh and plugin/.mcp.json
  • AC-5: Existing users upgrade in place. Going from 2.18.0 to the release carrying this change with claude plugin update sequant@sequant keeps the id, and skills, hooks and the MCP server load. Evidence: a CI step that installs 2.18.0 from its tag, updates, and runs claude plugin details sequant
  • AC-6: Release and pin tooling follows the new folder: release.sh, src/lib/plugin-version-sync.ts, scripts/plugin-mcp-pin.test.ts (it hard-codes root .mcp.json at :69), scripts/generate-mcp-launch-inline.mjs, check-skill-sync.ts, lint-skill-calls.ts, the .gitignore:38-40 bare .mcp.json pattern (it would swallow plugin/.mcp.json), and package.json files. Evidence: npm test and npm run lint:skill-sync && npm run lint:skill-calls pass, and a dry run of the release version stamp updates plugin/.claude-plugin/plugin.json and plugin/.mcp.json
  • AC-7: claude plugin validate --strict passes on plugin/ and on the marketplace. Evidence: claude plugin validate --strict ./plugin && claude plugin validate --strict . in CI
  • AC-8: (human-required) The developer portal's Validate at claude.ai/directory/manage, run on sequant-io/sequant folder plugin, reports no Blocking findings. The PR lists each remaining Policy hold with a one-line reason. Expected holds: "Scripts the validator couldn't follow" for the hook scripts (the subfolder rule), "MCP server command wasn't read" (the node -e launcher), and "Runs a pinned npx package". Evidence: the portal findings pasted in the PR body by the owner (needs a claude.ai login)
  • AC-10: Owner decision 2026-10-01, reversing fix(mcp): plugin MCP server dies with CONNECTION_CLOSED when the open project has an older sequant in node_modules — npx ignores the pin and runs the local copy #1084 AC-2 for the plugin copy only: plugin/.mcp.json runs node ${CLAUDE_PLUGIN_ROOT}/mcp-launch.mjs sequant@<version>, with plugin/mcp-launch.mjs byte-identical to scripts/mcp-launch.mjs (synced by npm run mcp-launch:inline). Root .mcp.json and templates/mcp.json stay inline. Reason: the developer portal blocks v2.18.0 with "MCP server config couldn't be fully checked" (the inline command has over 1,024 parts), and the inline form existed only because root .mcp.json doubled as this repo's project config. Evidence: npx vitest run scripts/plugin-mcp-pin.test.ts (the "fix(plugin): ship a slim ./plugin folder — the repo-root plugin pulls ~700 MB of dev dependencies into every install and fails directory review limits #1265: shipped plugin .mcp.json runs the launcher file" block), mutation-verified by restoring the inline args in plugin/.mcp.json

Non-Goals

Owner checklist (after merge + release)

  • Withdraw the 2026-08-30 submission at platform.claude.com/plugins/submissions (no Withdraw button → email [email protected]). Until then the portal can refuse the repo with "Already submitted by another organization".
  • Resubmit at claude.ai/directory/manage → Submit new → Plugin bundle → repo sequant-io/sequant, folder plugin.

Graph metadata

May touch

  • new plugin/ tree; .claude-plugin/marketplace.json; root skills/, hooks/ (retired)
  • scripts/sync-hooks.sh, scripts/check-skill-sync.ts, scripts/lint-skill-calls.ts, scripts/prepare-marketplace.ts, scripts/release.sh, scripts/plugin-mcp-pin.test.ts, scripts/generate-mcp-launch-inline.mjs, src/lib/plugin-version-sync.ts
  • .github/workflows/plugin-install-test.yml, .gitignore, package.json
  • skills/setup/SKILL.md and skills/exec/SKILL.md ${CLAUDE_PLUGIN_ROOT} paths, if the layout under plugin/ changes them

Activity

  1. added
    bug
    on Oct 1, 2026
  2. admarble commented on Oct 1, 2026

    @admarble
    ContributorAuthor

    Run context (2026-10-01). Read before exec.

  3. admarble commented on Oct 1, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (8 ACs, 8 directories). AC quality check: all 8 pass lint. Scope verdict: SCOPE_SPLIT_RECOMMENDED, overridden to stay one issue — all 8 AC gate one atomic decision (commit a plugin/ folder as the marketplace source), and splitting would strand AC-7's validator gate from AC-3/AC-6's prerequisite tooling.

    Blocked by #1263 and #1264 (both OPEN) — do not start exec until they merge.

    Plan: (1) scaffold plugin/ + extend sync-hooks.sh/check-skill-sync.ts to generate it from templates/; (2) flip marketplace.json's source to ./plugin and fix the one genuinely hardcoded path in plugin-mcp-pin.test.ts (#1084 block, not the #988 block — that one already resolves dynamically) plus release.sh's version-stamp coverage; (3) wire the plugin-install-test.yml gates for AC-1/2/5/7, and defer deleting root hooks//skills/ to a follow-up PR so the revert path stays one line.

    Design note: this is a third leg of the existing templates/ → mirror pattern (already repatched in #645, #738) — in-class, not a fresh recurrence. One live gap found en route: memory/constitution.md vs templates/memory/constitution.md already disagree by the #1250 producer-parity row; recommend backporting it before it ships as plugin/memory/constitution.md (see Open Questions in the full plan).

    ADR required: docs/adr/0006-slim-plugin-folder.md, recording the three options in the issue's own Decision section.

    Recommended: exec → qa, quality loop enabled, no testgen (every AC already names its exact gate-test target).

  4. added
    planned
    on Oct 1, 2026
  5. admarble commented on Oct 1, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #1265

    Reviewed feature/1265-… at b1504df4 (8 commits, 0 behind origin/main, no PR opened yet, so CI has not run).

    AC Coverage

    AC Status Notes
    AC-1 PENDING marketplace.json source is ./plugin; plugin/ has no package.json. The gate step in plugin-install-test.yml is there but CI hasn't run (no PR). No SEQUANT_MUTATION marker yet.
    AC-2 MET (locally) / PENDING (CI) 58 files, no files over 256 KiB, no symlinks, no .DS_Store/Thumbs.db. The gate step is wired. No mutation marker yet.
    AC-3 PARTIALLY_MET plugin/hooks/*.sh is byte-gated by hook-sync.test.ts. Mutation-checked: appending a line to plugin/hooks/post-tool.sh failed exactly that case. plugin/skills/** is gated by lint:skill-sync. plugin/memory/constitution.md has no gate and no generator. Appending a line to it left hook-sync.test.ts, check-constitution-dod.test.ts and lint:skill-sync all green, and neither sync-hooks.sh nor check-skill-sync.ts --fix regenerates it. It is byte-identical today, but only by hand.
    AC-9 MET The AC's diff command is empty and check-constitution-dod.test.ts passes.
    AC-4 PARTIALLY_MET plugin/LICENSE exists and the README has ≥ 40 words. The disclosure list is incomplete or wrong against plugin/hooks/*.sh: (1) it omits that post-tool.sh runs the project's local node_modules/.bin/prettier on edited files, on by default (around :227); (2) it omits the opt-in CLAUDE_HOOKS_SMART_TESTS=true → npm test (:324/:371); (3) it says logs go to ~/.sequant/logs/, but under the plugin post-tool.sh:68-69 writes to $CLAUDE_PLUGIN_DATA/logs first, with $TMPDIR as the fallback (lock files go there too); (4) it calls memory/constitution.md "this repository's own project constitution", but it is the templates/ copy.
    AC-5 NOT_MET The upgrade-test job can't pass as written. It does git worktree add "$CLONE_DIR" v2.18.0, then rm -rf "$CLONE_DIR", then git worktree add "$CLONE_DIR" HEAD. Git refuses the second add: fatal: '<dir>' is a missing but already registered worktree (exit 128, reproduced locally). Use git worktree remove --force / git worktree prune, or a fresh path. Two smaller points: the skill-load check only warns when it fails, and nothing checks that the MCP server loads, though the AC requires it.
    AC-6 PARTIALLY_MET Done: release.sh (plugin.json stamp), plugin-mcp-pin.test.ts (resolves the path from source), check-skill-sync.ts, lint-skill-calls.ts, and the .gitignore anchor /.mcp.json. Not touched: src/lib/plugin-version-sync.ts still checks only root .claude-plugin/plugin.json. scripts/generate-mcp-launch-inline.mjs --write still rewrites only root .mcp.json, so after a launcher change npm run prepare:marketplace leaves plugin/.mcp.json's inline source stale, and the #1084 pin test fails at release time. package.json files is unchanged. Both AC-named lints pass. The full npm test was not run here; CI owns it.
    AC-7 MET (locally) / PENDING (CI) claude plugin validate --strict ./plugin and claude plugin validate --strict . both print "Validation passed". The CI step is wired.
    AC-8 PENDING Human-required: portal findings need the owner's claude.ai login.

    Verification run

    • npm run lint:skill-sync: 47 synced, 0 diverged. npm run lint:skill-calls: no violations.
    • npx vitest run hook-sync.test.ts plugin-mcp-pin.test.ts check-constitution-dod.test.ts: 32/32 pass.
    • npm run build: pass. bash scripts/sync-hooks.sh: already in sync.
    • cmp: plugin/.mcp.json = root .mcp.json; plugin/hooks/hooks.json = hooks/hooks.json; plugin/.claude-plugin/plugin.json = root.
    • Quality: 0 any added, 0 deleted tests. Sub-agent quality checks were not spawned; the inline checks were scoped to the hand-written diff, since plugin/ is generated copies (about 20.7k of 23.7k added lines).

    Mutation Verification

    AC-1, AC-2 and AC-3 are gate-test ACs. Missing: there is no PR body, so there are no SEQUANT_MUTATION markers. AC-3's hook case was mutation-checked here (above). AC-1 and AC-2 run only in CI.

    Risk Assessment

    Trust-Boundary Check

    Status: Clean. The diff implements only the product requirements; no agent-directed instruction from issue or comment text was acted on.

    Behavior-Rule Survival / Declared-Evidence

    Declared evidence: Incomplete. AC-1, AC-5 and the CI half of AC-7 are unexecuted until a PR triggers CI. npm test was not run here.

    CHANGELOG

    The [Unreleased] → Fixed entry is present with (#1265). ADR-0006 was added and indexed.

    Adversarial Re-Read

    Gaps found (all listed above): the AC-5 worktree re-add bug, which I reproduced; the ungated plugin/memory; three AC-6 files untouched; the AC-4 disclosure omissions. HEAD is a wip checkpoint commit with no content. Non-goals did not creep in; root skills/ and hooks/ are deferred to a follow-up, as the CHANGELOG says.

    Verdict: AC_NOT_MET

    Next Steps

    1. Fix upgrade-test's second git worktree add: prune or remove first, or use a new path. Make the skill and MCP load checks fail instead of only warning.
    2. Add templates/memory/constitution.md → plugin/memory/constitution.md to a sync script, and add a byte-identity test for it. Mutation-verify the test.
    3. Point generate-mcp-launch-inline.mjs --write at plugin/.mcp.json too (or resolve it from source). Extend plugin-version-sync.ts to cover plugin/.claude-plugin/plugin.json. Decide on package.json files.
    4. Correct and complete the plugin/README.md disclosure: local prettier, opt-in npm test, $CLAUDE_PLUGIN_DATA / $TMPDIR log paths, and which constitution it ships.
    5. Open the PR with SEQUANT_MUTATION markers for AC-1, AC-2 and AC-3, then let CI run.
  6. added
    needs-work
    on Oct 1, 2026
  7. admarble commented on Oct 1, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_NOT_MET

    AC coverage: 3/5 met

  8. added 2 commits that reference this issue on Oct 1, 2026
  9. admarble commented on Oct 1, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_NOT_MET

    AC coverage: 6/7 met

    Gaps:

    • AC-5 upgrade job hard-fails in CI because the skill-load check needs auth
    • AC-4 disclosure misdescribes the shipped constitution (carry-over from iteration 1)
    • AC-4 file-write disclosure contains a false completeness claim
    • Gate-test mutation records missing
    • CHANGELOG contradicts the issue's decision on root .mcp.json
    • Owner must paste portal findings
    • The AC-5 auth failure (above).
    • The AC-4 README accuracy problems (above).

    Suggestions:

    • The CHANGELOG says root .mcp.json "is retired in a follow-up PR". The issue says root .mcp.json stays, because it is also this repo's project MCP config.
    • plugin/hooks/hooks.json is copied from root hooks/hooks.json, but no test checks that copy.
    • Root .mcp.json is no longer stamped at release (only plugin/.mcp.json is), so its pin will fall behind the package version.
  10. added a commit that references this issue on Oct 1, 2026
  11. admarble commented on Oct 1, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_NOT_MET

    AC coverage: 7/8 met

    Gaps:

    • AC-5 upgrade gate is vacuous: v2.18.0 tag and HEAD share version 2.18.0, so plugin update is a no-op and post-update checks run against the old repo-root install
    • Post-upgrade cache check cannot distinguish old vs new layout; should assert new version dir and absence of package.json/node_modules
    • Owner must paste directory portal Validate findings into the PR
    • Mutation-marker classifier marks AC-1/AC-2 workflow-step gate tests test_not_in_diff although the file is in the diff; tooling follow-up
  12. added 4 commits that reference this issue on Oct 1, 2026
  13. added 3 commits that reference this issue on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-workplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions