precommit

A pre-commit check for a Java Maven project. It formats code, checks style rules, and runs tests in that order, for one module or the whole project.

In plain words
What is it for?
Use it before committing Java changes in a multi-module Maven project. It helps prepare a clean commit and reports which checks passed or failed.
Why use it?
It catches formatting, style, and test failures before a commit. This avoids committing changes that do not meet the project's checks.

Skill for Claude CodeCodex

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.

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

Made for: Claude Code, Codex.

Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 411 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00019 $0.00411
Opus 5 $0.00010 $0.00205
Sonnet 5 $0.00004 $0.00082
Haiku 4.5 $0.00002 $0.00041

Measured yesterday against content hash 932125491236, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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.

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.

.claude/skills/precommit/SKILL.md · 72 lines

What it actually says

Pre-commit Check: Format → Validate → Test

Run this before every commit to catch format and checkstyle issues early.

$ARGUMENTS is an optional module name (e.g. jhelm-core). If omitted, runs against all modules.


Step 1: Auto-format

Single module:

./mvnw spring-javaformat:apply -pl $ARGUMENTS

All modules:

./mvnw spring-javaformat:apply

Step 2: Validate (checkstyle)

Single module:

./mvnw validate -pl $ARGUMENTS 2>&1 | grep -E "^\[ERROR\]|violations"

All modules:

./mvnw validate 2>&1 | grep -E "^\[ERROR\]|violations"

If violations remain after auto-format, invoke the /checkstyle skill to fix them manually. Do not proceed to Step 3 until validate passes cleanly.


Step 3: Run tests

Single module:

./mvnw test -pl $ARGUMENTS 2>&1 | tail -20

All modules (full build):

./mvnw install 2>&1 | tail -20

Outcome

Report a summary:

Step Result
Format Applied / Already clean
Checkstyle 0 violations / N violations (list them)
Tests X passed, 0 failures / list failures

If everything is green, the working tree is ready to commit. If anything fails, fix it before committing.

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 First seen · 72 lines · 19 tokens per session scan A 932125491236

Subscribe to this mod's changes

precommit is a skill published in the GitHub repository alexmond/jhelm (4 stars, last pushed 8d ago), licensed Apache-2.0. It adds 19 tokens to every session and 411 once invoked, about $0.0001 per session on Opus 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-08-31.

Related

Other skills, from other repositories

evergreen

Evergreen CI infrastructure, configuration validation. Use when modifying .evergreen/ config, preparing to submit changes or understanding the Evergreen test matrix.

mongodb/mongo-java-driver · 31 tokens

sync-agents-docs

Sync AGENTS.md files, skills, and references after buildSrc or convention changes. Use after modifying build plugins, formatting rules, testing conventions, or task names to keep documentation consistent.

mongodb/mongo-java-driver · 43 tokens

ai-article

AI 类文章撰写。三种风格:安装教程、产品评测、面试八股。覆盖 AI Coding 工具实测、AI 开发框架应用、大模型测评、Agent/Skills/RAG 技术讲解。.

itwanger/toBeBetterJavaer · 57 tokens

job-article

根据指定选题,按照二哥的写作风格完成求职/校招/面试/职场类文章撰写。专注于秋招春招建议、公司薪资爆料+学习路线、面经八股解析、求职心态与球友故事分享。触发关键词:写一篇求职文章、秋招、春招、校招、offer、面经、薪资、面试、八股、简历、求职建议、球友故事、学习路线等。.

itwanger/toBeBetterJavaer · 118 tokens

video-cover-image

Generate matched 3:4, 16:9, and 4:3 short-video cover images from toBeBetterJavaer video scripts or AI/Java technical topics. Use when the user asks for 视频封面, 封面图, 横版和竖版, 小红书/抖音/B站/快手封面, pure-text covers with 白色大字+黄色小字, reference-image-matched covers, or wants a repeatable cover workflow for Markdown scripts under…

itwanger/toBeBetterJavaer · 113 tokens

video-script

为短视频/口播生成或优化脚本。适用于 AI 技术科普、Agent/Skill/RAG 等技术概念讲解、工具实测、热点拆解类短视频。支持两种模式:给定主题从零产出口播稿、对已有口播稿进行优化。触发关键词包括:口播、口播稿、视频脚本、短视频文案、录视频、拍视频、video script。.

itwanger/toBeBetterJavaer · 99 tokens