SMG Dev Guide
The agent-native development guide for the Shepherd Model Gateway: seven skills that change what a coding agent does in the SMG repository, grounded in SMG's own code and history, and kept verifiably in sync with it by scripts.
Works with Claude Code (as a plugin, with hooks and subagents), and with Codex, Gemini CLI, Google Antigravity and Cursor through the Agent Skills format. SMG's own CI installs this plugin into every automated PR review (claude-code-review.yml), and SMG's REVIEW.md asks reviewers to run smg:review-pr.
| Skill | Use it to | First read |
|---|
smg:map | orient: a live crate map read from the checkout, the seven invariants, the area table (path → recipe → review checklist) | 60 lines + the live map |
smg:implement | build: a detection table routes to one of 27 recipes; every step has a file, a verify command and the silent trap; exemplar commits show the full file set a real change touched | 60 lines + a recipe (~100) |
smg:craft | write it the way the maintainers do: vocabulary (sides, role, pool), performance discipline, interface design, structure, release notes and announcements; five evidence-backed references | 50 lines |
smg:review-pr | review: changed files map to per-subsystem checklists (with anti-patterns); error handling, testing and craft always apply; REVIEW.md markers with file:line | 70 lines + matched checklists |
smg:contribute | ship: the whole pre-PR gate as one command (scripts/gate.sh), clippy and tests scoped to the crates the diff touches, that also prints the CI lanes a diff triggers and checks vocabulary | 55 lines |
smg:learn | record a lesson (stale path, missing step, unpredicted CI failure) as an issue the next sync promotes | |
smg:sync | maintainers: resync the guide against SMG HEAD (drift, coverage, digest, lessons → PR) | |
Verified against SMG c75b44de (v1.16.0-dev): 5,000+ anchors, 0 broken (smg-ref.json). Every recipe carries its own verified commit, level, watch paths and exemplars.
How the guide stays true
Hard-coded facts about a codebase that merges dozens of PRs a day rot in weeks. Three checkers and one data file keep this guide honest:
scripts/check_anchors.py: every path, symbol, flag and CI lane the skills cite is extracted from the Markdown and verified against an SMG checkout. Zero maintenance; placeholders and stated negatives live in anchors/ignore.txt.
scripts/check_coverage.py: for each recipe, recent feat(...) commits touching its watch paths (plus its listed exemplars) are read, and the areas at least half of them touch but the recipe never mentions are reported. "Names exist" is the floor; "matches what PRs touch" is the bar.
scripts/check_vocabulary.py: flags the terms SMG rejects (PD "leg", a dispatch "arm", per CONTRIBUTING.md) and generated-sounding filler, over a diff, commit messages, or the guide's own prose.
data/subsystems.json: one row per area (paths, owner, recipe, review checklists, CI lanes, key types). scripts/render.py writes it into the skills between markers; scripts/lanes.py maps a diff to lanes and checklists for the gate. data/rules.json holds the naming and attribution regexes once, for the gate, the hook and the contribute skill.
agent in SMG hits a wrong step ──/smg:learn──▶ issue labelled `lesson`
│
daily drift.yml: anchors + coverage + digest │
against SMG main ──▶ "Guide drift report" issue │
▼
/smg:sync (human or claude-code-action)
fix skills · promote lessons · 0 broken anchors
bump smg-ref.json · PR "docs: resync skills with smg HEAD"
│
PR CI: lint_guide.py (template, data, render, vocabulary) + check_anchors.py at the pin ◀┘
Hooks (Claude Code): a SessionStart banner names the SMG version you are in and its drift from the pin; a PreToolUse guard blocks what SMG's CI would reject later (unsigned commits, Claude/anthropic attribution trailers, --no-verify, commits on main, pushes from badly named branches). Subagents: smg-reviewer (isolated-context review) and smg-scout (where/how questions and history mining without flooding the main context).
Install
Claude Code
claude plugin marketplace add smg-project/smg-dev-guide
claude plugin install smg@smg-dev-guide
Or inside Claude Code: /plugin marketplace add smg-project/smg-dev-guide, /plugin install smg@smg-dev-guide, /reload-plugins. /smg:go <request> routes to the right skill.
Codex