AgentSkillsCN

spec

指导规格驱动开发(SDD)的工作流程,在实施前规划变更。 当您需要创建规格、撰写提案、规划功能,或使用 OpenSpec 等类似工具时,可使用此功能。 关键词:spec、specification、SDD、proposal、openspec、design doc、规格、提案、设计文档。

SKILL.md
--- frontmatter
name: spec
scope: universal
description: |
  Guide Spec-Driven Development (SDD) workflow for planning changes before implementation.
  Use when: creating specs, proposals, planning features, using OpenSpec or similar tools.
  Keywords: spec, specification, SDD, proposal, openspec, design doc, 規格, 提案, 設計文件.

Spec-Driven Development Guide

Language: English | 繁體中文

Version: 1.1.0 Last Updated: 2026-01-26 Applicability: Claude Code Skills


Purpose

This skill guides you through Spec-Driven Development (SDD), ensuring changes are planned, documented, and approved before implementation.

Quick Reference

SDD Workflow

code
┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│   Proposal   │───▶│    Review    │───▶│Implementation│
└──────────────┘    └──────────────┘    └──────────────┘
                                               │
                                               ▼
                    ┌──────────────┐    ┌──────────────┐
                    │   Archive    │◀───│ Verification │
                    └──────────────┘    └──────────────┘

Workflow Stages

StageDescriptionOutput
ProposalDefine what to change and whyproposal.md
ReviewStakeholder approvalApproval record
ImplementationExecute approved specCode, tests, docs
VerificationConfirm implementation matches specTest results
ArchiveClose and archiveArchived spec with links

Core Principles

PrincipleDescription
Evaluate FirstAssess scope and sync needs before creating spec
Spec FirstNo functional changes without approved spec
Tool PriorityUse SDD tool commands when available
Methodology > ToolingSDD works with any tool or manual process
Bidirectional SyncChanges propagate to all related artifacts

Pre-Spec Evaluation

Before creating a specification, answer these questions:

QuestionOptionsResult
Scope?Project-specific / UniversalDetermines if Core Standard needed
Interactive?Yes / NoDetermines if Skill needed
User-triggered?Yes / NoDetermines if Command needed

Exceptions to "Spec First"

  • Critical hotfixes (restore service immediately, document later)
  • Trivial changes (typos, comments, formatting)

Proposal Template

markdown
# [SPEC-ID] Feature Title

## Summary
Brief description of the proposed change.

## Motivation
Why is this change needed? What problem does it solve?

## Detailed Design
Technical approach, affected components, data flow.

## Acceptance Criteria
- [ ] Criterion 1
- [ ] Criterion 2

## Dependencies
List any dependencies on other specs or external systems.

## Risks
Potential risks and mitigation strategies.

Detailed Guidelines

For complete standards, see:

AI-Optimized Format (Token-Efficient)

For AI assistants, use the YAML format files for reduced token usage:

  • Base standard: ai/standards/spec-driven-development.ai.yaml

Integration with Other Standards

With Commit Messages

Reference spec ID in commit messages:

code
feat(auth): implement login feature

Implements SPEC-001 login functionality with OAuth2 support.

Refs: SPEC-001

With Check-in Standards

Before checking in code for a spec:

  • Spec is approved
  • Implementation matches spec
  • Tests cover acceptance criteria
  • Spec ID referenced in PR

With Code Review

Reviewers should verify:

  • Change matches approved spec
  • No scope creep beyond spec
  • Spec acceptance criteria met

Examples

✅ Good Practices

markdown
# SPEC-001 Add OAuth2 Login

## Summary
Add Google OAuth2 login to allow users to sign in with their Google accounts.

## Motivation
- Reduce friction for new users
- Improve security by not storing passwords

## Acceptance Criteria
- [ ] Users can click "Sign in with Google" button
- [ ] New users are automatically registered
- [ ] Existing users are linked to Google account

❌ Bad Practices

markdown
# Add login

Adding login.
  • Missing spec ID
  • No motivation
  • No acceptance criteria

Common SDD Tools

ToolDescriptionCommand Examples
OpenSpecSpecification management/openspec proposal, /openspec approve
Spec KitLightweight spec tracking/spec create, /spec close
ManualNo tool, file-basedCreate specs/SPEC-XXX.md manually

Sync Verification

After completing a spec, verify synchronization:

Sync Checklist

markdown
## Sync Status

### Scope: [Universal|Project|Utility]

- [ ] Core Standard: [Created|Updated|N/A]
- [ ] Skill: [Created|Updated|N/A]
- [ ] Command: [Created|Updated|N/A]
- [ ] Translations: [Synced|Pending|N/A]

Sync Matrix

Change OriginSync To
Core Standard→ Skills, Commands, Translations
Skill→ Core Standard, Commands, Translations
Command→ Skill, Translations

Best Practices

Do's

  • ✅ Evaluate scope before creating spec
  • ✅ Keep specs focused and atomic (one change per spec)
  • ✅ Include clear acceptance criteria
  • ✅ Link specs to implementation PRs
  • ✅ Archive specs after completion
  • ✅ Verify sync status before closing

Don'ts

  • ❌ Start coding before spec approval
  • ❌ Skip scope evaluation
  • ❌ Modify scope during implementation without updating spec
  • ❌ Leave specs in limbo (always close or archive)
  • ❌ Skip verification step
  • ❌ Forget to sync related artifacts

Configuration Detection

This skill supports project-specific configuration.

Detection Order

  1. Check for SDD tool in workspace (OpenSpec, Spec Kit, etc.)
  2. Check CONTRIBUTING.md for spec workflow documentation
  3. If not found, default to manual file-based workflow

First-Time Setup

If no configuration found:

  1. Ask the user: "This project hasn't configured SDD. Would you like to set up a specs directory?"
  2. Suggest documenting in CONTRIBUTING.md:
markdown
## Spec-Driven Development

We use Spec-Driven Development for all non-trivial changes.

### Process
1. Create proposal in `specs/` directory
2. Get approval from team lead
3. Implement and reference spec in PR
4. Archive spec after merge

### Spec Template
See `specs/TEMPLATE.md`

Related Standards


Version History

VersionDateChanges
1.1.02026-01-26Added: Pre-Spec Evaluation, Sync Verification, Sync Matrix, enhanced best practices
1.0.02025-12-30Initial release

License

This skill is released under CC BY 4.0.

Source: universal-dev-standards