Creates durable technical specs for new features by analyzing existing codebase and issue requirements.

Install

mkdir -p .claude/skills/spec-matteocervelli && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9519" && unzip -o skill.zip -d .claude/skills/spec-matteocervelli && rm skill.zip

Installs to .claude/skills/spec-matteocervelli

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Write a durable feature spec before touching code. Reads the codebase map, reads related models/migrations to ask technical questions (not generic ones), then produces a structured spec doc in docs/specs/. Designed to pipeline with /implementation --issue N. Use before any feature implementation.
297 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Load codebase maps and architecture documentation
  • Read GitHub issues for requirements
  • Generate structured feature specifications
  • Perform adversarial reviews of specifications

How it works

The tool reads codebase indices and issue details to generate a structured specification document before any implementation begins.

Inputs & outputs

You give it
GitHub issue number
You get back
feature specification document in docs/specs/

When to use spec

  • Drafting a feature specification from a GitHub issue
  • Analyzing database models and migrations for a new feature
  • Performing an adversarial review of a proposed feature spec
  • Preparing documentation for implementation phase

About this skill

/spec — Feature Specification

Trigger

/spec --issue N [--fast]
  • --issue N — required. Reads GitHub issue #N.
  • --fast — skip questions, apply defaults from reference/defaults.md, still requires user approval of the spec (hard gate).

Output

docs/specs/YYYY-MM-DD-{slug}-issue-{N}.md

YAML frontmatter includes issue: N so /implementation --issue N finds this file automatically.


Workflow

Step 1 — Load codebase map

ls docs/codebase/INDEX.md 2>/dev/null || echo "missing"

If exists and < 7 days old: read architecture.md + conventions.md. If missing or stale: run /map-codebase first, then proceed.

Step 2 — Read issue

gh issue view N --json title,body,labels,state

Step 3 — Brainstorm (9 stages)

See workflows/brainstorm.md.

Key principle: Stage 1 reads actual related code (models, migrations, FK patterns) before formulating questions. Questions must demonstrate codebase understanding — reference specific tables, patterns, or files found in Stage 1.

Step 4 — Write spec

Use templates/spec.md. Every column, every endpoint, every file in manifest. No placeholders. No TBD. If unknown → make it a deferred decision, explicitly.

Step 5 — Adversarial review (optional)

Ask explicitly:

"Do you want an adversarial review of this spec before committing? This spawns a Codex/Gemini reviewer that looks for: missing constraints, wrong FK assumptions, scope creep, contradictions, and security gaps."

  • Yes → run /review solve "adversarial spec review: find flaws in docs/specs/{filename}", present findings, offer to fix before commit
  • No → proceed to Step 6

Step 6 — Commit spec

git add docs/specs/{filename}
git commit -m "docs(spec): {feature slug} spec — issue #{N}"

Step 7 — Hand off

Print this block verbatim so the user can copy-paste it:

Spec committed: docs/specs/{filename}  (on main)

── Option A: implement in current session ──────────────────
  /implementation --issue {N}

── Option B: implement in a parallel worktree ──────────────
  git worktree add -b feature/{N}-{slug} ../{project}-{N} main
  # open new Claude Code session in ../{project}-{N}
  /implementation --issue {N}

── Fast mode (no questions, Codex review at end) ───────────
  /implementation --issue {N} --fast

Spec stays on main. The branch is created by worktree add or by /implementation at start. Multiple specs can be committed to main in parallel — they are docs only, no code conflicts.

Do not start implementing. Do not write any code.


References

  • workflows/brainstorm.md — 9-stage spec generation with technical question guidelines
  • reference/defaults.md — fast mode assumptions table
  • templates/spec.md — required spec document format

When not to use it

  • When implementing features without a specification
  • When the codebase map is missing or stale

Prerequisites

GitHub CLI

Limitations

  • Requires an existing codebase index
  • Does not allow code implementation during the specification phase

How it compares

It mandates the creation of a durable specification document linked to a GitHub issue, preventing ad-hoc implementation.

Compared to similar skills

spec side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
spec (this skill)02moReviewIntermediate
repo-research-analyst16moReviewIntermediate
business-knowledge-workflow13moNo flagsIntermediate
gathering-requirements38moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by matteocervelli

View all by matteocervelli

You might also like

repo-research-analyst

parcadei

Analyze repository structure, patterns, conventions, and documentation for understanding a new codebase

16

business-knowledge-workflow

TencentBlueKing

业务知识获取与 Skill 文档编写工作流。当用户需要熟悉新业务模块、从 iWiki 获取文档、结合代码分析生成架构文档、或将业务知识沉淀为 Skill 时使用。

15

gathering-requirements

CaptainCrouton89

Systematically clarify user needs, preferences, and constraints before planning or implementation. Classifies work type, investigates existing systems, discovers edge cases and integration points, resolves assumptions, and creates detailed specifications. Use when building features, enhancements, or integrations where requirements need clarification.

31

rfc

jiangzhe

Design and resolve RFC documents through evidence-gated multi-round workflow. Use when planning large architectural/program-level changes in docs/rfcs, enforcing goal/scope/direction clarity, explicit first-principles/long-term/original-fit proposal lenses with rationale, draft-to-formal progression

00

trellis-brainstorm

mindfold-ai

Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex task.

00

ito-research

withakay

Conduct structured research for feature development, technology evaluation, or problem investigation. Use when the user needs to explore options, analyze trade-offs, or investigate technical approaches.

00

Search skills

Search the agent skills registry