locales/zh-CN/skills/spec-driven-dev/SKILL.md
在编写代码前,建立、审查和管理规格文件。 使用时机:建立规格、审查设计、规格驱动开发流程。 关键字:spec, specification, SDD, design, review, 规格, 设计, 审查, 验证。
npx skillsauth add asiaostrich/universal-dev-standards locales/zh-CN/skills/spec-driven-devInstall 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.
在编写代码前,建立、审查和管理规格文件。
在编写代码前,建立、审查和管理规格文件。
/sdd vs uds spec | 何时使用| 场景 | /sdd | uds spec |
|----------|--------|------------|
| 带审查周期的正式功能开发 | ✅ | ❌ |
| 完整 spec 生命周期(Draft → Archived) | ✅ | ❌ |
| 快速原型 / Vibe coding | ❌ | ✅ |
| 小幅增量改动 | ❌ | ✅ |
| 需要利益相关方签核 | ✅ | ❌ |
| 从自然语言意图生成 micro-spec | ❌ | ✅ |
/sdd= 用于正式开发的完整 spec 生命周期uds spec= 用于快速迭代的轻量 micro-spec
/sdd= 正式开发的完整规格生命周期uds spec= 快速迭代的轻量微规格
specs/、docs/specs/ 或项目的 spec 目录SPEC-NNN 或 kebab-case 变更 IDNew request? | 新需求?
├─ Bug fix restoring spec behavior? → Fix directly | 直接修复
├─ Typo/format/comment? → Fix directly | 直接修复
├─ Dependency update (non-breaking)? → Fix directly | 直接修复
├─ New feature/capability? → Create proposal | 建立提案
├─ Breaking change? → Create proposal | 建立提案
├─ Architecture change? → Create proposal | 建立提案
├─ Agent/role definition (spans multiple features)? → Use spec-type: agent | 使用 Agent SPEC template
└─ Unclear? → Create proposal (safer) | 建立提案(较安全)
DISCUSS ──► CREATE ──► REVIEW ──► APPROVE ──► IMPLEMENT ──► VERIFY ──► ARCHIVE
捕捉灰色地带、建立指导原则,并在撰写 spec 前消解歧义。
定义需求、技术设计、验收条件与测试计划。
与利益相关方一起检查完整性、一致性与可行性。
在实作开始前取得利益相关方签核。
依据已核准的 spec 进行开发,参照需求与 AC。
确保实作与 spec 相符、所有测试通过、AC 满足。
将完成的 spec 归档,并附上指向 commit/PR 的链接。
| 状态 | Description | 说明 | |-------|-------------|------| | Draft | Work in progress | 草稿中 | | Review | Under review | 审查中 | | Approved | Ready for implementation | 已核准 | | Implemented | Code complete | 已实作 | | Archived | Completed or deprecated | 已归档 |
# [SPEC-ID] Feature: [Name]
## Overview
Brief description of the proposed change.
## Motivation
Why is this change needed? What problem does it solve?
## Requirements
### Requirement: [Name]
The system SHALL [behavior description].
#### Scenario: [Success case]
- **GIVEN** [initial context]
- **WHEN** [action performed]
- **THEN** [expected result]
## Acceptance Criteria
- AC-1: Given [context], when [action], then [result]
## Technical Design
[Architecture, API changes, database changes]
## Test Plan
- [ ] Unit tests for [component]
- [ ] Integration tests for [flow]
spec-type: agent)# [SPEC-ID] Agent: [Role Name]
<!-- spec-type: agent -->
<!-- agent-id auto-referenced by feature SPECs -->
## Role Definition
- **Role**: [Agent Name]
- **Responsibility**: [One sentence]
- **Autonomy Level**: L[1-5] (per DEC-065)
## Capability Scope
**Owns:**
- [Capability 1]
- [Capability 2]
**Does NOT own:**
- [Explicit exclusion]
## Interface Contract
### Input
| Message Type | Required Fields | Optional Fields |
|---|---|---|
| [Type] | [fields] | [fields] |
### Output
| Artifact Type | Success Condition | Failure Condition |
|---|---|---|
| [Type] | [condition] | [condition] |
## Agent Interactions
- **Upstream**: [Who calls this agent]
- **Downstream**: [Who this agent calls]
- **Parallel**: [Agents working alongside]
## Related Feature SPECs
- [SPEC-NNN] — [This agent's role in that spec]
#### Scenario:(h4 标题)修改既有 spec 时,使用 delta 区段:
| Operation | Description | 说明 |
|-----------|-------------|------|
| ## ADDED Requirements | New capabilities | 新增功能 |
| ## MODIFIED Requirements | Changed behavior | 修改行为 |
| ## REMOVED Requirements | Deprecated features | 移除功能 |
| ## RENAMED Requirements | Name changes | 重新命名 |
/sdd - Interactive spec creation wizard | 互动式规格建立向导
/sdd auth-flow - Create spec for specific feature | 为特定功能建立规格
/sdd review - Review existing specs | 审查现有规格
/sdd --sync-check - Check sync status | 检查同步状态
/sdd 完成后,AI 助手应建议:
规格文件已建立。建议下一步 / Specification document created. Suggested next steps:
- 执行
/derive从规格推导测试工件 ⭐ Recommended / 推荐 — Derive test artifacts from spec- 执行
/derive bdd仅推导 BDD 场景 — Derive BDD scenarios only- 执行
/derive tdd仅推导 TDD 骨架 — Derive TDD skeletons only- 审查 AC 完整性,确保所有验收条件可测试 — Review AC completeness
- 检查 UDS 规范覆盖率 → 执行
/audit --patterns— Check UDS standard coverage → Run/audit --patterns
完整的 AI 行为定义请参阅对应的命令文件:
/sddFor complete AI agent behavior definition, see the corresponding command file:
/sdd
development
[UDS] 扫描代码库的调试残留与代码质量问题;可自动修正安全模式。 Use when: before committing, during PR review, or periodic codebase cleanup. Keywords: sweep, debug cleanup, console.log, debugger, TODO, ts-any, code quality, 扫描, 清理.
tools
[UDS] 从规格衍生 BDD 场景、TDD 骨架或 ATDD 表格
development
[UDS] 识别重复流程并以正确的开发深度构建 Skill
tools
[UDS] AI 辅助 git push 安全层:质量门禁 + 协作护栏。 Use when: pushing commits, force pushing, pushing to protected branches, pushing feature branches. Keywords: git push, force push, protected branch, quality gate, push receipt, PR automation, 推送, 保护分支, 质量门禁.