Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

doc-tspec文档说明

Agent Skill

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

总安装

643

周安装

26

GitHub Stars

14

下载量

202
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 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

简介

创建测试规格说明书,支撑测试驱动开发流程。

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

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)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

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