| name | pr-to-spec |
| description | Analyze code changes and detect intent drift using the pr-to-spec CLI — converts a branch, staged edits, or recent commits into a structured, agent-consumable spec. Use when declaring intent before a change, checking a finished change for drift against that intent, or generating a spec for agent review. Trigger with "/pr-to-spec", "pr-to-spec scan", "pr-to-spec check", or "pr-to-spec intent". |
| version | 0.8.0 |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| license | MIT |
| compatibility | Requires the pr-to-spec CLI on PATH (Node.js 18+; ships with this plugin) and a git repository to analyze. Runs in Claude Code or any agent runtime with shell access. |
| tags | ["git","pr","spec","intent-drift","code-review","agent-protocol"] |
| argument-hint | [scan | check | intent set | intent show] |
| allowed-tools | ["Bash(pr-to-spec:*)"] |
pr-to-spec Skill
Overview
Convert code changes into structured, agent-consumable specs with intent
drift detection. The workflow is: declare what a change is supposed to do
(intent set), make the changes, then check — the CLI produces a spec of
what actually changed plus drift signals against the declared intent, wrapped
in a versioned JSON envelope any agent can consume.
Prerequisites
- The
pr-to-spec CLI on PATH (it ships with this plugin; standalone install
and MCP-server usage are covered in the repo README).
- A git repository with something to analyze — a branch diverging from main,
staged edits, or recent commits.
Usage
/pr-to-spec scan
Analyze current branch changes vs main and output a structured spec.
pr-to-spec scan --branch main --json
Use --diff N to scan last N commits, or --staged for staged changes only.
/pr-to-spec check
Scan current changes AND check for drift against declared intent.
pr-to-spec check --json
Returns exit code 3 if drift is detected, 2 if high-risk, 0 if clean.
/pr-to-spec intent set
Declare what this change is supposed to do.
pr-to-spec intent set --goal "Add rate limiting to API" --scope "src/middleware/**" --forbid "src/db/**" --max-risk medium
/pr-to-spec intent show
Show the current intent declaration.
pr-to-spec intent show --json
Output format
All --json output is wrapped in the agent protocol envelope:
{
"version": 1,
"command": "check",
"status": "drift_detected",
...
...
...