fix(skills): quality sweep — compile errors, stale facts, contradictions across 20 skills#184
Merged
Merged
Conversation
…ons across 20 skills Four-agent adversarial review of all 28 pre-existing skills (the event-sourcing skill was reviewed separately in #181), every finding independently verified before fixing: - 9 snippet groups that failed tsc 5.7.2 --strict: union access without narrowing (testing, ddd testing-by-layer), implicit any (testing, react-testing legacy), Record indexed on a union member missing the key (hexagonal cross-cutting), self-overwriting spread + wrong-arity factory call (ddd aggregate-design), evolve vs the union state the skill mandates (ddd domain-events), dangling variable (api-design idempotency), non-UUID randomUUID mock (characterisation-tests), and the incoherent over-engineered compose example (functional) - Stale/wrong facts: Stryker trim() mutation, deprecated Zod idioms, fabricated npm package, getByDisplayValue as a Browser Mode locator, RFC 9745 Deprecation header syntax, Stripe v2, 422 reason phrase, dead attribution link, npx skills check side effects, PlantUML mxgraph portability, stale Gemini example - Contradictions: DDD Occasion shape drift, cli-design FakeLogger vs the Logger port + falsely-justified assertions, optimistic locking vs error-modeling, CORS vs disable-OPTIONS, Gherkin framing vs this repo's behaviour-driven testing rule, refactoring bullets that forbade all refactoring, storyboard /harden + commit-gate drift, three wrong relative resource paths All fenced-snippet fixes re-verified under tsc --strict; ./test/run.sh passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Since skills CLI ~1.5, npx skills add copies each skill into ~/.claude/skills/<name> as a regular directory tracked in ~/.agents/.skill-lock.json, instead of symlinking through the universal ~/.agents/skills/ cache. install-claude.sh still assumed symlink-or-legacy, so every run moved all CLI-managed skills aside as pre-skills.sh leftovers and then warned that the fresh copies won't be visible to non-Claude agents — an endless move-and-reinstall cycle that loses skills if an install step fails after the move. Teach migrate_legacy_skill_dirs and verify_skills_installed to consult the skills CLI lock file: symlinks and lock-tracked directories are CLI-managed and left alone; only unmanaged strays are migrated or flagged. Add test/install-claude-skill-layout.sh covering the three layouts (old-CLI symlink, new-CLI lock-tracked copy, genuine leftover). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A four-agent adversarial review of all 28 pre-existing skills (event-sourcing was reviewed separately in #181), applying the same methodology that caught the non-compiling snippets there: extract every fenced TypeScript block and compile under
tsc 5.7.2 --strict; verify factual claims against primary sources, npm registries, and installed CLIs; hunt internal contradictions and broken references. Every finding was independently verified with a compiler error or a source URL before being fixed — several suspicious-looking claims were positively confirmed correct and left alone (Stryker flags, RateLimit draft status, OWASP list, 12-factor names, codex/claude/gemini CLI flags, Vitest Browser Mode APIs).Fixed — snippets that did not compile under strict TS (9 groups)
toEqualassertions, with a note on why); implicit-anyparams +awaitin a non-asyncitcallback in the extraction example;Pickfactory tip that required all picked fields (nowPartial<Pick<…>>); a spy example that never triggered its own spytesting-by-layerunion narrowing;aggregate-design'screateOccasion(self-overwriting spread that silently undid the advertised.trim(), zero-arg call to a one-arg factory);domain-events'evolvecould not typecheck against the discriminated-union state the skill itself mandatesRecord<PledgeResult['reason'], number>indexed a union member the success variant lacks (nowExtract<…>)resultvariable that was never defined (restored the dropped parse step)randomUUIDmocked with a non-UUID literal (its return type is a 4-hyphen template literal)anyprovider/render-helper paramscomposeexample didn't compile and filtered strings by.active— now coherent, so its only flaw is the unnecessary abstractionFixed — stale or wrong facts
trim()by removal (the swap pair istrimStart()↔trimEnd())z.string().email()/uuid()→z.email()/z.uuid()vitest-compatible-jest-extended-snapshotdoes not exist on npm and Vitest has no "Jest compatibility mode";approvalsintegration claim tightenedgetByDisplayValueis not a Vitest Browser Mode locator;getByPlaceholdernaming difference flagged@-timestamp Structured-Field syntax, not an IETF draft with HTTP-date/v2in 2024 — "never made a v2" correctednpx skills checkis undocumented and applies updates — guidance now points atnpx skills updatemxgraph.*stencils are a docu.md-viewer extension official renderers reject — portability warning added, plus a "where will this be viewed?" rule in diagrams (GitHub renders only ```mermaid)Fixed — contradictions and broken references
Occasionentity now matches every snippet that uses it (totalPledged/isFundingClosed/GiftIdea.status)FakeLoggernow implements the realLoggerport (was silently recording categories as messages); two type assertions with false written justifications deleted (the code compiles without them);FORCE_COLORprecedence wording/harden→/impeccable harden(no standalone skill exists), commit steps respect the commit-approval gate, pre-commit-hook claim hedgedresources/…from files already insideresources/, and a cross-skill file referenced as if local)Also included — installer fix (supersedes #183)
install-claude.shstill assumed the old skills CLI layout (symlinks into the universal~/.agents/skills/cache). Since skills CLI ~1.5,npx skills addcopies each skill into~/.claude/skills/<name>as a regular directory, tracked in~/.agents/.skill-lock.json. The installer treated every regular directory as a pre-skills.sh leftover, so each run moved all CLI-managed skills aside as "legacy", reinstalled them, then warned they "won't be visible to non-Claude agents" — an endless move-and-reinstall cycle that silently loses skills if an install step fails after the move (and made a newly merged skill likeevent-sourcingfrom #181 look like the installer "wasn't updated"; verified with sandboxed-HOMEinstalls that discovery itself is fine — all 29 skills + resources land).migrate_legacy_skill_dirsandverify_skills_installednow consult the skills CLI lock file via a newskill_is_lock_managedhelper: symlinks (old layout) and lock-tracked directories (new layout) are CLI-managed and left alone; only genuinely unmanaged directories are migrated or flagged. Newtest/install-claude-skill-layout.sh(written RED first against the old behaviour) covers all three layouts. Separatepatchchangeset included.Testing
tsc --strictfrom the updated markdown./test/run.sh— all passChangeset
Includes
.changeset/skills-quality-improvements.md(patch).🤖 Generated with Claude Code