Token导航 LogoToken导航

Agent Skill · 前端设计

doc-spec(文档规范)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

doc-spec 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 3,439。

总安装 1,322周安装 54GitHub Stars 14下载 423核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:doc-spec(文档规范)
来源仓库:https://github.com/vladm3105/aidoc-flow-framework
仓库路径:skills/doc-spec
安装命令:
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-spec
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-spec

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于创建符合 SDD 流程的技术规格说明书(SPEC)。适合定义代码级实现细节,衔接需求与设计到开发的桥梁。基于上游 BRD、PRD 等文档生成 YAML 格式规格文件。必须在已有上游工件基础上调用,否则无法生成有效规格。doc-spec 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/doc-spec

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-spe…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

doc-spec 怎么安装?

在终端执行 npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill doc-spec。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

doc-spec 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

doc-spec 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

doc-spec 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

doc-spec 用的人多吗?

公开数据是累计安装 1,322 次,近一周安装 54 次,下载 423 次,GitHub 14 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

doc-spec 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
doc-spec

文档规范 · 本页

1,32214接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

doc-spec

Purpose

Create Technical Specifications (SPEC) - Layer 9 artifact in the SDD workflow that defines implementation-ready specifications in YAML format, providing complete technical details for code generation.

Layer: 9

Upstream: BRD (Layer 1), PRD (Layer 2), EARS (Layer 3), BDD (Layer 4), ADR (Layer 5), SYS (Layer 6), REQ (Layer 7), CTR (Layer 8 - optional)

Downstream Artifacts: TSPEC (Layer 10), TASKS (Layer 11), Code (Layer 12)

Prerequisites

Upstream Artifact Verification (CRITICAL)

Before creating this document, you MUST:

  1. List existing upstream artifacts: ls docs/01_BRD/ docs/02_PRD/ docs/03_EARS/ docs/04_BDD/ docs/05_ADR/ docs/06_SYS/ docs/07_REQ/ docs/08_CTR/ 2>/dev/null
  2. Reference only existing documents in traceability tags
  3. Use null only when upstream artifact type genuinely doesn't exist
  4. NEVER use placeholders like BRD-XXX or TBD
  5. Do NOT create missing upstream artifacts - skip functionality instead

Before creating SPEC, read:

  1. Shared Standards: .claude/skills/doc-flow/SHARED_CONTENT.md
  2. Upstream REQ: Read atomic requirements (PRIMARY SOURCE)
  3. Upstream CTR: Read contracts if Layer 9 created
  4. Template: ai_dev_ssd_flow/09_SPEC/SPEC-MVP-TEMPLATE.yaml
  5. Creation Rules: ai_dev_ssd_flow/09_SPEC/SPEC-MVP-TEMPLATE.md
  6. Validation Rules: ai_dev_ssd_flow/09_SPEC/SPEC_MVP_SCHEMA.yaml
  7. Validation Scripts:
  • python3 ai_dev_ssd_flow/09_SPEC/scripts/validate_spec.py
  • python3 ai_dev_ssd_flow/09_SPEC/scripts/validate_spec_implementation_readiness.py

Reserved ID Exemption (SPEC-00_*)

Scope: Documents with reserved ID 000 are FULLY EXEMPT from validation.

Pattern: SPEC-00_*.md, SPEC-00_*.yaml

Document Types:

  • Index documents (SPEC-00_index.md)
  • Traceability matrix templates (SPEC-00_TRACEABILITY_MATRIX-TEMPLATE.md)
  • Glossaries, registries, checklists

Rationale: Reserved ID 000 documents are framework infrastructure (indexes, templates, reference materials), not project artifacts requiring traceability or quality gates.

Validation Behavior: Skip all checks when filename matches SPEC-00_* pattern.

When to Use This Skill

Use doc-spec when:

  • Have completed BRD through REQ (Layers 1-7)
  • Ready to create implementation-ready specifications
  • Preparing for code generation or implementation
  • Need complete technical details in structured format
  • You are at Layer 9 of the SDD workflow

SPEC-Specific Guidance

1. YAML Format (MANDATORY)

Format: Pure YAML (not markdown)

Structure:

# SPEC-NN: [Specification Title]

