← 返回
开发者工具 中文

Spec-First Development

Spec-driven development workflow. Before writing any code, generates a comprehensive SPEC.md covering data models, user flows, API contracts, file structure,...
基于规格的开发工作流,在编写代码前生成包含数据模型、用户流程、API契约、文件结构等的完整 SPEC.md 文档。
kevdogg102396-afk kevdogg102396-afk 来源
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 799
下载
💾 15
安装
1
版本
#architecture#development#latest#planning#spec

概述

Spec-First — Spec-Driven Development Workflow

Why This Exists

80% of "Claude built the wrong thing" failures come from jumping into code before the spec is clear. This skill forces the right order: spec → approval → implementation.

Trigger

Use at the start of ANY non-trivial build. If the task will touch >2 files or take >15 minutes, run this first.

Invoked as: /spec-first-dev [brief description of what you want to build]

Or auto-triggered by phrases like "build me", "create a", "implement a" when the scope is non-trivial.

Process

Step 1: Clarify Intent

Parse $ARGUMENTS for:

  • What is being built (feature, service, script, component, etc.)
  • Who uses it (end users, internal tooling, automated pipeline)
  • Key constraints (stack, budget, timeline if mentioned)

If intent is ambiguous, ask ONE clarifying question before proceeding.

Step 2: Explore Existing Codebase

Before speccing anything new, understand what already exists:

  • Run Glob to find relevant existing files (configs, schemas, components)
  • Run Grep to find related code patterns
  • Identify: what can be reused, what must be new, what might conflict

Step 3: Generate SPEC.md

Write SPEC.md to the project root (or current directory). Include:

# SPEC: [Feature Name]

## Overview
[1-2 sentences. What this does and why.]

## Data Models
[All entities, fields, types, relationships]

## User Flows / API Contracts
[Numbered steps for each major flow. Include request/response shapes for APIs.]

## File Structure
[New files to create, existing files to modify, with brief reason for each]

## Edge Cases & Error Handling
[Specific scenarios to handle: empty states, failures, invalid input, concurrency]

## Out of Scope
[What we are explicitly NOT building in this task]

## Open Questions
[Any decisions that need input before coding starts]

Step 4: Present and Gate

Output the SPEC.md contents to the user and explicitly pause:

SPEC complete. Review above and confirm before I write any code.
Reply 'go' to proceed, or tell me what to change.

Do not write any implementation code until the user explicitly approves the spec.

Step 5: Implement Against Spec

Once approved:

  • Work through the spec section by section
  • Check off items as you complete them
  • Flag any spec deviations immediately (don't quietly deviate)
  • If a new edge case emerges, add it to the spec and note it

Output Files

  • SPEC.md — written in the project root before implementation starts
  • (Optional) SPEC_APPROVED.md — copy of approved spec for audit trail

Integration

Works well with:

  • Task-tracking tools (prefix each coding session with this skill)
  • Code review workflows (attach SPEC.md to PRs)
  • Team handoffs (spec is the briefing document)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 08:04 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 194 📥 67,409
business-ops

Freelance Proposal Writer

kevdogg102396-afk
根据招聘信息(Upwork、Toptal等)撰写高转化率自由职业提案。提供链接或粘贴内容,分析客户需求。
★ 0 📥 864
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,723