validate-code

A project-aware code check that formats files, fixes lint issues, checks types, and runs the project's tests.

In plain words
What is it for?
Use it to validate a Node, Python, Go, Rust, or similarly configured project before committing code.
Why use it?
It gathers the checks needed before a commit and uses the tools already defined by the project. It also reports which files were changed automatically and where failures occur.

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

Made for: Claude Code, Codex.

Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 575 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.00056 $0.00575
Opus 5 $0.00028 $0.00287
Sonnet 5 $0.00011 $0.00115
Haiku 4.5 $0.00006 $0.00057

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

Security

Grade A, and why

validate-code 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 2d 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.

skills/validate-code/SKILL.md · 39 lines

What it actually says

Validate Code

Run the project's own quality gates — format/lint fix, type check, tests — whatever this project defines. Detect the toolchain; never assume npm.

Workflow

  1. Detect the project's commands. Prefer a task the project already defines over a raw tool call:
    • Node → package.json scripts (lint:fix/lint-fix, lint, typecheck/tsc, test)
    • Python → pyproject.toml / tox.ini / Makefile (ruff --fix/black, ruff/flake8, mypy, pytest)
    • Go → gofmt -w, go vet, go build ./..., go test ./...
    • Rust → cargo fmt, cargo clippy, cargo check, cargo test
    • else → read the Makefile / CI config for the equivalent targets
  2. Format + lint fix (the fix variant). These rewrite files in place and exit 0 silently — capture what changed right after (git status --short / git diff --stat) and remember it for the report. The user is about to commit; they need to know their tree was modified.
  3. Lint + types (check variants).
  4. Tests.
  5. Report: an Auto-fixed section listing files the fix step changed (or "nothing auto-fixed"), then overall PASS or FAIL with file:line error references.

Rules

  • Detect the project's commands — never hardcode a package manager
  • Always auto-fix before reporting errors — but never modify files silently; always report which files auto-fix changed
  • Run fix → check → test sequentially
  • If the fix step fails, still run check + tests; report all failures at the end
  • Report errors as file:line references
  • Never commit, stage, or push anything

Error Handling

  • If no recognizable manifest/tasks → ask the user for the validate command, or report and stop
  • If a step's command doesn't exist → skip it, note it was skipped
  • If all steps missing → report nothing to run, stop
  • If tests time out → report and suggest raising the runner's timeout
  • If a runner crashes (exit code other than 0 or 1) → report crash output and stop
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. 2d ago First seen · 39 lines · 56 tokens per session scan A 2d1666dcfdd5

Subscribe to this mod's changes

validate-code is a skill published in the GitHub repository helderberto/agent-skills (13 stars, last pushed 11d ago), licensed MIT. It adds 56 tokens to every session and 575 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

code-review-and-quality

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.

addyosmani/agent-skills · 51 tokens

constraint-driven-development

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or…

addyosmani/agent-skills · 154 tokens

performance-optimization

Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.

addyosmani/agent-skills · 59 tokens

api-and-interface-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

addyosmani/agent-skills · 49 tokens

doubt-driven-development

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production, security-sensitive logic, irreversible operations), or any time a confident output would be cheaper to verify now…

addyosmani/agent-skills · 67 tokens

test-driven-development

Drives development with tests. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.

addyosmani/agent-skills · 50 tokens