Validation Tools¶
Agents validate after every file edit. A 40-second lint run blocks the agent's reasoning loop for 40 seconds. Multiply that by dozens of edits per task, and slow tooling becomes the dominant cost.
Speed Comparison¶
| Category | Traditional | Fast | Speedup |
|---|---|---|---|
| Lint JS/TS | ESLint | Biome | ~40x |
| Lint Python | Flake8/Pylint | Ruff | 10-100x |
| Types Python | mypy | ty | 10-60x |
| Types TS | tsc | Native port | ~10x |
| Packages Python | pip | uv | 10-100x |
| Dead code JS/TS | manual | Knip | N/A |
| Web automation | Selenium | Playwright MCP | N/A |
The speedup compounds. An agent that runs lint, type-check, and tests after each edit might hit validation 50 times in a session. A tool that saves 30 seconds per run saves 25 minutes total.
Hooks for Automatic Validation¶
PostToolUse hooks can trigger validation after file changes. The pattern works when tools finish in under a second. With slow tools, every edit stalls the agent while it waits for feedback.
{
"hooks": {
"PostToolUse": [
{
"matcher": { "tool_name": "edit" },
"command": "ruff check --fix $FILE_PATH"
}
]
}
}
This hook runs Ruff after every file edit. Ruff checks a typical Python file in 10-50ms, so the agent barely notices. The same pattern with Pylint would add 2-5 seconds of delay per edit.
Skills with Validation Steps¶
Skills often include validation as part of their workflow: "After generating the component, run lint and type-check." These steps work when tools are fast. When they're slow, the skill becomes a series of waiting periods with occasional progress.
The /implement in this repository's .agents/commands follows the pattern of edit-then-verify relies on sub-second feedback. Each verification step confirms the previous edit succeeded before moving on. Slow tools break this rhythm.
Agent-Friendly Configuration¶
Agents parse tool output to decide what to do next. Machine-readable formats eliminate ambiguity.
# JSON output for programmatic parsing
biome lint --reporter=json src/
# GitHub Actions format (one issue per line)
ruff check --output-format=github .
# CI mode skips interactive prompts
uv pip install --no-interaction -r requirements.txt
Key flags for agent workflows:
--reporter=jsonor--output-format=jsonfor structured output--no-interactionor--non-interactiveto skip prompts--fixto auto-correct where possible- Exit codes: 0 for success, non-zero for failures
Tool Ecosystems¶
Python¶
The Astral toolchain (uv, Ruff, ty) replaces pip, Flake8/Pylint, and mypy with Rust implementations. All three tools share configuration in pyproject.toml and use consistent command patterns. See Python validation for an overview.
JavaScript/TypeScript¶
Biome handles linting and formatting at roughly 40x ESLint speed, replacing both ESLint and Prettier with a single tool. Knip finds unused files, dependencies, and exports. tsc handles type checking. See JavaScript validation for an overview.
Web¶
Playwright provides browser automation through accessibility snapshots. Chrome DevTools gives access to performance profiling, network inspection, and debugging. See Web validation for an overview.
Feedback Loop Sensitivity¶
A human developer runs the linter once before committing. They skim errors visually and fix them from memory. The 40-second wait is annoying but tolerable.
A proper agent environment should run validation after every edit to confirm the change worked. It reads the full output to understand what to fix. That 40-second wait happens dozens of times per task. The agent cannot skim or work from memory.
Without fast feedback loops, agents produce code that doesn't work. Strong verification guides agents toward correct results, but requires speed to run constantly.
Related Topics¶
- Hooks - PostToolUse triggers validation after edits
- Skills - Validation steps in workflow definitions
- Agent Rules - Where to document command invocations