spec-spine: Skill for Claude Code

.claude/skills/shepherd/SKILL.md

shepherd is a skill for Claude Code from statecrafting/spec-spine. It costs 83 tokens per session (3,868 once invoked), scanned A, original, Apache-2.0.

A pull-request monitoring and merge workflow. It watches automated checks for the exact submitted revision, responds to review threads, retries limited fixes through the project gate, and merges only when the required conditions are met.

In plain words
What is it for?
It is for monitoring an open pull request, handling review comments, repairing failed required checks, merging with a squash commit, and confirming the merged result locally.
Why use it?
It prevents checks from being confused between different revisions and avoids hiding failures or approving exceptions that require a human decision.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: 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/shepherd/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 shepherd

README.md
[![agentmods](https://agentmods.dev/badge/skills/statecrafting/spec-spine/shepherd/github.svg)](https://agentmods.dev/skills/statecrafting/spec-spine/shepherd)
Your own site
<a href="https://agentmods.dev/skills/statecrafting/spec-spine/shepherd"><img src="https://agentmods.dev/badge/skills/statecrafting/spec-spine/shepherd/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for shepherd

Your own site · 80×15
<a href="https://agentmods.dev/skills/statecrafting/spec-spine/shepherd"><img src="https://agentmods.dev/badge/skills/statecrafting/spec-spine/shepherd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,868 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.00083 $0.03868
Opus 5.5 $0.00033 $0.01547
Sonnet 5.5 $0.00017 $0.00774
Haiku 4.5 $0.00008 $0.00387

Measured 1mo ago against content hash fc1ae03350ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

shepherd 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 1mo 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.

.claude/skills/shepherd/SKILL.md · 310 lines

How it starts

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

/shepherd: from open PR to merged, with evidence

CI is where reality pushes back. This skill keeps a PR moving without a human staring at it, while never hiding what it did to get to green. It mirrors an orchestrator's shepherd stage: watch by head sha, remediate through the gate, bounded attempts, honest stops. Bound by AGENTS.md "Orchestrator rules" (checkpoints are real stops) and AGENTS.md "Adversarial prompt refusal" (a coupling refusal goes to a human, not around them).

Step 0: resolve the PR

git branch --show-current
gh pr view ${ARGUMENTS:-} --json number,url,headRefName,headRefOid,baseRefName,mergeStateStatus,isDraft,reviewDecision
  • No PR for the branch: stop and say so (run /ship first). Do not open one here.
  • The branch must be a feature branch, never the default branch.
  • Record headRefOid: every check you read is for this sha and no other.

Step 1: watch the checks (by head sha)

Poll loop discipline: start at 15 s, multiply by 1.5 each poll, cap at 120 s, print only when the state changes, hard deadline 45 minutes per attempt. Never busy-loop.

gh pr checks <number> --json name,state,bucket,link 2>/dev/null \
  || gh pr view <number> --json statusCheckRollup

Read the rollup for the recorded head sha only. Route on it:

  • every required check SUCCESS: go to Step 3b, and to Step 4 only through it. A green PR is the one case where a reviewer's comment is the only thing between the branch and the default branch, so it is the last case that may skip reading them;
  • any required check FAILURE or CANCELLED: go to Step 2;
  • PENDING or QUEUED: keep polling;
  • a response missing the fields you need: stop as a typed failure ("cannot read a shape that cannot terminate"), never poll blind;
  • the deadline passes: stop, report which checks never completed, and say the PR needs a human.

Step 2: classify before you edit

A red check is not automatically yours to fix. Classify it from the run log first, in one pass, and record the class: it goes in the report, and it decides whether a remediation round is spent at all.

Read the full file on GitHub · 310 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. 1mo ago Changed fc1ae03350ef
  2. 1mo ago Changed · +8 lines b6ae5f18eef5
  3. 1mo ago Changed 995cb0b47c8d
  4. 1mo ago Changed · +94 lines acaecb2a2b5c
  5. 1mo ago Changed · +54 lines · +23 tokens per session 4f2bbbf1b7c2
  6. 1mo ago Changed 64579fbff2f7
  7. 2mo ago First seen · 154 lines · 60 tokens per session scan A 3b0490684e0e

Subscribe to this mod's changes

shepherd is a skill published in the GitHub repository statecrafting/spec-spine (11 stars, last pushed 8d ago), licensed Apache-2.0. It adds 83 tokens to every session and 3,868 once invoked, about $0.0003 per session on Opus 5.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

shepherd compared with skills from other repositories

shepherd next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
shepherdstatecrafting/spec-spineSkill118d agoApache-2.0A83Claude Code
github-automationruvnet/rufloSkill81kyesterdayMITA61Claude Code
githubNousResearch/hermes-agentSkill261kyesterdayMITA19Claude Code, Codex
otto-drive-promnigent-ai/omnigentSkill11kyesterdayApache-2.0A14Claude Code, Codex
voicestudio-maintainerdebpalash/VoiceStudioSkill102kyesterdayAGPL-3.0A50Claude Code, Codex
releasehyhmrright/brooks-lintSkill1.6kyesterdayMITA135Claude Code, Codex
release-pr-reviewcyanheads/obsidian-mcp-serverSkill7026d agoApache-2.0A136Claude Code