·
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: 8. Review findings remaining: 2.
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. Default to npm if unclear. Also treat the newer Bun text lockfile as indicating bun. If more than one lockfile is present, check the package manager field in package.json and ask the user which to use. Report the chosen package manager to the user before installing anything.
Confirm the current directory is inside a git repository and that package.json sits at the repository root. If it does not, stop and tell the user that the setup needs adjusting for that layout.
Install as devDependencies:
Before installing, tell the user which packages will be installed and with which package manager, and get their confirmation. Include the updated lockfile in the commit so the installed versions are recorded.
Before running this, check for an existing .husky/pre-commit, a custom git hooks path, other hook managers, any existing lint-staged config, and a lint-staged section in package.json. Husky init points git at the .husky/ dir for hooks, so hooks set up elsewhere stop running. If any of these exist, show them to the user and merge with them, or ask the user before replacing anything.
Run this only after the step 2 install has succeeded, so that npx runs the locally installed copy. If the install failed or the local copy is missing, stop and tell the user.
This creates .husky/ dir and adds prepare: "husky" to package.json.
If package.json already has a prepare script, keep it and run husky alongside it rather than replacing it, and tell the user about the change.
.husky/pre-commitWrite this file only when none exists or the user approves replacing it (no shebang needed for Husky v9+):
Adapt: Replace npm with detected package manager. Use the detected package manager's own local runner for every npx call in steps 3, 4 and 7, so only the locally installed copy runs. If repo has no typecheck or test script in package.json, omit those lines and tell the user.
.lintstagedrcWrite this only when no lint-staged config exists or the user approves replacing it.
The star pattern formats every staged file. Recommend that the user create or review a Prettier ignore file covering generated and vendored paths, or narrow the pattern to source file types the user confirms.
.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 includes huskyprettier config existsnpx lint-staged to verify it works, using the local copy from step 2 only; if it is missing, stop and tell the userStage only the files this skill created or changed: package.json, the lockfile, .husky/pre-commit, .lintstagedrc, and .prettierrc if it was created. Show the user git status and the staged diff. Also show the .husky/pre-commit contents and the typecheck and test script definitions from package.json, then get explicit 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. Let the hooks run in full and create a new commit.
prettier --ignore-unknown skips files Prettier can't parse (images, etc.)Get started with chainctlchainctl skill install public/mattpocock/setup-pre-commit:321658273cb1d20b76026717d027d505790106d4
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.chainreg.biz/public/github.com/mattpocock/skills/misc/setup-pre-commit:321658273cb1d20b76026717d027d505790106d4
MIT
HARDENING.md
LICENSE
SKILL.md
agents/openai.yaml