← 返回
未分类 中文

Spec-Kit SDD

GitHub Spec-Kit integration for Spec-Driven Development (SDD). Use when: (1) initializing a new Spec-Kit project, (2) creating/updating project constitution,...
GitHub Spec‑Kit 集成,用于规格驱动开发(SDD)。使用场景:(1) 初始化新的 Spec‑Kit 项目;(2) 创建/更新项目章程,...
james-code-hash james-code-hash 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 291
下载
💾 0
安装
1
版本
#latest

概述

Spec-Kit — Spec-Driven Development (SDD)

> GitHub 官方開源工具包 (v0.4.3),將規格驅動開發引入 AI Agent 工作流程。

> Repo: https://github.com/github/spec-kit | License: MIT

What is Spec-Driven Development?

Spec-Kit reverses traditional AI coding: specifications are first-class citizens, code is a derived output. Instead of "vibe coding" where you prompt AI directly, SDD follows a structured pipeline:

Constitution → Specify → Clarify → Plan → Tasks → Implement

Each phase has explicit inputs, outputs, and quality gates.

Prerequisites

CLI Installation

# Install Specify CLI (requires uv)
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@v0.4.3

# Verify
specify check

System requirements: Python 3.11+, uv, Git, a supported AI agent.

Agent Support

Spec-Kit supports 30+ AI agents. Key ones for our stack:

AgentIntegrationNotes
---------------------------
Claude Code/speckit.* slash commands.claude/commands/speckit.*.md
Gemini CLI.gemini/commands/speckit.*.tomlStandard
opencode/speckit.* slash commandsStandard
Codex CLI--ai-skills flagSkills in .agents/skills/
GitHub Copilot/speckit.* slash commandsVS Code native

Workflow Commands

Core Pipeline

StepCommandOutputWhen
-----------------------------
0. Initspecify init --ai .specify/ + commandsNew project
1. Constitution/speckit.constitution memory/constitution.mdNew project / principles
2. Specify/speckit.specify specs//spec.mdStarting a new feature
3. Clarify/speckit.clarifyUpdates spec.md clarificationsBefore planning
4. Plan/speckit.plan specs//plan.md + researchAfter spec approved
5. Tasks/speckit.tasksspecs//tasks.mdAfter plan validated
6. Implement/speckit.implementCode changesTasks defined

Optional Commands

CommandPurposeWhen
------------------------
/speckit.analyzeCross-artifact consistency & coverage analysisBefore final review
/speckit.checklistQuality checklists (unit tests for specs)Validate completeness
/speckit.taskstoissuesConvert tasks to GitHub IssuesNeed project board sync

CLI Reference

specify init

# New project
specify init my-project --ai claude

# Existing directory
specify init . --ai claude --force

# With Codex skills
specify init my-project --ai codex --ai-skills

# Skip git init
specify init my-project --ai claude --no-git

# Timestamp-based branch numbering
specify init my-project --ai claude --branch-numbering timestamp

specify check

Verifies: git + all CLI agents configured in AGENT_CONFIG.

Extension & Preset Management

# Extensions
specify extension search                    # Browse available
specify extension add <name>                # Install

# Presets
specify preset search                       # Browse available
specify preset add <name>                   # Install

Project Structure

After specify init:

project-root/
├── .specify/
│   ├── memory/
│   │   └── constitution.md          # Project principles (Step 1)
│   ├── scripts/
│   │   ├── check-prerequisites.sh
│   │   ├── common.sh
│   │   ├── create-new-feature.sh    # Creates feature branch + spec dir
│   │   ├── setup-plan.sh
│   │   └── update-claude-md.sh
│   ├── templates/
│   │   ├── constitution-template.md
│   │   ├── spec-template.md
│   │   ├── plan-template.md
│   │   └── tasks-template.md
│   ├── extensions/
│   │   ├── catalog.json
│   │   └── <ext-id>/templates/
│   └── presets/
│       └── <preset-id>/templates/
├── specs/
│   └── 001-feature-name/
│       ├── spec.md                   # Feature specification (Step 2)
│       ├── plan.md                   # Technical plan (Step 4)
│       ├── research.md               # Phase 0 research output
│       ├── data-model.md             # Data model design
│       ├── quickstart.md             # Getting started guide
│       ├── contracts/                # API contracts
│       │   ├── api-spec.json
│       │   └── signalr-spec.md
│       └── tasks.md                  # Task breakdown (Step 5)
├── .claude/commands/
│   ├── speckit.constitution.md
│   ├── speckit.specify.md
│   ├── speckit.plan.md
│   ├── speckit.tasks.md
│   └── speckit.implement.md
└── [source code]

