setup-pre-commit
Set Up Reliable Pre-Commit Checks
Manual formatting and validation allow avoidable issues into commits. This skill configures Husky, lint-staged, Prettier, type checks, and tests for consistent local checks.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "setup-pre-commit" from https://skillstore.io/skills/mattpocock-setup-pre-commit.md and its manifest at https://skillstore.io/api/skills/mattpocock-setup-pre-commit/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "setup-pre-commit". Set up pre-commit checks in this npm project.
Expected outcome:
- Detected npm from package-lock.json.
- Installed the three development tools and initialized Husky.
- Added staged formatting and available validation scripts.
- Ran lint-staged successfully and displayed the files ready to commit.
Using "setup-pre-commit". Add hooks without changing our current Prettier rules.
Expected outcome:
Kept the existing Prettier configuration, created the Husky hook and lint-staged settings, then verified staged formatting.
Using "setup-pre-commit". Configure this pnpm project, which has no test script.
Expected outcome:
Detected pnpm, configured formatting and type checking, omitted tests, and reported the missing test script.
Security Audit
Medium RiskAll 22 static findings are false positives caused by Markdown backticks and fenced examples, not Ruby backtick execution or injectable command construction. One semantic risk remains: the workflow instructs the agent to stage every changed file, which can include unrelated or sensitive work.
Confirmed security concerns (1)
Risk Factors
โ๏ธ External commands (22)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/mattpocock-setup-pre-commit/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/mattpocock-setup-pre-commit?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/mattpocock-setup-pre-commit?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/mattpocock-setup-pre-commit/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/mattpocock-setup-pre-commit.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
mattpocock. (2026). setup-pre-commit security audit report (audit version 5) [Author version unspecified]. Skillstore. https://skillstore.io/skills/mattpocock-setup-pre-commit/audits/5BibTeX citation
@techreport{mattpocock-mattpocock-setup-pre-commit-2026,
author = {mattpocock},
title = {setup-pre-commit security audit report (audit version 5)},
institution = {Skillstore},
year = {2026},
number = {5},
url = {https://skillstore.io/skills/mattpocock-setup-pre-commit/audits/5},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "setup-pre-commit security audit report (audit version 5)"
version: "unspecified"
type: report
authors:
- name: "mattpocock"
date-released: "2026-07-23"
url: "https://skillstore.io/skills/mattpocock-setup-pre-commit/audits/5"
identifiers:
- type: other
value: "skillstore:mattpocock-setup-pre-commit:audit:5"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: MediumWhat You Can Build
Protect Feature Commits
Add formatting and validation checks before new application code enters project history.
Standardize Team Repositories
Apply consistent local commit checks across an existing JavaScript project.
Modernize Project Tooling
Add Husky and lint-staged to a maintained repository without replacing its existing Prettier settings.
Try These Prompts
Set up pre-commit checks in this repository. Detect the package manager and explain each changed file before committing.
Add Husky and lint-staged. Keep the existing Prettier configuration and use only typecheck or test scripts already present.
Inspect this repository for existing hooks and scripts. Configure compatible pre-commit checks, report omitted checks, and run the documented verification.
Plan a Husky v9 setup using the detected package manager. Minimize hook duration, test lint-staged, show the staged diff, and request commit confirmation.
Best Practices
- Review existing hooks, package scripts, and formatting settings before making changes.
- Run lint-staged and inspect the staged diff before creating the setup commit.
- Keep pre-commit checks fast enough for regular local use.
Avoid
- Do not replace an existing Prettier configuration with generic defaults.
- Do not add typecheck or test commands when package.json lacks those scripts.
- Do not stage unrelated repository changes with the setup files.
Frequently Asked Questions
Which package managers are supported?
Will it replace my Prettier configuration?
What happens when typecheck or test scripts are missing?
What runs before each commit?
Does the workflow create a commit?
Which Husky version does the hook format target?
Developer Details
Author
mattpocockLicense
MIT
Skillstore revision
r2
Version notice
The author did not declare a version.
Ref
ebdfe608f5de2b66ff37ab4af12af8ac4f5e8006
Maintenance freshness
7/25/2026
Usage
4 downloads ยท 0 views
File structure
๐ SKILL.md