skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
loxosceles-dev/dev-skills101 installs

pre-commit-check

Review staged files before committing for security, code quality, and breakage risks. Follow when preparing a commit or when the git-commits skill triggers a pre-commit check.

How do I install this agent skill?

npx skills add https://github.com/loxosceles-dev/dev-skills --skill pre-commit-check
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill establishes a secure pre-commit workflow by enforcing checks for hardcoded secrets, code quality, and runtime stability. It is a defensive tool designed to prevent security leaks and broken deployments.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

Pre-Commit Check

This is a strict guideline. Follow these rules exactly.

Before any commit, review only the staged files against three gates. All three must pass.


Gate 1: Security

Delegate to the security-checklist skill. Scan staged files for:

  • Hardcoded secrets, API keys, tokens, passwords
  • .env files with real values
  • Credentials, private keys, connection strings

If found: STOP. Do not proceed to Gate 2.


Gate 2: Code Quality

Review staged files against core-principles and standard best practices:

  • DRY — Does this change duplicate logic that already exists elsewhere? Check for copy-pasted code, repeated patterns that should be extracted.
  • Pure functions — Are helpers pure and testable? Are side effects isolated?
  • Fail fast — No silent defaults. Missing config or data should throw, not fall back.
  • Naming — Are variables, functions, and files named clearly?
  • Separation of concerns — Is business logic mixed with I/O or presentation?
  • Error handling — Are errors caught at the right level with actionable context?
  • Dead code — Are there leftover console.log, commented-out blocks, or unused imports?

Report issues. Minor style nits can be noted but should not block the commit.


Gate 3: Will It Break?

Before committing, ask: what will break after push that unit tests won't catch?

Unit tests run automatically — this gate is about the things they miss: runtime environment issues, missing permissions, misconfigured infrastructure, broken deployments.

Always:

  • Does the code build? Run the build.
  • Do existing tests pass? Run them.
  • Are there linter errors? Run the linter.

Infrastructure code (Lambdas, CDK, SST) — this is where most post-push failures come from:

  • Deploy to dev and invoke the Lambda directly.
  • Check CloudWatch for missing environment variables, permission errors, or import failures.
  • Verify any new SSM parameters or secrets actually exist in the target environment.
  • A Lambda can pass every unit test and still fail on invoke. Always invoke it.

Frontend:

  • Does it render without console errors?
  • Does the page load in the browser?

CI-dependent changes (workflows, build configs):

  • Run the relevant step locally if possible (build command, test suite, lint).

The rule: If verification takes less than 2 minutes, do it now. Don't push and hope CI catches it.


Output

When reporting findings, use this format:

🔴 Blocked — [reason, e.g. "hardcoded API key in config.ts"]
🟡 Fix before commit — [code quality issue with file reference]
✅ Verified — [what was tested, e.g. "build passes, Lambda invoked successfully"]

Progressive Improvement

If the developer corrects a behavior that this skill should have prevented, suggest a specific amendment to this skill to prevent the same correction in the future.

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/loxosceles-dev/dev-skills/pre-commit-check">View pre-commit-check on skillZs</a>