Template Details

Constitution (memory/constitution.md)

Defines non-negotiable project principles. All specs must comply.

Structure:

  • Core Principles (I, II, III, ...) — Each with clear description
  • Additional Constraints — Tech stack, compliance, security
  • Development Workflow — Code review, testing gates
  • Governance — Amendment rules, compliance verification

Only CEO/CTO may amend. Version: X.Y.Z | Ratified: YYYY-MM-DD

Spec (spec.md)

Key sections:

  • Feature Branch: NNN-feature-name
  • User Scenarios & Testing — Prioritized user stories (P1, P2, P3), each independently testable
  • Edge Cases — Boundary conditions, error scenarios
  • Requirements — Functional + non-functional
  • Review & Acceptance Checklist — Validation gates

Plan (plan.md)

  • Summary — Primary requirement + technical approach
  • Technical Context — Language, dependencies, storage, testing, platform
  • Constitution Check — Must pass before Phase 0
  • Project Structure — File tree
  • Implementation Details — Phase-by-phase breakdown

Tasks (tasks.md)

Format: [ID] [P?] [Story] Description

  • [P] = can run in parallel
  • [Story] = which user story (US1, US2, ...)
  • Organized by user story for independent implementation

Extensions & Presets

Template Resolution Priority (highest → lowest)

Project-local overrides (.specify/templates/overrides/)
    ↓
Presets (.specify/presets/<preset-id>/templates/)
    ↓
Extensions (.specify/extensions/<ext-id>/templates/)
    ↓
Core (.specify/templates/)

Notable Community Extensions

ExtensionPurposeType
--------------------------
spec-kit-jiraSync specs to Jira Epics/Storiesintegration
spec-kit-verifyValidate code vs spec artifactscode (read-only)
spec-kit-cleanupPost-implementation quality gatecode (read+write)
spec-kit-reviewComprehensive code reviewcode (read-only)
spec-kit-archiveArchive merged featuresdocs (read+write)
spec-kit-syncDetect/resolve spec vs code driftdocs (read+write)
spec-kit-doctorProject health diagnosticsvisibility (read-only)
spec-kit-maqa-extMulti-agent QA coordinatorprocess

Notable Presets

PresetPurpose
-----------------
pirate-speakFun localization demo
aide-in-placeIn-place technology migrations

Paperclip Integration

Reassign via API (use this, NOT shell scripts)

PAPERCLIP_API="http://localhost:3100/api"

# Reassign by agent ID
curl -s -X PATCH "$PAPERCLIP_API/issues/$ISSUE_ID" \
  -H "Content-Type: application/json" \
  -d "{\"assigneeAgentId\": \"$TARGET_AGENT_ID\"}"

# Comment on issue
curl -s -X POST "$PAPERCLIP_API/issues/$ISSUE_ID/comments" \
  -H "Content-Type: application/json" \
  -d "{\"body\": \"Description of work done\"}"

Issue Lifecycle

Dev → implement → reassign code-reviewer → CTO review → reassign qa → PM confirms → done
Bug: Dev → fix → reassign cto → reassign qa → done

Best Practices

  1. Spec before code — Resist "write code first, document later"
  2. Constitution is law — All PRs must verify compliance
  3. Prioritize user stories — P1 is the MVP, each story independently testable
  4. Keep specs alive — Update specs when implementation drifts, don't pretend
  5. Task granularity — Each task 2-4 hours max, split large ones
  6. Use extensions — Install verify + cleanup for automated quality gates
  7. Validate before implement — Run /speckit.analyze + /speckit.checklist
  8. Clarify before planning/speckit.clarify reduces rework

Common Pitfalls

  • Skipping constitution → Agent makes inconsistent decisions
  • Overly vague specs → AI hallucinates features or misses edge cases
  • No clarify step → Plan includes wrong assumptions
  • Tasks too large → AI loses context, produces buggy code
  • Not updating specs after changes → Drift between spec and code
  • Ignoring constitution during plan → Architecture violations

Upgrade

uv tool install specify-cli --force --from git+https://github.com/github/spec-kit.git@v0.4.3

References

  • Official repo: https://github.com/github/spec-kit
  • Methodology deep-dive: spec-driven.md in repo
  • GitHub blog: https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/
  • Extension catalog: extensions/catalog.community.json
  • Preset catalog: presets/catalog.community.json
  • Addy Osmani's spec writing guide: https://addyosmani.com/blog/good-spec/

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 21:10 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Docker Essentials

arnarsson
核心 Docker 命令和工作流程,包括容器管理、镜像操作和调试。
★ 38 📥 32,692
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,119
dev-programming

Mcporter

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