validate-before-commit

A pre-commit checklist that selects the required linting, formatting, testing, and compliance checks based on the files changed. A pre-commit hook is an automatic check that runs before Git creates a commit.

In plain words
What is it for?
Use it before committing or pushing changes to determine and run the applicable validation commands, and to install the repository's pre-commit hooks.
Why use it?
It reduces the chance of committing files that fail the repository's required checks. It also explains which checks apply to scripts, tests, agent files, skills, and research documents.

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/endogenai/dogma/validate-before-commit
Any agent
npx skills add EndogenAI/dogma --skill validate-before-commit
Clone the repo
git clone --depth 1 https://github.com/EndogenAI/dogma

Made for: Claude Code, Codex.

Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,999 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.00102 $0.01999
Opus 5 $0.00051 $0.01000
Sonnet 5 $0.00020 $0.00400
Haiku 4.5 $0.00010 $0.00200

Measured yesterday against content hash 6d5601abe0a6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

validate-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 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.

.github/skills/validate-before-commit/SKILL.md · 200 lines

How it starts

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

Validate Before Commit

This skill enacts the Algorithms Before Tokens axiom from MANIFESTO.md: validation is encoded once as a deterministic gate and executed consistently, not re-checked interactively per session. The full guardrail sequence is governed by AGENTS.md § Guardrails. When this skill and those documents conflict, the primary documents take precedence.


1. Decision Table — Which Checks Apply

Run the checks corresponding to which file types were changed:

Files changed Required checks
scripts/ or tests/ Lint, format, fast tests
.github/agents/*.agent.md Lint, format, fast tests, agent compliance, drift check
.github/skills/*/SKILL.md Lint, format, fast tests, skills compliance
docs/research/*.md Research doc compliance
Any of the above All applicable checks in the rows above
None of the above (docs, plans, guides) No code checks required

Pre-commit hook coverage — the hooks in .pre-commit-config.yaml run automatically on git commit (and fast-tests on git push) once installed with uv run pre-commit install. They cover every row in this table. If pre-commit is installed, manual checks are needed only for lychee dead links (network-only, no local equivalent).

When in doubt, run all checks. The full sequence takes under 60 seconds on a warm environment.


2. Full Check Sequence

2.1 Lint and Format

uv run ruff check scripts/ tests/
uv run ruff format --check scripts/ tests/

To auto-fix format violations (safe, no logic changes):

uv run ruff format scripts/ tests/

2.2 Fast Tests

uv run pytest tests/ -x -m "not slow and not integration" -q

The -x flag stops on the first failure. The marker filter skips network and slow tests — fast enough to run before every commit.

2.3 Agent File Compliance

Run this only when .github/agents/*.agent.md files were changed:

Read the full file on GitHub · 200 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. yesterday First seen · 200 lines · 102 tokens per session scan A 6d5601abe0a6

Subscribe to this mod's changes

validate-before-commit is a skill published in the GitHub repository EndogenAI/dogma (2 stars, last pushed 8d ago), licensed Apache-2.0. It adds 102 tokens to every session and 1,999 once invoked, about $0.0005 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.