spec-spine: Skill for Claude Code

.claude/skills/validate-and-fix/SKILL.md

validate-and-fix is a skill for Claude Code from statecrafting/spec-spine. It costs 44 tokens per session (1,321 once invoked), scanned A, original, Apache-2.0.

A local continuous-integration check-and-fix routine. It runs the same validation gate used by the project’s CI system, sorts failures by severity, and sends decisions it cannot safely make to a human.

In plain words
What is it for?
It is for running builds, tests, linters, and specification checks; grouping their failures; fixing ordinary problems; and escalating coupling or protected-file issues.
Why use it?
It avoids guessing which commands CI runs and prevents unsafe fixes to specification or protected files. It also gives developers the full error details needed to fix problems locally before committing.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions AGENTS.md.

This is statecrafting/spec-spine's own configuration. It tells Claude Code how to work on spec-spine itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything spec-spine configures →

Reuse

Borrowing it

Nothing to install: this file belongs to statecrafting/spec-spine. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/statecrafting/spec-spine/main/.claude/skills/validate-and-fix/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/statecrafting/spec-spine

Made for: Claude Code.

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 validate-and-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/statecrafting/spec-spine/validate-and-fix.svg)](https://agentmods.dev/skills/statecrafting/spec-spine/validate-and-fix)
Your own site
<a href="https://agentmods.dev/skills/statecrafting/spec-spine/validate-and-fix"><img src="https://agentmods.dev/badge/skills/statecrafting/spec-spine/validate-and-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,321 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00044 $0.01321
Opus 5 $0.00022 $0.00660
Sonnet 5 $0.00009 $0.00264
Haiku 4.5 $0.00004 $0.00132

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

Security

Grade A, and why

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

.claude/skills/validate-and-fix/SKILL.md · 108 lines

How it starts

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

/validate-and-fix

Run the local CI loop and fix what it surfaces. When AGENTS.md names a composite (a make ci, a script), that composite is the single source of truth for what CI validates: if it passes locally, CI passes too. Many projects declare no composite; then the gate command list under "Working the backlog" is the source of truth and step 1 runs it directly. Either way, do not rediscover validation commands by grepping manifests: read what AGENTS.md declares, and if it declares neither, say so rather than inventing a gate.

1. Run the gate

Run the gate exactly as AGENTS.md "Working the backlog" lists it under "Run the gate before every commit". The governance floor is spec-spine compile, spec-spine index, spec-spine lint --fail-on-warn, spec-spine index check, spec-spine couple --base origin/main --head HEAD, and spec-spine index coverage --fail-on-untraced where ownership is required; the stack's build, tests, and lints follow. Run git fetch origin main first if the coupling gate cannot find its base.

Capture full output (file paths, line numbers, messages) and categorize:

  • CRITICAL (human decision, do not fix silently): a coupling failure (C-001 drift, or a C-002 whose only remedy is editing a spec you are not implementing); any change to a never-touch artefact the path-scoped rules name (a golden vector, a fixture chain, an evaluation baseline); a dependency cycle; an ambient input (clock, environment, unordered map) reaching a hashed path.
  • HIGH: test failures, build breaks, index or registry staleness, a C-002 whose remedy is claiming the file in the spec being implemented (the legitimate edit .claude/rules/adversarial-prompt-refusal.md names).
  • MEDIUM: spec-spine lint warnings (the gate runs --fail-on-warn), linter findings, type errors, dependency advisories with a fix.
  • LOW: formatting, wording in prose, minor cleanups.

If a check is missing from the composite, add it to the composite and to the CI workflow in the same change; never introduce a validation as a one-off script.

Read the full file on GitHub · 108 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 · 108 lines · 44 tokens per session scan A 5002811c351d

Subscribe to this mod's changes

validate-and-fix is a skill published in the GitHub repository statecrafting/spec-spine (10 stars, last pushed today), licensed Apache-2.0. It adds 44 tokens to every session and 1,321 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-09-07.

Related

Other skills, from other repositories

systematic-debugging

4-phase root cause debugging: understand bugs before fixing.

NousResearch/hermes-agent · 16 tokens

langsmith-observability

LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.

davila7/claude-code-templates · 45 tokens

experimental-code-coverage-local-debugger

Runs code coverage locally via Universal Test Runner (UTR) or helper scripts, mimicking LUCI trybots. Activate when CQ tryjobs fail or underreport coverage, to test local GN/recipe repairs before uploading, or to debug hermetic crashes.

chromium/chromium · 59 tokens

adversarial-reviewer

Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.

emdash-cms/emdash · 71 tokens

cli-e2e

Write, modify, or debug Docker-based Composio CLI end-to-end tests under ts/e2e-tests/cli, including binary invocation, fixture isolation, output assertions, and package manifests. Use for CLI E2E test suites only; use cli-command for CLI source implementation.

ComposioHQ/composio · 62 tokens

ios-simulator

Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an iPhone or iPad Simulator.

callstack/agent-device · 69 tokens