Skip to content
Agentmart
Submit a tool

pr-shepherd-contract

GitHub adapter binding for the shepherd contract: turn a real pull request into observed events, resolve the responsible actor from commit authorship, and…

Skill by sonichi

IndexedMIT★ 400
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/sonichi-pr-shepherd-contract

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

GitHub adapter binding for the shepherd contract: turn a real pull request into observed events, resolve the responsible actor from commit authorship, and persist the waiting contract under the workspace so a later pass (or process) can resume it.

Use cases: documents

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/pr-shepherd-contract

What's inside

Skill name
pr-shepherd-contract
Description
GitHub adapter binding for the shepherd contract: turn a real pull request into observed events, resolve the responsible actor from commit authorship, and persist the waiting contract under the workspace so a later pass (or process) can resume it.
License
MIT
Instructions
39 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (2)

  • SKILL.md
  • shepherd_github.py · scripts/

SKILL.md (first lines)

# PR Shepherd Contract (GitHub adapter)

The GitHub binding for the provider-neutral shepherd contract
(`src/shepherd_contract.py`). The contract defines WHAT a shepherd task is
responsible for and WHICH observed events count; this skill supplies the
GitHub-specific half:

- **Observation** — `observe(repo, number)` reads live PR state via the
  GitHub CLI (`gh api`) and emits one `ObservedEvent` (merged / closed
  unmerged / updated).
- **Actor resolution** — `resolve_actor(repo, number)` uses the last
  non-merge commit's author email (`git.commit_author_email`), not the
  account login, because several actors can push under one login.
- **Persistence** — `save(task_id, scope, state)` / `load(task_id)` /
  `resume(task_id)` keep the durable contract record under
  `<workspace>/state/shepherd/`, create-or-advance only (never rebind), so a
  different process can pick the objective up later.

## Usage

Import from the skill's scripts directory (the module bootstraps `src/` onto
`sys.path` itself):

```python
import sys, pathlib
sys.path.insert(0, str(repo_root / "skills" / "pr-shepherd-contract" / "scripts"))
import shepherd_github as g

scope = g.scope_for("owner/repo", 123, g.resolve_actor("owner/repo", 123))
g.save("task-abc", scope, "waiting", "shepherding PR 123")
# ... later, any process:
state, why = g.resume("task-abc")
```

Tests: `tests/shepherd-github-durability.test.py`,
`tests/shepherd-github-integrity.test.py` (contract policy itself:
`tests/shepherd-contract-admission.test.py`).

From sonichi/sutando, MIT.

More from sonichi/sutando

Signals

Stars
400
Forks
98
Open issues
1,202
Last commit (this folder)
Aug 27, 2026 (2 months ago)
Last release
Aug 20, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
Website
sutando.ai
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from sonichi

Cite this page

pr-shepherd-contract skill. Agent Mart. https://agentmart.dev/skills/sonichi-pr-shepherd-contract (last updated 2026-10-24)