spec-refine

spec-refine is a command for coding agents from Connorrmcd6/vibe-spec. It costs 49 tokens per session (677 once invoked), scanned A, original, MIT.

A specification review step in the Vibe-Spec workflow. It turns a rough V0 project description into a clearer V1 plan that connects each feature to documented development tools.

In plain words
What is it for?
Use it to review a project spec, answer clarification questions, choose tools for features such as authentication or databases, and establish a shared implementation plan.
Why use it?
It exposes missing requirements and unclear edge cases before implementation begins.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the vibe-spec plugin — 1 skill, 9 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/connorrmcd6/vibe-spec/spec-refine
Clone the repo
git clone --depth 1 https://github.com/Connorrmcd6/vibe-spec

Or install vibe-spec, the plugin that ships this one along with the rest of its 1 skill, 9 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spec-refine

README.md
[![agentmods](https://agentmods.dev/badge/commands/connorrmcd6/vibe-spec/spec-refine.svg)](https://agentmods.dev/commands/connorrmcd6/vibe-spec/spec-refine)
Your own site
<a href="https://agentmods.dev/commands/connorrmcd6/vibe-spec/spec-refine"><img src="https://agentmods.dev/badge/commands/connorrmcd6/vibe-spec/spec-refine.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 677 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00049 $0.00677
Opus 5 $0.00024 $0.00338
Sonnet 5 $0.00010 $0.00135
Haiku 4.5 $0.00005 $0.00068

Measured 5d ago against content hash 3a88b4078e86, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spec-refine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/spec-refine.md · 43 lines

What it actually says

You are running Step 2 of the Vibe-Spec spec-driven workflow: promoting the V0 spec → V1 spec. The V1 spec becomes the single source of truth — it details exactly which tools achieve each piece of functionality.

What to do

  1. Read the existing spec at docs/project-spec.md (the V0 draft from /spec-draft). If it doesn't exist, tell the user to run /spec-draft first.

  2. Critique it. Identify gaps, ambiguities, and missing edge cases, and ask the user clarifying questions about them before deciding anything.

  3. Map functionality → tools using the vibe-spec skill. For each capability in the spec, load the relevant reference file(s) (under ${CLAUDE_PLUGIN_ROOT}/skills/vibe-spec/) and choose the documented approach:

    • Web app foundation → reference/01-scaffolding.md
    • Local DB / structured data → reference/03-docker.md, 04-database.md, 05-prisma.md
    • Auth → reference/07-auth.md (decide OAuth vs OTP+JWT with the user)
    • Roles / permissions → reference/08-rbac.md
    • External APIs / webhooks / input → reference/09-validation.md
    • Data pipelines / analytics → reference/06-dbt.md, 17-scripts.md
    • Uploads → reference/12-s3.md; push / PWA → reference/13-push-notifications.md
    • UI → reference/11-ui.md; testing → reference/10-testing.md
    • CI/CD, hooks, deploy → reference/14-ci-cd.md, 15-pre-commit.md, 16-deployment.md
    • Documentation governance (keep AGENTS.md / hub docs from silently rotting as the code moves) → reference/20-surface.md
    • High-performance API → reference/02-nestjs.md (only if a measured need exists)
    • Secrets / config → reference/19-secrets.md: for each capability needing a secret, name the env var holding it and mark it server-only (never NEXT_PUBLIC_). Considering this now makes the later /spec-secrets audit a confirmation rather than a discovery.

    Use the skill's quick-reference table to avoid pulling in tools the project doesn't need. Prefer the simplest option that satisfies the requirement.

  4. Rewrite docs/project-spec.md as the V1 spec: the same workflows, now with an explicit tech-stack section and per-feature tool choices (with a one-line rationale each). Note anything deliberately skipped and why.

This is a good step to run in planning mode. End by telling the user to run /spec-phases next.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 43 lines · 49 tokens per session scan A 3a88b4078e86

Subscribe to this mod's changes

spec-refine is a command published in the GitHub repository Connorrmcd6/vibe-spec (9 stars, last pushed 2mo ago), licensed MIT. It adds 49 tokens to every session and 677 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.