·
Last changedVersion:
This version passed the hardening gate. Hardening applied 9 targeted changes and preserved all other text. Classified findings before hardening: 1. Classified findings closed: 0. Classified findings remaining: 1. Unclassified scanner findings remaining: 0. Review findings closed: 11. Review findings remaining: 1.
1
1
Expand | File | Group | Subtype | Severity | Status |
|---|---|---|---|---|---|
SKILL.md | Supply Chain & Install-Time Trust | — | Medium | Open |
1 finding
Check for package-lock.json (npm), pnpm-lock.yaml (pnpm), yarn.lock (yarn), bun.lockb (bun). Use whichever is present. If several lockfiles or none are found, ask the user which package manager to use. Before installing, check the repo's package manager config files for a custom registry and report any you find to the user.
Install as devDependencies:
Use the detected package manager's dev dependency option. Husky must be version nine or later, since later steps rely on that behavior. Keep the updated lockfile and include it in the commit so later installs resolve the same versions. Tell the user these packages come from the registry at their current versions so they can review them.
This creates .husky/ dir and adds prepare: "husky" to package.json.
Before running it, check package.json for an existing prepare script and check for an existing .husky/pre-commit. Tell the user this adds a prepare script and a committed hook that run for every contributor, and get confirmation first. If a prepare script already exists, keep it and run husky after it. Run npx husky init only after step 2 has installed Husky locally; if the local package is missing, stop and tell the user so that npx uses the project copy only.
.husky/pre-commitIf .husky/pre-commit already exists, merge these lines into it or ask the user before replacing it. Otherwise write this file (no shebang needed for Husky v9+):
Adapt: Replace npm with detected package manager. Replace npx with the detected package manager's command for running a locally installed binary, so the hook uses only the project copy. If repo has no typecheck or test script in package.json, omit those lines and tell the user. Before adding the typecheck and test lines, show the user the exact script contents from package.json and get confirmation.
.lintstagedrcIf a lint-staged config already exists (including a lint-staged key in package.json), merge into it or ask the user before replacing it.
Tell the user this hook rewrites every staged file Prettier understands in place on each commit, and suggest a Prettier ignore file for generated or vendored content if the repo has any.
.prettierrc (if missing)Only create if no Prettier config exists. Use these defaults:
.husky/pre-commit exists and is executable.lintstagedrc existsprepare script in package.json is "husky"prettier config existsnpx lint-staged to verify it works, using the locally installed copy; if it is missing, stop and tell the userStage only the files this skill changed or created (package.json, the lockfile, .husky/pre-commit, .lintstagedrc, and .prettierrc if created). Leave other pre-existing changes unstaged unless the user approves. Show the user the git status and the staged diff, and ask for confirmation before committing with message: Add pre-commit hooks (husky + lint-staged + prettier)
This will run through the new pre-commit hooks: a good smoke test that everything works. Make this commit only after the user has approved running the typecheck and test scripts. If the hook fails, report the failure output to the user and let the user decide the next step; keep the hooks active and leave code and tests as they are.
prettier --ignore-unknown skips files Prettier can't parse (images, etc.)Get started with chainctlchainctl skill install public/mattpocock/setup-pre-commit:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/mattpocock/skills/misc/setup-pre-commit:latest
MIT
HARDENING.md
LICENSE
SKILL.md
agents/openai.yaml