api-spec
Generate OpenAPI specifications for story endpoints. Use when user wants to create API specs for a story or mentions /api-spec command.
от rakovi4★ 54 звезды на GitHub
Установить api-spec в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Generate API Specification
Generate OpenAPI 3.0.3 specifications for frontend endpoints in a story.
Usage
/api-spec "Story name"
/api-spec 5 # By MVP story number
/api-spec # Interactive selection
MVP Mindset
Generate the MINIMUM viable API, not the complete API.
- Prefer fewer endpoints - consolidate where possible
- No health/status endpoints (infrastructure, not features)
- No separate replace endpoints (use PUT on same resource)
- No separate "get current state" if POST response returns it
- When in doubt, leave it out
Workflow
Phase 1: Context & Story Selection
Read context files:
ProductSpecification/BriefProductDescription.mdProductSpecification/stories.md
Parse user input to find target story (by name, number, or interactive)
Read the target story's folder —
stories/NN-story-name/first, thenstories/done/NN-story-name/(.claude/rules/workflow.md, "Resolving a story folder"), since an unresolved archived folder reads exactly like a story with no interview:NN_StoryName.md(specification),mockups/(UI mockups — the fields each screen needs),interview.mdif it exists (authoritative source for API details)Read what the areas this story touches already expose — the acceptance tests of those areas, for their request/response shapes, status codes and Statements. Never sweep
stories/*/mockups/orstories/*/interview.mdto reconstruct it (.claude/rules/workflow.md, "Where the Current State Lives"). Only enabled tests count as shipped — one still carrying its disable/skip marker is a pending increment, not a live endpoint. Where the suite is silent about an area, read that area's controllers and say what you found — silence is not evidence that no endpoint exists. In a repo with no acceptance suite yet, say so explicitly and fall back to the story folders. Open an earlier story'sinterview.mdordecisions/*-decision.mdonly for a named precedent — the rule behind an existing response shape — resolving it understories/orstories/done/, since the story that set the shape has usually closed (.claude/rules/workflow.md, "Resolving a story folder")
Phase 2: Generate Specifications
Load .claude/templates/spec/api-spec-template.md for document formats.
Based on story and mockups, identify the minimum endpoints needed.
- Create
endpoints.mdin story folder - Create OpenAPI YAML in
ProductSpecification/api-specs/[resource]_[action].yaml - Include realistic request and response examples following the template's payload-example requirements.
Phase 3: Validate Specifications
Run an OpenAPI 3.0.3 validator against every created or changed API document,
resolving local and external $ref values from each file's location. When shared
components change, also validate the documents that reference them. YAML parsing
alone does not verify OpenAPI structure or required fields.
Also check every payload example against its resolved schema and the documented scenario, including required fields, types, formats, enums, and variant selection. Do not assume structural OpenAPI validation validates example payloads.
Fix validation errors and rerun before completing this step. If validation cannot
run, report the blocker and leave the API-spec step incomplete. Record the
validator command and result in the summary (or the worklog when dispatched by
/continue).
Phase 4: Summary
Report: created or changed files, endpoints generated, design decisions, validation result.
Design Constraints
- OpenAPI version: 3.0.3 (YAML format)
- API versioning:
/api/v1/prefix - Naming: snake_case files, kebab-case URLs
- RESTful: Follow REST conventions
- Minimal responses: Only essential fields
- Check if spec already exists before creating
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл api-spec?
Generate OpenAPI specifications for story endpoints. Use when user wants to create API specs for a story or mentions /api-spec command.
Как установить скилл api-spec?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл api-spec запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…