claude/skills/create-spec/SKILL.md
This skill should be used when the user asks to create a spec, a specification, or to formalize requirements. It accepts any input (Linear issue, free text, file, URL, etc.), explores the codebase to identify impacts and required changes, then collaboratively produces a behavior-driven specification with toggleable behaviors that map directly to automated tests.
npx skillsauth add b-galati/dotfiles create-specInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Transform any input — a Linear issue, free-text description, file, or conversation — into a behavior-driven specification by analyzing the codebase and collaborating with the user. The output is a document with context, a goal, and a list of small, toggleable behaviors that each map to an automated test.
The user can provide the spec source in any form:
AMP-3117 — fetch it via the Linear MCP tool get_issueWebFetch)If the input is unclear or missing, ask the user what they want to spec.
Throughout the entire workflow, every step, interaction, reflection, decision, and finding MUST be logged to the spec file created in the Configuration step.
After each step, append a section to the .specs/<SPEC-ID>.md file documenting:
This file serves as a persistent trace of the spec creation process and can be consulted in future sessions.
Determine a <SPEC-ID> for the log file:
AMP-3166)add-webhook-retry, fix-pdf-export)Create a spec log file at .specs/<SPEC-ID>.md.
Initialize the file with:
# Spec Log: <SPEC-ID>
## Step 1: Collect Input
All subsequent steps will append their findings and decisions to this file.
Gather the raw material based on the input type:
get_issue, extract title and descriptionThis raw input is the draft containing the user's initial intent.
Log: Append a summary of the raw input to the spec file.
Read and understand the input. Identify:
Summarise your understanding back to the user in a few sentences to confirm alignment before exploring the codebase.
Log: Append your analysis summary to the spec file.
Ask the user whether they have reference merge requests (branches) that the implementation should follow or be inspired by. Use AskUserQuestion with a free-text option so the user can provide branch names.
local-mr-diff-summarizer subagent in parallel (one Task per branch) to retrieve and summarize each MR diff. Pass the branch name as the prompt.Once all summaries are returned, synthesize the key patterns, conventions, and architectural decisions observed across the reference MRs. Use these insights — combined with the draft from step 2 — to guide a more focused codebase exploration in step 4.
Log: Append the branch names provided, each MR summary, and the synthesized insights to the spec file.
Use the available tools (Glob, Grep, Read, Task with deep-explore subagent) to investigate the codebase and identify:
If reference MR summaries were gathered in step 3, use them to focus and refine the exploration — you already know which patterns to look for and which areas of the codebase are likely impacted.
Be thorough but focused — only explore what is relevant to the issue at hand.
Log: Append key files discovered, patterns identified, and any architectural constraints to the spec file.
If the codebase exploration reveals ambiguities, trade-offs, or missing information, ask the user targeted questions using AskUserQuestion. Common topics:
Do not proceed to drafting until you have enough information to write all behaviors.
Log: Append each question asked and the user's answer to the spec file.
Compose the formalized specification using the template below. The content must be:
Behavior rules:
Given / When / Then format so each behavior is directly translatable to an automated test- [ ]) so it can be toggled on/off during implementation (e.g., to defer or descope a behavior)Spec template:
## Context
<What area/feature is concerned, background information, relevant existing code/patterns>
## Goal
<The objective of this spec — what should be true when this is done>
## Behaviors
### <Group name>
- [ ] **<Short behavior title>**
Given <precondition>, when <action>, then <expected outcome>
- [ ] **<Short behavior title>**
Given <precondition>, when <action>, then <expected outcome>
### <Group name>
- [ ] ...
## References
- <URL, link to codebase example, documentation, or related MR>
- <e.g., `src/Domain/Workflow/Handler/CreateWorkflowHandler.php` — existing pattern to follow>
- <e.g., https://docs.example.com/api/webhooks — external documentation>
- ...
Also propose a title. Title rules:
[feat], [fix], etc.Log: Append the full draft (title + description) to the spec file.
Present the full draft (title + description) to the user for review.
save_issue with the new title and description. Preserve all other existing fields (team, project, priority, assignee, labels, state). Display the issue identifier and confirm the update..specs/<SPEC-ID>.md).Log: Append the final outcome (accepted/iterated) and delivery confirmation to the spec file.
testing
TDD workflow - Write a failing test, then implement Super Green
development
OpenAPI specification expert for creating, improving, and validating clear, self-documenting API specs. Use when designing, reviewing, or refactoring OpenAPI/Swagger specs for clarity, consistency, and usability.
testing
Implement behaviors from a specification file produced by the local-create-spec skill. Use when the user says 'implement behaviors from ...', 'implement the spec', 'implement spec ...', or wants to implement a .specs/ markdown file containing Given/When/Then behaviors with checkboxes.
tools
Implement a Linear issue by breaking its acceptance criteria into tasks, implementing each with TDD, and updating the Linear issue status when done. Use when the user says 'implement issue ...', 'implement TEAM-123', or wants to implement a Linear issue.