Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

doc-req-autopilot文档要求自动驾驶仪

Agent Skill

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

总安装

612

周安装

26

GitHub Stars

14

下载量

214
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

从 SYS 文档自动生成原子化 REQ 文件集。

  • 按能力拆分输出多个独立 REQ 文件。
  • 提供 SPEC-Ready 与 IMPL-Ready 双维度评分。
  • 强化累积追踪标签与跨层关联机制。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • doc-req-autopilot 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

doc-req-autopilot

Purpose

Automated Atomic Requirements (REQ) generation pipeline that processes SYS documents and decomposes them into multiple atomic REQ files (one per capability), using REQ MVP format with 11 sections, dual readiness scoring (SPEC-Ready + IMPL-Ready), and cumulative traceability.

Layer: 7 (REQ Generation)

Upstream: BRD (Layer 1), PRD (Layer 2), EARS (Layer 3), BDD (Layer 4), ADR (Layer 5), SYS (Layer 6)

Downstream Artifacts: CTR (Layer 9), SPEC (Layer 10)

Key Enhancement (v2.0): Based on Trading Nexus REQ layer analysis, this skill now generates atomic file decomposition (10-15 files per module) instead of monolithic REQ documents. See Phase 1.5: Atomic Decomposition.


Input Contract (IPLAN-004 Standard)

  • Supported modes:

- --ref <path> - --prompt "<text>" - --iplan <path|IPLAN-NNN>

  • Precedence: --iplan > --ref > --prompt
  • IPLAN resolution order:

1. Use explicit file path when it exists 2. Resolve work_plans/IPLAN-NNN*.md 3. Resolve governance/plans/IPLAN-NNN*.md 4. If multiple matches exist, fail with disambiguation request

  • Merge conflict rule:

- Objective/scope conflicts between primary and supplemental sources are blocking and require user clarification.


Input Contract (IPLAN-004 Standard)

  • Supported modes:

- --ref <path> - --prompt "<text>" - --iplan <path|IPLAN-NNN>

  • Precedence: --iplan > --ref > --prompt
  • IPLAN resolution order:

1. Use explicit file path when it exists 2. Resolve work_plans/IPLAN-NNN*.md 3. Resolve governance/plans/IPLAN-NNN*.md 4. If multiple matches exist, fail with disambiguation request

  • Merge conflict rule:

- Objective/scope conflicts between primary and supplemental sources are blocking and require user clarification.


Skill Dependencies

This autopilot orchestrates the following skills:

SkillPurposePhase
doc-namingElement ID format (REQ.NN.xxxx), type codes 01/05/06/27All Phases
doc-sys-validatorValidate SYS SPEC-Ready scorePhase 2: SYS Readiness
doc-reqREQ creation rules, REQ MVP 11-section structure, templatePhase 3: REQ Generation
quality-advisorReal-time quality feedback during REQ generationPhase 3: REQ Generation
doc-req-validatorValidate REQ structure, content, SPEC-Ready scorePhase 4: REQ Validation
doc-req-reviewerContent review, link validation, quality scoringPhase 5: Review
doc-req-fixerApply fixes from review report, create missing filesPhase 5: Fix

Delegation Principle: The autopilot orchestrates workflow but delegates:

  • REQ structure/content rules -> doc-req skill
  • Real-time quality feedback -> quality-advisor skill
  • REQ validation logic -> doc-req-validator skill
  • Content review and scoring -> doc-req-reviewer skill
  • Issue resolution and fixes -> doc-req-fixer skill
  • SYS validation logic -> doc-sys-validator skill
  • Element ID standards -> doc-naming skill

Document Type Contract (MANDATORY)

When generating REQ document instances, the autopilot MUST:

  1. Read instance_document_type from template:

- Source: ai_dev_ssd_flow/07_REQ/REQ-MVP-TEMPLATE.yaml - Field: metadata.instance_document_type: "req-document"

  1. Set document_type in generated document frontmatter: custom_fields: document_type: req-document # NOT "template" artifact_type: REQ layer: 7
  2. Validation: Generated documents MUST have document_type: req-document

- Templates have document_type: template - Instances have document_type: req-document - Schema validates both values

Error Handling: If instance_document_type is missing from template, default to req-document.


Smart Document Detection

The autopilot automatically determines the action based on the input document type.

Input Type Recognition

InputDetected AsAction
REQ-NNSelf typeReview existing REQ document
SYS-NNUpstream typeGenerate if missing, review if exists

Detection Algorithm

1. Parse input: Extract TYPE and NN from "{TYPE}-{NN}"
2. Determine action:
   - IF TYPE == "REQ": Review Mode
   - ELSE IF TYPE == "SYS": Generate/Find Mode
   - ELSE: Error (invalid type for this autopilot)
3. For Generate/Find Mode:
   - Check: Does REQ-{NN} exist in docs/07_REQ/?
   - IF exists: Switch to Review Mode for REQ-{NN}
   - ELSE: Proceed with Generation from SYS-{NN}

File Existence Check

# Check for nested folder structure (mandatory)
ls docs/07_REQ/REQ-{NN}_*/

Examples

# Review mode (same type - REQ input)
/doc-req-autopilot REQ-01           # Reviews existing REQ-01

# Generate/Find mode (upstream type - SYS input)
/doc-req-autopilot SYS-01           # Generates REQ-01 if missing, or reviews existing REQ-01

# Multiple inputs
/doc-req-autopilot SYS-01,SYS-02    # Generates/reviews REQ-01 and REQ-02
/doc-req-autopilot REQ-01,REQ-02    # Reviews REQ-01 and REQ-02

Action Determination Output

Input: SYS-01
├── Detected Type: SYS (upstream)
├── Expected REQ: REQ-01
├── REQ Exists: Yes → docs/07_REQ/REQ-01_f1_iam/
└── Action: REVIEW MODE - Running doc-req-reviewer on REQ-01

Input: SYS-05
├── Detected Type: SYS (upstream)
├── Expected REQ: REQ-05
├── REQ Exists: No
└── Action: GENERATE MODE - Creating REQ-05 from SYS-05

Input: REQ-03
├── Detected Type: REQ (self)
└── Action: REVIEW MODE - Running doc-req-reviewer on REQ-03

When to Use This Skill

Use doc-req-autopilot when:

  • You have one or more completed SYS documents ready for REQ generation
  • You want automated decomposition of system requirements into atomic units
  • You need REQ-Ready score validation before generation
  • You want automatic SPEC-Ready score validation after REQ creation
  • You need to generate REQ MVP documents with 11 sections

Do NOT use when:

  • Creating a single REQ with extensive manual customization (use doc-req directly)
  • SYS documents are incomplete or in Draft status
  • You need fine-grained control over each REQ section
  • SYS REQ-Ready score is below 90%

Workflow Overview

