check-linters-before-commit

check-linters-before-commit is a skill for Claude Code, Codex from dimetron/pi-go. It costs 30 tokens per session (809 once invoked), scanned A, original, MIT.

A checklist for verifying Go code before creating a Git commit. It covers changed files, linting, tests, and building the pi command-line program.

In plain words
What is it for?
Use it when preparing or checking a commit: run the configured linter, Go tests, and the build command, and fix failures before committing.
Why use it?
It prevents commits from being made while static checks, tests, or compilation are failing.

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/dimetron/pi-go/check-linters-before-commit
Any agent
npx skills add dimetron/pi-go --skill check-linters-before-commit
Clone the repo
git clone --depth 1 https://github.com/dimetron/pi-go

Made for: Claude Code, Codex.

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 check-linters-before-commit

README.md
[![agentmods](https://agentmods.dev/badge/skills/dimetron/pi-go/check-linters-before-commit.svg)](https://agentmods.dev/skills/dimetron/pi-go/check-linters-before-commit)
Your own site
<a href="https://agentmods.dev/skills/dimetron/pi-go/check-linters-before-commit"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/check-linters-before-commit.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 809 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.00030 $0.00809
Opus 5 $0.00015 $0.00404
Sonnet 5 $0.00006 $0.00162
Haiku 4.5 $0.00003 $0.00081

Measured 4d ago against content hash 8cae2e0c4bf3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

check-linters-before-commit 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 4d ago.

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.

.pi-go/skills/check-linters-before-commit/SKILL.md · 112 lines

How it starts

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

Check Linters Before Commit

You are an expert at ensuring code quality by running linters and static analysis before committing changes.

When to Use

Use this skill whenever the user asks to commit, prepare a commit, or check whether code is ready to commit. Run the checks before committing anything, and do not proceed with a commit until the required checks pass.

Workflow

1. Check What Changed

First, identify what files have changed:

git diff --name-only
git diff --cached --name-only

2. Run Linters

Run the full linting suite (uses .golangci.yml v2 config):

golangci-lint run ./...

This covers go vet, staticcheck, errcheck, errorlint, misspell, revive, and more. Falls back to go vet ./... only if golangci-lint is not installed.

3. Run Tests

Verify tests pass:

go test ./...

Since Go 1.27, go test also runs the stdversion vet check by default, which fails on use of stdlib symbols newer than the go directive in go.mod. If a test fails that way, bump go.mod in the same change — do not //nolint around it. See the go-127 skill.

4. Build Verification

Ensure the code builds:

go build ./cmd/pi

Success Criteria

All of the following must pass before reporting readiness or creating a commit:

  • golangci-lint run ./... exits with code 0 (no issues)
  • go test ./... exits with code 0 (all tests pass)
  • go build ./cmd/pi exits with code 0 (builds successfully)

Output Format

Report the status of each check:

## Pre-Commit Checks

| Check | Status | Notes |
|-------|--------|-------|
| Lint (golangci-lint) | ✅ PASS / ❌ FAIL | |
| Tests | ✅ PASS / ❌ FAIL | |
| Build | ✅ PASS / ❌ FAIL | |

**Result:** Ready to commit / Fix issues before committing

If Checks Fail

For each failing check:

  1. Note the specific file:line where the issue occurs
  2. Provide the linter rule/message
  3. Suggest a fix or create a TODO for manual fixing

Example:

Read the full file on GitHub · 112 lines

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. 4d ago First seen · 112 lines · 30 tokens per session scan A 8cae2e0c4bf3

Subscribe to this mod's changes

check-linters-before-commit is a skill published in the GitHub repository dimetron/pi-go (151 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 809 once invoked, about $0.0002 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-30.