Skip to content
Back to skills

Pr To Spec

ASecurity

Analyze code changes and detect intent drift using pr-to-spec CLI

  • 2,688 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 29, 2026
ai-agentsgobashapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 29, 2026

npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill pr-to-spec --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pr To Spec?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pr To Spec
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jeremylongshore-pr-to-spec/badge)](https://www.skillsdirectory.com/skills/jeremylongshore-pr-to-spec)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pr-to-spec
description: Analyze code changes and detect intent drift using pr-to-spec CLI
version: 0.8.0
author: Jeremy Longshore
triggers:
  - /pr-to-spec
  - pr-to-spec scan
  - pr-to-spec check
  - pr-to-spec intent
---

# pr-to-spec Skill

Convert code changes into structured, agent-consumable specs with intent drift detection.

## Commands

### /pr-to-spec scan

Analyze current branch changes vs main and output a structured spec.

```bash
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.

```bash
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.

```bash
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.

```bash
pr-to-spec intent show --json
```

## Agent Protocol

All `--json` output is wrapped in the agent protocol envelope:

```json
{
  "version": 1,
  "command": "check",
  "status": "drift_detected",
  "exit_code": 3,
  "signals": [...],
  "spec": {...},
  "intent": {...}
}
```

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Clean — no issues |
| 1 | Error |
| 2 | High-risk changes detected |
| 3 | Drift detected |

## Usage in CLAUDE.md

Add to your project's CLAUDE.md:

```markdown
## Change Validation

Before any significant code change:
1. Set intent: `pr-to-spec intent set --goal "..." --scope "..." --max-risk medium`
2. After changes: `pr-to-spec check --json` — exit 3 means drift, investigate before continuing
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.