flowchart TD
    subgraph Phase1["Phase 1: SYS Analysis"]
        A[Input: SYS List] --> B[Read SYS Documents]
        B --> C[Extract Functional Requirements]
        C --> D[Identify Quality Attributes]
        D --> E[Catalog Interface Specifications]
        E --> F[Extract Threshold References]
    end

    subgraph Phase2["Phase 2: REQ Readiness Check"]
        F --> G{Next SYS}
        G --> H[Check REQ-Ready Score]
        H --> I{Score >= 90?}
        I -->|No| J[Auto-Fix SYS Issues]
        J --> K[Re-validate SYS]
        K --> I
        I -->|Yes| L[Mark SYS Ready]
    end

    subgraph Phase3["Phase 3: REQ Generation"]
        L --> M[Decompose into Atomic Requirements]
        M --> N[Generate 11 Required Sections]
        N --> O[Add Interface Specifications]
        O --> P[Add Data Schemas]
        P --> Q[Add Error Handling Specifications]
        Q --> R[quality-advisor: Real-time Feedback]
        R --> S[Add Cumulative Tags - 6 Required]
        S --> T[Write REQ Files]
    end

    subgraph Phase4["Phase 4: REQ Validation"]
        T --> U[Run doc-req-validator]
        U --> V{SPEC-Ready >= 90?}
        V -->|No| W[Auto-Fix REQ Issues]
        W --> X[Re-validate REQ]
        X --> V
        V -->|Yes| Y{IMPL-Ready >= 90?}
        Y -->|No| W
        Y -->|Yes| Z[Validation Passed]
    end

    subgraph Phase5["Phase 5: Review & Fix Cycle"]
        Z --> ZA[Run doc-req-reviewer]
        ZA --> ZB{Score >= 90?}
        ZB -->|No| ZC[Run doc-req-fixer]
        ZC --> ZD{Iteration < Max?}
        ZD -->|Yes| ZA
        ZD -->|No| ZE[Flag Manual Review]
        ZB -->|Yes| ZF[Verify Quality Checks]
        ZE --> ZF
        ZF --> AA[Check 12-Section Completeness]
        AA --> AB[Verify Cumulative Tags - 6 Required]
        AB --> AC[Validate Threshold References]
        AC --> AD[Check Atomic Requirement Principles]
        AD --> AE[Mark REQ Complete]
    end

    AE --> AF{More SYS?}
    AF -->|Yes| G
    AF -->|No| AG[Generate Summary Report]
    AG --> AH[Complete]

Detailed Workflow

Phase 1: SYS Analysis

Analyze SYS documents to extract requirements for REQ decomposition.

Input Sources (from SYS):

SYS SectionREQ ContentMapping
Section 4: Functional RequirementsCore capabilitiesSection 2: Functional Requirements
Section 5: Quality AttributesPerformance/SecuritySection 7: Quality Attributes
Section 6: Interface SpecificationsAPIs, protocolsSection 3: Interface Specifications
Section 7: Data ManagementSchemas, modelsSection 4: Data Schemas
Section 8: Testing RequirementsVerificationSection 10: Verification Methods
Section 11: Acceptance CriteriaTest conditionsSection 9: Acceptance Criteria
Section 13: TraceabilityUpstream refsSection 11: Traceability

Analysis Process:

# Check for SYS documents
ls -la docs/06_SYS/

# Expected structure:
# - SYS-NN_{slug}.md (monolithic)
# - SYS-NN_{slug}/ (sectioned with SYS-NN.S_{section}.md files)

Output: Requirement decomposition plan with atomic units, threshold references, and traceability links.

Phase 1.5: Atomic Decomposition (NEW in v2.0)

Decompose SYS functional requirements into separate atomic REQ files.

Reference: Based on Trading Nexus project patterns (/opt/data/trading_nexus_v4.2/Nexus_Platform_v4.2/docs/07_REQ/REQ-01_f1_iam/)

Decomposition Strategy:

  1. One REQ File Per Capability: Each SYS.NN.MM.SS functional requirement maps to one REQ-NN.MM file
  2. Self-Contained Files: Each file is complete with all 11 sections
  3. Cross-Linked: Files reference siblings via @discoverability tags

Output Structure Example (for F1 IAM module):

docs/07_REQ/REQ-01_f1_iam/
├── REQ-01.00_index.md                    # Index with capability matrix
├── REQ-01.01_jwt_authentication.md       # SYS.01.0101
├── REQ-01.02_token_refresh_mechanism.md  # SYS.01.0102
├── REQ-01.03_token_revocation.md         # SYS.01.0103
├── REQ-01.04_session_binding.md          # SYS.01.0104
├── REQ-01.05_rbac_enforcement.md         # SYS.01.0201
├── REQ-01.06_4d_authorization_matrix.md  # SYS.01.0202
├── REQ-01.07_permission_inheritance.md   # SYS.01.0203
├── REQ-01.08_context_aware_access.md     # SYS.01.0204
├── REQ-01.09_mfa_integration.md          # SYS.01.0301
├── REQ-01.10_api_key_management.md       # SYS.01.0302
├── REQ-01.11_audit_logging.md            # SYS.01.0401
└── REQ-01.12_compliance_reporting.md     # SYS.01.0402

Decomposition Rules:

RuleDescription
File NamingREQ-{module}.{sequence}_{capability_slug}.md
Minimum Files≥3 atomic files per SYS module (configurable)
Maximum Size30KB per file (triggers additional split)
Index RequiredREQ-NN.00_index.md for navigation
Cross-LinksEach file references related capabilities

Index File Template (REQ-NN.00_index.md):

# REQ-01: F1 Identity & Access Management - Atomic Requirements Index

## Capability Matrix

| REQ ID | Capability | SYS Source | Priority | SPEC-Ready |
|--------|------------|------------|----------|------------|
| REQ-01.01 | JWT Authentication | SYS.01.0101 | P1 | 94% |
| REQ-01.02 | Token Refresh | SYS.01.0102 | P1 | 92% |
| REQ-01.03 | Token Revocation | SYS.01.0103 | P1 | 91% |
| ... | ... | ... | ... | ... |

## Cross-Reference Matrix

| REQ | Depends On | Discovered By |
|-----|------------|---------------|
| REQ-01.01 | - | REQ-01.02, REQ-01.11 |
| REQ-01.02 | REQ-01.01 | REQ-01.03 |
| REQ-01.06 | REQ-01.05, REQ-01.07, REQ-01.08 | REQ-01.11, REQ-01.12 |

When NOT to Decompose (use monolithic):

  • SYS module has ≤2 functional requirements
  • Total estimated REQ content < 20KB
  • --monolithic flag explicitly set

Phase 2: REQ Readiness Check

Validate that source SYS documents meet REQ-Ready requirements before generation.

Skill Delegation: This phase uses validation rules from doc-sys-validator skill. See: .claude/skills/doc-sys-validator/SKILL.md for complete SYS validation rules.

REQ-Ready Scoring Criteria (100%):

CategoryWeightCriteria
Functional Completeness35%All FR-NNN requirements documented with priority
Quality Attributes25%Performance, reliability, security categories present
Interface Specifications20%API contracts, protocols defined
Data Management10%Data schemas, storage requirements documented
Traceability10%5 upstream tags present (@brd, @prd, @ears, @bdd, @adr)