metadata:
  spec_id: SPEC-01
  title: "Order Validation Service Specification"
  version: "1.0.0"
  created_date: "2025-01-15T00:00:00"
  updated_date: "2025-01-15T00:00:00"
  status: "approved"
  owner: "team-backend"
  task_ready_score: "✅ 95% (Target: ≥90%)"

cumulative_tags:
  brd: ["BRD.01.0103"]
  prd: ["PRD.01.0702"]
  ears: ["EARS.01.2501"]
  bdd: ["BDD.01.1401"]
  adr: ["ADR-033", "ADR-045"]
  sys: ["SYS.01.2601"]
  req: ["REQ.01.2701"]
  contracts: ["CTR-01"]  # optional - if Layer 8 created

overview:
  purpose: "Define trade order validation service implementation"
  scope: "Validate trade orders against position limits and business rules"
  requirements:
    - "REQ-risk-limits-01"
    - "REQ-risk-limits-02"

architecture:
  pattern: "layered"
  layers:
    - name: "controller"
      technology: "FastAPI"
      description: "REST API endpoint handlers"
    - name: "service"
      technology: "Python"
      description: "Business logic and validation"
    - name: "repository"
      technology: "SQLAlchemy"
      description: "Database access layer"

interfaces:
  api_endpoints:
    - endpoint: "/api/v1/trades/validate"
      method: "POST"
      contract_ref: "CTR-01"
      authentication: "Bearer token"
      rate_limit: "@threshold: PRD.NN.limit.api.requests_per_second"
      rate_limit_window: "1min"

  data_models:
    - model: "TradeOrderRequest"
      schema_ref: "CTR-01#/components/schemas/TradeOrderRequest"
    - model: "ValidationResponse"
      schema_ref: "CTR-01#/components/schemas/ValidationResponse"

implementation:
  modules:
    - name: "controllers/trade_validation_controller.py"
      purpose: "API endpoint handlers"
      dependencies: ["services/trade_validator.py"]

    - name: "services/trade_validator.py"
      purpose: "Business logic and validation"
      dependencies:
        - "repositories/position_repository.py"
        - "models/trade_order.py"

    - name: "repositories/position_repository.py"
      purpose: "Database access for positions"
      dependencies: ["database/connection.py"]

  functions:
    - name: "validate_trade_order"
      module: "services/trade_validator.py"
      signature: "async def validate_trade_order(order: TradeOrderRequest) -> ValidationResponse"
      purpose: "Validate trade order against all rules"
      algorithm:
        - "1. Validate symbol exists"
        - "2. Check quantity is positive"
        - "3. Validate price within range"
        - "4. Check position limits"
        - "5. Return validation result"

error_handling:
  error_codes:
    - code: "INVALID_SYMBOL"
      http_status: 400
      message: "Symbol not found in approved list"
      recovery: "user_correction"

    - code: "LIMIT_EXCEEDED"
      http_status: 403
      message: "Position limit exceeded"
      recovery: "reduce_position"

configuration:
  environment_variables:
    - name: "MAX_POSITION_DELTA"
      type: "float"
      default: "0.50"
      required: true

  feature_flags:
    - name: "enable_strict_validation"
      default: false
      description: "Enable enhanced validation rules"

testing:
  unit_tests:
    - test: "test_validate_valid_order"
      module: "tests/unit/test_trade_validator.py"
      coverage_target: 95

  integration_tests:
    - test: "test_validation_endpoint"
      module: "tests/integration/test_trade_api.py"

  performance_tests:
    - test: "test_validation_latency"
      target: "P95 < 50ms"

deployment:
  container:
    image: "trade-validator:1.0.0"
    base: "python:3.11-slim"

  resources:
    cpu: "1000m"
    memory: "512Mi"

  scaling:
    min_replicas: 2
    max_replicas: 10
    target_cpu: 70

monitoring:
  metrics:
    - name: "validation_latency_ms"
      type: "histogram"
      labels: ["endpoint", "status"]

    - name: "validation_errors_total"
      type: "counter"
      labels: ["error_code"]

  alerts:
    - alert: "HighValidationLatency"
      condition: "P95 > 100ms"
      severity: "warning"

traceability:
  upstream_sources:
    - artifact: "BRD-01"
      sections: ["section-3"]
    - artifact: "PRD-01"
      sections: ["feature-2"]
    - artifact: "REQ-risk-limits-01"
      sections: ["all"]

  downstream_artifacts:
    - "TASKS-01"
    - "Code: src/services/trade_validator.py"

2. Element ID Format (MANDATORY)

Pattern: SPEC.{DOC_NUM}.{HASH} (3 segments, dot-separated)

Element TypeCodeExample
Step15SPEC.02.1501
Interface16SPEC.02.1601
Data Model17SPEC.02.1701
Validation Rule21SPEC.02.2101
Specification Element28SPEC.02.2801
REMOVED PATTERNS - Do NOT use legacy formats: - STEP-XXX - Use SPEC.NN.15.SS instead - IF-XXX or INT-XXX - Use SPEC.NN.16.SS instead - DM-XXX or MODEL-XXX - Use SPEC.NN.17.SS instead - VR-XXX - Use SPEC.NN.21.SS instead

Reference: ID_NAMING_STANDARDS.md - Cross-Reference Link Format

3. Required Top-Level Sections

MANDATORY Sections:

  1. metadata: Spec ID, title, version, dates, status, owner, task_ready_score
  2. cumulative_tags: All upstream tags (7-9 tags depending on layers)
  3. overview: Purpose, scope, requirements
  4. architecture: Pattern, layers, technologies
  5. interfaces: API endpoints, data models
  6. implementation: Modules, functions, algorithms
  7. error_handling: Error codes, HTTP status, recovery
  8. configuration: Environment variables, feature flags
  9. testing: Unit, integration, performance tests
  10. deployment: Container, resources, scaling
  11. monitoring: Metrics, alerts, logging
  12. traceability: Upstream sources, downstream artifacts

4. TASKS-Ready Scoring System

Purpose: Measures SPEC maturity and readiness for progression to TASKS implementation planning.

Format in Metadata:

metadata:
  task_ready_score: "✅ 95% (Target: ≥90%)"

Status and TASKS-Ready Score Mapping:

TASKS-Ready ScoreRequired Status
≥90%approved
70-89%in_review
<70%draft

Scoring Criteria:

  • YAML Completeness (25%): All metadata fields, traceability chain, all sections populated
  • Interface Definitions (25%): External APIs with CTR contracts, internal interfaces, data schemas
  • Implementation Specifications (25%): Behavior enables code generation, performance/security quantifiable
  • Code Generation Readiness (25%): Machine-readable fields, TASKS-ready metadata

Quality Gate: Score <90% prevents TASKS artifact creation.

5. Threshold Registry Integration

Purpose: Prevent magic numbers by referencing centralized threshold registry.

When @threshold Tag is Required: Use for ALL quantitative values that are:

  • Performance configurations (latencies, throughput, IOPS)
  • Timeout configurations (connection, read, write timeouts)
  • Rate limiting values (requests per second, burst limits)
  • Resource limits (memory, CPU, storage)
  • Circuit breaker configurations

@threshold Tag Format in YAML:

# String value format
performance:
  p95_latency_ms: "@threshold: PRD.NN.perf.api.p95_latency"

# Comment format for documentation
timeout:
  request_ms: 5000  # @threshold: PRD.NN.timeout.request.sync

Invalid (hardcoded values):

performance:
  p95_latency_ms: 200
timeout:
  request_ms: 5000
rate_limit:
  requests_per_second: 100

Valid (registry references):

performance:
  p95_latency_ms: "@threshold: PRD.NN.perf.api.p95_latency"
timeout:
  request_ms: "@threshold: PRD.NN.timeout.request.sync"
rate_limit:
  requests_per_second: "@threshold: PRD.NN.limit.api.requests_per_second"

6. cumulative_tags Field (CRITICAL)

CRITICAL: SPEC must include cumulative_tags section with ALL upstream tags

Element Type Codes for Cumulative Tags:

TagArtifactElement TypeCode
brdBRDBusiness Requirement01
prdPRDProduct Feature07
earsEARSEARS Statement25
bddBDDScenario14
adrADRDocument reference(dash notation)
sysSYSSystem Requirement26
reqREQAtomic Requirement27
contractsCTRDocument reference(dash notation)

Format (maximum - CTR included):

cumulative_tags:
  brd: ["BRD.01.0103", "BRD.01.0105"]
  prd: ["PRD.01.0702", "PRD.01.0715"]
  ears: ["EARS.01.2501", "EARS.01.2502"]
  bdd: ["BDD.01.1401"]
  adr: ["ADR-033", "ADR-045"]
  sys: ["SYS.01.2601", "SYS.01.2607"]
  req: ["REQ.01.2701"]
  contracts: ["CTR-01"]

Format (minimum - CTR skipped):

cumulative_tags:
  brd: ["BRD.01.0103"]
  prd: ["PRD.01.0702"]
  ears: ["EARS.01.2501"]
  bdd: ["BDD.01.1401"]
  adr: ["ADR-033", "ADR-045"]
  sys: ["SYS.01.2601"]
  req: ["REQ.01.2701"]

Tag Count: 7-8 tags (minimum 7, maximum 8)

7. contract_ref Field

Purpose: Link SPEC to CTR (if Layer 9 created)

Format:

interfaces:
  api_endpoints:
    - endpoint: "/api/v1/trades/validate"
      method: "POST"
      contract_ref: "CTR-01"  # Link to contract
      contract_path: "#/paths/~1api~1v1~1trades~1validate/post"  # JSON Pointer

  data_models:
    - model: "TradeOrderRequest"
      schema_ref: "CTR-01#/components/schemas/TradeOrderRequest"

8. Implementation Readiness

100% Implementation-Ready: SPEC must contain ALL information needed to write code

Checklist:

  • All modules identified with file paths
  • All functions identified with signatures
  • All algorithms documented step-by-step
  • All data models linked to schemas
  • All error codes defined
  • All configuration specified
  • All tests specified
  • Deployment requirements complete

Tag Format Convention (By Design)

The SDD framework uses two distinct notation systems for cross-references:

NotationFormatArtifactsPurpose
DashTYPE-NNADR, SPEC, CTRTechnical artifacts - references to files/documents
DotTYPE.NN.xxxxBRD, PRD, EARS, BDD, SYS, REQ, IMPL, TASKSHierarchical artifacts - references to elements inside documents

Key Distinction:

  • @adr: ADR-033 → Points to the document ADR-033_risk_limit_enforcement.md
  • @brd: BRD.17.0101 → Points to element 01.01 inside document BRD-017.md

Unified Element ID Format (MANDATORY)

For hierarchical requirements (BRD, PRD, EARS, BDD, SYS, REQ, IMPL):

  • Always use: TYPE.NN.xxxx (dot separator, 3-segment unified format)
  • Never use: TYPE-NN:NNN (colon separator - DEPRECATED)
  • Never use: TYPE.NN.TT.SS (old 4-segment format - DEPRECATED)

Examples:

  • @brd: BRD.17.0101 ✅
  • @brd: BRD.017.001 ❌ (old 3-segment format)

Validation Checks

Tier 1: Errors (Blocking)

CheckDescription
CHECK 1YAML Syntax Validation (parseable)
CHECK 2Required Metadata Fields (version, status, task_ready_score)
CHECK 3TASKS-Ready Score format (✅ emoji + percentage + target)
CHECK 4Complete Traceability Chain (cumulative_tags section)
CHECK 5Element ID Format (SPEC.NN.xxxx)

Tier 2: Warnings (Recommended)

CheckDescription
CHECK 6Interface Specifications (CTR contract references)
CHECK 7Implementation Readiness (code generation enabling)
CHECK 8Code Generation Compatibility (TASKS creation)

Tier 3: Info

CheckDescription
CHECK 9Threshold Registry Integration (@threshold references)
CHECK 10Performance benchmarks defined

Pre-Commit Hooks

SPEC validation is automatically enforced via pre-commit hooks:

# .pre-commit-config.yaml
- id: spec-core-validator
  name: Validate SPEC core checks (validator, framework library)
  entry: bash ai_dev_ssd_flow/09_SPEC/scripts/spec_core_validator_hook.sh ai_dev_ssd_flow/09_SPEC
  language: system
  pass_filenames: false
  stages: [pre-commit]

- id: spec-quality-gate
  name: Validate SPEC quality gates
  entry: bash ai_dev_ssd_flow/09_SPEC/scripts/spec_quality_gate_hook.sh ai_dev_ssd_flow/09_SPEC
  language: system
  pass_filenames: false
  stages: [pre-commit]

- id: spec-implementation-ready
  name: Validate SPEC Implementation-Ready score (≥90%)
  entry: bash ai_dev_ssd_flow/09_SPEC/scripts/spec_implementation_ready_hook.sh ai_dev_ssd_flow/09_SPEC
  language: system
  pass_filenames: false
  stages: [pre-commit]

Quality Gates Enforced:

  • ✅ YAML syntax validation (parseable structure)
  • ✅ Implementation-Ready score ≥90% for implementation
  • ✅ Required metadata fields (version, status, tasks_ready_score)
  • ✅ TASKS-Ready score format (✅ emoji + percentage)
  • ✅ Complete traceability chain (8 cumulative tags: @brd through @ctr)
  • ✅ Element ID format (SPEC.NN.xxxx for components)
  • ✅ Interface specifications (CTR contract references)
  • ✅ Code generation compatibility
  • ✅ Threshold registry integration (@threshold references)
  • ✅ Performance benchmarks defined
  • ✅ REQ implementations section (per-REQ mapping)
  • ✅ Concrete examples (pseudocode, API samples, Pydantic models)

Hook Scripts:

  • spec_core_validator_hook.sh - Core SPEC structure and YAML validation
  • spec_quality_gate_hook.sh - Quality gate checks for completeness
  • spec_implementation_ready_hook.sh - Implementation-Ready score calculation (≥90% required)

Upstream/Downstream Artifacts

Upstream Sources:

  • BRD (Layer 1) - Business requirements
  • PRD (Layer 2) - Product features
  • EARS (Layer 3) - Formal requirements
  • BDD (Layer 4) - Test scenarios
  • ADR (Layer 5) - Architecture decisions
  • SYS (Layer 6) - System requirements
  • REQ (Layer 7) - Atomic requirements (PRIMARY SOURCE)
  • CTR (Layer 8) - Data contracts (optional)

Downstream Artifacts:

  • TSPEC (Layer 10) - Test specifications
  • TASKS (Layer 11) - Task breakdown
  • Code (Layer 12) - Implementation code

Same-Type Document Relationships (conditional):

  • @related-spec: SPEC-NN - SPECs sharing implementation context
  • @depends-spec: SPEC-NN - SPEC that must be implemented first

Creation Process

Step 1: Read Upstream Artifacts

Focus on REQ (Layer 7) and optionally CTR (Layer 9).

Step 2: Reserve ID Number

Check docs/09_SPEC/ for next available ID number (or create docs/09_SPEC/ directory if first SPEC).

ID Numbering Convention: Start with 2 digits and expand only as needed.

  • ✅ Correct: SPEC-01, SPEC-99, SPEC-102
  • ❌ Incorrect: SPEC-001, SPEC-009 (extra leading zero not required)

Step 3: Create SPEC File

Nested Folder Rule (MANDATORY): ALL SPEC documents MUST use nested folders regardless of document size.

File naming: docs/09_SPEC/SPEC-NN_{slug}/SPEC-NN_{slug}.yaml

Example: docs/09_SPEC/SPEC-01_trade_validation/SPEC-01_trade_validation.yaml

IMPORTANT: Pure YAML format (NOT markdown)

Note: Templates and examples are in ai_dev_ssd_flow/09_SPEC/ while project-specific SPECs go in docs/09_SPEC/.

CRITICAL: Never create SPEC files directly in docs/09_SPEC/ without a nested folder structure.

Step 4: Fill Metadata Section

Complete spec_id, title, version, dates, status, owner, task_ready_score.

Step 5: Add Cumulative Tags

Include all 7-9 upstream tags (brd through req/impl/contracts).

Step 6: Define Overview

Purpose, scope, and requirements list.

Step 7: Specify Architecture

Pattern, layers, and technologies (reference ADR decisions).

Step 8: Define Interfaces

API endpoints (with contract_ref), data models (with schema_ref).

Step 9: Document Implementation

Modules (file paths), functions (signatures), algorithms (step-by-step).

Step 10: Specify Error Handling

Error codes, HTTP status, messages, recovery procedures.

Step 11: Define Configuration

Environment variables, feature flags, defaults. Use @threshold for quantitative values.

Step 12: Specify Testing

Unit tests, integration tests, performance tests with targets.

Step 13: Define Deployment

Container, resources, scaling, environment.

Step 14: Add Monitoring

Metrics, alerts, logging requirements.

Step 15: Add Traceability

Upstream sources and downstream artifacts.

Step 16: Create/Update Traceability Matrix

MANDATORY: Create or update docs/09_SPEC/SPEC-00_TRACEABILITY_MATRIX.md (use template from ai_dev_ssd_flow/09_SPEC/SPEC-00_TRACEABILITY_MATRIX-TEMPLATE.md)

Step 17: Validate SPEC

# YAML validation
yamllint docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml

# Schema + quality validation
python3 ai_dev_ssd_flow/09_SPEC/scripts/validate_spec.py docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml
python3 ai_dev_ssd_flow/09_SPEC/scripts/validate_spec_implementation_readiness.py docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml --verbose

# Cumulative tagging validation
python ai_dev_ssd_flow/scripts/validate_tags_against_docs.py --artifact SPEC-01 --expected-layers brd,prd,ears,bdd,adr,sys,req,contracts --strict

# Cross-document validation
python ai_dev_ssd_flow/scripts/validate_cross_document.py --document docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml

Step 18: Commit Changes

Commit SPEC file and traceability matrix.

Validation

Automated Validation

# YAML validation
yamllint docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml

# Schema + quality validation
python3 ai_dev_ssd_flow/09_SPEC/scripts/validate_spec.py docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml
python3 ai_dev_ssd_flow/09_SPEC/scripts/validate_spec_implementation_readiness.py docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml --verbose

# Cumulative tagging validation
python ai_dev_ssd_flow/scripts/validate_tags_against_docs.py \
  --artifact SPEC-01 \
  --expected-layers brd,prd,ears,bdd,adr,sys,req,contracts \
  --strict

# Cross-document validation
python ai_dev_ssd_flow/scripts/validate_cross_document.py --document docs/09_SPEC/SPEC-01_*/SPEC-01_*.yaml

Manual Checklist

  • Pure YAML format (not markdown)
  • Metadata section complete with task_ready_score
  • cumulative_tags section with 7-9 upstream tags
  • Overview defines purpose and scope
  • Architecture references ADR decisions
  • Interfaces link to CTR (if Layer 9 created)
  • Implementation specifies modules with file paths
  • Functions have signatures and algorithms
  • Error handling complete
  • Configuration uses @threshold for quantitative values
  • Testing requirements defined
  • Deployment requirements complete
  • Monitoring specified
  • Traceability links to upstream/downstream
  • 100% implementation-ready
  • Element IDs use SPEC.NN.xxxx format

Diagram Standards

All diagrams MUST use Mermaid syntax. Text-based diagrams (ASCII art, box drawings) are prohibited. See: ai_dev_ssd_flow/DIAGRAM_STANDARDS.md and mermaid-gen skill.

Common Pitfalls

  1. Markdown format: SPEC must be pure YAML, not markdown
  2. Missing cumulative_tags: Must include all 7-9 upstream tags
  3. No contract_ref: Must link to CTR if Layer 9 created
  4. Vague implementation: Must specify exact file paths and signatures
  5. Missing algorithms: Functions need step-by-step algorithms
  6. Incomplete: Must be 100% implementation-ready
  7. Hardcoded values: Use @threshold for performance/timeout/rate limits
  8. Wrong element IDs: Use SPEC.NN.xxxx, not legacy STEP-XXX, IF-XXX, DM-XXX
  9. Wrong cumulative tag codes: Use correct element type codes (EARS=25, BDD=14, SYS=26, REQ=27, IMPL=29)

Post-Creation Validation (MANDATORY - NO CONFIRMATION)

CRITICAL: Execute this validation loop IMMEDIATELY after document creation. Do NOT proceed to next document until validation passes.

Automatic Validation Loop

LOOP:
  1. Run: python ai_dev_ssd_flow/scripts/validate_cross_document.py --document {doc_path} --auto-fix
  2. IF errors fixed: GOTO LOOP (re-validate)
  3. IF warnings fixed: GOTO LOOP (re-validate)
  4. IF unfixable issues: Log for manual review, continue
  5. IF clean: Mark VALIDATED, proceed

Validation Command

# Per-document validation (Phase 1)
python ai_dev_ssd_flow/scripts/validate_cross_document.py --document docs/09_SPEC/SPEC-NN_slug/SPEC-NN_slug.yaml --auto-fix

# Layer validation (Phase 2) - run when all SPEC documents complete
python ai_dev_ssd_flow/scripts/validate_cross_document.py --layer SPEC --auto-fix

Layer-Specific Upstream Requirements

This LayerRequired Upstream TagsCount
SPEC (Layer 9)@brd, @prd, @ears, @bdd, @adr, @sys, @req (+ @ctr if created)7-8 tags

Auto-Fix Actions (No Confirmation Required)

IssueFix Action
Missing upstream tagAdd with upstream document reference
Invalid tag formatCorrect to TYPE.NN.xxxx (3-segment) or TYPE-NN format
Broken linkRecalculate path from current location
Missing traceability sectionInsert from template

Validation Codes Reference

CodeDescriptionSeverity
XDOC-001Referenced requirement ID not foundERROR
XDOC-002Missing cumulative tagERROR
XDOC-003Upstream document not foundERROR
XDOC-006Tag format invalidERROR
XDOC-007Gap in cumulative tag chainERROR
XDOC-009Missing traceability sectionERROR

Quality Gate

Blocking: YES - Cannot proceed to next document until Phase 1 validation passes with 0 errors.


Next Skill

After creating SPEC, use:

doc-tasks - Create Task Breakdown (Layer 11)

The TASKS will:

  • Reference this SPEC as upstream source
  • Include all 8-9 upstream tags
  • Break SPEC into actionable tasks
  • Provide AI-structured TODO format

Reference Documents

SPEC artifacts do not support REF documents. Reference documents are limited to BRD and ADR types only per the SDD framework.

For supplementary documentation needs, create:

  • BRD-REF: Business context documentation
  • ADR-REF: Technical reference guides (API quick references, implementation guides)

Related Resources

  • Template: ai_dev_ssd_flow/09_SPEC/SPEC-MVP-TEMPLATE.yaml (primary authority)
  • SPEC Creation Rules: ai_dev_ssd_flow/09_SPEC/SPEC-MVP-TEMPLATE.md
  • SPEC Validation Rules: ai_dev_ssd_flow/09_SPEC/SPEC_MVP_SCHEMA.yaml
  • SPEC Schema: ai_dev_ssd_flow/09_SPEC/SPEC_MVP_SCHEMA.yaml
  • SPEC README: ai_dev_ssd_flow/09_SPEC/README.md
  • Shared Standards: .claude/skills/doc-flow/SHARED_CONTENT.md
  • Naming Standards: .claude/skills/doc-naming/SKILL.md (ID and naming conventions)

Quick Reference

SPEC Purpose: Implementation-ready technical specifications

Layer: 9

Element ID Format: SPEC.NN.xxxx

  • Step = 15
  • Interface = 16
  • Data Model = 17
  • Validation Rule = 21
  • Specification Element = 28

Removed Patterns: STEP-XXX, IF-XXX, INT-XXX, DM-XXX, MODEL-XXX, VR-XXX

Tags Required: @brd through @req/contracts (7-8 tags)

Format: Pure YAML (not markdown)

Key Features:

  • cumulative_tags section (CRITICAL)
  • contract_ref field (links to CTR)
  • schema_ref field (links to data models)
  • @threshold references for quantitative values
  • 100% implementation-ready
  • All modules, functions, algorithms specified

TASKS-Ready Score: ≥90% required for "approved" status

Quality Gate: Must be 100% implementation-ready

Next: doc-tasks


Version History

VersionDateChangesAuthor
1.2.02026-02-27Normalized metadata schema; migrated canonical references to ai_dev_ssd_flow/09_SPEC; replaced stale docs/SPEC validation examples; aligned commands to existing SPEC validatorsSystem
1.1.02026-02-08Updated layer assignment from 10 to 9 per LAYER_REGISTRY v1.6; updated downstream artifacts (TSPEC Layer 10, TASKS Layer 11); removed IMPL from upstream; updated tag counts to 7-8System
1.0.02025-01-15Initial skill definitionSystem

平台分布

Gemini CLI

32.26%
按下载量换算136

Claude Code

23.42%
按下载量换算99

OpenCode

16.24%
按下载量换算69

Antigravity

14.29%
按下载量换算60

Codex

8.25%
按下载量换算35

windsurf

3.62%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills