agentic-validators
3
总安装量
3
周安装量
#59675
全站排名
安装命令
npx skills add https://github.com/vishalsachdev/claude-skills --skill agentic-validators
Agent 安装分布
opencode
3
gemini-cli
3
claude-code
3
github-copilot
3
codex
3
cursor
3
Skill 文档
Agentic Validators
Goal
Turn âagent wrote codeâ into âagent wrote code and the change is validated automatically.â
This skill helps you:
- choose the right validation strategy (per-file vs repo-wide)
- implement post-tool-use and stop hooks
- create narrow validators (fast, deterministic checks)
- structure work so multiple agents can run in parallel without losing correctness
Mental model
- Agents are non-deterministic; validators are deterministic.
- Context is fragile; validation + logs are durable.
- Prefer small, fast checks close to the change (per-file) + a final global gate (repo-wide).
When to use which hook
Post-tool-use hook (best default)
Use when:
- you want immediate feedback after edits
- you can validate the specific file(s) that were touched
- you want high signal without running the full test suite
Typical checks:
- formatting (prettier/black)
- linting (eslint/ruff)
- typecheck for that file/module (tsc –noEmit with project config)
Stop hook (end-of-run gate)
Use when:
- you need repo-wide invariants
- you want one last âexit criteriaâ check
Typical checks:
- unit tests
- build
- integration tests
Step-by-step: add validators to a repo
-
Identify file types and fast checks
- JS/TS: prettier + eslint + typecheck
- Python: ruff + pytest (optional)
- Go: gofmt + go test (optional)
-
Implement per-file validator(s)
- A validator should be:
- fast (<5â30s)
- deterministic
- clear output
- safe to run repeatedly
- A validator should be:
-
Wire into hooks
- Implement post-tool-use hook calling validator with the file path.
-
Add logs
- Write to a predictable location (e.g., .agent-logs/validators.log)
-
Add a stop-hook âfinal gateâ
- Run the broader checks once.
Example validator patterns
Pattern A: âformat + lintâ for a touched file
- Format file
- Lint file
- If any change was made by formatter, fail and ask agent to re-run with formatter changes committed
Pattern B: âcontract testâ
- For touched module, run a focused unit test subset
Pattern C: âreadme/docs invariantâ
- If docs changed, run markdown lint + link checker
Parallelism pattern
If you have many similar files (CSV, configs, docs):
- spawn one subagent per file
- each subagent runs its own post-tool-use validator
- aggregator agent only accepts results where validators passed
Common failure modes & fixes
- Validator too slow â split into fast per-file checks + slower stop hook.
- Validator flaky â remove network calls, pin versions, add retries only where safe.
- Agent ignores tool docs â write a short âconstitutionâ section and point to reference files.