Minimum Score: 90% (configurable)

Auto-Fix Actions:

IssueAuto-Fix Action
Missing Performance categoryAdd p50/p95/p99 template table
Missing Security categoryAdd authentication/authorization template
Incomplete Interface SpecificationsAdd protocol template structure
Missing upstream tagsAdd with placeholder references
Missing quality attribute metricsAdd MTBF/MTTR template

Validation Command (internal):

python ai_dev_ssd_flow/06_SYS/scripts/validate_sys.py \
  --sys docs/06_SYS/SYS-NN_{slug}.md \
  --min-score 90 \
  --auto-fix

Phase 3: REQ Generation

Generate REQ documents from validated SYS with real-time quality feedback.

Skill Delegation: This phase follows rules defined in doc-req skill. See: .claude/skills/doc-req/SKILL.md for complete REQ creation guidance. Quality Guidance: Uses quality-advisor skill for real-time feedback during generation. See: .claude/skills/quality-advisor/SKILL.md for quality monitoring.

Generation Process:

  1. Reserve REQ ID: # Check for next available ID ls docs/07_REQ/REQ-*.md docs/07_REQ/*/REQ-*.md 2>/dev/null | \ grep -oP 'REQ-\K\d+' | sort -n | tail -1 # Increment for new REQ
  2. Load REQ Template:
  • Primary: ai_dev_ssd_flow/07_REQ/REQ-MVP-TEMPLATE.md
  • Section templates: For sectioned REQ (>50KB)
  1. Generate Document Control Section: Field Value REQ ID REQ-NN Status Draft (initial) Version 0.1.0 Date Created Current date (YYYY-MM-DD) Last Updated Current date (YYYY-MM-DD) Author System Architect Priority From SYS priority (P1-P4) Category Functional Source Document SYS-NN section X.Y.Z Verification Method BDD + Integration Test Assigned Team From SYS context SPEC-Ready Score Calculated after generation IMPL-Ready Score Calculated after generation Template Version 3.0
  2. Decompose into Atomic Requirements: Atomic Requirement Principles:

- Single Responsibility: Each REQ defines exactly one requirement - Measurable: Acceptance criteria provide true/false outcomes - Self-Contained: Understandable without external context - SPEC-Ready: Contains ALL information for automated SPEC generation - Modal Language: SHALL (mandatory), SHOULD (preferred), MAY (optional)

  1. Generate All 11 Required Sections: Section 1: Description Section 2: Functional Requirements Section 3: Interface Specifications Section 4: Data Schemas Section 5: Error Handling Specifications Section 6: Configuration Specifications Section 7: Quality Attributes Section 8: Implementation Guidance Section 9: Acceptance Criteria Section 8: Testing Requirements (ENHANCED in v2.0) Unit Test Category Format (NEW in v2.0): Category Prefix Description Min Count Logic [Logic] Core business logic tests 3 Validation [Validation] Input validation tests 2 State [State] State machine/transition tests 1 Edge [Edge] Edge case and boundary tests 2 Security [Security] Security-specific tests 1 Example Unit Test Table: | Test Case | Input | Expected Output | Coverage | |--------------------------------|------------------------|----------------------|--------------| | **[Logic] Valid login** | Valid email/password | 200 with tokens | REQ.01.0101 | | **[Validation] Invalid email** | "not-an-email" | 400 INVALID_EMAIL | REQ.01.2101 | | **[State] Locked account** | Locked user | 403 ACCOUNT_LOCKED | REQ.01.2701 | | **[Edge] Rate limit boundary** | 5th attempt | 200 OK (not blocked) | REQ.01.0607 | | **[Security] Missing token** | No Authorization header| 401 Unauthorized | REQ.01.0202 | Section 9: Acceptance Criteria (ENHANCED in v2.0) Section 10: Traceability (ENHANCED in v2.0) Section 10.5 Cross-Links Format (NEW in v2.0): ### 10.5 Cross-Links @depends: REQ-NN.XX (direct dependency description) @discoverability: REQ-NN.YY (interaction context); REQ-NN.ZZ (shared resource) Example from Trading Nexus REQ-01.06: @discoverability: REQ-01.05 (role policies feed the matrix); REQ-01.07 (inheritance inputs drive matrix entries); REQ-01.08 (context dimensions align with matrix factors); REQ-01.11 (authz decisions must be audit-covered); REQ-01.12 (matrix outputs support compliance evidence) Section 11: Implementation Notes (ENHANCED in v2.0) Section 11.2 Code Implementation Paths Format (NEW): ` ### 11.2 Code Implementation Paths - **Primary**: src/foundation/f1_iam/auth/jwt_auth.py - **Tests**: tests/foundation/f1_iam/test_jwt_auth.py - **Integration**: tests/integration/test_auth_endpoints.py ` Section 12: Change History

- Atomic requirement statement with SHALL/SHOULD/MAY language - Context and scenario - Business justification - Core capabilities using REQ.NN.01.SS format - Business rules - Input/output specifications - Protocol/ABC definitions with type hints - DTO definitions (dataclass or Pydantic) - REST endpoints (if applicable) - JSON Schema (draft-07) - Pydantic BaseModel with validators - Database schema (if applicable) - Exception catalog with codes - Error response schema - Circuit breaker configuration - State machine for error recovery - YAML schema for settings - Environment variables - Validation rules - Performance targets (p50/p95/p99) - Reliability metrics (MTBF/MTTR) - Security requirements - Scalability targets - All with @threshold references - Recommended algorithms/patterns - Concurrency/async considerations - Dependency injection patterns - Minimum 15 measurable criteria using REQ.NN.06.SS format - Categories: Primary Functional (5), Error/Edge Case (5), Quality/Constraint (3), Data Validation (2), Integration (3) - Unit tests with category prefixes (see below) - Integration test checklist - BDD scenario references - Minimum 15 measurable criteria (split into subsections) - 9.1 Functional Acceptance (≥10 criteria) - 9.2 Quality Acceptance (≥5 criteria) - Status checkbox for tracking - 10.1 Upstream Sources table - 10.2 Downstream Artifacts table - 10.3 Traceability Tags (6 required) - 10.4 Traceability Matrix - 10.5 Cross-Links (NEW) - See below - 11.1 Technical Approach (specific patterns and libraries) - 11.2 Code Implementation Paths (NEW - mandatory) - 11.3 Dependencies table (NEW - mandatory) - Version control table - Change descriptions

  1. Real-Time Quality Feedback (via quality-advisor skill):

- Monitor section completion as content is generated - Detect anti-patterns (incomplete Protocol/ABC, missing schemas) - Validate cumulative tagging (6 required tags for Layer 7) - Check element ID format compliance (REQ.NN.xxxx) - Validate acceptance criteria count (>=15) - Flag issues early to reduce post-generation rework

  1. Add Element IDs by Type: Element Type Code Example Functional Requirement 01 REQ.02.0101 Dependency 05 REQ.02.0501 Acceptance Criteria 06 REQ.02.0601 Atomic Requirement 27 REQ.02.2701
  2. Add Cumulative Traceability Tags (6 Required): ## 11. Traceability **Required Tags** (Cumulative Tagging Hierarchy - Layer 7): @brd: BRD.01.0103 @prd: PRD.01.0702 @ears: EARS.01.2501 @bdd: BDD.01.1401 @adr: ADR-033, ADR-045 @sys: SYS.01.0101, SYS.01.0207
  3. Add Threshold References: ### Thresholds Referenced | Threshold ID | Category | Value | Source | |--------------|----------|-------|--------| | @threshold: PRD.01.perf.api.p95 | Performance | 100ms | PRD Section 14 | | @threshold: PRD.01.timeout.circuit_breaker | Timeout | 30s | PRD Section 20.1 | | @threshold: PRD.01.retry.max_attempts | Retry | 3 | PRD Section 20.4 |
  4. File Output (ALWAYS use nested folder): Nested Folder Rule: ALL REQ use nested folders (REQ-NN_{slug}/) regardless of size. This keeps companion files (review reports, fix reports, drift cache) organized with their parent document.

- Monolithic (<20k tokens): docs/07_REQ/REQ-NN_{slug}/REQ-NN_{slug}.md - Domain-based: docs/07_REQ/{domain}/REQ-NN_{slug}/REQ-NN_{slug}.md - Subdomain: docs/07_REQ/{domain}/{subdomain}/REQ-NN_{slug}/REQ-NN_{slug}.md - Sectioned (≥20k tokens): docs/07_REQ/REQ-NN_{slug}/REQ-NN.0_index.md, REQ-NN.1_core.md, etc. - Master Index (always): docs/07_REQ/REQ-00_index.md (create or update)

Phase 4: REQ Validation

After REQ generation, validate structure and dual readiness scores.

Skill Delegation: This phase uses validation rules from doc-req-validator skill. See: .claude/skills/doc-req-validator/SKILL.md for complete validation rules.

Validation Command:

./ai_dev_ssd_flow/07_REQ/scripts/validate_req_template.sh docs/07_REQ/REQ-NN_{slug}/REQ-NN_{slug}.md
python3 ai_dev_ssd_flow/07_REQ/scripts/validate_req_spec_readiness.py docs/07_REQ/REQ-NN_{slug}/REQ-NN_{slug}.md --verbose

Validation Checks:

CheckRequirementError Code
YAML FrontmatterValid metadata fieldsREQ-E001 to REQ-E005
Section StructureAll 11 sections presentREQ-E006
Document ControlAll 14 required fieldsREQ-E009
Interface SpecificationsProtocol/ABC definitionREQ-E010, REQ-E015
Data SchemasJSON Schema or PydanticREQ-E011, REQ-E016
Error HandlingException catalogREQ-E012, REQ-E017
Acceptance Criteria>=15 criteriaREQ-E013, REQ-W002
Element ID FormatREQ.NN.xxxx (3-segment)REQ-E020
Cumulative Tags6 tags presentREQ-W003
SPEC-Ready Score>= 90%REQ-W001
IMPL-Ready Score>= 90%REQ-W001

NEW Validation Checks (v2.0):

CheckRequirementError Code
Unit Test CategoriesAll 5 categories presentREQ-E025
Cross-Links SectionSection 10.5 existsREQ-E026
Error Catalog Depth≥5 error codes documentedREQ-E027
Recovery StrategyRecovery table presentREQ-E028
Code PathsSection 11.2 presentREQ-E029
Acceptance Criteria Count≥15 total criteriaREQ-E030
AC Split9.1 Functional + 9.2 QualityREQ-E031
Atomic Decomposition≥3 files if strategy=atomicREQ-E032
Dependencies TableSection 11.3 presentREQ-E033
Index FileREQ-NN.00_index.md existsREQ-E034

Auto-Fix Actions:

IssueAuto-Fix Action
Missing sectionInsert from template
Missing Protocol/ABCAdd interface template
Missing JSON SchemaAdd schema template
Missing Exception CatalogAdd error handling template
Acceptance criteria < 15Add placeholder criteria
Invalid element ID formatConvert to REQ.NN.xxxx format
Missing cumulative tagsAdd with placeholder references
Missing SPEC-Ready ScoreCalculate and insert

Validation Loop:

LOOP (max 3 iterations):
  1. Run doc-req-validator
  2. IF errors found: Apply auto-fixes
  3. IF warnings found: Review and address if critical
  4. IF SPEC-Ready Score < 90%: Enhance sections
  5. IF IMPL-Ready Score < 90%: Add implementation guidance
  6. IF clean: Mark VALIDATED, proceed
  7. IF max iterations: Log issues, flag for manual review

Phase 5: Review & Fix Cycle (v2.1)

Iterative review and fix cycle to ensure REQ quality before completion.

flowchart TD
    A[Phase 5 Start] --> B[Run doc-req-reviewer]
    B --> C[Generate Review Report]
    C --> D{Review Score >= 90?}

    D -->|Yes| E[PASS - Proceed to Final Checks]
    D -->|No| F{Iteration < Max?}

    F -->|Yes| G[Run doc-req-fixer]
    G --> H[Apply Fixes]
    H --> I[Generate Fix Report]
    I --> J[Increment Iteration]
    J --> B

    F -->|No| K[Flag for Manual Review]
    K --> L[Generate Final Report with Remaining Issues]
    L --> E

5.1 Initial Review

Run doc-req-reviewer to identify issues.

/doc-req-reviewer REQ-NN

Output: REQ-NN.R_review_report_v001.md

5.2 Fix Cycle

If review score < 90%, invoke doc-req-fixer.

/doc-req-fixer REQ-NN --revalidate

Fix Categories:

CategoryFixes Applied
Missing FilesCreate index, reference docs
Broken LinksUpdate paths, create targets
Element IDsConvert legacy patterns (AC-XXX, FR-XXX, R-XXX), fix invalid type codes
ContentReplace template placeholders, update dates
ReferencesUpdate traceability tags, @threshold references
Cross-LinksAdd missing @discoverability tags
CriteriaAdd missing test category prefixes, add placeholder criteria

Output: REQ-NN.F_fix_report_v001.md

5.3 Re-Review

After fixes, automatically re-run reviewer.

/doc-req-reviewer REQ-NN

Output: REQ-NN.R_review_report_v002.md

5.4 Iteration Control

ParameterDefaultDescription
max_iterations3Maximum fix-review cycles
target_score90Minimum passing score
stop_on_manualfalseStop if only manual issues remain

Iteration Example:

Iteration 1:
  Review v001: Score 84 (4 errors, 6 warnings)
  Fix v001: Fixed 8 issues, updated 3 files

Iteration 2:
  Review v002: Score 92 (0 errors, 4 warnings)
  Status: PASS (score >= 90)

5.5 Quality Checks (Post-Fix)

After passing the fix cycle:

  1. 12-Section Completeness:
  • All 11 sections present and substantive
  • No placeholder or stub content
  • Template Version = 3.0
  1. Cumulative Tag Validation (6 Tags Required):

