spec-spine: Skill for Claude Code

.claude/skills/shepherd/SKILL.md

shepherd is a skill for Claude Code from statecrafting/spec-spine. It costs 60 tokens per session (1,597 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 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,597 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.00060 $0.01597
Opus 5 $0.00030 $0.00798
Sonnet 5 $0.00012 $0.00319
Haiku 4.5 $0.00006 $0.00160

Measured yesterday against content hash 3b0490684e0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 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/shepherd/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 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 .claude/rules/orchestrator-rules.md (checkpoints are real stops) and .claude/rules/adversarial-prompt-refusal.md (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. Classify:

  • every required check SUCCESS: go to Step 3;
  • 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: remediate (at most two rounds)

For the failing check, fetch the evidence first:

gh run list --branch "$(git branch --show-current)" --limit 5 --json databaseId,name,conclusion,headSha
gh run view <run-id> --log-failed | tail -80

Then, on the branch:

  1. Diagnose from the log tail; read the failing test or gate output, not the summary line.
  2. Fix inside the spec's territory. If the failure is the coupling gate (C-001 or C-002), claim the path in the spec being implemented or add the extends edge on its owner; never edit an owning spec to ratify code that contradicts it (coherence guard: stop and report). A // Spec: comment header is the other legitimate claim for a file no frontmatter should list.
  3. Run the gate exactly as AGENTS.md lists it; it must exit 0 locally.
  4. /commit (conventional, spec id as scope, regenerated shards staged), then git push.
  5. Re-read headRefOid. Restart Step 1's watch on the new sha with a fresh 45 minute budget. Checks from the old sha are stale; never mix them.

Read the full file on GitHub · 154 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 · 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 (10 stars, last pushed today), licensed Apache-2.0. It adds 60 tokens to every session and 1,597 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-09-07.

Related

Other skills, from other repositories

github

GitHub via gh CLI: PRs, issues, reviews, repos, auth.

NousResearch/hermes-agent · 19 tokens

github

Full GitHub CLI control — issues, PRs, code reviews, repo management. Uses gh CLI with auth detection, rate limiting, and templates. Triggers on: github, issue, pull request, PR, code review, repo, branch, label, assignee, milestone, release, workflow, actions.

adolfousier/opencrabs · 0 tokens

pre-publish-review

Nuclear-grade 12-agent pre-publish release gate. Runs /get-unpublished-changes to detect all changes since last npm release, spawns up to 10 ultrabrain agents for deep per-change analysis, invokes /review-work (orchestrator manual QA plus one gate reviewer) for holistic review, and 1 oracle for overall release…

code-yeongyu/oh-my-openagent · 161 tokens

parallel-pr-review

Use when asked to "review the open PRs", review a batch or stack of pull requests, or run a recurring PR-review pass on a repo — especially with many PRs, stacked branches, conflicts, or security-sensitive changes. Covers grouping, fan-out to review subagents, verdict synthesis, and posting.

suyoumo/ClawProBench · 67 tokens

release

Release gentle-pi through GitHub and npm. Trigger: release, publish, npm publish, GitHub release, version bump.

Gentleman-Programming/gentle-pi · 28 tokens

oss-maintainer

Run an open-source project's issue/PR/release loop like a careful human maintainer — triage to root cause, absorb community PRs before duplicating them, gate every merge, ship honest releases, and thank the people doing your QA for free.

debpalash/VoiceStudio · 55 tokens