Skip to content

chore(#1271): retire the root hooks/ and skills/ copies; one shared list of skill mirror roots - #1299

Merged
admarble merged 4 commits into
mainfrom
feature/1271-chore-plugin-retire-the-root-hooks-and-skills-copi
Oct 4, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1271-chore-plugin-retire-the-root-hooks-and-skills-copi

Conversation

@admarble

@admarble admarble commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Root trees deleted. The 52 files under root skills/ and hooks/ are gone. npm run sync:skills and npm run sync:hooks do not recreate them, and sync-hooks.sh no longer copies root hooks.json into the plugin.
  • One shared list of skill mirror roots (derived AC-6). scripts/check-skill-sync.ts now exports SKILL_SOURCE_ROOT, SKILL_MIRROR_ROOTS and SKILL_ROOTS. lint-skill-calls.ts, ground-check.ts, ready-backtest.ts and about 40 gate tests now import it instead of keeping their own copy. Many of those copies had no plugin/skills, including fullsolve-merge-gate-skill.test.ts, so they now also check the shipped copy. The two "sync N/N match" tests take N from SKILL_ROOTS.length instead of a hard-coded 4/4.
  • Two lists stay local on purpose: SCAN_ROOTS in lint-skill-gates.ts and the candidate list in generate-constitution-dod.ts. Both are first-match lists that also run in user projects, not mirror lists. In each I replaced root skills with plugin/skills.
  • plugin/hooks/hooks.json is now its own source (derived AC-5). The test that compared it byte-for-byte with root hooks.json is replaced by a check that every script it registers exists in plugin/hooks/.
  • Hook tests and scripts now use plugin/hooks/: the three pre-tool integration tests and token-utils.test.ts. scripts/hook-corpus.ts now reads templates/hooks/, both normally and at the --diff ref, because that directory exists at every ref.
  • CI workflow plugin-install-test.yml:
    • Path filters swap root hooks/** and skills/** for templates/hooks/** and templates/skills/**.
    • The skill scan, bash -n, the smoke tests and the hooks.json check all run on plugin/.
    • The --plugin-dir step now loads ./plugin (derived AC-7).
    • The AC-2 grep missed one break: the hooks.json step looked up script paths from the repo root. With root hooks/ gone, it would have failed on every PR. It now looks under plugin/.
  • Docs and data: CONTRIBUTING (mirror table, plugin section, new-skill steps), the drift-prevention and behavior-rule docs, the plugin path audit and a few code comments are updated. The /upstream default and .sequant/upstream/baseline.json now name plugin/hooks/hooks.json. New ADR docs/adr/0008-retire-root-plugin-mirrors.md, listed in the ADR index.

Pre-PR AC Verification

AC Source Status Evidence
AC-1 Original ✅ test ! -e skills && test ! -e hooks passes; lint:skill-sync reports 47 synced, 0 missing; lint:skill-calls reports no violations
AC-2 Original ✅ The AC grep on plugin-install-test.yml returns nothing; the hooks.json and skill-scan steps were run locally and pass. The workflow itself first runs on the PR.
AC-3 Original ✅ Every live hit is fixed. Left as history or test data for QA to review: docs/internal/graph-2026-09/issues/*, docs/investigations/*, hook-corpus.jsonl, the tautology-detector strings, and the fixture lists in markdown-only-ci, qa-markdown-only-ci-snippet and assess-collision-detect
AC-4 Original ✅ test -f .agents/skills/qa/SKILL.md passes
AC-5 Derived ✅ src/lib/relay/__tests__/hook-sync.test.ts registration check; sync-hooks.sh reports "already in sync"
AC-6 Derived ✅ SKILL_ROOTS is exported once and imported everywhere
AC-7 Derived ✅ claude --plugin-dir ./plugin

Mutation-verified: AC-2 — dropped the plugin/ prefix from the hooks.json path check; the step failed with "Referenced script not found: hooks/pre-tool.sh"; restored.
Mutation-verified: AC-5 — registered a script that doesn't exist in plugin/hooks/hooks.json; only the new registration test failed (1 of 5); restored.
Mutation-verified: AC-6 — added root skills back to SKILL_MIRROR_ROOTS; lint:skill-sync reported 47 missing and the soak gate tests failed; restored.

AC-6 has no parseable marker on purpose. Its guard is the single import of SKILL_ROOTS, not one test. Re-adding a root fails lint:skill-sync and the soak gates, as the prose line above records.

Fixes #1271

Runner verification (post-QA)

The runner re-checked the work after QA:

  • AC-1 to AC-4 and AC-7 evidence, run on the branch:
    • test ! -e skills && test ! -e hooks passes.
    • lint:skill-sync reports 47 synced, and lint:skill-calls finds no violations.
    • The AC-2 grep matches nothing outside plugin/ and templates/.
    • test -f .agents/skills/qa/SKILL.md passes.
    • The workflow runs claude --plugin-dir ./plugin.
  • AC-2 mutation, run locally: the runner pulled the "Validate hooks.json structure" step out of the workflow and ran it.
    • As written, it exits 0 ("hooks.json validated!").
    • With the plugin/ prefix removed, it exits 1 with Referenced script not found: hooks/pre-tool.sh.
  • scripts/hook-corpus.ts (QA §11):
    • npx tsx scripts/hook-corpus.ts --diff HEAD~3 exits 0 with "0 verdict changes".
    • QA's concern that templates/hooks/ might be missing at older refs doesn't apply. templates/hooks/pre-tool.sh was added in the repository's first commit (49bf8204, 2026-01-03), so the "exists at every ref" comment is accurate.
  • Follow-up ledger:
  • This body was rewritten: the generated one stopped mid-way through an HTML comment, which hid the closing keyword (closingIssuesReferences was empty).

🤖 Generated with Claude Code

@admarble admarble changed the title chore(#1271): retire the root hooks/ and skills/ copies once ./plugin ships chore(#1271): retire the root hooks/ and skills/ copies; one shared list of skill mirror roots Oct 4, 2026
@admarble
admarble merged commit fe14e33 into main Oct 4, 2026
11 checks passed
@admarble
admarble deleted the feature/1271-chore-plugin-retire-the-root-hooks-and-skills-copi branch October 4, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(plugin): retire the root hooks/ and skills/ copies once ./plugin ships

1 participant