precommit

precommit is a skill for Claude Code, Codex from hmj1026/dhpk. It costs 54 tokens per session (617 once invoked), scanned A, original, MIT.

A packaged pre-commit pipeline that runs a project's standard checks in fast or full mode before changes are handed off. It can run lint fixes, a build, and unit tests in a fixed order when the project supports them.

In plain words
What is it for?
Use it before handing repository changes to someone else. It detects the project setup, selects the package manager, runs the configured checks, and returns the runner's final verdict.
Why use it?
It replaces ad hoc checking with one deterministic runner and a clear final result. It also reports changed files and distinguishes passes, failures, and skipped checks.

Skill for Claude CodeCodex

Written for Claude Code and Codex: argument-hint in frontmatter, but also agents/openai.yaml present. Also seen: $skill-name invocation.

Part of the dhpk plugin — 39 skills, 1 command, 1 agent, 3 hooks shipped together

Good fit Use it before handing repository changes to someone else. It detects the project setup, selects the package manager, runs the configured checks, and returns the runner's final verdict.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hmj1026/dhpk/precommit
View source ↗ hmj1026/dhpk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hmj1026/dhpk --skill precommit
Clone the repo
git clone --depth 1 https://github.com/hmj1026/dhpk

Made for: Claude Code, Codex.

Or install dhpk, the plugin that ships this one along with the rest of its 39 skills, 1 command, 1 agent, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for precommit

README.md
[![agentmods](https://agentmods.dev/badge/skills/hmj1026/dhpk/precommit/github.svg)](https://agentmods.dev/skills/hmj1026/dhpk/precommit)
Your own site
<a href="https://agentmods.dev/skills/hmj1026/dhpk/precommit"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/precommit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for precommit

Your own site · 80×15
<a href="https://agentmods.dev/skills/hmj1026/dhpk/precommit"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/precommit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 617 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.00617
Opus 5.5 $0.00022 $0.00247
Sonnet 5.5 $0.00011 $0.00123
Haiku 4.5 $0.00005 $0.00062

Measured yesterday against content hash f46cb126632e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

precommit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/lib/runner-utils.js, scripts/precommit-runner.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

generated/claude-marketplace/package/skills/precommit/SKILL.md · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Precommit

Workflow

Run from the consumer repository. Resolve --fast to fast mode and no flag to full mode, then invoke the package-local runner:

node "$SKILL_DIR/scripts/precommit-runner.js" --mode <fast|full> --tail 80

Here $SKILL_DIR is the installed directory containing this SKILL.md; the current working directory remains the consumer repository. The runner and its adjacent $SKILL_DIR/scripts/lib/runner-utils.js are one local runtime tree. With the setup installer, the runner is .claude/dhpk/skills/precommit/scripts/precommit-runner.js. The runner owns ecosystem detection, package-manager selection, lint:fix -> build -> test:unit ordering, graceful skips, changed-file reporting, and the final verdict. Read references/workflow.md for the terminal boundary.

When NOT to Use

  • A read-only verification loop is requested (use $repo-verify).
  • Dependency security evidence or a fix operation is requested (use $change-verdict deps).
  • A one-off command is requested outside the deterministic precommit pipeline.

Output

Return the runner output, changed-file report, and its final PASS/FAIL or skip evidence. A missing runner, runner crash, or non-zero exit is terminal UNAVAILABLE/FAIL; never replace it with hand-written checks or claim a pass from partial output.

Verification

  • Mode is exactly fast or full and the runner received --tail 80.
  • The package-local runner ran from the consumer repository cwd.
  • The local runner-utils.js helper resolved beside the runner.
  • Runner-owned stage order, skips, changed files, and verdict are intact.
  • A semantic FAIL (summary.json overallPass=false or the final Markdown verdict) remains failure even when the CLI exits zero.
  • Non-zero exit or missing final verdict remains a failure.

References

Read the full file on GitHub · 66 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +8 lines f46cb126632e
  2. 23d ago First seen · 58 lines · 54 tokens per session scan A 85c99dcecd1f

Subscribe to this mod's changes

precommit is a skill published in the GitHub repository hmj1026/dhpk (2 stars, last pushed today), licensed MIT. It adds 54 tokens to every session and 617 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-24.