/pr-to-spec:pr-to-spec [scan | check | intent set | intent show]from pr-to-spec
Converts code changes (branch, staged edits, commits, or GitHub PR) into a versioned JSON spec and detects intent drift. Useful for declaring change intent before editing, reviewing completed work, or producing evidence for code review.
Ships in pr-to-spec. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Turn observed code changes into a versioned JSON spec and compare them with a declared intent. Lead with the outcome and supporting signals, risks, contracts, and policy evidence; never treat a nonzero gate exit as an ordinary CLI failure.
pr-to-spec on PATH.GITHUB_TOKEN through the environment. Prefer
a fine-grained token with pull-request read access; do not pass tokens on the
command line or print them..pr-to-spec/intent.yaml, contracts.yaml, and policy.yaml as project
governance state. Review changes before committing them.Quote globs so the shell does not expand them:
pr-to-spec intent set \
--goal "Add rate limiting to the API" \
--scope "src/middleware/**" \
--forbid "src/db/**" \
--max-risk medium \
--json
pr-to-spec intent show --json
Add --type or --size-budget when they express a real acceptance boundary.
Do not broaden intent after a drift result merely to make the gate pass.
Use one comparison mode and request JSON for deterministic agent parsing:
pr-to-spec scan --branch main --json
pr-to-spec scan --staged --json
pr-to-spec scan --diff 3 --json
--staged takes precedence, then --diff; otherwise the CLI compares the
current branch with --branch or main. A scan can exit 2 when high-risk
changes are found even though it produced a valid spec.
For a GitHub pull request, use the root command:
pr-to-spec --repo OWNER/REPO --pr 42 --json
Set the token in the calling environment without echoing it.
Run the same comparison boundary used for the scan:
pr-to-spec check --branch main --json
Expected result: a versioned envelope whose exit code distinguishes clean, high-risk, drift, policy failure, and runtime error states.
If no intent exists, check falls back to scan behavior and returns 0 or 2.
With intent, it evaluates drift, verification contracts, and any policy gate.
Read the JSON status, signals, gate_result, and contracts fields before
deciding whether work may continue.
0: clean for the evaluated boundary.2: valid result with high-risk changes; review risk flags.3: drift or a blocking contract violation; fix the change or deliberately
revise intent with an explicit explanation.4: policy gate failed; satisfy its blocking checks.1: invocation, Git, configuration, or runtime error; repair and rerun.Never collapse codes 2–4 into a generic failure because each requires a
different response.
JSON output uses the versioned agent-protocol envelope:
{
"version": 1,
"command": "check",
"status": "drift_detected",
"exit_code": 3,
"signals": [],
"spec": {},
"intent": {}
}
Report the comparison boundary, exit code and meaning, changed-file summary, highest risk, each drift signal, contract and gate results, and the next safe action. Preserve the JSON with review evidence when it gates a release.
git branch -a.2, 3, or 4: parse the emitted envelope before remediation..pr-to-spec file and rerun.pr-to-spec intent set --goal "Refactor cache keys" \
--scope "src/cache/**" --forbid "src/auth/**" --max-risk low --json
pr-to-spec check --branch main --json
pr-to-spec scan --staged --field intent.change_type --stdout
Expected result: only the inferred change type for the staged diff.
What SKILL.md sets; muted values are Claude Code's defaults
inherithighGenerated from the plugin's indexed repository (jeremylongshore/pr-to-prompt) — no native marketplace selected
npx claudepluginhub p/jeremylongshore-pr-to-spec2 plugins ship this exact skill · first indexed Sep 10, 2026
Other plugins' skills for the same job