Command Palette

Search for a command to run...

Back to skills
skill № 45403

spec-rewrite

Audit and iteratively rewrite Gherkin acceptance criteria (.feature files, scenarios, or spec.md Gherkin blocks) for newcomer context, plain English, and…

FreeNo executable scripts
Integralistby Integralist★ 31 GitHub stars

Install spec-rewrite in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Improve background context, plain-English clarity, and concision in Gherkin acceptance criteria through a bounded back-and-forth between the main agent and a blank-slate newcomer subagent. Preserve exact behaviour and contract literals. Wording-only edits to docs/specs/ are editorial under spec-delta; if a requested change alters required behaviour, stop and follow that skill instead. When a living .feature file drives executable acceptance tests (such as Godog), changing step text also requires updating bound step-definition patterns so scenarios stay wired and passing.

Source and mode. Use --source=<path|#number|url> to name a local .feature or spec.md file, a GitHub issue (#<number> or URL holding a spec.md Root Issue Artifact), or a GitHub PR (#<number> or URL whose diff touches .feature or spec.md Gherkin). Ask if no source is clear from the prompt or session. Infer GitHub handling from a URL, #<number>, or an active GitHub-tracked project in this session (use gh to distinguish an issue from a PR when given #<number>): for a GitHub issue, read and follow GITHUB-ISSUES.md to inspect and update the spec.md Root Issue Artifact; for a GitHub PR, inspect its changed Gherkin via gh and edit files locally only when the current checkout matches the PR branch, otherwise propose rewrites without touching an unrelated checkout. Pass --scenario=<name> to restrict edits to one Scenario, Scenario Outline, or Rule. Pass --audit-only to run the newcomer audit and report findings without proposing a rewrite.

Workflow

  1. Load full context. Read the source Gherkin (or named scenario), root GLOSSARY.md (or legacy CONTEXT.md), SPEC-FORMAT.md, voice-product, and CONCISE-PROSE.md. For living .feature files, locate any bound step definitions (such as Godog initializers and step patterns) so you know which bindings will break if step text changes.
  2. Run a blank-slate newcomer audit. Following SUBAGENT-STEERABILITY.md, spawn a fresh read-only subagent with only the source Gherkin text, root GLOSSARY.md or CONTEXT.md (if present), and the absolute path to SPEC-FORMAT.md#newcomer-check. Withhold source code, diffs, step definitions, and chat history so it reads without repo memory. Ask it to return COMPLETE/INCOMPLETE plus concrete findings: missing Feature:/Rule: background, unexplained jargon or acronyms, implementation leaks, verbose steps, or unclear actors and outcomes. If --audit-only was passed or no real issues exist, report the result and stop.
  3. Rewrite while preserving the contract. Using your full context, revise only what fixes verified findings: orient newcomers in Feature: and Rule: descriptions, replace unexplained jargon with plain English or glossary terms, tighten verbose steps, and keep exact contract literals (statuses, error codes, field names, timing) and behaviour intact. If step text changes in a living .feature file with bound acceptance tests (such as Godog), prepare the matching step-definition pattern updates following conventions-acceptance-tests so the suite stays green (or keep step text bound when only improving Feature:/Rule: context).
  4. Re-check with a fresh blank-slate pass. Send the revised Gherkin (again without code, diffs, or your reasoning) to a fresh read-only newcomer subagent to confirm every finding is closed and no new jargon appeared. Cap the audit-rewrite loop at 2 rounds; if a tension remains after round 2, stop and surface the trade-off to the user.
  5. Approve, apply, and verify. Show the Gherkin diff together with every matching step-definition update (or list required Godog/runner updates explicitly if proposing rewrites against a remote PR without local edits), and confirm the edit stays editorial under spec-delta. Wait for explicit approval before writing local files or updating a GitHub Issue Artifact. After applying local edits, run the project's spec and acceptance test targets (such as make check-specs and the Godog/acceptance suite) to confirm no undefined or failing steps remain, and report any unrun checks as verification gaps.
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the spec-rewrite skill do?

Audit and iteratively rewrite Gherkin acceptance criteria (.feature files, scenarios, or spec.md Gherkin blocks) for newcomer context, plain English, and concision without changing required behaviour. Use when asked to rewrite, clarify, polish, or audit acceptance criteria, a feature file, or Gherkin scenarios.

How do I install the spec-rewrite skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the spec-rewrite skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare spec-rewrite with