Agent skill · software engineering · jeremylongshore

pr-to-spec

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".

Why this skill is useful

Adds executable commands for intent declaration and drift detection that enhance code review processes.

What it needs

Requires pr-to-spec installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

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. 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. 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 show Show the current intent declaration. Output format All --json output is wrapped in the agent protocol envelope: The spec field is the structured description of what changed, intent is the declared intent (when one exists), and signals carries the drift and risk findings that produced the status and exitcode. Error Handling Interpret exit codes — they are the contract: Code Meaning ------ --------- 0 Clean — no issues 1 Error 2 High-risk changes detected 3 Drift detected Exit 3 (drift) — the change touched files outside the declared scope, hit a --forbid pattern, or diverged from the declared goal. Stop and investigate before continuing; either fix the change or re-declare intent deliberately. Exit 2 (high-risk) — the change exceeds the declared --max-risk ceiling. Review the signals array for which risk flags fired. Exit 1 (error) — the CLI itself failed (not a git repo, no intent declared for check, malformed arguments). …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/pr-to-spec

View the source on GitHub

Browse the @skills marketplace