From skills
Use when the user says "drive the code", "/drive-code", "clean up the code in this PR", "make sure the touched files follow best practices", or asks Claude to do a code-quality pass on the files a PR (or working tree) touches. Evaluates each touched file for single-responsibility, modularity, service/repository pattern compliance, utility placement, naming, length, and runs the project's linter + formatter. Applies mechanical fixes automatically; proposes (with diff) any structural refactor before changing it. Does NOT verify the feature's behaviour (use /drive-feature) or its UX (use /drive-ux).
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:drive-codeThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
drive-code looks at every file the PR changed and asks: does this file
drive-code looks at every file the PR changed and asks: does this file still earn its keep after this change? SRP, layering, utility placement, length, naming, linter + formatter pass.
Mechanical fixes (lint --fix, format) apply automatically. Structural changes (split file, extract function, move util) show a diff first, apply, and get flagged in the report.
Decide which files are in scope, in this priority order:
gh pr diff --name-only against the base branch.git diff --name-only HEAD for uncommitted work.Exclude: lockfiles, generated files (linguist-generated=true, dist/,
build/, generated/, __generated__/, *.pb.*), binary blobs,
fixtures (fixtures/, __fixtures__/, testdata/), vendored code
(vendor/, third_party/, external/).
Detect linter, formatter, TS/JS symbol intel, and test runner from config
files. See references/code-checklist.md for the detection table.
Read CLAUDE.md and the relevant README.md first - the project may
document conventions that override defaults.
Run in parallel where possible:
<linter> --fix <paths>
<formatter> --write <paths>
tslsp code-action --file <path> --kind source.organizeImports --apply 0
Diff what changed. Mechanical fixes are commit-worthy on their own. Capture unfixable lint issues for the Phase 4 report.
Commit mechanical fixes separately from structural ones:
git add -- <only the mechanically-changed files>
git commit -m "lint + format on touched files"
Read each file (use tslsp outline first for TS/JS, then Read only the
interesting parts). Evaluate the categories below - full long-form
checklist with examples and counter-examples lives in
references/code-checklist.md, load it on demand.
Manager/Helper/Util)The reference has examples and counter-examples per category.
For any structural change identified in Phase 3:
formatUserName from
src/profile/UserCard.tsx to src/utils/users.ts - used by 4 other
files."tslsp:
tslsp rename-file src/profile/UserCard.tsx src/utils/users.ts --dry-run
tslsp rename --symbol formatUserName --new-name formatUserName --dry-run
git commit -m "extract formatUserName to src/utils/users.ts"
If borderline, don't apply. Note in the report as "considered but not applied: , because ".
After Phase 2 + Phase 4:
tslsp diagnostics --files <paths>
go build ./... | cargo check | npx tsc --noEmit | pyright
<test-runner> <paths>
If anything fails, stop, surface the failure, and undo the structural change that caused it. Mechanical fixes rarely introduce failures; if they do, flag misconfigured tooling.
drive-code reviewed N files in <pr>/<working tree>.
Mechanical fixes: lint <K> auto-fixed, format <K>, imports organised <K>.
Structural changes applied (each its own commit): <sha> <one-line>...
Considered but not applied: <change> - <reason>
Unresolved lint / flagged for human re-read: <file>:<line> <rule/reason>
CI-equivalent gates: tsc ok, test <N> passed
Be specific. "src/foo.ts is too long" is not actionable; "split
src/foo.ts into foo/queries.ts + foo/mutations.ts - the two share
no state" is.
references/trust-policy.md./drive-pr may suggest /drive-code when reviewers flag the same
issue repeatedly./drive-code, /drive-feature is a good follow-up: code that
reads well still has to behave well./drive-ux is orthogonal - it cares about the user-facing surface.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub 0xdeafcafe/skills --plugin skills