- @brd tag references valid BRD elements - @prd tag references valid PRD elements - @ears tag references valid EARS elements - @bdd tag references valid BDD elements - @adr tag references valid ADR documents - @sys tag references valid SYS elements

  1. Threshold Reference Validation:

- All @threshold tags reference valid PRD thresholds - No magic numbers in quality attributes - Threshold values match source

  1. Atomic Requirement Principles:

- Each REQ defines single responsibility - Acceptance criteria are measurable - Self-contained without external context - Uses modal language (SHALL/SHOULD/MAY)

  1. Dual Readiness Score Report: REQ Readiness Score Breakdown ============================= SPEC-Ready Score: Interface Completeness: 20/20 Data Schema: 15/15 Error Handling: 15/15 Configuration: 10/10 Quality Attributes: 15/15 Implementation Guidance: 10/10 Acceptance Criteria: 10/10 Traceability: 5/5 ---------------------------- SPEC-Ready Total: 100/100 (Target: >= 90) IMPL-Ready Score: Implementation Guidance: 25/25 Architecture Patterns: 20/20 Concurrency Handling: 15/15 DI Patterns: 15/15 Algorithm Specifications: 15/15 Testing Strategy: 10/10 ---------------------------- IMPL-Ready Total: 100/100 (Target: >= 90) Status: READY FOR SPEC/IMPL CREATION
  2. Traceability Matrix Update: # Update REQ-00_TRACEABILITY_MATRIX.md python ai_dev_ssd_flow/scripts/update_traceability_matrix.py \ --req docs/07_REQ/REQ-NN_{slug}/REQ-NN_{slug}.md \ --matrix docs/07_REQ/REQ-00_TRACEABILITY_MATRIX.md

REQ MVP Section Reference

Required Sections (11 Total)

SectionPurposeRequired Elements
Document ControlMetadata14 fields including dual readiness scores
1. DescriptionAtomic requirementSHALL/SHOULD/MAY language, context
2. Functional RequirementsCore capabilitiesREQ.NN.01.SS format, business rules
3. Interface SpecificationsAPIs, protocolsProtocol/ABC, DTOs, REST endpoints
4. Data SchemasModels, validationJSON Schema, Pydantic, Database
5. Error HandlingExceptions, recoveryException catalog, circuit breaker
6. ConfigurationSettings, flagsYAML schema, environment variables
7. Quality AttributesPerformance, securityp50/p95/p99, @threshold references
8. Implementation GuidancePatterns, algorithmsDI, concurrency, architecture
9. Acceptance CriteriaTest conditions>=15 criteria, 5 categories
10. Verification MethodsTestingBDD, unit, integration, contract
11. TraceabilityReferences6 cumulative tags

Note: Change History is intentionally omitted in REQ MVP.


Execution Modes

Single SYS Mode

Generate REQ from one SYS document.

# Example: Generate REQ from SYS-01
/doc-req-autopilot SYS-01 --output docs/07_REQ/

Batch Mode

Generate REQ from multiple SYS documents in sequence.

# Example: Generate REQ from all SYS
/doc-req-autopilot all --auto

Batch Configuration (config/req_batch.yaml):

req_generation:
  - id: "01"
    slug: "order_validation"
    sys: "SYS-01"
    domain: "trading"
    priority: 1

  - id: "02"
    slug: "risk_limits"
    sys: "SYS-02"
    domain: "risk"
    priority: 1

  - id: "03"
    slug: "data_collection"
    sys: "SYS-03"
    domain: "data"
    priority: 2

execution:
  parallel: false
  fail_fast: true

Dry Run Mode

Preview execution plan without generating files.

/doc-req-autopilot SYS-01 --dry-run

Review Mode (v2.1)

Validate existing REQ documents and generate a quality report without modification.

Purpose: Audit existing REQ documents for compliance, quality scores, and identify issues.

Command:

# Review single REQ folder
/doc-req-autopilot REQ-01 --mode review

# Review all REQ folders
/doc-req-autopilot all --mode review \
  --output-report tmp/req_review_report.md

Review Process:

flowchart TD
    A[Input: Existing REQ] --> B[Load REQ Files]
    B --> C[Validate 11-Section Structure]
    C --> D[Check Atomic Decomposition]
    D --> E[Validate Dual Scores]
    E --> F[Check Cross-Links]
    F --> G[Identify Issues]
    G --> H{Generate Report}
    H --> I[Fixable Issues List]
    H --> J[Manual Review Items]
    H --> K[Dual Score Breakdown]
    I --> L[Output: Review Report]
    J --> L
    K --> L

Review Report Structure:

# REQ Review Report: REQ-01_f1_iam

## Summary
- **SPEC-Ready Score**: 88% 🟡
- **IMPL-Ready Score**: 85% 🟡
- **Total Files**: 12 atomic REQ files
- **Total Issues**: 15
- **Auto-Fixable**: 11
- **Manual Review**: 4

## Dual Score Breakdown

### SPEC-Ready Score (88%)
| Component | Score | Status |
|-----------|-------|--------|
| Interface Completeness | 18/20 | 🟡 |
| Data Schema | 14/15 | ✅ |
| Error Handling | 13/15 | 🟡 |
| Configuration | 9/10 | ✅ |
| Quality Attributes | 14/15 | ✅ |
| Implementation Guidance | 8/10 | 🟡 |
| Acceptance Criteria | 9/10 | ✅ |
| Traceability | 5/5 | ✅ |

### IMPL-Ready Score (85%)
| Component | Score | Status |
|-----------|-------|--------|
| Implementation Guidance | 22/25 | 🟡 |
| Architecture Patterns | 18/20 | 🟡 |
| Concurrency Handling | 13/15 | 🟡 |
| DI Patterns | 14/15 | ✅ |
| Algorithm Specifications | 12/15 | 🟡 |
| Testing Strategy | 9/10 | ✅ |

## Atomic Decomposition Check
| Check | Status | Details |
|-------|--------|---------|
| Index File Present | ✅ | REQ-01.00_index.md exists |
| Cross-Links Valid | 🟡 | 3 files missing @discoverability |
| Section 11.2 Code Paths | ❌ | 4 files missing implementation paths |
| Acceptance Criteria Count | 🟡 | 2 files below 15 criteria |

## v2.0 Compliance
| Check | Status | Details |
|-------|--------|---------|
| 12 Sections Present | ✅ | All atomic files complete |
| Element ID Format | 🟡 | 2 legacy IDs found |
| Test Category Prefixes | ❌ | Missing [Logic]/[Validation] tags |
| Recovery Strategy Table | ❌ | 3 files missing recovery table |
| @threshold References | ✅ | All numeric values parameterized |
| 6 Cumulative Tags | ✅ | All present |

## Auto-Fixable Issues
| # | Issue | Location | Fix Action |
|---|-------|----------|------------|
| 1 | Missing @discoverability | REQ-01.03 | Add cross-link tags |
| 2 | Legacy element ID | REQ-01.05:L45 | Convert AC-001 to REQ.01.0601 |
| 3 | Missing test category | REQ-01.07:AC-003 | Add [Logic] prefix |
| ... | ... | ... | ... |

## Manual Review Required
| # | Issue | Location | Reason |
|---|-------|----------|--------|
| 1 | Incomplete interface spec | REQ-01.04:S3 | Domain knowledge needed |
| 2 | Missing algorithm | REQ-01.08:S8 | Architecture decision required |
| ... | ... | ... | ... |

Review Configuration:

review_mode:
  enabled: true
  checks:
    - section_completeness     # All 11 sections
    - atomic_decomposition     # File structure
    - element_id_compliance    # REQ.NN.xxxx format
    - acceptance_criteria      # >= 15 count
    - cross_links              # @discoverability tags
    - cumulative_tags          # 6 upstream tags
    - dual_score_calculation   # SPEC-Ready + IMPL-Ready
    - test_categories          # [Logic]/[Validation] prefixes
  output:
    format: markdown
    include_fix_suggestions: true
  thresholds:
    spec_ready_pass: 90
    impl_ready_pass: 90
    warning: 85

Fix Mode (v2.1)

Auto-repair existing REQ documents while preserving manual content.

Purpose: Apply automated fixes to REQ documents to improve quality scores and compliance.

Command:

# Fix single REQ folder
/doc-req-autopilot REQ-01 --mode fix

# Fix with backup
/doc-req-autopilot REQ-01 --mode fix \
  --backup

# Fix specific issue types only
/doc-req-autopilot REQ-01 --mode fix \
  --fix-types "element_ids,sections,cross_links"

# Dry-run fix (preview changes)
/doc-req-autopilot REQ-01 --mode fix \
  --dry-run

Fix Categories and Actions:

CategoryIssueAuto-Fix ActionPreserves Content
Element IDsLegacy AC-XXX formatConvert to REQ.NN.06.SS
Element IDsLegacy FR-XXX formatConvert to REQ.NN.01.SS
Element IDsLegacy R-XXX formatConvert to REQ.NN.27.SS
SectionsMissing sectionInsert from template
SectionsMissing SPEC-Ready ScoreCalculate and insert
SectionsMissing IMPL-Ready ScoreCalculate and insert
Cross-LinksMissing @discoverabilityAdd related REQ references
Cross-LinksMissing Section 10.5Add cross-link section
CriteriaMissing test categoryAdd [Logic]/[Validation] prefix
CriteriaCount below 15Add placeholder criteria
TraceabilityMissing cumulative tagsAdd with placeholder references
IndexOutdated capability matrixRegenerate from files

Content Preservation Rules:

  1. Never delete existing acceptance criteria
  2. Never modify functional requirement text
  3. Never change interface specifications
  4. Only add missing sections and metadata
  5. Only convert legacy element IDs
  6. Backup first if --backup flag is set

Fix Report Structure:

# REQ Fix Report: REQ-01_f1_iam

## Summary
- **Before SPEC-Ready Score**: 88% 🟡
- **After SPEC-Ready Score**: 94% ✅
- **Before IMPL-Ready Score**: 85% 🟡
- **After IMPL-Ready Score**: 92% ✅
- **Issues Fixed**: 11
- **Issues Remaining**: 4 (manual review required)

## Fixes Applied
| # | Issue | Location | Fix Applied |
|---|-------|----------|-------------|
| 1 | Legacy element ID | REQ-01.05:L45 | Converted AC-001 → REQ.01.0601 |
| 2 | Missing @discoverability | REQ-01.03 | Added cross-links to REQ-01.01, REQ-01.11 |
| 3 | Missing test category | REQ-01.07:AC-003 | Added [Logic] prefix |
| 4 | Below 15 criteria | REQ-01.09 | Added 3 placeholder criteria |
| ... | ... | ... | ... |

## Files Modified
- docs/07_REQ/REQ-01_f1_iam/REQ-01.00_index.md
- docs/07_REQ/REQ-01_f1_iam/REQ-01.03_token_revocation.md
- docs/07_REQ/REQ-01_f1_iam/REQ-01.05_rbac_enforcement.md
- docs/07_REQ/REQ-01_f1_iam/REQ-01.07_permission_inheritance.md
- docs/07_REQ/REQ-01_f1_iam/REQ-01.09_mfa_integration.md

## Backup Location
- tmp/backup/REQ-01_f1_iam_20260209_143022/

## Dual Score Impact
### SPEC-Ready
| Component | Before | After | Delta |
|-----------|--------|-------|-------|
| Interface Completeness | 18/20 | 19/20 | +1 |
| Error Handling | 13/15 | 15/15 | +2 |
| Acceptance Criteria | 9/10 | 10/10 | +1 |

### IMPL-Ready
| Component | Before | After | Delta |
|-----------|--------|-------|-------|
| Implementation Guidance | 22/25 | 24/25 | +2 |
| Architecture Patterns | 18/20 | 19/20 | +1 |
| Algorithm Specifications | 12/15 | 14/15 | +2 |

## Next Steps
1. Complete interface spec in REQ-01.04
2. Add algorithm details to REQ-01.08
3. Re-run validation to confirm scores

Fix Configuration:

fix_mode:
  enabled: true
  backup:
    enabled: true
    location: "tmp/backup/"
    retention_days: 7

  fix_categories:
    element_ids: true        # Legacy ID conversion
    sections: true           # Missing required sections
    cross_links: true        # @discoverability tags
    criteria: true           # Acceptance criteria
    traceability: true       # Cumulative tags
    index: true              # Regenerate index

  preservation:
    acceptance_criteria: true   # Never delete criteria
    functional_requirements: true
    interface_specs: true
    comments: true

  validation:
    re_validate_after_fix: true
    require_score_improvement: false
    max_fix_iterations: 3

  element_id_migration:
    AC_XXX_to_REQ_NN_06_SS: true   # AC-001 → REQ.01.0601
    FR_XXX_to_REQ_NN_xxxx: true   # FR-001 → REQ.01.0101
    R_XXX_to_REQ_NN_27_SS: true    # R-001 → REQ.01.2701

Command Line Options (Review/Fix):

OptionModeDefaultDescription
--mode reviewReview-Run review mode only
--mode fixFix-Run fix mode
--output-reportBothautoReport output path
--backupFixtrueCreate backup before fixing
--fix-typesFixallComma-separated fix categories
--dry-runFixfalsePreview fixes without applying
--preserve-allFixfalseExtra cautious preservation

Configuration

Default Configuration

# config/req_autopilot.yaml
req_autopilot:
  version: "2.0"

  # NEW in v2.0: Atomic decomposition settings
  decomposition:
    strategy: atomic          # atomic | monolithic | auto
    min_files: 3              # Minimum files for atomic decomposition
    max_file_size_kb: 30      # Trigger additional split if exceeds
    create_index: true        # Generate REQ-NN.00_index.md
    require_cross_links: true # Mandate Section 10.5

  scoring:
    req_ready_min: 90
    spec_ready_min: 90
    impl_ready_min: 90
    strict_mode: false

  execution:
    max_parallel: 3        # HARD LIMIT - do not exceed
    chunk_size: 3          # Documents per chunk
    pause_between_chunks: true
    auto_fix: true
    continue_on_error: false
    timeout_per_sys: 300  # seconds

  output:
    structure: atomic  # atomic (default v2.0) | monolithic | auto
    size_threshold_kb: 30
    report_format: markdown

  validation:
    skip_validation: false
    fix_iterations_max: 3
    # NEW in v2.0: Enhanced validation rules
    min_acceptance_criteria: 15
    require_test_categories: true   # [Logic]/[Validation]/etc
    require_error_catalog: true     # Full error table
    require_recovery_strategy: true # Recovery table
    require_code_paths: true        # Section 11.2 mandatory

  review:
    enabled: true
    check_sections: true
    check_tags: true
    check_thresholds: true
    check_atomicity: true
    auto_fix_sections: true
    min_acceptance_criteria: 15
    # NEW in v2.0
    check_cross_links: true
    check_test_categories: true

Command Line Options

OptionDefaultDescription
--min-req-ready90Minimum REQ-Ready score (SYS)
--min-spec-ready90Minimum SPEC-Ready score (REQ)
--min-impl-ready90Minimum IMPL-Ready score (REQ)
--no-auto-fixfalseDisable auto-fix (manual only)
--continue-on-errorfalseContinue if one SYS fails
--dry-runfalsePreview execution plan only
--output-formatautoForce flat, domain-based, or sectioned
--skip-reviewfalseSkip final review phase
--domainautoForce domain for output path

Output Artifacts

Generated Files

All REQ use nested folders (REQ-NN_{slug}/) regardless of size. Document sectioning (monolithic vs sectioned) depends only on document size (>20k tokens = sectioned).

FilePurposeLocation
REQ-NN_{slug}/REQ folder (ALWAYS created)docs/07_REQ/ or docs/07_REQ/{domain}/
REQ-NN_{slug}.mdMain REQ document (monolithic <20k tokens)docs/07_REQ/REQ-NN_{slug}/
REQ-NN.0_index.mdSection index (sectioned ≥20k tokens)docs/07_REQ/REQ-NN_{slug}/
REQ-NN.S_{section}.mdSection files (sectioned ≥20k tokens)docs/07_REQ/REQ-NN_{slug}/
REQ-NN.R_review_report_v{VVV}.mdReview reportdocs/07_REQ/REQ-NN_{slug}/
REQ-NN.F_fix_report_v{VVV}.mdFix reportdocs/07_REQ/REQ-NN_{slug}/
.drift_cache.jsonDrift detection cachedocs/07_REQ/REQ-NN_{slug}/

Validation Reports

ReportPurposeLocation
req_validation_report.jsonValidation resultstmp/
spec_ready_score.jsonSPEC-Ready breakdowntmp/
impl_ready_score.jsonIMPL-Ready breakdowntmp/
autopilot_log.mdExecution logtmp/

Error Handling

Error Categories

CategoryHandlingExample
SYS MissingAbort with messageNo SYS document found
REQ-Ready Below 90%Auto-fix SYS, retrySYS score at 85%
Validation FailureAuto-fix, retryMissing required section
SPEC-Ready Below 90%Enhance sections, retryScore at 88%
IMPL-Ready Below 90%Add implementation guidanceScore at 87%
Max Retries ExceededFlag for manual reviewPersistent errors

Recovery Actions

def handle_error(error_type: str, context: dict) -> Action:
    match error_type:
        case "SYS_MISSING":
            return Action.ABORT_WITH_MESSAGE
        case "REQ_READY_LOW":
            return Action.AUTO_FIX_SYS
        case "VALIDATION_FAILURE":
            if context["retry_count"] < 3:
                return Action.AUTO_FIX_RETRY
            return Action.FLAG_MANUAL_REVIEW
        case "SPEC_READY_LOW":
            return Action.ENHANCE_SECTIONS
        case "IMPL_READY_LOW":
            return Action.ADD_IMPLEMENTATION_GUIDANCE
        case _:
            return Action.FLAG_MANUAL_REVIEW

Context Management

Chunked Parallel Execution (MANDATORY)

CRITICAL: To prevent conversation context overflow errors ("Prompt is too long", "Conversation too long"), all autopilot operations MUST follow chunked execution rules:

Chunk Size Limit: Maximum 3 documents per chunk

Chunking Rules:

  1. Chunk Formation: Group SYS-derived REQ documents into chunks of maximum 3 at a time
  2. Sequential Chunk Processing: Process one chunk at a time, completing all documents in a chunk before starting the next
  3. Context Pause: After completing each chunk, provide a summary and pause for user acknowledgment
  4. Progress Tracking: Display chunk progress (e.g., "Chunk 2/4: Processing REQ-04, REQ-05, REQ-06...")

Why Chunking is Required:

  • Prevents "Conversation too long" errors during batch processing
  • Allows context compaction between chunks
  • Enables recovery from failures without losing all progress
  • Provides natural checkpoints for user review

Execution Pattern:

For REQ batch from multiple SYS documents:
  Chunk 1: REQ-01, REQ-02, REQ-03 → Complete → Summary
  [Context compaction opportunity]
  Chunk 2: REQ-04, REQ-05, REQ-06 → Complete → Summary
  [Context compaction opportunity]
  ...continue until all documents processed

Chunk Completion Template:

## Chunk N/M Complete

Generated:
- REQ-XX: SPEC-Ready 94%, IMPL-Ready 92%
- REQ-YY: SPEC-Ready 91%, IMPL-Ready 93%
- REQ-ZZ: SPEC-Ready 95%, IMPL-Ready 94%

Proceeding to next chunk...

Integration Points

Pre-Execution Hooks

# Hook: pre_req_generation
# Runs before REQ generation starts
./hooks/pre_req_generation.sh

# Example: Validate SYS exists and is ready
if [ ! -f "docs/06_SYS/SYS-01_*.md" ]; then
  echo "ERROR: SYS-01 required"
  exit 1
fi

Post-Execution Hooks

# Hook: post_req_generation
# Runs after REQ generation completes
./hooks/post_req_generation.sh

# Example: Trigger SPEC autopilot for validated REQ
if [ "$REQ_VALIDATED" = "true" ]; then
  /doc-spec-autopilot "$REQ_PATH" --output docs/09_SPEC/
fi

CI/CD Integration

# .github/workflows/req_autopilot.yml
name: REQ Autopilot

on:
  push:
    paths:
      - 'docs/06_SYS/**'

jobs:
  generate-req:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run REQ Autopilot
        run: |
          /doc-req-autopilot all --auto --validate

      - name: Upload Validation Report
        uses: actions/upload-artifact@v4
        with:
          name: req-validation
          path: tmp/req_validation_report.json

Quality Gates

Phase Gates

PhaseGateCriteria
Phase 1Input GateAt least one SYS document found
Phase 2Readiness GateSYS REQ-Ready Score >= 90%
Phase 3Generation GateAll 11 sections generated
Phase 4Validation GateSPEC-Ready >= 90% AND IMPL-Ready >= 90%
Phase 5Review GateNo blocking issues remaining

Blocking vs Non-Blocking

Issue TypeBlockingAction
Missing required sectionYesMust fix before proceeding
SPEC-Ready Score < 90%YesMust enhance sections
IMPL-Ready Score < 90%YesMust add implementation guidance
Acceptance criteria < 15YesMust add more criteria
Missing Protocol/ABCYesMust add interface definition
Missing @threshold tagsNoLog warning, continue
Style/formatting issuesNoAuto-fix, continue

Validation Checklist

After autopilot completion:

  • All target REQ documents generated
  • Each REQ has SPEC-Ready score >= 90%
  • Each REQ has IMPL-Ready score >= 90%
  • Each REQ uses Template Version 3.0
  • All 12 required sections completed
  • Traceability matrix updated (REQ-00_TRACEABILITY_MATRIX.md)
  • Each REQ references all 6 upstream tags (@brd, @prd, @ears, @bdd, @adr, @sys)
  • Section 3: Interface Specifications has Protocol/ABC definition
  • Section 4: Data Schemas has JSON Schema or Pydantic models
  • Section 5: Error Handling has Exception Catalog
  • Section 7: Quality Attributes has @threshold references
  • Section 9: Acceptance Criteria has >= 15 measurable criteria
  • Element IDs use REQ.NN.xxxx format (codes: 01, 05, 06, 27)
  • No legacy ID patterns (AC-XXX, FR-XXX, R-XXX)
  • Each requirement is atomic (single responsibility)

Quick Reference

InputOutputKey Metrics
SYS(s)REQ(s)SPEC-Ready >= 90%, IMPL-Ready >= 90%

Usage:

/doc-req-autopilot <SYS-LIST> [OPTIONS]

Common Commands:

# Single SYS
/doc-req-autopilot SYS-01

# All SYS (automatic)
/doc-req-autopilot all --auto

# Preview only
/doc-req-autopilot all --dry-run

# Resume after failure
/doc-req-autopilot resume

# Domain-based output
/doc-req-autopilot SYS-01 --domain risk

Related Resources

Skills (Delegated)

  • REQ Skill: .claude/skills/doc-req/SKILL.md - REQ creation rules and 11-section structure
  • REQ Validator Skill: .claude/skills/doc-req-validator/SKILL.md - Validation rules and error codes
  • SYS Validator Skill: .claude/skills/doc-sys-validator/SKILL.md - SYS readiness validation
  • Quality Advisor Skill: .claude/skills/quality-advisor/SKILL.md - Real-time quality feedback
  • Naming Standards Skill: .claude/skills/doc-naming/SKILL.md - Element ID format

Templates and Rules

  • REQ Template: ai_dev_ssd_flow/07_REQ/REQ-MVP-TEMPLATE.md
  • REQ Schema: ai_dev_ssd_flow/07_REQ/REQ_MVP_SCHEMA.yaml
  • REQ Creation Rules: ai_dev_ssd_flow/07_REQ/REQ-MVP-TEMPLATE.md
  • REQ Validation Rules: ai_dev_ssd_flow/07_REQ/REQ_MVP_SCHEMA.yaml

Section Splitting Reference (for documents >50KB)

  • Reference: ai_dev_ssd_flow/ID_NAMING_STANDARDS.md (Section-Based File Splitting)

Framework References

  • SDD Workflow: ai_dev_ssd_flow/SPEC_DRIVEN_DEVELOPMENT_GUIDE.md
  • MVP Autopilot: ai_dev_ssd_flow/AUTOPILOT/MVP_AUTOPILOT.md
  • SYS Autopilot Skill: .claude/skills/doc-sys-autopilot/SKILL.md (if available)
  • EARS Autopilot Skill: .claude/skills/doc-ears-autopilot/SKILL.md

Review Document Standards (v2.2)

Review reports generated by this skill are formal project documents and MUST comply with shared standards.

Reference: See REVIEW_DOCUMENT_STANDARDS.md in the skills directory for complete requirements.

Key Requirements:

  1. Storage Location: Same folder as the reviewed REQ document
  2. File Naming: preferred REQ-NN.A_audit_report_vNNN.md; legacy-compatible REQ-NN-SSS.R_review_report_vNNN.md or REQ-NN.R_review_report_vNNN.md
  3. YAML Frontmatter: Required with artifact_type: REQ-REVIEW, layer: 7
  4. Score Fields: spec_ready_score_claimed/validated and impl_ready_score_claimed/validated
  5. Parent Reference: Must link to parent REQ document

Example Location:

docs/07_REQ/REQ-03_f3_observability/
├── REQ-03.md
├── REQ-03-001_telemetry_collection.md
├── REQ-03-002_metrics_export.md
└── REQ-03.A_audit_report_v001.md    # ← Preferred combined audit report

Version History

VersionDateChanges
2.42026-02-11Smart Document Detection: Added automatic document type recognition; Self-type input (REQ-NN) triggers review mode; Upstream-type input (SYS-NN) triggers generate-if-missing or find-and-review; Updated input patterns table with type-based actions
2.32026-02-10Review & Fix Cycle: Replaced Phase 5 with iterative Review -> Fix cycle using doc-req-reviewer and doc-req-fixer; Added doc-req-fixer skill dependency; Phase 5 now includes flowchart, iteration control, and quality checks sections (5.1-5.5)
2.22026-02-10Added Review Document Standards section; Review reports now stored alongside reviewed documents with proper YAML frontmatter and parent references
2.12026-02-09Added Review Mode for validating existing REQ documents without modification; Added Fix Mode for auto-repairing REQ documents while preserving manual content; Added fix categories (element_ids, sections, cross_links, criteria, traceability, index); Added content preservation rules; Added backup functionality for fix operations; Added review/fix report generation with dual score impact (SPEC-Ready + IMPL-Ready); Added element ID migration support (AC_XXX, FR_XXX, R_XXX to unified format)
2.02026-02-09Major Enhancement: Added Phase 1.5 Atomic Decomposition based on Trading Nexus REQ layer analysis; New atomic file output (10-15 files per module); Enhanced Section 8 with unit test category prefixes ([Logic]/[Validation]/[State]/[Edge]/[Security]); New Section 10.5 Cross-Links with @discoverability tags; Enhanced Section 11 with mandatory Code Implementation Paths (11.2) and Dependencies table (11.3); Enhanced error catalog format with Recovery Strategy table; Minimum 15 acceptance criteria split into Functional (10+) and Quality (5+); New validation rules REQ-E025 through REQ-E032
1.02026-02-08Initial skill creation with 5-phase workflow; Integrated doc-naming, doc-req, doc-req-validator, quality-advisor skills; Added REQ v3.0 12-section structure; Dual readiness scoring (SPEC-Ready + IMPL-Ready); 6 cumulative tags required (@brd, @prd, @ears, @bdd, @adr, @sys); Element ID types 01/05/06/27

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.44%
按下载量换算74

Claude

30.9%
按下载量换算66

Cursor

17.07%
按下载量换算37

Gemini CLI

8.28%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

来源信息

继续浏览同类 Skills