Herds Claude Code through your project's conventions: injects a per-project task->skill routing table on every prompt and blocks edits to governed files unless the matching skill was invoked first. Project rules live in .claude/sheepdog/config.json (scaffold it with /sheepdog:setup); the plugin ships no project-specific rules. Hooks are plain bash + jq; on governed projects the gate fails closed when jq is missing or the config is broken.
You wrote skills so Claude would follow your project's standards to the letter: how
a component is structured, what an API route returns, how a migration is written.
Claude read them. And forty minutes into a session, it writes the component by hand
anyway — its own way, politely, confidently, wrong.
Ask it afterwards why it skipped the skill and you get the same answer every time:
"I thought I didn't need it." It did need it. That is the flaw in advisory
guidance: the model decides when your conventions apply, and it decides wrong
exactly when it matters.
sheepdog takes that decision away from the model. Like the border collie it's named
after, it doesn't cage the agent — it herds it. Inside the directories you declare
governed, every edit must go through the skill that documents exactly how that task
is done in this project — invoked fresh, minutes ago, not remembered from last
Tuesday. A reminder on every prompt keeps the agent in the flock; a hard gate turns
it back the moment it strays.
The plugin is project-agnostic and ships zero rules of its own. Each project
declares what is governed, and by which skill, in .claude/sheepdog/config.json.
On a project that hasn't opted in, it is a silent no-op.
Before / After
Without sheepdog
With sheepdog
⏺ Write(src/components/DatePicker.tsx)
⎿ Wrote 214 lines
Its own props API, its own CSS, none of your
design system — merged before anyone notices.
⏺ Write(src/components/DatePicker.tsx)
⎿ ✗ blocked — invoke the skill
"create-component" first
⏺ Skill(create-component)
⏺ Write(src/components/DatePicker.tsx)
⎿ Wrote 32 lines
It discovers the project's skills, scaffolds .claude/sheepdog/config.json
(commit it — these are shared team rules) and adds a .gitignore entry for
.claude/sheepdog/.skill-used (runtime state — never commit it).
How it works
Three bash hooks, all reading project-owned config from
$CLAUDE_PROJECT_DIR/.claude/sheepdog/:
Hook
Event
Role
skill-reminder.sh
UserPromptSubmit
Bark — injects a reminder + the path→skill routing table (generated from rules) on every prompt.
stamp-skill.sh
PostToolUse(Skill)
Witness — records <timestamp> <skill> in .skill-used whenever a skill is invoked.
require-skill.sh
PreToolUse(Edit|Write|MultiEdit)
Gate — matches the edited file against rules; blocks unless the matching skill was stamped within the window.
sequenceDiagram
participant Claude
participant Dog as sheepdog
Note over Claude,Dog: on every user prompt
Dog-->>Claude: inject routing table (UserPromptSubmit)
Claude->>Dog: Edit src/components/DatePicker.tsx
Dog-->>Claude: ✗ blocked — invoke "create-component" first
Claude->>Dog: Skill("create-component") — stamped
Claude->>Dog: Edit src/components/DatePicker.tsx
Dog-->>Claude: ✓ allowed (matching stamp, still fresh)
When an edit is rejected, the error is a recovery recipe, not a slap: