Token导航 LogoToken导航

Agent Skill · 开发

doc-tspec(文档说明)

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

doc-tspec 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 14,961。

总安装 643周安装 26GitHub Stars 14下载 202核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

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

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

创建测试规格说明书,支撑测试驱动开发流程。基于 SPEC 文档定义 UTEST、ITEST 等各层级测试用例。要求验证所有上游文档存在性,确保测试覆盖完整性。输出物为 Layer 10 标准 TSPEC,指导后续任务与编码实现。doc-tspec 属于开发类 Skill,可作为该场景下的辅助能力补充。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

doc-tspec 怎么安装?

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

doc-tspec 支持哪些 AI 工具?

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

doc-tspec 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

doc-tspec 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

doc-tspec 用的人多吗?

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

doc-tspec 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
doc-tspec

文档说明 · 本页

64314只读未明确通过

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

SKILL.md 原文

doc-tspec

Purpose

Create Test Specifications (TSPEC) - Layer 10 artifact in the SDD workflow that defines test cases for Test-Driven Development (TDD) between SPEC (Layer 9) and TASKS (Layer 11).

Layer: 10

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), SPEC (Layer 9)

Downstream Artifacts: 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/ docs/09_SPEC/ 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 TSPEC, read:

  1. Shared Standards: .claude/skills/doc-flow/SHARED_CONTENT.md
  2. Upstream SPEC: Read technical specifications (PRIMARY SOURCE)
  3. Upstream REQ: Read atomic requirements
  4. Template by Type:

- UTEST: ai_dev_ssd_flow/10_TSPEC/UTEST/UTEST-MVP-TEMPLATE.md - ITEST: ai_dev_ssd_flow/10_TSPEC/ITEST/ITEST-MVP-TEMPLATE.md - STEST: ai_dev_ssd_flow/10_TSPEC/STEST/STEST-MVP-TEMPLATE.md - FTEST: ai_dev_ssd_flow/10_TSPEC/FTEST/FTEST-MVP-TEMPLATE.md

  1. TSPEC README: ai_dev_ssd_flow/10_TSPEC/README.md

When to Use This Skill

Use doc-tspec when:

  • Have completed BRD through SPEC (Layers 1-9)
  • Ready to define test cases before implementation
  • Following Test-Driven Development workflow
  • Need to specify unit, integration, smoke, or functional tests
  • You are at Layer 10 of the SDD workflow

Reserved ID Exemption (TSPEC-00_*)

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

Pattern: TSPEC-00_*.md, {TYPE}-00_*.md (where TYPE is UTEST/ITEST/STEST/FTEST)

Document Types:

  • Index documents (TSPEC-00_index.md)
  • Traceability matrix templates (TSPEC-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 TSPEC-00_* or {TYPE}-00_* pattern.

Element ID Format (MANDATORY)

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

Element TypeCodeTest CategoryExample
Unit Test Case40UTESTTSPEC.01.4001
Integration Test Case41ITESTTSPEC.01.4101
Smoke Test Case42STESTTSPEC.01.4201
Functional Test Case43FTESTTSPEC.01.4301
Performance Test Case44PTESTTSPEC.01.4401
Security Test Case45SECTESTTSPEC.01.4501
REMOVED PATTERNS - Do NOT use legacy formats: - TC-XXX - Use TSPEC.NN.xxxx instead - UT-XXX - Use TSPEC.NN.40.SS instead - IT-XXX - Use TSPEC.NN.41.SS instead - ST-XXX - Use TSPEC.NN.42.SS instead - FT-XXX - Use TSPEC.NN.43.SS instead

Reference: doc-naming skill for complete element type codes.

TSPEC Types Overview

TypeCodeAbbreviationPurposePrimary Source
Unit Test40UTESTIndividual function/method testsREQ (L7), SPEC (L9)
Integration Test41ITESTComponent interaction testsCTR (L8), SYS (L6)
Smoke Test42STESTPost-deployment health checksEARS (L3), BDD (L4)
Functional Test43FTESTSystem behavior validationSYS (L6)
Performance Test44PTESTLoad, stress, and response time testingSYS (L6), SPEC (L9)
Security Test45SECTESTVulnerability and threat testingSYS (L6), ADR (L5)

Note: Acceptance tests remain in BDD (Layer 4), not duplicated in TSPEC.

TSPEC-Specific Guidance

1. Test Document Structure

Directory Structure:

docs/10_TSPEC/
├── UTEST/
│   ├── UTEST-01_{component}_unit.md
│   └── UTEST-02_{component}_unit.md
├── ITEST/
│   ├── ITEST-01_{component}_integration.md
│   └── ITEST-02_{component}_integration.md
├── STEST/
│   ├── STEST-01_{component}_smoke.md
│   └── STEST-02_{component}_smoke.md
├── FTEST/
│   ├── FTEST-01_{component}_functional.md
│   └── FTEST-02_{component}_functional.md
└── TSPEC-00_TRACEABILITY_MATRIX.md

2. Required Sections (All TSPEC Types)

Document Control (MANDATORY - First section):

ItemDetails
StatusDraft / Review / Approved / Implemented
Version0.1.0
Date CreatedYYYY-MM-DD
Last UpdatedYYYY-MM-DD
Author[Author name]
Component[Component/module name]
SPEC ReferenceSPEC-NN
Coverage TargetXX%
TASKS-Ready Score[XX]% (Target: see type-specific)

Core Sections:

  1. Document Control: Metadata and version tracking
  2. Test Scope: Component under test, categories, dependencies
  3. Test Case Index: Summary table of all test cases
  4. Test Case Details: Full specification per test case
  5. Coverage Matrix: REQ/SPEC coverage tracking
  6. Traceability: Cumulative upstream/downstream tags

3. Test Case Format

Each test case MUST include:

### TSPEC.NN.xxxx: [Test Name]

**Category**: [Logic] | [State] | [Validation] | [Edge] | [Integration] | [Critical Path]

**Traceability**:
- @req: REQ.NN.27.XX
- @spec: SPEC-NN (Section X.Y)

**Input/Output Table**:

| Input | Expected Output | Notes |
|-------|-----------------|-------|
| `param1="valid"` | `True` | Happy path |
| `param1=""` | `ValidationError` | Empty input |

**Pseudocode**:

GIVEN valid input parameters WHEN function_under_test(param1) is called THEN result equals expected_output AND no side effects occur

**Error Cases**:

| Error Condition | Expected Behavior |
|-----------------|-------------------|
| Invalid input type | Raise `TypeError` |

4. Type-Specific Requirements

UTEST (Unit Tests - Code 40)

TASKS-Ready Score Target: >=90%

Required Tags: @req, @spec

Test Categories: [Logic], [State], [Validation], [Edge]

Coverage Requirements:

  • Function coverage: >=90%
  • Branch coverage: >=80%
  • REQ element coverage: >=90%
ITEST (Integration Tests - Code 41)

TASKS-Ready Score Target: >=90%

Required Tags: @ctr, @sys, @spec

Test Categories: [Integration], [Contract], [Sequence]

Requirements:

  • Sequence diagrams for complex interactions
  • CTR contract validation
  • Mock/stub strategy documented
STEST (Smoke Tests - Code 42)

TASKS-Ready Score Target: 100%

Required Tags: @ears, @bdd, @req

Test Categories: [Critical Path], [Health Check], [Deployment]

Requirements:

  • Total execution time <5 minutes
  • Rollback procedures documented
  • Critical path coverage 100%
FTEST (Functional Tests - Code 43)

TASKS-Ready Score Target: >=90%

Required Tags: @sys, @threshold

Test Categories: [Functional], [Scenario], [End-to-End]

Requirements:

  • SYS requirement coverage
  • Threshold registry references for performance assertions

5. Coverage Matrix Format

## Coverage Matrix

| REQ ID | REQ Title | Test IDs | Coverage |
|--------|-----------|----------|----------|
| REQ.NN.27.01 | [Title] | TSPEC.NN.40.01, TSPEC.NN.40.03 | Covered |
| REQ.NN.27.02 | [Title] | TSPEC.NN.40.02 | Covered |
| REQ.NN.27.03 | [Title] | - | NOT COVERED |

**Coverage Summary**:
- Total REQ elements: [N]
- Covered: [N]
- Coverage: [XX]%

Cumulative Tagging Requirements

Layer 10 (TSPEC): Must include tags from Layers 1-9

Tag Count: 8 required tags (minimum), 9 if CTR created

Element Type Codes for Cumulative Tags

ArtifactElement TypeCodeExample
BRDBusiness Requirement01BRD.01.0103
PRDProduct Feature07PRD.01.0702
EARSEARS Statement25EARS.01.2501
BDDScenario14BDD.01.1401
ADRDocument reference-ADR-033 (dash notation)
SYSSystem Requirement26SYS.01.2601
REQAtomic Requirement27REQ.01.2701
SPECDocument reference-SPEC-01 (dash notation)

Minimum (8 tags - CTR skipped):

## Traceability

**Required Tags** (Cumulative Tagging Hierarchy - Layer 10):

@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
@spec: SPEC-01

Maximum (9 tags - CTR included):

@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
@ctr: CTR-01
@spec: SPEC-01

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, TSPECHierarchical 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

Validation Checks

Tier 1: Errors (Blocking)

CheckDescription
CHECK 1Filename format valid ({TYPE}-NN_{slug}.md)
CHECK 2YAML frontmatter present with required fields
CHECK 3Document Control table complete
CHECK 4All required sections present
CHECK 5Element ID format compliance (TSPEC.NN.xxxx)
CHECK 6Element type code matches document type (40/41/42/43)
CHECK 7All 8 required traceability tags present
CHECK 8Parent SPEC reference valid and file exists

Tier 2: Warnings

CheckDescription
CHECK W1I/O table present for each test case
CHECK W2Pseudocode provided for complex tests
CHECK W3Coverage matrix complete
CHECK W4TASKS-Ready Score meets type-specific target
CHECK W5Error cases documented

Tier 3: Info

CheckDescription
CHECK I1Test fixtures documented
CHECK I2Mock strategy specified
CHECK I3Performance targets defined (FTEST)

Creation Process

Step 1: Identify Test Type Needed

Determine which TSPEC type(s) to create based on requirements:

  • UTEST for unit testing individual functions
  • ITEST for component integration testing
  • STEST for deployment health verification
  • FTEST for system behavior validation

Step 2: Read Upstream Artifacts

Focus on SPEC (Layer 9) and REQ (Layer 7) as primary sources.

Step 3: Reserve ID Number

Check docs/10_TSPEC/{TYPE}/ for next available ID number.

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

  • Correct: UTEST-01, ITEST-02, STEST-99
  • Incorrect: UTEST-001, ITEST-009 (extra leading zero not required)

Step 4: Create TSPEC File

File naming: docs/10_TSPEC/{TYPE}/{TYPE}-NN_{slug}.md

Examples:

  • docs/10_TSPEC/UTEST/UTEST-01_auth_service_unit.md
  • docs/10_TSPEC/ITEST/ITEST-01_api_integration.md
  • docs/10_TSPEC/STEST/STEST-01_deployment_smoke.md
  • docs/10_TSPEC/FTEST/FTEST-01_order_processing_functional.md

Step 5: Fill Document Control Section

Complete metadata including SPEC Reference and TASKS-Ready Score.

Step 6: Define Test Scope

Document component under test, test categories, and dependencies.

Step 7: Create Test Case Index

Summary table listing all test cases with priority.

Step 8: Write Test Case Details

For each test case:

  • Assign Element ID (TSPEC.NN.xxxx)
  • Define category
  • Add traceability tags
  • Create I/O table
  • Write pseudocode
  • Document error cases

Step 9: Build Coverage Matrix

Map test cases to REQ elements, calculate coverage percentage.

Step 10: Add Cumulative Tags

Include all 8-9 upstream tags (@brd through @spec).

Step 11: Create/Update Traceability Matrix

MANDATORY: Update docs/10_TSPEC/TSPEC-00_TRACEABILITY_MATRIX.md

Step 12: Validate TSPEC

# Type-specific validation
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_utest.py docs/10_TSPEC/UTEST/UTEST-01_*.md
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_itest.py docs/10_TSPEC/ITEST/ITEST-01_*.md
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_stest.py docs/10_TSPEC/STEST/STEST-01_*.md
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_ftest.py docs/10_TSPEC/FTEST/FTEST-01_*.md

# Combined quality score
bash ai_dev_ssd_flow/10_TSPEC/scripts/validate_tspec_quality_score.sh docs/10_TSPEC/

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

Step 13: Commit Changes

Commit TSPEC file and traceability matrix.

Validation

Automated Validation

# All TSPEC types
bash ai_dev_ssd_flow/10_TSPEC/scripts/validate_all_tspec.sh docs/10_TSPEC/

# Type-specific validation
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_utest.py docs/10_TSPEC/UTEST/*.md
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_itest.py docs/10_TSPEC/ITEST/*.md
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_stest.py docs/10_TSPEC/STEST/*.md
python ai_dev_ssd_flow/10_TSPEC/scripts/validate_ftest.py docs/10_TSPEC/FTEST/*.md

# Cross-document validation
python ai_dev_ssd_flow/scripts/validate_cross_document.py --document docs/10_TSPEC/UTEST/UTEST-01_*.md

Manual Checklist

  • Document Control section at top
  • Test Scope defines component and categories
  • Test Case Index lists all tests with priority
  • Each test case has TSPEC.NN.xxxx ID
  • Element type code matches document type (40/41/42/43)
  • I/O tables present for all test cases
  • Pseudocode provided for complex logic
  • Error cases documented
  • Coverage Matrix complete
  • TASKS-Ready Score meets type-specific target
  • Cumulative tags: @brd through @spec (8-9 tags)
  • Traceability matrix updated

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. Wrong element type code: Use 40 for UTEST, 41 for ITEST, 42 for STEST, 43 for FTEST
  2. Missing I/O tables: Every test case needs input/output specification
  3. No coverage matrix: Must track REQ element coverage
  4. Wrong tag format: Use TSPEC.NN.xxxx for elements, TYPE-NN for documents
  5. Missing cumulative tags: Layer 10 requires all 8-9 upstream tags
  6. Legacy test IDs: Use TSPEC.NN.xxxx, NOT TC-XXX, UT-XXX, etc.
  7. No pseudocode: Complex tests require algorithm specification
  8. Incomplete error cases: Document expected behavior for all error conditions

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/10_TSPEC/UTEST/UTEST-NN_slug.md --auto-fix

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

Layer-Specific Upstream Requirements

This LayerRequired Upstream TagsCount
TSPEC (Layer 10)@brd, @prd, @ears, @bdd, @adr, @sys, @req, @spec (+ @ctr if created)8-9 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

TSPEC v2.0 Validation Infrastructure (2026-03-06)

Overview

TSPEC validation infrastructure provides automated quality gates, pre-commit hooks, and type-specific validators for all 6 test types (UTEST, ITEST, STEST, FTEST, PTEST, SECTEST).

Features:

  • Pre-commit hooks for automatic validation
  • Standardized error codes (38 TSPEC-specific codes)
  • Schema validation with flexible path resolution
  • JSON output for automation
  • Enhanced batch validator with CLI options
  • Type-specific quality gates and thresholds

Type-Specific Validators

Test TypeValidatorThresholdDescription
UTESTvalidate_utest.py≥90%Unit test coverage of REQ elements
ITESTvalidate_itest.py≥90%Contract coverage and sequence diagrams
STESTvalidate_stest.py100%Critical path smoke tests (strict)
FTESTvalidate_ftest.py≥90%SYS requirement coverage
PTESTvalidate_ptest.py≥85%Performance scenario coverage
SECTESTvalidate_sectest.py≥90%Security threat and control coverage

Pre-Commit Hooks

Automatic validation on every commit:

# .pre-commit-config.yaml (auto-configured)

- id: tspec-core-validator
  name: Validate TSPEC core checks
  entry: bash ai_dev_ssd_flow/10_TSPEC/scripts/tspec_core_validator_hook.sh

- id: tspec-quality-gate
  name: Validate TSPEC quality gates
  entry: bash ai_dev_ssd_flow/10_TSPEC/scripts/tspec_quality_gate_hook.sh

- id: tspec-tasks-ready
  name: Validate TSPEC TASKS-Ready scores
  entry: bash ai_dev_ssd_flow/10_TSPEC/scripts/tspec_tasks_ready_hook.sh

Exit codes:

  • 0 = PASS (all checks passed)
  • 1 = WARN (warnings only, commit allowed)
  • 2 = FAIL (errors present, commit blocked)

Error Code Format

Pattern: [CODE] Message (context)

Examples:

[UTEST-E002] Missing I/O table (TC-001)
[TSPEC-E007] Missing Traceability section (missing @spec reference)
[ITEST-E001] CTR coverage 75.0% < 90%

Error Code Categories:

PrefixCategoryCountExamples
TSPEC-EGeneric errors10Missing sections, invalid format
UTEST-E/WUnit test issues7Low REQ coverage, missing pseudocode
ITEST-E/WIntegration issues4Missing sequence diagrams, weak coverage
STEST-ESmoke test issues4Timeout exceeded, missing rollback
FTEST-E/WFunctional issues3Low SYS coverage, missing thresholds
PTEST-E/WPerformance issues4Missing load scenarios, invalid metrics
SECTEST-E/WSecurity issues4Missing threat scenarios, weak controls

Batch Validation

Enhanced validator with 6 CLI options:

# Basic validation
bash ai_dev_ssd_flow/10_TSPEC/scripts/validate_all_tspec_enhanced.sh docs/10_TSPEC

# Verbose output with quality gates
bash ai_dev_ssd_flow/10_TSPEC/scripts/validate_all_tspec_enhanced.sh --verbose docs/10_TSPEC

# JSON output for automation
bash ai_dev_ssd_flow/10_TSPEC/scripts/validate_all_tspec_enhanced.sh --json docs/10_TSPEC

# Force color output
bash ai_dev_ssd_flow/10_TSPEC/scripts/validate_all_tspec_enhanced.sh --color docs/10_TSPEC

Options:

  • --verbose: Show detailed quality gate breakdown
  • --quality-gates: Show quality scores per gate
  • --json: Machine-readable JSON output
  • --color: Force color output
  • --no-color: Disable color output
  • --help: Show usage information

Individual Type Validation

Validate specific test type:

# Unit tests
python3 ai_dev_ssd_flow/10_TSPEC/scripts/validate_utest.py docs/10_TSPEC/UTEST/*.md

# Integration tests
python3 ai_dev_ssd_flow/10_TSPEC/scripts/validate_itest.py docs/10_TSPEC/ITEST/*.md -v

# With quality gates
python3 ai_dev_ssd_flow/10_TSPEC/scripts/validate_ftest.py --quality-gates docs/10_TSPEC/FTEST/*.md

Schema Validation

Flexible path resolution (4+ strategies):

  1. Sibling to TSPEC file: UTEST/UTEST_MVP_SCHEMA.yaml
  2. Parent directory: 10_TSPEC/UTEST/UTEST_MVP_SCHEMA.yaml
  3. Search upward to TSPEC or 10_TSPEC directory
  4. Graceful degradation if schema not found

YAML frontmatter validation:

  • Required fields: id, title, version, cumulative_tags, test_type
  • Type-specific fields validated per test type
  • Schema errors block document creation

Quality Score Calculation

Combined score across all 6 test types:

# Calculate quality score
bash ai_dev_ssd_flow/10_TSPEC/scripts/validate_tspec_quality_score.sh docs/10_TSPEC

Output:

UTEST:   92.5%
ITEST:   88.0%
STEST:   100.0%
FTEST:   91.2%
PTEST:   86.0%
SECTEST: 90.5%

Combined: 91.4%
Status: [PASS] Quality score ≥85%

Test Fixtures

42 test fixtures for regression testing:

# Create test fixtures (if needed)
bash ai_dev_ssd_flow/10_TSPEC/scripts/create_test_fixtures.sh

Categories:

  • Valid documents (6 types × 3 variants = 18 fixtures)
  • Missing sections (6 types = 6 fixtures)
  • Invalid traceability (6 types = 6 fixtures)
  • Schema violations (6 types = 6 fixtures)
  • Edge cases (6 additional fixtures)

File Exclusion Patterns

Auto-excluded from validation:

PatternPurposeExample
*-00_*Reserved IDsUTEST-00_template.md
*TEMPLATE*Template filesUTEST-MVP-TEMPLATE.md
*FIX_PLAN*Fix plansUTEST-01_FIX_PLAN.md
*.A_audit_report*Audit reportsUTEST-01.A_audit_report.md
*.R_review_report*Review reportsUTEST-01.R_review_report.md
*.F_fix_report*Fix reportsUTEST-01.F_fix_report.md
*.V_validation_report*Validation reportsUTEST-01.V_validation_report.md

Integration with /doc-tspec-audit

Unified audit workflow (recommended):

# Run complete audit (validator + reviewer)
/doc-tspec-audit

# Produces: TSPEC-NN.A_audit_report.md with:
# - Schema validation results
# - Quality gate scores
# - Error code details
# - Recommended fixes

Quality Gate

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


Next Skill

After creating TSPEC, use:

doc-tasks - Create Task Breakdown (Layer 11)

The TASKS will:

  • Reference this TSPEC for test implementation
  • Include all 9-10 upstream tags
  • Break SPEC and TSPEC into actionable tasks
  • Provide AI-structured TODO format

Reference Documents

TSPEC 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: Test strategy guides, coverage analysis reports

Related Resources

  • Templates:

- ai_dev_ssd_flow/10_TSPEC/UTEST/UTEST-MVP-TEMPLATE.md - ai_dev_ssd_flow/10_TSPEC/ITEST/ITEST-MVP-TEMPLATE.md - ai_dev_ssd_flow/10_TSPEC/STEST/STEST-MVP-TEMPLATE.md - ai_dev_ssd_flow/10_TSPEC/FTEST/FTEST-MVP-TEMPLATE.md

  • TSPEC README: ai_dev_ssd_flow/10_TSPEC/README.md
  • TSPEC Index: ai_dev_ssd_flow/10_TSPEC/TSPEC-00_index.md
  • Traceability Matrix Template: ai_dev_ssd_flow/10_TSPEC/TSPEC-00_TRACEABILITY_MATRIX-TEMPLATE.md
  • Shared Standards: .claude/skills/doc-flow/SHARED_CONTENT.md
  • doc-naming skill: .claude/skills/doc-naming/SKILL.md (element type codes)
  • doc-spec skill: .claude/skills/doc-spec/SKILL.md (upstream SPEC creation)
  • quality-advisor skill: .claude/skills/quality-advisor/SKILL.md (quality guidance)

Quick Reference

TSPEC Purpose: Test specifications for TDD workflow

Layer: 10

Element ID Format: TSPEC.NN.xxxx

  • Unit Test = 40
  • Integration Test = 41
  • Smoke Test = 42
  • Functional Test = 43

Removed Patterns: TC-XXX, UT-XXX, IT-XXX, ST-XXX, FT-XXX

Tags Required: @brd through @spec (8-9 tags)

Format: Markdown with I/O tables and pseudocode

TSPEC Types:

  • UTEST: Unit tests (>=90% coverage, REQ-focused)
  • ITEST: Integration tests (>=85% coverage, CTR-focused)
  • STEST: Smoke tests (100% critical paths, <5min execution)
  • FTEST: Functional tests (>=85% SYS coverage)

Key Sections:

  • Document Control
  • Test Scope (component, categories, dependencies)
  • Test Case Index
  • Test Case Details (I/O tables, pseudocode, error cases)
  • Coverage Matrix
  • Traceability (cumulative tags)

Quality Gate: Type-specific TASKS-Ready Score

Next: doc-tasks

Version History

VersionDateChanges
2.02026-03-06MAJOR: Added v2.0 validation infrastructure with pre-commit hooks (3 hooks), error codes (38 TSPEC-specific codes), schema validation, enhanced batch validator (6 CLI options), error code integration in all 6 validators (UTEST/ITEST/STEST/FTEST/PTEST/SECTEST), 42 test fixtures, JSON output, quality score calculation, and comprehensive validation documentation
1.22026-02-27Normalized frontmatter to metadata schema with versioning_policy; aligned cross-document/tag validation command examples to canonical ai_dev_ssd_flow/scripts/* locations
1.12026-02-26Added PTEST (code 44) and SECTEST (code 45) support; Fixed template paths to ai_dev_ssd_flow/10_TSPEC/
1.02026-02-08Initial release with UTEST/ITEST/STEST/FTEST support (codes 40-43)

平台分布

Codex

39.34%
按下载量换算79

Claude

30.45%
按下载量换算62

Cursor

17.18%
按下载量换算35

Gemini CLI

9.5%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills