Repository navigation
Closed
Labels
needs-improvementAC met but improvements recommendedplannedImplementation plan approvedrefactorCode refactoring
Description
Tier: mechanical Found: 2026-10-01, #1265 spec, which deferred this to keep that PR revertible with a one-line source flip.
Problem. Once #1265 makes plugin/ the shipped plugin (marketplace.json "source": "./plugin", generated from templates/), the root hooks/ and skills/ trees are dead copies.
- Root
skills/is the third mirror thatscripts/check-skill-sync.ts:40-42andscripts/lint-skill-calls.ts:55enforce. Every skill edit has to be made three times, andplugin/skills/would make it four. - Root
hooks/is hand-maintained, outsidescripts/sync-hooks.sh, and had already drifted fromtemplates/hooks/(missing the relay-check and coverage blocks; it still carriednpx prettierafter fix(hooks): post-tool hook downloads and runs the latest prettier via npx in every project that doesn't have it #1264). - CI tests the dead copy.
.github/workflows/plugin-install-test.ymlstill tests the root copies: path filters at:9-10,19-20, the skill scan at:171-199, andbash -nand the mock-input runs at:295-397.
AC
- AC-1: Root
skills/andhooks/are deleted.check-skill-sync.tsandlint-skill-calls.tsscanplugin/skillsin place ofskills. Evidence:test ! -e skills && test ! -e hooks, plusnpm run lint:skill-sync && npm run lint:skill-calls - AC-2: Every check in
plugin-install-test.ymlthat ran against roothooks/orskills/runs againstplugin/hooks/andplugin/skills/, and the path filters nameplugin/**. Evidence:grep -nE "(^|[ '\"])(hooks|skills)/" .github/workflows/plugin-install-test.ymlmatches onlyplugin/-prefixed paths, and the workflow passes on the PR - AC-3: No doc, script or skill outside
templates/,.claude/andplugin/refers to rootskills/<name>/SKILL.mdorhooks/*.shas a live path. Evidence:git grep -nE "(^|[^a-z/._-])(skills/[a-z-]+/SKILL\.md|hooks/[a-z-]+\.sh)" -- . ':!templates' ':!.claude' ':!plugin' ':!CHANGELOG.md' ':!docs/adr'matches only historical references, each reviewed in QA - AC-4: The
.agents/skillssymlink (→../.claude/skills) is unaffected and still resolves. Evidence:test -f .agents/skills/qa/SKILL.md
Non-Goals
- Changing
templates/or.claude/mirroring. - Rewriting CHANGELOG or ADR history that names old paths.
Graph metadata
May touch
skills/,hooks/(deleted);scripts/check-skill-sync.ts,scripts/lint-skill-calls.ts,scripts/prepare-marketplace.ts;.github/workflows/plugin-install-test.yml; docs underdocs/features/that cite root skill paths
Metadata
Metadata
Assignees
Labels
needs-improvementAC met but improvements recommendedplannedImplementation plan approvedrefactorCode refactoring
Activity
admarble commentedon Oct 4, 2026
Runner context (2026-10-04, main @ eecbb12, after #1276, #1287 and #1295 merged) — read before spec and exec
1. The blast radius is much larger than "May touch". About 40 files name the root
skillstree as a mirror root (git grep -lE '^[[:space:]]*"skills",?' -- '*.ts'):SKILL_ROOTSarrays:src/lib/__tests__/*-skill.test.ts,__tests__/integration/*skill*.integration.test.ts,src/lib/__tests__/skill-allowed-tools-gate.test.ts(fix(skills): narrow broad allowed-tools grants — bare Bash, Bash(*), and runner wildcards hold the directory listing for review #1287),src/lib/workflow/mutation-marker-6i-skill.integration.test.ts(fix(qa): §6i mutation markers naming a CI workflow step always classify test_not_in_diff — the diff list only greps .test./.spec. files #1276).scripts/generate-constitution-dod.ts+scripts/check-constitution-dod.test.ts,scripts/lint-skill-gates.ts,scripts/spec/ground-check.test.ts.hooks/is read bysrc/lib/workflow/token-utils.test.ts:466-485(hooks/capture-tokens.shbyte-identity,hooks/hooks.jsonSessionEnd registration).plugin-install-test.yml:363-465runsbash -nand the mock-input runs onhooks/*.sh.bin/cli.ts(--only skills),src/commands/*, which create.claude/skillsin fixtures. Check each match before editing it.2. Producers: this is a design question, not 40 edits. The list of skill mirror roots has one real owner,
scripts/check-skill-sync.ts:37-47(SOURCE_DIR+ the mirror list). Every gate test re-declares it by hand, and the copies already disagree:fullsolve-merge-gate-skill.test.tshas noplugin/skills. The recommended shape:check-skill-sync.ts, or a tiny shared module next to it;skillsthere once.That costs the same number of file edits as removing
"skills"from each array by hand, and it ends the drift class. If spec judges the shared-constant refactor out of scope for a mechanical issue, stop and surface it. Don't silently pick the per-array edit. The owner will rule. If the ruling is to stay local, record it as "deliberately local, class tracked in #N".3. Mirror direction.
.claude/skillsis canonical.npm run sync:skillswritestemplates/skills,skillsandplugin/skillsfrom it. After deleting rootskills/, the sync must no longer recreate it (check-skill-sync.ts --fix). AC-1'snpm run lint:skill-syncwill show this.4. AC-2 is a workflow-step gate. As of #1276,
/qa§6i counts a changed.github/workflows/*.ymlas a gate-test file. ASEQUANT_MUTATIONmarker'sfailedTestmay therefore start with.github/workflows/plugin-install-test.yml > …. Note thatplugin-install-test.yml:256changed in #1296: it now validates.claude-plugin/marketplace.json, not.. Keep that line.5. exec and qa phases: do not run the full
npm test. It runs past the 30-minute phase wall. Run only:npx vitest run <files>),npm run lint:skill-sync,npm run lint:skill-calls,npx tsc --noEmit,in the foreground, and commit WIP every ~10 minutes. CI runs the full suite.
admarble commentedon Oct 4, 2026
Complexity: Complex (4 ACs + 3 derived, ~8 directories) —
refactorlabelAC Quality Check
lintAcceptanceCriteria: all 4 ACs pass. Every AC carries a parseableEvidence:clause (AC-1/2/4 → unit_test, AC-3 → integration_test). Each command-shapedEvidence:was run againstmain@ eecbb12:test ! -e skills && test ! -e hooksfailsplugin/linesclaude --plugin-dir .(plugin-install-test.yml:267), which loads the repo root as a plugin. With the root trees gone, that root has no skills or hooks. See derived AC-7.docs/internal/graph-2026-09/issues/*,docs/investigations/*)Gap the ACs don't cover: root
hooks/hooks.jsonis not a dead copy. It is the producer ofplugin/hooks/hooks.json:scripts/sync-hooks.sh:55-63copies root → plugin, andsrc/lib/relay/__tests__/hook-sync.test.ts:90asserts byte-identity against root. If AC-1 deletes it as written, the sync silently stops and the parity test fails with ENOENT. See derived AC-5.Scope Assessment
Non-Goals: templates/ and .claude/ mirroring unchanged; CHANGELOG and ADR history not rewritten.
scripts/,src/lib/__tests__,__tests__/,src/commands,.github/workflows,docs/, rootskills/+hooks/deleted)skills(most are gate tests with a hand-writtenSKILL_ROOTS); 6 name roothooks/Verdict:⚠️ SCOPE_WARNING. The edit count is large but mechanical, and one shared constant collapses most of it. Quality loop on.
Acceptance Criteria
AC-1: Root
skills/andhooks/deleted; sync + call-lint scanplugin/skillsVerification: Integration Test (CLI)
Scenario: Given the trees are deleted → When
npm run lint:skill-sync && npm run lint:skill-callsandnpm run sync:skills→ Then both pass, and--fixdoes not recreateskills/.Assumptions:
MIRROR_DIRS/DIR_LABELS(check-skill-sync.ts:37-47) andSCAN_DIRS(lint-skill-calls.ts:55) both lose"skills".plugin/skillsis already in both.AC-2:
plugin-install-test.ymltestsplugin/onlyVerification: Integration Test (the workflow runs on the PR)
Scenario: Given the PR → When the workflow runs → Then
paths:(:9-10,:20-21) drophooks/**andskills/**(plugin/**is already present); the skill scan (:212) iteratesplugin/skills/*/;bash -n, the hooks.json validation and the mock-input runs (:363-465) useplugin/hooks/*.Assumptions: Keep
:256(.claude-plugin/marketplace.jsonvalidate, #1296) andmarketplace add ./(the marketplace lives at root). This is a workflow-step gate: per #1276, aSEQUANT_MUTATIONfailedTestmay start with.github/workflows/plugin-install-test.yml > ….AC-3: No live root-path references outside templates/.claude/plugin
Verification: Integration Test (
git grep) + QA review of each hitLive references to fix:
__tests__/{pre-tool-hook,hook-corpus,plugin-staleness-warning}.integration.test.ts(HOOK_COPIES: root →plugin/hooks/pre-tool.sh);src/lib/workflow/token-utils.test.ts:471,484(→plugin/hooks/...);scripts/check-constitution-dod.test.ts:41;scripts/spec/ground-check.test.ts:66,238;src/lib/__tests__/assess-skill.test.ts:21.docs/features/skill-cli-drift-prevention.md:62,docs/internal/plugin-path-audit.md.src/lib/assess/types.ts:17,src/commands/assess-render.ts:6,scripts/sync-hooks.sh:17-20,check-skill-sync.ts:3-13header.Historical (leave, QA confirms):
docs/internal/graph-2026-09/issues/*,docs/investigations/*,__tests__/fixtures/hook-corpus.jsonl, the tautology-detector corpus strings, and.sequant/upstream/baseline.json.False positives (fixture or consumer
.claude/skills):bin/cli.ts,src/commands/{init,sync,status}.ts,src/lib/templates.ts.AC-4:
.agents/skillssymlink still resolvesVerification: Unit Test (
test -f .agents/skills/qa/SKILL.md). Untouched, because it points at.claude/skills.Derived AC-5:
plugin/hooks/hooks.jsonbecomes the hand-maintained sourceVerification: Unit Test
Scenario: Given root
hooks/is gone → Whennpm run sync:hooks→ Then it runs clean, with no root read.sync-hooks.sh:55-63is removed. Inhook-sync.test.ts:90, the root-vs-plugin byte-identity test is replaced by a structural check: every scriptplugin/hooks/hooks.jsonregisters exists inplugin/hooks/. That keeps a gate on the manifest after its only parity check goes away. Mutation-verify it.Rejected:
templates/hooks/hooks.json.templates/hooks/*is copied into consumer.claude/hooks/bysync-hooks.sh/sequant init, so the manifest would ship to every consumer.Derived AC-6: One exported list of skill mirror roots (class fix)
Verification: Unit Test
Scenario:
check-skill-sync.tsexportsSKILL_SOURCE_ROOT+SKILL_MIRROR_ROOTS(repo-relative strings). It is already import-safe:main()is guarded at:203, and 13 tests already importcollectFilesfrom it. Every gate test and script that re-declares the list imports it instead.Evidence:
git grep -nE '^\s*"skills",?$|\[[^]]*"skills"' -- '*.ts'returns no mirror-root arrays (QA classifies any remaining fixture hits).Exceptions (keep local, delete
"skills"only):lint-skill-gates.ts:62andgenerate-constitution-dod.ts:35-37are first-match precedence lists that also run in consumer layouts, not mirror lists.Derived AC-7: the
--plugin-dirsmoke step loadsplugin/plugin-install-test.yml:267claude --plugin-dir .→--plugin-dir ./plugin(plus the echo on:265).Implementation Plan
Phase 1: Single owner for the mirror list (AC-6, AC-1)
scripts/check-skill-sync.ts, exportSKILL_SOURCE_ROOT = ".claude/skills"andSKILL_MIRROR_ROOTS = ["templates/skills", "plugin/skills"]. DeriveMIRROR_DIRS/DIR_LABELSfrom them, and update the header comment ("three-directory" → source + 2 mirrors).scripts/lint-skill-calls.ts, setSCAN_DIRS = [SKILL_SOURCE_ROOT, ...SKILL_MIRROR_ROOTS].SKILL_ROOTS/MIRROR_ROOTS/SCAN_ROOTSinsrc/lib/__tests__/*-skill*.test.ts,__tests__/integration/*skill*.integration.test.ts,__tests__/canary/downstream.integration.test.ts,src/lib/workflow/mutation-marker-6i-skill.integration.test.ts,scripts/*.test.ts,src/lib/{qa,assess}/*.test.tsandsrc/lib/stacks.no-npm-fallback-gate.test.tsto import the constant. Check eachgit grephit before editing it.fullsolve-merge-gate-skill.test.ts:28currently lacksplugin/skills, and the import fixes that."skills"from the precedence lists inlint-skill-gates.tsandgenerate-constitution-dod.ts, pluscheck-constitution-dod.test.ts:41.Phase 2: hooks (AC-5, AC-3 hook tests)
hooks.jsoncopy fromsync-hooks.shand rewrite its header. Replacehook-sync.test.ts:90with the registration-integrity check.HOOK_COPIESin the 3 pre-tool integration tests andtoken-utils.test.ts:466-485atplugin/hooks/. Note: rootpost-tool.shhad already drifted (no relay-check,npx prettier). Repointing to the generated copy is the fix, not a regression.Phase 3: delete + CI + docs (AC-1, AC-2, AC-3, AC-7)
git rm -r skills hooks. Then runnpm run sync:skillsandnpm run sync:hooks, and confirm neither recreates them.plugin-install-test.ymlper AC-2 and AC-7.Verification for exec and qa (runner instruction, do not run full
npm test):npx vitest run <touched test files>npm run lint:skill-sync && npm run lint:skill-calls && npm run lint:skill-gates && npx tsc --noEmitbash scripts/sync-hooks.shCommit WIP every ~10 minutes. CI runs the full suite.
Design Review
scripts/check-skill-sync.ts, which already defines source → mirror direction and already exportscollectFiles/EXCLUDEto 13 tests. The hooks manifest belongs toplugin/hooks/hooks.jsonitself: it has no template and only the plugin consumes it."skills"from ~25 arrays by hand.templates/hooks/hooks.json(it would leak to consumers).plugin/skillsfile by file. Several test comments still record "the denominator grew from 3 to 4". 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 also missedfullsolve-merge-gate-skill.test.ts.check-skill-sync.ts/lint-skill-calls.ts) is the site the class fix centres on..claude-plugin/plugin.jsontoo?" It is out of scope./releasebumps it, and marketplacesourcealready points at./plugin. See Open Questions.claude plugin marketplace add ./still work?" Yes. It reads.claude-plugin/marketplace.json, which stays.skills/. Producer:check-skill-sync.ts --fix. Consumers:lint-skill-calls.ts,lint-skill-gates.ts,generate-constitution-dod.ts, ~50 gate tests,plugin-install-test.yml:212. It is not shipped: package.jsonfileslistsplugin, notskills, andprepare-marketplace.tscopiestemplates/skills.hooks/*.sh. No producer (hand copies, already drifted). Consumers: 4 tests andplugin-install-test.yml:363-465.hooks/hooks.json. Producer: hand-edited. Consumers:sync-hooks.sh(→ plugin),hook-sync.test.ts,token-utils.test.ts:484,plugin-install-test.yml:373. Moving to a single owner inplugin/hooks/leaves one producer.ADR required: the plan picks between designs (shared constant vs per-array edits; where the hooks manifest lives). The exec PR adds
docs/adr/NNNN-retire-root-plugin-mirrors.md(next number; shape perdocs/adr/README.md).Feature Quality Planning
Notable items:
failedTeststarts with.github/workflows/plugin-install-test.yml > ….plugin/hooks/thathooks.jsonregisters. The newhook-sync.test.tscase fails.skills/**removed, a.claude/skills-only edit no longer triggersplugin-install-test.yml. Add'templates/skills/**'and'templates/hooks/**'topaths:, becauseplugin/is generated from them (the edits land inplugin/**anyway after sync, but the template is the real input).Derived ACs
plugin/hooks/hooks.jsonis the source; sync stops reading root; registration-integrity testSKILL_SOURCE_ROOT/SKILL_MIRROR_ROOTS; gate tests import it--plugin-dir ./pluginOpen Questions
mechanicalissue to ~50 files. Recommendation: do it (runner comment §2; ≥2 prior re-patches). If the owner rules otherwise, record "deliberately local, class tracked in #N" and file the follow-up. Impact if wrong: the next mirror change repeats 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's miss..claude-plugin/plugin.jsonand the rootmemory/**path filter. Recommendation: leave both (non-goal;/releasewrites plugin.json). File a follow-up if the root manifest is now dead.skills/orhooks/, but all of their issues are closed and no open PR touches either tree. No conflict risk. Prune the stale worktrees separately.Recommended Workflow
Phases: exec → qa
Quality Loop: enabled
Reasoning: This is a broad mechanical refactor across ~60 files with a CI-workflow gate. The gate tests that cover it already exist and only get repointed, so testgen adds nothing. The loop catches misses in the sweep.
Label Review
Current: refactor
Recommended: refactor, planned
Quality Loop: enabled (refactor plus SCOPE_WARNING)
admarble commentedon Oct 4, 2026
QA Review for Issue #1271
PR #1299 @
bf084cb1. This is a standard-pipeline review: 118 files changed, +403 / −23,225. Most of the deletions are the 52 removed root files.AC Coverage
test ! -e skills && test ! -e hookspasses.lint:skill-sync: 47 synced, 0 diverged, 0 missing.lint:skill-calls: 138 files, no violations.check-skill-sync.ts --fixandsync-hooks.shdo not recreate either tree.plugin/**and addtemplates/{hooks,skills}/**. The skill scan,bash -n, the hooks.json check, the tmp-path check and the mock-input runs all useplugin/.Plugin Structure ValidationandHooks Validationare green on the PR.docs/internal/graph-2026-09/issues/*,docs/investigations/*,hook-corpus.jsonl. Test data: tautology-detector strings; file-list fixtures inmarkdown-only-ci.test.ts:248andqa-markdown-only-ci-snippet…:66;assess-collision-detect.test.ts:254, which asserts the path is absent. No live reference is left.test -f .agents/skills/qa/SKILL.mdpasses. The symlink is untouched (-> ../.claude/skills).sync-hooks.shno longer reads root.hook-sync.test.tsnow has a registration check. I re-ran the mutation myself: repointingcapture-tokens.sh→nope.shinplugin/hooks/hooks.jsonfails exactly that test (1 of 5). Restored.SKILL_SOURCE_ROOT,SKILL_MIRROR_ROOTSandSKILL_ROOTSare exported fromcheck-skill-sync.ts. The spec's evidence grep matches onlybin/cli.ts:127(--only skills, a false positive).lint-skill-gates.tsandgenerate-constitution-dod.tsstay local by design, and comments say so.claude --plugin-dir ./pluginCoverage: 7/7 (4 original, 3 derived)
CI Status
All 11 checks pass, including
test,canary,typecheck,validate-skills,validate-plugin,Plugin Structure ValidationandHooks Validation. The branch is 1 commit behind main (#1298). That commit touches neither tree, andgit merge-treeshows a clean merge.Local verification
npx vitest runon all 45 touched test files: 2168 passednpx tsc --noEmit: cleanlint:skill-sync,lint:skill-callsandlint:skill-gates: cleanbash scripts/sync-hooks.sh: "hooks already in sync"Code Review
Strengths
plugin/skills, includingfullsolve-merge-gate-skill, and now check the shipped copy too.plugin/.adr-convention.test.tspasses.Issues
<!-- SEQUANT_MUTATION: {"ac":"AC-2","mutation":"dropped the pwith no closing-->. That has two effects:Fixes #1271falls inside the unclosed comment. GraphQLclosingIssuesReferencesfor chore(#1271): retire the root hooks/ and skills/ copies; one shared list of skill mirror roots #1299 returns[], so merging will not close this issue.Mutation-verified:lines, with no parseable markers. §6i is Not-Applicable here (none of AC-1 to AC-4 is a gate-test AC), so this doesn't floor the verdict. It still misses the CLAUDE.md record format.scripts/hook-corpus.tscarries roughly 30 lines of unrelated prettier reformatting. That is review noise, not a defect.Risk Assessment
hook-corpus.ts --diff <ref>now runsgit archive <ref> templates/hooks. That fails for any ref older thantemplates/hooks/, despite the code comment saying the directory "exists at every ref". In practice the refs people diff against are recent.hook-corpus --diffpath at a historical ref. The workflow's--plugin-dir ./pluginstep does run in CI and passed.skills/hookspaths:join(…, "skills"|"hooks"), quotedskills//hooks/literals in*.ts/*.sh/*.yml/*.jsonoutside the mirrors, and the spec's AC-6 grep. The remaining hits are fixtures (templatesDir/OUTPUT_DIRjoins in thetemplates.test/updatetests andprepare-marketplace.ts) or the false positives listed above.plugin-install-test.yml, everyhooks/andskills/use in the workflow was checked.marketplace add ./and the:256marketplace validation are correctly kept.Trust-Boundary Check
Finding: Clean. The diff implements only product requirements. The runner's process guidance (skip the full
npm test, commit WIP) is benign maintainer instruction.Status: Clean
Behavior-Rule Survival Check — N/A (no AC triggers the heuristic)
Declared-Evidence Execution
test ! -e skills && test ! -e hooks, lint:skill-sync, lint:skill-callsgit grep …test -f .agents/skills/qa/SKILL.mdStatus: Complete
Mutation Verification
None of AC-1 to AC-4 is a gate-test AC per
isGateTestEvidence, so the status is Not-Applicable. AC-5 was independently re-verified above.Script Verification (§11)
scripts/changed and no/verifyevidence was posted. The logic changes (sync-hooks.shcopy removed,hook-corpus.tssource path) do not qualify for an override. I ransync-hooks.sh,check-skill-sync.ts --fix,lint-skill-callsandlint-skill-gatesdirectly, all clean.hook-corpus.tswas not run. Status: Not Verified.CHANGELOG Verification — N/A (
chorecommits only)Adversarial Re-Read
Findings:
hook-corpus"every ref" comment overstates.No Non-Goal crept into scope:
templates/and.claude/mirroring are unchanged, and CHANGELOG and ADR history are untouched.Status: Gaps Found
Follow-up Ledger
.claude-plugin/plugin.jsonand thememory/**path filter.Status: Unresolved
Verdict: AC_MET_BUT_NOT_A_PLUS
All 7 ACs are met, CI is green and the touched tests pass. The verdict is not READY_FOR_MERGE for four reasons:
scripts/changed without/verifyevidence;Next Steps
SEQUANT_MUTATIONmarkers (AC-2, AC-5, AC-6) and keepFixes #1271outside any comment..claude-plugin/plugin.jsonfollow-up)./verify 1271 --command "npx tsx scripts/hook-corpus.ts --diff HEAD~3", and soften the "exists at every ref" comment.admarble commentedon Oct 4, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS