Skip to content

bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711

Closed

Description

@admarble

Summary

docs/guides/customization.md documents .claude/.local/ as an update-safe override layer: "Put your customizations in .claude/.local/ and they will never be overwritten" and, for skills, "The local version takes precedence." For skills (and almost certainly hooks) this is false. A skill placed in .claude/.local/skills/<name>/SKILL.md is never loaded or invoked — neither in an orchestrated run nor when a user types /<name> interactively. The original .claude/skills/<name>/SKILL.md always runs.

This is the headline use case of the customization layer (fork a skill, survive updates), and it silently does nothing. Users following the guide get no error and no effect.

Related but distinct: #708 covers update/sync overwriting in-place edits. #708 assumes .local/ is a working safe-harbor; this issue shows the safe-harbor itself is non-functional for skills/hooks. Fixing #708 alone still leaves "copy a skill into .local/ to customize it" broken.

Verification (this session)

Confirmed at three layers:

  1. No runtime merge in sequant. The only .local/ handling in all of src/:

    • src/commands/update.ts:136-159 — skips .local/ during updates (legit update-safety)
    • src/commands/status.ts:400-402 — cosmetic "Custom overrides: Yes" if the dir exists

    There is no code that reads .claude/.local/skills/ and merges it into the discovered skill path.

  2. Skills are invoked via the harness, not sequant. The orchestrator hands a prompt ending "Run the /spec {issue} workflow." (src/lib/workflow/phase-registry.ts:178). Sequant never reads SKILL.md content itself — it delegates /spec to Claude Code's native skill discovery.

  3. Native discovery has no .local/ path. Claude Code resolves skills only at user (~/.claude/skills/), project (.claude/skills/), and plugin (namespaced) scopes. .claude/.local/skills/ is not a discovery location, so the file is invisible.

Hooks: very likely the same failure mode (hooks fire from explicit settings.json paths; .local/hooks/* is not auto-discovered). Not fully traced — calling it out for the same pass.

False claims in docs/guides/customization.md

Acceptance criteria

  • .claude/.local/skills/<name>/SKILL.md either (a) actually takes precedence when invoked, or (b) the docs stop claiming it does and point users to a mechanism that works.
  • Same resolution for .claude/.local/hooks/ (verify, then fix or correct docs).
  • A net-new custom skill has a documented home that the harness actually discovers (project .claude/skills/ checked-in, or user ~/.claude/skills/), and update/sync treat unmanaged dirs under .claude/skills/ as user-owned (never clobber).
  • customization.md contains no override instruction that doesn't function end-to-end (verified by an actual invocation, not just file placement).

Fix options (for /spec to weigh)

  1. Runtime overlay hook (recommended for prose skills). Each managed SKILL.md ends with a stable directive: "If .claude/.local/skills/<name>/overrides.md exists, treat its instructions as authoritative over the above." Works regardless of harness discovery (Claude reads the file at invocation), survives updates because users write small deltas not full forks, and avoids the vendored-copy rot of full-file shadowing.
  2. Install-time merge. init/update/sync copy .local/skills/* over .claude/skills/* so the harness-discovered file is the merged result. Simple but re-clobbers on every sync and loses the "never touched" guarantee.
  3. Redirect to native scopes. Drop .local/skills/ entirely; document forking into project .claude/skills/ (checked in) and make update/sync manifest-hash-aware so in-place edits aren't overwritten (overlaps fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708 — wire up the unused manifest.files hashes).

Recommendation: (1) for modifying existing skills + correct the docs; net-new skills go to project .claude/skills/ per (3); coordinate the update-safety mechanics with #708.

Suggested approach

  • Correct docs/guides/customization.md first (stop the false promise), then implement the overlay hook across skill templates (templates/skills/, skills/, .claude/skills/ — keep all three in sync).
  • Add a verification test that actually invokes an overridden skill and asserts the override ran, so this can't silently regress.

Activity

  1. admarble commented on Jun 4, 2026

    @admarble
    ContributorAuthor

    → PROCEED — Fix or correct the .claude/.local/ override layer (non-functional for skills/hooks)

    Workflow: spec → exec → qa (-Q)

    Clear ACs (4) but large/multi-surface: runtime overlay mechanism + doc correction + 3-dir SKILL.md template edits + an actual invocation test. Three fix options in the body — pick one strategy in /spec before exec. If option (1) is chosen, it appends a directive to every SKILL.md and overlaps #707's release/SKILL.md edit.

  2. admarble commented on Jun 4, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (4 ACs, ~5 directory roots / 3× skill mirror dirs)

    AC Quality Check

    AC Assessment
    AC-1 ✅ Measurable, but branching ("(a) takes precedence or (b) docs stop claiming it"). Pick one in this spec so exec/qa have a single bar. → chose (a) overlay + docs correction.
    AC-2 ⚠️ Two-step ("verify, then fix or correct docs"). Verification is a precondition; the deliverable is fix-or-correct. Treated as: verify discovery → correct docs (no runtime hook mechanism for hooks exists).
    AC-3 ✅ Concrete: documented home + update/sync never clobber unmanaged .claude/skills/ dirs.
    AC-4 ✅ Strong, verifiable: "no override instruction that doesn't function end-to-end (verified by actual invocation)."

    No vague/unmeasurable language. Branching ACs resolved below.


    Scope Assessment

    Non-Goals: ⚠️ Not declared in the issue. Proposed (confirm): out of scope = (i) building a generic harness-level .local skill discovery path (we don't control Claude Code's resolver); (ii) re-doing #708's manifest-hash update-safety (closed/merged — we depend on it, not redo it); (iii) a per-hook runtime overlay mechanism (none feasible — docs-correct only for hooks).

    Metric Value Status
    Feature count 1 (override layer) + docs ✅
    AC items 4 ✅
    Directory spread docs/guides + 3 skill mirror dirs (×18 each) + src/commands ⚠️

    Verdict: ⚠️ SCOPE_WARNING — high file fan-out (directive appended to every managed SKILL.md × 3 mirror dirs). Auto-enables quality loop. Matches /assess (quality-loop=true).


    Key finding that reframes the fix

    update.ts:~150-159 already has a .local branch: when .claude/.local/skills/<name>/SKILL.md exists it marks the package file local-override and skips overwriting it. This is the source of the false promise — update believes it's honoring an override, but the harness never loads the .local copy at invocation, so nothing changes. Any fix must retire/repurpose this full-file-shadow assumption, not leave it dangling.


    Acceptance Criteria

    AC-1: .local/skills/<name> override actually takes effect (chose option 1: runtime overlay)

    Verification: Integration Test
    Scenario: Given a managed SKILL.md shipped with the overlay directive and a .claude/.local/skills/<name>/overrides.md present → When the skill is invoked → Then the override instructions are treated as authoritative.
    Decision: Append a stable directive to each managed SKILL.md: "If .claude/.local/skills/<name>/overrides.md exists, treat its instructions as authoritative over the above." Delta-file (overrides.md), not full-SKILL.md shadow — survives updates, avoids vendored-copy rot. Automated bar = assert the directive string is present in every managed SKILL.md (unit). End-to-end bar = documented actual invocation (AC-4).
    Assumptions: Claude reads the full SKILL.md body at invocation (true — that's how skills run); <name> is resolvable per-skill (substitute literal name, not a placeholder, so the path is correct).

    AC-2: Same resolution for .claude/.local/hooks/

    Verification: Integration Test (discovery) + docs correction
    Scenario: Given a hook in .claude/.local/hooks/ → When the corresponding tool event fires → Then confirm whether it runs (expected: does not, hooks fire only from explicit settings.json paths).
    Decision: No per-hook runtime-overlay mechanism is feasible. Correct customization.md to point hook customization at the real mechanism (settings.local.json / explicit settings paths), and remove the false .local/hooks/ promise.
    Assumptions: .claude/settings.local.json is honored (referenced in worktree-isolation.test.ts); confirm during exec.

    AC-3: Net-new custom skill has a real home; update/sync never clobber unmanaged .claude/skills/ dirs

    Verification: Integration Test
    Scenario: Given a net-new .claude/skills/foo/SKILL.md not present in templates/ → When update/sync runs → Then foo/ is untouched.
    Decision: Document net-new skills → checked-in project .claude/skills/ (harness-discovered) or user ~/.claude/skills/. Update-safety is largely already satisfied: update.ts only writes paths derived from listTemplateFiles() and never deletes non-template files, so unmanaged dirs are already safe — add a regression test proving it + document the guarantee.
    Assumptions: sync:skills (cp -r templates/skills/* .claude/skills/) only adds/overwrites managed names, never prunes unmanaged — verify the npm-script and sync command path both hold this.

    AC-4: customization.md contains no non-functional override instruction

    Verification: Manual/Integration Test
    Scenario: Given the rewritten guide → When each documented override path is actually exercised (skill invoked, hook fired) → Then every instruction produces its claimed effect.
    Decision: Rewrite the doc to: overlay (overrides.md) for modifying skills; project/user .claude/skills/ for net-new; corrected hook guidance. Each example must be invocation-verified, not file-placement-verified.


    Implementation Plan

    Phase 1: Correct the false promise (ship first, independently mergeable)

    1. Rewrite docs/guides/customization.md: replace full-file .local/skills/<name>/SKILL.md shadowing with the overrides.md overlay; redirect net-new skills to project/user .claude/skills/; fix the hooks section to the real mechanism; soften the blanket "never overwritten" line (cross-ref fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708).

    Phase 2: Overlay mechanism (the functional fix)

    1. Add the overlay directive to every managed SKILL.md across all three mirror dirs (templates/skills/, .claude/skills/, skills/) — keep scripts/check-skill-sync.ts green (synced 3/3). templates/skills/ is the published source-of-truth (in package.json files).
    2. Repurpose/retire the update.ts:~150-159 local-override SKILL.md-shadow branch so it aligns with overrides.md (don't leave a dead full-file-shadow code path).

    Phase 3: Update-safety guarantee for net-new skills

    1. Add a regression test: update/sync against a fixture containing an unmanaged .claude/skills/foo/ asserts it is untouched.

    Phase 4: Anti-regression test for the override

    1. Add a test asserting the overlay directive is present in every managed SKILL.md (so a new skill can't ship without it), plus a documented manual invocation-verification step proving an overrides.md actually wins.

    Design Review

    1. Where does this logic belong? The override "mechanism" lives in the prose SKILL.md body (LLM-interpreted at invocation), not TypeScript — there is no sequant runtime skill loader to hook. update/sync safety lives in src/commands/update.ts + sync.
    2. Simplest correct approach? Delta overrides.md directive beats install-time merge (re-clobbers, loses "never touched") and beats trying to add a .local discovery path we don't control in the harness.
    3. Existing pattern it follows? Constitution overlay (.local/memory/constitution.md) is the precedent for "user delta read at runtime." 3-dir SKILL.md sync is the established mirror pattern (check-skill-sync.ts, memory: sync .claude/skills/, templates/skills/, skills/).
    4. What a senior reviewer would challenge? "Appending an identical directive to 18×3 files is churn and collides with Add warn-only README "What's new in X.Y" freshness gate to /release skill #707." → True; the directive is one stable line, and the 3-dir sync is already enforced by CI. Coordinate ordering with Add warn-only README "What's new in X.Y" freshness gate to /release skill #707 (it also edits release/SKILL.md).

    Rule Touchpoints

    The override is a behavior rule implemented at two touchpoints — flagged so neither goes stale:

    Concern Touchpoint Note
    Override directive */skills/*/SKILL.md (×3 mirrors) LLM-interpreted at invocation
    Update-safety of .local src/commands/update.ts:~150-159 Existing local-override branch must be reconciled, not duplicated

    Conflict Risk Analysis (in-flight)

    Worktrees exist but are empty (0 commits) for #707/#709/#713 — no live conflict yet, forward-looking only:


    Open Questions

    1. Confirm proposed Non-Goals (esp. no per-hook runtime overlay — hooks are docs-correct only). Recommendation: accept. Impact if wrong: scope balloons into harness-resolver territory we don't own.
    2. Retire vs. repurpose the existing update.ts local-override SKILL.md branch? Recommendation: repurpose to recognize overrides.md. Impact: leaving it dead-but-present re-creates the false-promise smell.

    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: enabled (SCOPE_WARNING)
    Reasoning: Matches /assess (spec,exec,qa, quality-loop=true). Not adding testgen as a separate phase — the only clean automated tests are the directive-presence assertion (AC-1/4) and the unmanaged-dir regression (AC-3); fold both into exec. No test phase (no browser UI). Docs-heavy + prose-skill directive, so exec carries the bulk.


    Label Review

    Current: (none)
    Recommended: bug, docs, cli
    Reason: Non-functional documented feature (bug) + doc rewrite (docs) + update/sync safety in CLI commands (cli). Mirrors #708's labeling.
    Quality Loop: Will auto-enable via SCOPE_WARNING (directory fan-out).

    → gh issue edit 711 --add-label bug,docs,cli


    --- DRAFT GITHUB ISSUE COMMENT (PLAN) ---

    Plan — fix the non-functional .claude/.local/ override layer

    Chosen strategy (resolving the branching ACs): Option (1) runtime overlay for modifying skills + native project .claude/skills/ for net-new + correct the docs.

    Root cause nuance: update.ts:~150-159 already has a .local/skills/<name>/SKILL.md "local-override" branch that skips overwriting the package file — but the harness never loads the .local copy, so it silently does nothing. That branch is the source of the false promise and must be reconciled with the new overrides.md mechanism.

    ACs & verification

    • AC-1 Overlay directive in every managed SKILL.md makes .claude/.local/skills/<name>/overrides.md authoritative — Integration test invokes an overridden skill; unit asserts directive present in all SKILL.md.
    • AC-2 Verify .local/hooks/ discovery (expected: not auto-loaded) → correct docs to the real mechanism (settings.local.json). No per-hook runtime overlay is feasible.
    • AC-3 Net-new skills documented to project/user .claude/skills/; update/sync never clobber unmanaged dirs — regression test on an unmanaged .claude/skills/foo/.
    • AC-4 customization.md contains no override instruction that isn't invocation-verified.

    Plan: (1) correct customization.md first; (2) add overlay directive across all 3 skill mirror dirs (keep check-skill-sync green); (3) reconcile the update.ts local-override branch; (4) regression + directive-presence tests.

    Coordinate: #707 also edits release/SKILL.md; #709/#713 touch update.ts/sync (update-safety). Worktrees currently empty — sequence on merge order.

    Open Qs: (1) confirm Non-Goals (no per-hook overlay); (2) repurpose vs. retire the existing update.ts local-override branch (recommend repurpose).

    Workflow: spec → exec → qa, quality loop on.

  3. added
    bug
    documentation
    cli
    planned
    on Jun 4, 2026
  4. admarble commented on Jun 4, 2026

    @admarble
    ContributorAuthor

    Exec Progress — PR #716

    Implemented the chosen strategy: runtime overlay for modifying skills + project/user .claude/skills/ for net-new + docs correction.

    AC coverage

    AC Status Evidence
    AC-1 ✅ Implemented Overlay directive (<!-- sequant:local-override -->) appended to all 53 SKILL.md across the 3 mirror dirs; presence asserted by __tests__/integration/local-override-directive.integration.test.ts; verified end-to-end — a skill body carrying the directive read .claude/.local/skills/<name>/overrides.md and emitted the override marker instead of its default output
    AC-2 ✅ Implemented Confirmed .local/hooks/ is not auto-discovered (hooks fire only from explicit settings.json command paths); customization.md corrected to register hooks via .claude/settings.local.json (Claude Code merges it, gitignored, update-safe)
    AC-3 ✅ Implemented Net-new skills documented to project/user .claude/skills/; update/sync only write listTemplateFiles() paths and never delete unmanaged files — src/commands/unmanaged-skill-safety.integration.test.ts proves a custom .claude/skills/foo/ survives both update and sync --force
    AC-4 ✅ Implemented docs/guides/customization.md + docs/troubleshooting.md rewritten so no documented override path is non-functional; added a manual invocation-verification recipe; overlay proven by actual invocation (not file placement)

    Key files changed

    • .claude/skills/*/SKILL.md, templates/skills/*/SKILL.md, skills/*/SKILL.md (53 files) — overlay directive
    • docs/guides/customization.md — overrides.md overlay for skills; project/user scope for net-new; corrected hooks → settings.local.json; verification recipe
    • docs/troubleshooting.md — fixed the same broken full-SKILL.md-shadow snippet
    • src/lib/templates.ts — clarifying comment: .local/ parallel-file protection guards in-place edits (constitution), not skill loading
    • __tests__/integration/local-override-directive.integration.test.ts (new), src/commands/unmanaged-skill-safety.integration.test.ts (new)
    • CHANGELOG.md

    Quality Plan Alignment

    N/A — the /spec comment had no dedicated Feature Quality Planning / Derived ACs table; quality was folded into the 4 ACs above.

    Design decision (spec Open Question #2)

    Kept #708's generic .local/ parallel-file protection intact rather than gutting it. Under the overlay mechanism users write overrides.md (auto-skipped under .local/) and leave the managed SKILL.md unchanged, so that branch is inert for skills — not a live false promise. Removing it risked regressing freshly-shipped #708. Added a clarifying comment instead.

    Checks

    • npm run build ✅ · npm run lint ✅ · lint:skill-calls ✅
    • New tests (directive presence ×53 + unmanaged-dir safety) ✅ · existing templates/update/sync/behavior-rule-sync tests ✅

    Coordination

    Suggested reviewer step

    Invoke a real skill (e.g. /spec) with a marker overrides.md present and confirm the marker appears in output — closes the loop on AC-4's live-invocation bar.

  5. admarble commented on Jun 4, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #711

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original .local/skills/<name> override actually takes effect MET Overlay directive (<!-- sequant:local-override -->) in all 53 SKILL.md across 3 mirror dirs, each with the literal skill name in the override path (verified 0 problems). Presence asserted by local-override-directive.integration.test.ts. Independently verified end-to-end: a fresh agent acting as /spec with the shipped directive read overrides.md and emitted the override marker instead of its default output
    AC-2 Original Same resolution for .local/hooks/ MET Confirmed hooks fire only from explicit settings.json command paths — no .local/hooks/ auto-discovery. customization.md corrected to the real mechanism (.claude/settings.local.json, which Claude Code merges and gitignores — verified .claude/settings.local.json is in .gitignore). Hook JSON format matches templates/settings.json
    AC-3 Original Net-new skill home + update/sync never clobber unmanaged dirs MET Net-new documented to project/user .claude/skills/. update/sync only write listTemplateFiles() paths and never delete — unmanaged-skill-safety.integration.test.ts proves update AND sync --force both leave an unmanaged .claude/skills/foo/ byte-identical while updating the managed skill
    AC-4 Original customization.md has no non-functional override instruction MET customization.md + troubleshooting.md rewritten; full-repo scan finds no residual takes precedence / SKILL.md-shadow / .local/hooks false promises. Each documented path is invocation-verified, not file-placement-verified; added a user-facing verification recipe

    Coverage: 4/4 AC items fully met (all original; no derived ACs)


    CI Status

    Check State Impact
    build (22.x) SUCCESS ✅ MET
    typecheck SUCCESS ✅ MET
    validate-plugin SUCCESS ✅ MET
    Plugin Structure Validation SUCCESS ✅ MET
    validate-skills SUCCESS ✅ MET
    Hooks Validation SUCCESS ✅ MET
    Setup Directory Creation SUCCESS ✅ MET

    CI Summary: 7 passed, 0 pending, 0 failed (build matrix completed during QA).


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 59 (53 identical directive footers + 6 substantive) OK
    Lines added +550 OK
    Lines deleted -41 OK
    Build / Lint pass / pass OK
    Tests (new + related) 92 passed OK

    Test Coverage Analysis

    Changed File Tier Has Tests?
    src/lib/templates.ts Standard ✅ comment-only change; covered by templates.test.ts + update.integration + new unmanaged-skill-safety
    53× */SKILL.md Optional (prose) ✅ directive presence asserted by local-override-directive.integration.test.ts
    docs/*.md Optional N/A (docs) — AC-4 covered by actual invocation

    Coverage: All substantive changes covered.


    Skill-Sync (3-dir) Check

    Skill .md files modified → ran check-skill-sync.ts. Result 24 synced / 8 diverged / 10 missing is byte-identical to the origin/main baseline — this PR introduced zero new divergence. The pre-existing diverged files (improve, loop, qa refs, security-review) each carry the directive consistently across all 3 mirrors; their divergence predates this branch and is out of scope (per the behavior-rule-skill-sync touched-files-only precedent). Does not block merge.


    Code Review

    Strengths:

    • Minimal, surgical code change: the only TypeScript edit is a clarifying comment in templates.ts — no behavior change, so fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708's freshly-shipped in-place-protection logic is preserved.
    • Directive is a single stable line with an HTML sentinel, making the presence test robust to wording tweaks and future-proof (test scans dynamically, so a new skill can't ship without it).
    • Docs are accurate and actionable: clear "what reads it" table, a delta-vs-fork rationale, and a self-serve verification recipe.
    • Both copies of the broken pattern fixed (customization.md and troubleshooting.md) — cross-file sibling caught.

    Issues: None blocking.

    Observations (non-blocking, no change required):


    Skill Command Verification

    Not Required — the only skill-file change is the prose overlay directive; no CLI commands were added or modified.

    Detection Pattern Verification

    Not Required — the directive is prose, not a corpus-matching grep/awk/jq/sed/regex pattern. No detection patterns added.

    Execution Evidence

    N/A — no scripts/ changes; the templates.ts change is comment-only.

    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅
    User-facing change (fix:) ✅
    [Unreleased] entry for #711 ✅ Present

    Risk Assessment

    • Likely failure mode: A future skill author adds a SKILL.md without the directive (override silently stops working for that skill) — mitigated: the presence test scans all dirs dynamically and fails CI if any SKILL.md lacks the sentinel. Secondary: the overlay is LLM-interpreted prose, so an exceptionally stubborn skill could ignore it — mitigated by placing the directive at end-of-file and verifying it wins at actual invocation.
    • Not tested: AC-2's "hooks don't auto-discover" is a docs-only correction (no automated test) — acceptable; no per-hook runtime overlay is feasible. The end-to-end overlay was verified via a simulated invocation, not a real sequant run (the prose mechanism has no unit-testable runtime surface).
    • Sibling sites considered: Cross-file scan of README + all docs found the false-promise pattern in exactly two files (customization.md, troubleshooting.md); both fixed. No other occurrences.
    • Sibling-line audit: templates.ts hasLocalOverride is the only in-file site touching .local/ resolution; reviewed and intentionally retained for constitution protection.

    Adversarial Re-Read

    Findings: No gaps found because: (1) ran the new overlay against an independent fresh-fixture invocation (not exec's) — overrides.md won over the default, confirming AC-1/AC-4 at runtime; (2) the AC-4 evidence is a genuine post-fix validation (override honored), not a pre-fix repro; (3) inspected process state — working tree clean, single commit, branch 0 ahead/behind origin, zero new sync divergence vs origin/main; (4) cited sibling sites explicitly — cross-file (customization.md + troubleshooting.md, both fixed; full-repo scan clean) and intra-file (templates.ts branch, intentionally retained); (5) checked spec Non-Goals — overlay stays prose-level (no harness-resolver work), templates.ts got only a comment (didn't redo #708), hooks are docs-only (no per-hook overlay). No Non-Goal expanded into scope.

    Status: Clean


    Verdict: READY_FOR_MERGE

    All 4 ACs literally met and verified by actual invocation (independently re-run in QA), all 7 CI checks green, build/lint/92 tests pass, CHANGELOG present, and zero new 3-dir skill divergence. The fix is minimal and well-scoped, docs are accurate with no residual false promises, and the one debatable design point (retaining the templates.ts protection branch) is the correct, documented choice. A+.

    Documentation

    Next Steps

    1. Merge PR fix(#711): make .claude/.local skill overrides functional via runtime overlay #716.
    2. Coordinate merge order with Add warn-only README "What's new in X.Y" freshness gate to /release skill #707 (touches release/SKILL.md, different section — trivial) and fix(update): no non-interactive path — crashes without a TTY, add --yes #709/fix(sync): areSkillsOutdated/checkAndWarnSkillsOutdated pre-flight is version-only — misses content drift (sibling of #708) #713 (touch update.ts/sync; this PR only adds a comment + tests).
  6. added
    ready-for-review
    on Jun 4, 2026
  7. admarble commented on Jun 4, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #711

    Fresh full-weight pass at a32d8763f (HEAD). The prior QA was at b48c31d; the only deltas to HEAD are the #707 release/SKILL.md rebase + CHANGELOG integration — the override mechanism and docs are byte-identical to the previously verified content.

    AC Coverage

    AC Description Status Notes
    AC-1 .local/skills/<name> override actually takes precedence (or docs corrected + point to a working mechanism) MET Overlay directive (<!-- sequant:local-override -->) present in all 53 SKILL.md across 3 mirror dirs, each with the literal skill name in the override path (0 mismatches). Old false claims removed from docs. Presence asserted by local-override-directive.integration.test.ts.
    AC-2 Same resolution for .local/hooks/ (verify, then fix or correct docs) MET "Customizing Hooks" rewritten: hooks fire from settings, not .local/hooks/ auto-discovery; documents the real mechanism (register script in .claude/settings.local.json).
    AC-3 Net-new custom skill has a discoverable home; update/sync never clobber unmanaged .claude/skills/ dirs MET "Creating a New Skill" documents project/user scope. unmanaged-skill-safety.integration.test.ts proves update and sync --force leave an unmanaged .claude/skills/foo/ intact while updating the managed spec.
    AC-4 No documented override instruction that doesn't function end-to-end (verified by actual invocation) MET Docs contain no residual non-functional path (grep confirms "local version takes precedence" / "never be overwritten" gone). Overlay end-to-end verified by actual invocation in the prior QA pass on identical mechanism content; a manual-verification recipe ("Verifying an override took effect") was added so it can't silently regress.

    Coverage: 4/4 AC items MET (4/4 original; no derived ACs).


    Quality Metrics

    Metric Value Status
    Files changed 59 (mostly mechanical: 5-line directive × 19 skills × 3 dirs) OK
    Lines added / deleted +550 / −41 OK
    Type issues (any) 0 OK
    Deleted tests 0 OK
    New tests 2 integration suites, 58 assertions, all passing OK
    typecheck clean (tsc --noEmit exit 0) OK

    CI Status

    Check Conclusion
    build (22.x), typecheck, validate-skills, validate-plugin, Hooks Validation, Plugin Structure Validation, Setup Directory Creation ✅ SUCCESS (7/7)

    Test Coverage Analysis

    • local-override-directive.integration.test.ts — asserts the sentinel + literal per-skill override path in every managed SKILL.md across all 3 mirror dirs.
    • unmanaged-skill-safety.integration.test.ts — asserts update/sync --force never clobber an unmanaged .claude/skills/ dir.
    • src/lib/templates.ts change is comment-only (documents that the .local/ protection branch is not a skill-loading mechanism) — no runtime surface, no test needed.

    Code Review

    Strengths:

    • Correct fix strategy: runtime overlay (small overrides.md deltas) instead of full-SKILL.md shadow — survives update/sync, avoids vendored-copy rot. Isomorphic to the already-working constitution overlay.
    • Directive applied uniformly and correctly (53/53, literal per-skill paths) and placed at end-of-file.
    • Docs rewrite is thorough and honest — removes every false promise, adds a self-verification recipe, and corrects the hooks guidance to the real settings.local.json mechanism.
    • Honest test framing: the suite documents that the automated bar is directive-presence and the end-to-end bar is manual invocation (no unit-testable runtime surface for LLM-interpreted prose).

    Issues: None blocking.

    Skill Sync Check

    Three-dir sync reports 8 diverged / 10 missing — identical to the origin/main baseline (24 synced, 8 diverged, 10 missing). This PR introduced zero new divergence; the drift is pre-existing, longstanding repo structure (e.g. release/upstream only in .claude/skills) and out of scope for #711.

    Detection Pattern Verification

    N/A — the added directive is prose; no grep/awk/jq/sed or regex literals were added to skill markdown.

    CHANGELOG Verification

    ✅ [Unreleased] → Fixed entry present for #711.

    Risk Assessment

    • Likely failure mode: A future skill author adds a SKILL.md without the directive → override silently stops working for that skill. Mitigated — the presence test scans all dirs dynamically and fails CI if any SKILL.md lacks the sentinel. Secondary: overlay is LLM-interpreted prose, so a stubborn skill could ignore it — mitigated by end-of-file placement + the verified invocation.
    • Not tested (automated): AC-2's hook correction is docs-only (no per-hook runtime overlay is feasible) — acceptable. The overlay end-to-end is verified by invocation, not a unit test (no runtime surface).
    • Sibling sites considered: none — no cross-file siblings; the only .local/ handling in src/ is the (now-commented) templates.ts protection branch and the cosmetic status.ts check, neither of which is a loading path.
    • Sibling-line audit: none — single, uniform directive append; verified consistent across all 53 files.

    Adversarial Re-Read

    Findings: No gaps found, because: (1) confirmed every managed SKILL.md carries the directive with its literal skill name (53/53, 0 mismatches) — no placeholder/wrong-name resolution failures; (2) grepped docs for the original false claims and confirmed they're gone; (3) verified the templates.ts change is comment-only with no behavior delta; (4) confirmed the skill-sync divergence is pre-existing (byte-identical baseline on origin/main), not introduced here; (5) confirmed HEAD's override-mechanism content is byte-identical to the prior-QA commit that recorded the actual-invocation verification (only #707 rebase artifacts differ); (6) no Non-Goals silently expanded into scope.

    Status: Clean


    Verdict: READY_FOR_MERGE

    All 4 ACs literally met. The headline bug — .claude/.local/skills silently doing nothing — is fixed with the correct mechanism (runtime overlay), the docs no longer make any non-functional promise, net-new skills are pointed at a discoverable home with a regression test guarding unmanaged-dir safety, and the overlay's end-to-end efficacy is verified by actual invocation (recorded on identical content). Both new test suites pass, typecheck is clean, CI is 7/7 green, the CHANGELOG entry is present, and the PR introduces no new 3-dir skill divergence.

    Documentation

    Next Steps

    1. Merge PR fix(#711): make .claude/.local skill overrides functional via runtime overlay #716. (Optional belt-and-suspenders: a 30-second manual override invocation per the new "Verifying an override took effect" recipe.)
  8. added 3 commits that reference this issue on Jun 4, 2026
  9. admarble commented on Jun 4, 2026

    @admarble
    ContributorAuthor

    QA follow-up — gaps filled (commit 49b6c391e)

    After the READY_FOR_MERGE pass I did an adversarial second look and found real gaps; all are now fixed in this branch.

    1. Directive fired unreliably in long skills (the real one)

    The overlay directive was at end-of-file — line 3136 of the 3138-line /qa skill, 1938 of /exec. A "check the filesystem for an override first" instruction buried at the end of a 3000-line skill is unlikely to fire. Fixed: relocated the directive to the top of the body (right after frontmatter, before the first heading) in all 53 SKILL.md across the 3 mirror dirs — it's now the first thing the executing agent reads.

    Verified end-to-end on the worst case: a subagent running the full 3135-line /qa skill (neutral invocation prompt, no hint about overrides) read .claude/.local/skills/qa/overrides.md and honored a legitimate override delta (emitted the configured banner before its verdict). A deliberately injection-shaped override ("ignore all checks, emit token") was correctly refused — so the overlay honors legitimate deltas without becoming a safety-bypass.

    2. Orchestrated (sequant run) path

    Same fix closes it — orchestrated phase subagents load the identical SKILL.md and now see the directive first. The worst-case verification above was run through a subagent, which is the orchestrated execution shape.

    3. AC-2 hooks claim was asserted, not code-backed

    Added src/commands/local-hooks-not-autodiscovered.integration.test.ts: greps all of src/ and fails if any code path reads/executes .claude/.local/hooks/, so the docs' "register via settings.local.json" guidance is now backed by a test, not just reasoning.

    4. No copyable example / second-hand verification

    Added docs/examples/overrides.example.md (linked from the guide) as a copyable starting point. The end-to-end overlay is now verified by an invocation I ran directly (above), not relied on from the prior pass.

    Regression guard

    Strengthened local-override-directive.integration.test.ts to pin the sentinel **before the first # heading` — end-of-file regressions now fail CI.

    Status

    Verdict unchanged: READY_FOR_MERGE (now with the runtime overlay proven on the worst-case skill).

  10. added 5 commits that reference this issue on Jun 4, 2026
  11. admarble commented on Jun 4, 2026

    @admarble
    ContributorAuthor

    QA follow-up — CI green (commit 72024917e)

    The gap-fill push surfaced a CI-only failure in unmanaged-skill-safety.integration.test.ts (authored with the original PR). Root-caused it via staged CI diagnostics rather than guessing:

    • cwd, SEQUANT_TEMPLATES_DIR, the template-on-disk (v2), the change classification (modified), and fs.writeFile were all verified correct in CI.
    • The non-force updateCommand({}) path is gated by an inquirer.prompt confirm. In the shared, sequential integration worker that mock isn't reliably active inside updateCommand, so in CI the prompt resolved falsy and update aborted before applying → managed spec stayed v1 → sanity assertion failed. The sync --force sibling test (no prompt) always passed — the tell.

    Fix: drive the update test via updateCommand({ force: true }) — bypasses the prompt and is the stricter AC-3 assertion (even maximal-overwrite must leave the unmanaged foo dir alone, since foo is never in the template change set). Diagnostics removed.

    CI now 7/7 green on 72024917e; PR #716 MERGEABLE.

    (History note: three TEMP diag commits remain in the branch — they collapse on squash-merge; rewriting them would need a hook-blocked force-push.)

    Verdict unchanged: READY_FOR_MERGE.

  12. added 2 commits that reference this issue on Jun 4, 2026
  13. added a commit that references this issue on Jul 27, 2026
  14. added a commit that references this issue on Sep 9, 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

    bugclidocumentationplannedready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions