Repository navigation
Closed
Labels
Description
Problem
scripts/check-skill-sync.ts reports widespread drift across the three skill mirror roots (.claude/skills/, templates/skills/, skills/): 24 synced, 8 diverged, 10 missing (42 total). Because sequant init/sync regenerate from the templates/skills mirrors, divergence means downstream installs can receive stale or missing skill content. This is pre-existing debt, surfaced while resolving #733 (whose own qa/exec SKILL.md edits are correctly 3/3 synced) — it is unrelated to #733 and was deliberately kept out of PR #737 to keep that diff focused.
Current divergences (as of main @ 2026-06-22)
Diverged (content differs across roots):
improve/SKILL.md— .claude/skills: 672 | skills: 659loop/SKILL.md— .claude/skills: 504 | templates/skills: 406 | skills: 406qa/references/code-review-checklist.md— .claude/skills: 66 | skills: 67qa/references/quality-gates.md— .claude/skills: 467 | templates/skills: 180 | skills: 138qa/references/testing-requirements.md— .claude/skills: 150 | templates/skills: 110 | skills: 110qa/scripts/quality-checks.sh— .claude/skills: 735 | templates/skills: 669 | skills: 669security-review/SKILL.md— .claude/skills: 362 | skills: 363security-review/references/security-checklists.md— .claude/skills: 433 | skills: 380
Missing in one or more mirrors:
_shared/references/force-push.md(templates/skills, skills)_shared/references/prompt-templates.md(skills)qa/references/anti-pattern-detection.md(templates/skills, skills)qa/references/call-site-review.md(templates/skills, skills)qa/references/semgrep-rules.md(skills)qa/references/test-quality-checklist.md(templates/skills, skills)references/shared/framework-gotchas.md(templates/skills, skills)release/SKILL.md(templates/skills, skills)test/references/browser-testing-patterns.md(templates/skills, skills)upstream/SKILL.md(templates/skills, skills)
Acceptance Criteria
- AC-1 — Establish/confirm the canonical source root (
.claude/skills/is the working copy in this repo;templates/skills/+skills/are mirrors) and document the direction in the sync script or CONTRIBUTING. - AC-2 — Reconcile all 8 diverged files so
check-skill-sync.tsreports 0 diverged. Each reconciliation reviewed for intentional vs accidental drift (some.claude/skillsfiles are substantially longer — confirm the extra content should propagate, not be dropped). - AC-3 — Resolve the 10 missing files (copy into the mirrors, or intentionally exclude with a documented allowlist in the sync script).
- AC-4 —
check-skill-sync.tspasses clean in CI (consider gating CI on it if not already).
Notes
- This is a content-reconciliation task requiring per-file judgment (longest ≠ always canonical). Not mechanical.
- Three-directory sync is a recurring maintenance hazard; an enforced CI gate (AC-4) is the durable fix.
Activity
admarble commentedon Jun 22, 2026
Complexity: Complex (4 ACs, ~5 directories:
.claude/skills/,templates/skills/,skills/,scripts/,.github/workflows/)AC Quality Check
All 4 ACs are scoped and measurable. The repo AC-parser parsed 0 (issue uses
- [ ] **AC-1** —em-dash format; parser expects**AC-1:**colon form — minor parser gap, not a blocker for this plan; worth a follow-up).scripts/check-skill-sync.ts:6(Source of truth: .claude/skills/). Tighten AC-1 to "confirm + add a CONTRIBUTING/contributor-facing note + a documented exclude allowlist."0 diverged, all missing resolved). Good. AC-2 correctly flags the judgment requirement.check-skill-syncgreen in CI). Good.Scope Assessment
Non-Goals:⚠️ No Non-Goals section in the issue. Recommend adding: not re-architecting the 3-mirror model into build-time single-source generation (that's the durable fix — see Open Questions); not editing skill content semantics beyond reconciliation.
Verdict: ✅ SCOPE_OK — single coherent goal. Breadth is in content files touched, not in distinct features. Keep the architectural redesign out (follow-up issue).
Acceptance Criteria
AC-1: Confirm + document canonical source direction
Verification: Manual Test (+ grep assertion)
Scenario: Given the repo → When a contributor opens
scripts/check-skill-sync.ts/ CONTRIBUTING → Then.claude/skills/is named as source of truth andtemplates/skills/+skills/as mirrors, with the documented exclude allowlist.Assumptions:
.claude/skills/is canonical even where it is shorter than a mirror — confirmed by evidence:qa/references/code-review-checklist.md.claudeversion carries the #265/#309 "prefer Grep tool over bash" refactor; mirror still has the stale bash loop.AC-2: Reconcile all 8 diverged files → 0 diverged
Verification: Integration Test (CLI:
check-skill-sync.tsexits 0 / "0 diverged") + Manual (per-file diff review)Scenario: Given 8 diverged files → When each diff is reviewed and
.claude/skillscontent propagated to mirrors (after confirming no intentional mirror-only content is dropped) → Thencheck-skill-sync.tsreports 0 diverged.Assumptions: Direction is uniformly
.claude/skills→ mirrors (validated:loop/SKILL.mdgot the #502 edit in.claudebut mirrors lagged). One line needs a human decision: the mirror-only- Taskentry insecurity-review/SKILL.md(mirror is +1 line) — confirm it drops, not back-propagates.AC-3: Resolve all 10 missing files
Verification: Integration Test (CLI: 0 missing among content files) + Manual (allowlist review)
Scenario: Given 10 files present in
.claude/skillsbut missing in ≥1 mirror → When each is copied into the mirrors OR added to a documented exclude allowlist in the script → Thencheck-skill-sync.tsreports 0 missing (excluded files are not counted).Assumptions: All 10 are legitimate skill content to propagate. The transient
.sequant/.token-usage-*.jsonunder.claude/skills/(git-ignored, local-only) is a false positive the script currently surfaces — fix via dotfile/dot-dir skip so it never gates locally or in CI.AC-4:
check-skill-sync.tspasses clean in CI (gate it)Verification: Integration Test (CI step runs script, exits 0)
Scenario: Given a PR → When CI runs the new
npm run lint:skill-syncstep → Then it fails on any future drift and passes when synced.Assumptions: Slots into the existing skills-validation job in
ci.ymlright after "Lint skill calls" (ci.yml:122-123), mirroring thelint:skill-callspattern.Implementation Plan
Phase 1: Harden the sync script (enables a durable AC-4)
scripts/check-skill-sync.ts— add an exclude allowlist const (documented) + skip dotfiles/dot-directories incollectFiles()(kills the.sequant/.token-usage-*.jsonfalse positive). This is the only new logic in the issue.package.jsonscript:"lint:skill-sync": "npx tsx scripts/check-skill-sync.ts"(mirrorslint:skill-calls).Phase 2: Reconcile content (the judgment work — AC-2 + AC-3)
diff .claude/skills/<f>vs each mirror). Default direction.claude/skills→ mirrors. Flag/decide thesecurity-review/SKILL.md- Taskline before propagating.npx tsx scripts/check-skill-sync.ts --fix(copies.claude/skills→ mirrors for all non-synced; creates parent dirs). Then re-run without--fixto confirm0 diverged, 0 missing.--fixonly after step 3/4 review — blind--fixwould overwrite any legitimately-mirror-only content.Phase 3: Document + gate (AC-1 + AC-4)
check-skill-sync.tsheader and add a short contributor note (CONTRIBUTING or the script) + document the exclude allowlist.ci.yml— add step after line 123:- name: Check skill sync/run: npm run lint:skill-sync.Design Review
scripts/check-skill-sync.ts(the single authority). The gate belongs in the existing skills-validation job inci.yml. Content lives in the 3 skill roots;.claude/skillsis owner.--fixfor mechanical propagation; overlay human diff-review before running it. Don't build new tooling. Rejected: a brand-new reconcile script (the existing one already does copy + parent-dir creation).lint:skill-calls(scripts/lint-skill-calls.ts+ npm script +ci.yml:122-123) is the exact precedent for a script-backed CI lint gate. Follow it verbatim..claudeis canonical even when shorter?" — yes, evidenced (Audit skill prompts: prefer dedicated tools over bash for file operations #265/refactor(#265): prefer dedicated tools over bash for file operations #309 refactor in code-review-checklist).Feature Quality Planning
All standard checks pass. Notable items:
.sequant/.token-usage-*.json) are reported as "missing". Must skip dotfiles for AC-4 to be trustworthy locally. (In a fresh CI checkout the file is absent since git-ignored, so CI itself won't flake — but local DX and correctness warrant the fix.)--fixmust be a no-op; verify0 fixedon second run.Derived ACs
check-skill-sync.tsskips dotfiles/dot-dirs and documented allowlist entries (no false-positive "missing")Open Questions
templates/skills/+skills/from.claude/skills/at build/release time (removes the recurring hazard at its root). Impact if ignored: drift recurs; the CI gate just detects it, contributors still hand-sync 3 copies.security-review/SKILL.md- Taskline — Recommendation: drop it (treat.claudeas canonical) unless it's a deliberate mirror-only tool grant. Impact if wrong: a tool is silently removed from the agent's allowed list in the downstream-installed skill.Recommended Workflow
Phases: spec → testgen → exec → qa
Quality Loop: enabled (refactor label + content-judgment task → adversarial QA valuable; AC-2 explicitly needs per-file verification)
Reasoning: AC-3/AC-4 add real script logic (exclude allowlist + dotfile-skip) with Integration-Test verification →
testgenstubs that logic before implementation. The bulk (content reconciliation) is mechanical-with-judgment; QA must verify0 diverged / 0 missingand that no intentional content was dropped (per AC-2). No UI → notestphase. Not security-sensitive in the auth/payments sense (skipsecurity-review).Label Review
Current:
refactorRecommended:
refactor,chore(and considertech-debtif it exists)Reason: Content reconciliation + tooling/CI hardening —
refactorfits;chorematches the title prefix.Quality Loop: Will auto-enable under SCOPE_WARNING-adjacent breadth + refactor label; recommended ON regardless given the per-file judgment in AC-2.
→
gh issue edit 738 --add-label choreadmarble commentedon Jun 22, 2026
Implementation Progress (/exec)
PR: #742
AC Coverage
CONTRIBUTING.md"Skill mirror sync" section + strengthenedcheck-skill-sync.tsheader documenting.claude/skills/canonical → mirrorsquality-checks.shmerged (kept #310 tautology detection + restored #278/#303 cache-metrics JSON writer).- Taskgrant dropped fromsecurity-reviewmirror (canonical has no Task usage).npm run lint:skill-sync+ CI step inci.yml(afterlint:skill-calls), exits 0 on clean / 1 on driftcollectFilesskips dotfiles/dot-dirs (kills.sequant/.token-usage-*.jsonfalse positive) + documentedEXCLUDEallowlistFinal check:
42 synced, 0 diverged, 0 missing(exit 0), idempotent on re-run.Key reconciliation judgment (AC-2)
The only file that was not a clean
.claude → mirrorcopy:qa/scripts/quality-checks.shhad genuine bidirectional drift —.claudeuniquely had test-tautology detection (#310), the mirrors uniquely had the#278/#303structured cache-metrics JSON writer thatworktree-manager.ts:444reads to populatePhaseLog.cacheMetrics(shown bysequant logs). A blind copy would have dropped a live observability feature. Resolved by merging both into canonical.claudefirst, then propagating. Verified the cache-metrics JSON shape matchesCacheMetricsSchema(hits/misses/skipped).Files changed
scripts/check-skill-sync.ts(dotfile/dot-dir skip, EXCLUDE allowlist, exports + main-guard),package.json(lint:skill-sync).github/workflows/ci.yml,CONTRIBUTING.md,CHANGELOG.mdscripts/check-skill-sync.test.ts(unit),__tests__/integration/skill-sync.integration.test.ts(whole-repo guard).claude/skills/,templates/skills/,skills/Quality Plan Alignment
--fix= "Nothing to fix — all files synced"EXCLUDEdocumented inline; empty by design (dotfiles handled structurally)Derived ACs: 1/1 (AC-5) addressed.
Checks
npm run build✅ ·npm run lint✅ ·npm run lint:skill-sync✅ (exit 0)batch-executor.test.ts(cache-metrics consumer) 39 pass · existingbehavior-rule-skill-sync6 pass ·bash -nclean on all 3quality-checks.shKnown follow-ups (out of scope, flagged for triage)
templates/skills/+skills/from.claude/skills/at build/release time to eliminate hand-syncing 3 copies (spec Open Question feat: Complete remaining v1.0 features (AC-10, AC-13, AC-14) #1).npm run sync:skillsdirection bug: it copiestemplates/skills/* → .claude/skills/— the reverse of canonical. Left untouched to avoid changing contributor workflow in this PR; worth a dedicated fix.fix(#738): skip references/ shared dir in skill validation jobs
admarble commentedon Jun 22, 2026
QA Review for Issue #738
Reviewed at commit
8754bc1· PR #742 · all 8 CI checks greenAC Coverage
CONTRIBUTING.md"Skill mirror sync" section names.claude/skills/canonical, mirrors generated outward;check-skill-sync.tsheader strengthened;EXCLUDEallowlist documentedcheck-skill-sync.tsreports 0 diverged. Per-file review done;quality-checks.shmerged (kept #310 tautology detection + restored #278/#303 cache-metrics writer — verified live consumer atworktree-manager.ts:444);- Taskgrant dropped fromsecurity-review(body has zero Task usage; mirror now validates)references/validator gapcheck-skill-sync.tspasses clean in CI (gated)npm run lint:skill-syncstep added toci.yml; passing in CI; exits 0 clean / 1 on driftcollectFilesskips dotfiles/dot-dirs (kills.sequant/.token-usage-*.jsonfalse positive);EXCLUDEallowlist exported + documented; 6 unit testsCoverage: 5/5 AC items met (4 original + 1 derived).
CI Status
CI Summary: 8 passed, 0 pending, 0 failed. AC-4 (clean CI) verified green at HEAD.
Quality Metrics
any) in logic filesTest Coverage Analysis
scripts/check-skill-sync.tsscripts/check-skill-sync.test.ts(6) +__tests__/integration/skill-sync.integration.test.ts(2)quality-checks.sh(merge)batch-executor.test.ts(39 pass);bash -nclean across 3 rootsCoverage: logic changes have direct + integration tests; 8/8 new tests pass.
Execution Evidence
npm run lint:skill-sync42 synced, 0 diverged, 0 missing, exit 0 (idempotent)npm run validate:skillsnpx vitest run(new tests)Evidence status: Complete.
Script Verification Override
Override: Yes · Justification: Equivalent automated test coverage —
skill-sync.integration.test.tsexecutes the modified script end-to-end and asserts0 diverged / 0 missing+ exit 0. · Risk: Low.Detection Pattern Verification
Not Required (by provenance). The changed mirror
.mdfiles containgrep/awk/jqliterals in added lines, butcheck-skill-syncconfirms 0 diverged — every such line is byte-identical to the canonical.claude/skills/source already in active use in this repo. No new detection pattern was authored; this is mechanical propagation of already-reviewed canonical content, so there is no new pattern to verify against a corpus.Skill Command Verification
Passed (by provenance). Same reasoning — propagated commands are byte-identical to canonical. The one authored change (
quality-checks.shmerge) is shell, syntax-validated (bash -n) across all 3 roots, and itscache-metrics.jsonoutput matchesCacheMetricsSchema(hits/misses/skipped).CHANGELOG Verification
fix(#738):)[Unreleased]entry for #738Risk Assessment
_shared-only (ci.yml,plugin-install-test.yml,validate:skills) — all three fixed.src/sites (status.ts,skill-version.ts) iterate.claude/skills/which already hadreferences/pre-PR → unaffected (no new behavior).references/skip is the only newly-needed exclusion; no adjacent call sites with the same root cause remain.Adversarial Re-Read
Findings: No gaps found because: (1) fixtures — the issue's motivating target (
8 diverged / 10 missing) is verified resolved to0 diverged / 0 missingvia the actual script; (2) evidence — exec evidence is post-fix state, not a bug repro; (3) process state — working tree clean, 0 behindorigin/main, single feature branch; (4) sibling sites — cross-file scan complete (3 mirror-iterating sites fixed, src/ sites unaffected); (5) Non-Goals — no re-architecting of the 3-mirror model and no skill content-semantics edits beyond reconciliation (thequality-checks.shmerge restores an existing mirror feature, not new behavior).Status: Clean
Verdict: READY_FOR_MERGE
All 5 ACs met, CI fully green at
8754bc1, tests pass, quality clean, adversarial re-read clean. The QA pass caught and fixed a genuine CI regression introduced by the reconciliation; the fix is minimal and consistent with existing_shared/handling.Documentation: Before merging, optionally run
/docs 738— though CONTRIBUTING + CHANGELOG are already updated as part of this PR.Next Steps
templates/skills/+skills/from.claude/skills/at build time to retire hand-syncing.npm run sync:skillscopiestemplates → .claude(reverse of canonical) — worth a dedicated fix.admarble commentedon Jun 22, 2026
QA Review for Issue #738
AC Coverage
.claude/skills/documented as canonical in bothscripts/check-skill-sync.tsheader and a new CONTRIBUTING.md "Skill mirror sync" section, with the explicit "canonical even when a mirror is longer" rule.check-skill-sync.tsnow reports 0 diverged. Spot-checked previously-diverged files: canonical (longer) content propagated, not dropped. The one non-trivial case (qa/scripts/quality-checks.sh) was correctly merged —.claude's tautology detection (#310) + mirrors' cache-metrics writer (#278/#303) both present in all 3 roots (byte-identical, md50d9fb3b…).check-skill-sync.tsreports 0 missing. DocumentedEXCLUDEallowlist escape hatch added (currently empty); dotfiles/dot-dirs now skipped structurally to kill the.token-usage-*.jsonfalse positive.npm run lint:skill-syncstep added toci.yml(alongside lint:skill-calls). CI green on PR #742. Follow-up commit correctly excludes the new top-levelreferences/shared dir from the skill-validation loops inci.yml+plugin-install-test.yml.Coverage: 4/4 AC items fully met
Verification Evidence
npx tsx scripts/check-skill-sync.ts→ 42 synced, 0 diverged, 0 missing (exit 0)scripts/check-skill-sync.test.ts+__tests__/integration/skill-sync.integration.test.ts→ 8 passedvalidate-skills,Plugin Structure Validation,build (22.x),typecheck,node-floor-guard,validate-plugin,Hooks Validation,Setup Directory Creationsrc/lib/workflow/worktree-manager.tsreads thecache-metrics.jsonthe merged script writes (line 736 of quality-checks.sh) — the merge restored realPhaseLog.cacheMetricsobservability.Quality Metrics
Code Review
Strengths:
quality-checks.sh— was a true 3-way merge, not a blind overwrite. Both feat(#298): Add test tautology detector to QA quality gates #310 and Improve pipeline observability: file tracking, git SHA, diff stats, token usage #278/feat(#278): improve pipeline observability with file tracking, git SHA, diff stats, token usage #303 features coexist in all roots; provenance fully recorded in CHANGELOG.collectFiles/EXCLUDEnow exported + dotfile-skipping is the durable fix for the recurring false-positive class, with test coverage.lint:skill-sync) is the durable enforcement AC-4 asked for; thereferences/exclusion fix shows the author traced the second-order effect of adding a new shared dir into the validation loops.Issues: None blocking.
Suggestions: None material.
Detection Pattern Verification
The mirror files contain
grep/awk/jqliterals, but they are verbatim propagations of already-canonical, already-shipped.claude/skills/content — no net-new patterns are authored here. The corpus-drift risk §6c guards against does not apply to byte-for-byte mirror copies. Status: N/A (no net-new patterns authored).Risk Assessment
ci.ymlandplugin-install-test.ymlwere both updated for the newreferences/shared dir — the cross-file sibling was caught and fixed.Adversarial Re-Read
Findings: No gaps found because: (1) ran
check-skill-sync.tsto ground-truth 0 diverged / 0 missing rather than trusting the diff; (2) verified the one non-mechanical reconciliation (quality-checks.sh) is a real feature-preserving merge — both #310 and #278/#303 present, all 3 roots byte-identical, and the cache-metrics consumer inworktree-manager.tsconfirmed live; (3) confirmed canonical (longer) content won for spot-checked diverged files, addressing the issue's "don't drop extra content" warning; (4) traced thereferences/CI-exclusion follow-up to its cause (new top-level shared dir would fail the skill-validation loop) and confirmed both workflow files patched; (5) no Non-Goals expanded — diff is scoped to reconciliation + gate.Status: Clean
Verdict: READY_FOR_MERGE
All 4 ACs met.
check-skill-sync.tsreports 0 diverged / 0 missing, CI is fully green on PR #742, new tests pass, and the only non-mechanical reconciliation (the quality-checks.sh 3-way merge) was verified to preserve both divergent feature sets. The durable CI gate (AC-4) closes the recurring drift hazard.Documentation
Next Steps
fix(#738): repoint sync:skills at canonical fixer (was reversed)
chore(#738): reconcile skill-mirror divergences (8 diverged, 10 missi…