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

doc-brd-validator文档 brd 验证器

Agent Skill

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

总安装

264

周安装

11

GitHub Stars

14

下载量

88
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

验证 BRD 是否符合第1层 MVP 模式与结构要求。

  • 适用于 YAML 元数据、章节结构与文档控制完整性检查。
  • 执行命名规范与 PRD-Ready 评分验证。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 仅负责结构验证,语义审查由 reviewer 技能完成。
  • doc-brd-validator 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

doc-brd-validator

Validate Business Requirements Documents (BRD) against Layer 1 MVP schema standards.

Validation Scope Contract: This skill is the structural/schema gate only. Deep semantic review (strategic alignment, content quality, unresolved placeholders, business consistency) is owned by doc-brd-reviewer.

Purpose

Validates BRD documents for:

  • YAML frontmatter metadata compliance
  • Section structure (18 sections for comprehensive template)
  • Document Control completeness
  • Traceability tag format and presence
  • PRD-Ready scoring
  • File naming conventions
  • Architecture Decision Requirements completeness
  • Diagram contract structural compliance (c4-l1, dfd-l0, sequence tags, intent header fields)

Activation

Invoke when:

  • User requests validation of BRD documents
  • After creating/modifying BRD artifacts
  • Before generating downstream artifacts (PRD)
  • As part of quality gate checks

Schema Reference

ItemValue
Schemaai_dev_ssd_flow/01_BRD/BRD_MVP_SCHEMA.yaml
Templateai_dev_ssd_flow/01_BRD/BRD-MVP-TEMPLATE.md
Creation Rulesai_dev_ssd_flow/01_BRD/BRD_MVP_CREATION_RULES.md
Validation Rulesai_dev_ssd_flow/01_BRD/BRD_MVP_VALIDATION_RULES.md
Layer1
Artifact TypeBRD

Non-Redundancy Boundary

Concerndoc-brd-validatordoc-brd-reviewer
Template/schema compliance✅ Primary owner⚠️ Secondary check only
Required section/subsection presence✅ Primary owner⚠️ Spot-check
PRD-Ready numeric gate✅ Primary owner⚠️ Reports context
Link integrity and content quality❌ Out of scope✅ Primary owner
Manual business judgment calls❌ Out of scope✅ Primary owner

Autopilot sequence remains: validator first, then reviewer/fixer loop.

Validation Checklist

1. Metadata Validation

Required custom_fields:
  document_type: ["brd", "template"]
  artifact_type: "BRD"
  layer: 1
  architecture_approaches: [array format]
  priority: ["primary", "shared", "fallback"]
  development_status: ["active", "draft", "deprecated", "reference"]

Required tags:
  - brd (or brd-template)
  - layer-1-artifact

Forbidden tag patterns:
  - "^business-requirements$"
  - "^brd-\\d{3}$"

2. Structure Validation

Required Sections (18 Total):

SectionTitleRequired
0Document ControlMANDATORY
1IntroductionMANDATORY
2Business ObjectivesMANDATORY
3Project ScopeMANDATORY
4StakeholdersMANDATORY
5User StoriesMANDATORY
6Functional RequirementsMANDATORY
7Quality AttributesMANDATORY
8Business Constraints and AssumptionsMANDATORY
9Acceptance CriteriaMANDATORY
10Business Risk ManagementMANDATORY
11Implementation ApproachMANDATORY
12Support and MaintenanceMANDATORY
13Cost-Benefit AnalysisMANDATORY
14Project GovernanceMANDATORY
15Quality AssuranceMANDATORY
16TraceabilityMANDATORY
17GlossaryMANDATORY
18AppendicesMANDATORY

Section 14 Required Subsections:

  • 14.1 Governance Structure
  • 14.2 Decision Authority Matrix
  • 14.3 Status Reporting
  • 14.4 Change Control
  • 14.5 Approval and Sign-off

Section 15 Required Subsections:

  • 15.1 Quality Standards
  • 15.2 Testing Strategy
  • 15.3 Quality Gates

Section 16 Required Subsections:

  • 16.1 Requirements Traceability Matrix
  • 16.2 Cross-BRD Dependencies
  • 16.3 Test Coverage Traceability
  • 16.4 Traceability Summary

Section 17 Required Subsections (6 total):

  • 17.1 Business Terms
  • 17.2 Technical Terms
  • 17.3 Domain-Specific Terms
  • 17.4 Acronyms
  • 17.5 Cross-References
  • 17.6 External Standards

Section Format: ## N. Title (numbered H2 headings)

3. Document Control Required Fields

FieldDescriptionRequired
Project NameProject identifierMANDATORY
Document VersionSemantic versioning (X.Y.Z)MANDATORY
Date CreatedYYYY-MM-DD formatMANDATORY
Last UpdatedYYYY-MM-DD formatMANDATORY
Document OwnerOwner nameMANDATORY
Prepared ByAuthor nameMANDATORY
StatusDraft/In Review/Approved/SupersededMANDATORY
PRD-Ready ScoreXX/100 (MVP Target: ≥90)MANDATORY

4. Content Validation

Business Objectives Format (Section 2):

  • Pattern: BRD.NN.23.SS (unified 4-segment format)
  • Required fields: ID, Objective, Priority, Success Criteria, Measurement Method

Business Requirements Format (Section 6):

  • Pattern: BRD.NN.01.SS (unified 4-segment format)
  • Required fields: ID, Requirement, Type, Priority, Source, Rationale
  • Priority values: Critical (P1), High (P2), Medium (P3), Low (P4)
  • Type values: Functional, Non-Functional, Regulatory, Operational

PRD-Ready Score:

  • Minimum threshold: 90%
  • Components: Business objectives, requirements completeness, success metrics, constraints, stakeholder analysis, risk assessment, traceability, ADR topics completeness

5. Architecture Decision Requirements (Section 7.2) - MANDATORY

7 Mandatory ADR Topic Categories:

#CategoryElement IDStatus Values
1InfrastructureBRD.NN.32.01Selected/Pending/N/A
2Data ArchitectureBRD.NN.32.02Selected/Pending/N/A
3IntegrationBRD.NN.32.03Selected/Pending/N/A
4SecurityBRD.NN.32.04Selected/Pending/N/A
5ObservabilityBRD.NN.32.05Selected/Pending/N/A
6AI/MLBRD.NN.32.06Selected/Pending/N/A
7Technology SelectionBRD.NN.32.07Selected/Pending/N/A

Element Type Code: 32 = Architecture Topic (see doc-naming skill)

Required Fields Per Topic (Status=Selected):

  • Status (Selected/Pending/N/A)
  • Business Driver
  • Business Constraints
  • Alternatives Overview table (Option | Function | Est. Monthly Cost | Selection Rationale)
  • Cloud Provider Comparison table (Criterion | GCP | Azure | AWS)
  • Recommended Selection
  • PRD Requirements

Required Fields Per Topic (Status=Pending):

  • Status with reason
  • Business Driver
  • Business Constraints
  • PRD Requirements

Required Fields Per Topic (Status=N/A):

  • Status with explicit reason
  • PRD Requirements (can be "None for current scope")

6. Naming Compliance (doc-naming integration)

Element ID Validation:

  • Format: BRD.NN.TT.SS (4-segment unified format)
  • Valid element type codes for BRD: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 22, 23, 24, 32
  • No legacy patterns (BO-XXX, FR-XXX, AC-XXX, BC-XXX)

Section-Element Type Mapping (MANDATORY):

Element type codes MUST match the section context where they appear:

SectionSection TitleRequired Element Type CodeCode Meaning
2Business Objectives23Business Objective
5User Stories09User Story
6Functional Requirements01Functional Requirement
7.1Quality Attributes (NFRs)02Quality Attribute
7.2ADR Topics32Architecture Topic
8.1Constraints03Constraint
8.2Assumptions04Assumption
9Acceptance Criteria06Acceptance Criteria
10Risk Management07Risk

Validation Algorithm:

FOR each element ID found in document:
  1. Extract section number from surrounding context (## N. or ### N.M)
  2. Extract element type code (TT) from ID pattern BRD.NN.TT.SS
  3. Look up expected code for section in mapping table
  4. IF TT != expected_code:
     - Flag BRD-E022: Element type code mismatch
     - Report: "Section {N} requires code {expected}, found {TT}"

Example Violations:

Found IDSectionExpected CodeActual CodeError
BRD.64.05.015. User Stories0905BRD-E022
BRD.64.01.012. Business Objectives2301BRD-E022

File Naming Convention:

  • Pattern: BRD-NN_{descriptive_slug}.md
  • NN: 2+ digit number (01, 02,... 99, 100)
  • descriptive_slug: lowercase with underscores

Sectioned BRD Pattern: docs/01_BRD/BRD-NN_{slug}/BRD-NN.S_{section}.md

7. Traceability Validation

Layer 1 Tags:

  • No upstream artifacts required (BRD is the entry point)
  • Tag count: 0

Downstream Expected:

  • PRD documents (Layer 2)
  • EARS statements (Layer 3)
  • ADR documents (Layer 5)

Same-Type References:

  • @related-brd: BRD-NN
  • @supersedes-brd: BRD-NN
  • @depends-brd: BRD-NN

8. Upstream Source Configuration Validation

YAML Frontmatter Fields:

FieldRequiredTypeValid Values
custom_fields.upstream_modeNostring"ref", "none"
custom_fields.upstream_ref_pathConditionalstring or arrayRelative path(s)

Validation Rules:

  1. If upstream_mode not set: Valid (defaults to "none")
  2. If upstream_mode: "none": upstream_ref_path ignored
  3. If upstream_mode: "ref": upstream_ref_path should be set
  4. If upstream_ref_path set: Validate path(s) exist

Path Validation:

  • Resolve relative path from BRD file location
  • Check directory exists
  • Warn if directory empty

Default Behavior:

  • BRDs without upstream_mode are treated as upstream_mode: "none"
  • Drift detection is automatically skipped for these BRDs

8.2 Source Mode Awareness (Autopilot Contract)

Autopilot may generate BRDs from any of these source modes:

  • --ref <path>
  • --prompt "..."
  • --iplan <path|IPLAN-NNN>

Validator behavior remains frontmatter-based:

  • Validate only upstream_mode / upstream_ref_path values in BRD files.
  • Do not enforce source-mode flags at BRD file level.
  • For IPLAN-derived BRDs, upstream_mode: "none" is valid unless reference documents are explicitly tracked.

8.1 Hash Format Validation

When upstream_mode: "ref" and .drift_cache.json exists, validate hash integrity.

Validation Checks:

CheckRequirementError Code
Hash existsEach upstream doc in cache has hash fieldVAL-H001
Hash formatMatches ^sha256:[0-9a-f]{64}$VAL-H002
No placeholdersNot verified_no_drift, pending_verification, etc.VAL-H002

Validation Algorithm:

# For each upstream document in drift cache:
# 1. Check valid hash format
grep -oP '"hash":\s*"sha256:[0-9a-f]{64}"' .drift_cache.json

# 2. Check for placeholder values (must return empty)
grep -E '"hash":\s*"(sha256:)?(verified_no_drift|pending_verification|TBD)"' .drift_cache.json

Validation Logic:

  1. If upstream_mode: "none" → Skip hash validation
  2. If .drift_cache.json missing → Skip (reviewer will create it)
  3. If upstream_documents empty → Valid (no refs tracked)
  4. For each entry in upstream_documents:

- Check hash field exists → VAL-H001 if missing - Check hash format is valid → VAL-H002 if invalid or placeholder

9. Diagram Contract Validation

BRD diagram contract requirements follow ai_dev_ssd_flow/DIAGRAM_STANDARDS.md.

Advisory BRD tags:

  • @diagram: c4-l1
  • @diagram: dfd-l0

Conditional requirement:

  • If any sequence diagram is present, at least one sequence contract tag should be present:

- @diagram: sequence-sync - @diagram: sequence-async - @diagram: sequence-error

Diagram intent header fields (recommended for BRD diagram blocks):

  • diagram_type
  • level
  • scope_boundary
  • upstream_refs
  • downstream_refs

Transition policy:

  • BRD diagram checks are non-blocking advisories.
  • Canonical blocking enforcement is in PRD validator (PRD-E023..PRD-E026).

Error Codes

CodeSeverityDescription
BRD-E001ERRORMissing required tag 'brd'
BRD-E002ERRORMissing required tag 'layer-1-artifact'
BRD-E003ERRORInvalid document_type value
BRD-E004ERRORInvalid architecture_approaches format (must be array)
BRD-E005ERRORForbidden tag pattern detected
BRD-E006ERRORMissing required section
BRD-E007ERRORMultiple H1 headings detected
BRD-E008ERRORSection numbering not sequential
BRD-E009ERRORDocument Control missing required fields
BRD-E010ERRORMissing Business Objectives (Section 3)
BRD-E011ERRORMissing Business Requirements (Section 4)
BRD-E012ERRORMissing Traceability (Section 9)
BRD-E013ERRORMissing Section 7.2 (Architecture Decision Requirements)
BRD-E014ERRORMissing mandatory ADR topic category
BRD-E015ERRORADR topic missing required Status field
BRD-E016ERRORSelected ADR topic missing Alternatives Overview table
BRD-E017ERRORSelected ADR topic missing Cloud Provider Comparison table
BRD-E018ERRORN/A ADR topic missing explicit reason
BRD-E019ERRORInvalid element ID format (not BRD.NN.TT.SS)
BRD-E020ERRORElement type code not valid for BRD (see doc-naming)
BRD-E021ERRORDeprecated ID pattern used (BO-XXX, FR-XXX, etc.)
BRD-E022ERRORElement type code does not match section context (e.g., User Stories using code 05 instead of 09)
BRD-W011WARNINGMissing recommended BRD diagram tag @diagram: c4-l1
BRD-W012WARNINGMissing recommended BRD diagram tag @diagram: dfd-l0
BRD-W013WARNINGSequence diagram present without sequence contract tag
BRD-W014WARNINGMissing diagram intent header fields
BRD-W001WARNINGObjectives not using BRD.NN.23.SS format
BRD-W002WARNINGRequirements not using BRD.NN.01.SS format
BRD-W003WARNINGMissing Success Metrics (Section 5)
BRD-W004WARNINGPRD-Ready Score below 90%
BRD-W005WARNINGMissing Stakeholder Analysis
BRD-W006WARNINGFile name does not match format BRD-NN_{slug}.md
BRD-W007WARNINGADR topic missing cost estimates in Alternatives Overview
BRD-W008WARNINGADR topic missing PRD Requirements field
BRD-W009WARNINGMissing Document Revision History table
BRD-W010WARNINGTrust boundary annotation missing where expected
BRD-I001INFOConsider adding regulatory compliance requirements
BRD-I002INFOConsider adding market analysis context
BRD-I003INFOConsider completing Pending ADR topics before PRD creation
VAL-U001WARNINGInvalid upstream_mode value (must be "ref" or "none")
VAL-U002WARNINGupstream_ref_path set but upstream_mode is "none"
VAL-U003WARNINGupstream_mode is "ref" but upstream_ref_path not set
VAL-U004ERRORupstream_ref_path directory not found
VAL-U005INFOupstream_ref_path directory is empty
VAL-H001WARNINGMissing hash field for upstream document in drift cache
VAL-H002ERRORInvalid hash format or placeholder value detected (verified_no_drift, pending_verification, etc.)

Validation Commands

# Canonical BRD validation entrypoint (used by pre-commit and CI)
bash ai_dev_ssd_flow/01_BRD/scripts/validate_brd_wrapper.sh docs/01_BRD --skip-advisory

# Full tiered validation (includes advisory checks)
bash ai_dev_ssd_flow/01_BRD/scripts/validate_brd_wrapper.sh docs/01_BRD

# Component-level structural diagnostics (secondary)
python ai_dev_ssd_flow/01_BRD/scripts/validate_brd.py docs/01_BRD/BRD-01_example.md --verbose

# Cross-document validation
python ai_dev_ssd_flow/scripts/validate_cross_document.py --document docs/01_BRD/BRD-01.md --auto-fix

Validation Workflow

  1. Parse YAML frontmatter
  2. Check required metadata fields (document_type, artifact_type, layer)
  3. Validate tag taxonomy (brd, layer-1-artifact)
  4. Verify section structure (18 sections)
  5. Validate Document Control table completeness
  6. Check business objectives format (BRD.NN.23.SS)
  7. Check business requirements format (BRD.NN.01.SS)
  8. Validate Section 7.2 ADR Topics:

- Verify all 7 mandatory categories present - Check Status field (Selected/Pending/N/A) - For Selected: Verify Alternatives Overview table, Cloud Provider Comparison table - For N/A: Verify explicit reason provided - Validate element ID format (BRD.NN.32.SS)

  1. Validate upstream source configuration:

- Check upstream_mode value (valid: "ref", "none", or not set) - If upstream_mode: "ref": Verify upstream_ref_path is set and paths exist - If upstream_mode: "none": Skip upstream_ref_path validation

  1. Validate diagram contract advisory compliance:
  • Check recommended BRD tags @diagram: c4-l1 and @diagram: dfd-l0
  • If sequence diagram exists, check for sequence contract tag
  • Check diagram intent header fields
  1. Calculate PRD-Ready Score (includes ADR completeness)
  2. Verify file naming convention
  3. Check element ID format compliance (per doc-naming)
  4. Validate section-element type mapping (BRD-E022)
  5. Detect deprecated patterns
  6. Generate validation report

Auto-Fix Actions

IssueAuto-Fix Action
Invalid element ID formatConvert to BRD.NN.TT.SS format
Missing traceability sectionInsert from template
Missing Document Control fieldsAdd placeholder fields
Deprecated ID patternsConvert to unified format
Missing PRD-Ready ScoreCalculate and insert

Integration

  • Invoked by: doc-flow, doc-brd (post-creation), doc-prd-autopilot
  • Feeds into: trace-check (cross-document validation)
  • Reports to: quality-advisor

Output Format

BRD Validation Report
=====================
Document: BRD-01_platform_architecture.md
Status: PASS/FAIL

PRD-Ready Score: 92% (Target: ≥90%) ✓

Errors: 0
Warnings: 2
Info: 1

[BRD-W006] WARNING: File name should use lowercase slug
[BRD-W009] WARNING: Missing Document Revision History table
[BRD-I001] INFO: Consider adding regulatory compliance requirements

Related Resources

  • Naming Standards: .claude/skills/doc-naming/SKILL.md (element IDs, element type codes)
  • BRD Skill: .claude/skills/doc-brd/SKILL.md
  • BRD Template: ai_dev_ssd_flow/01_BRD/BRD-MVP-TEMPLATE.md
  • BRD Schema: ai_dev_ssd_flow/01_BRD/BRD_MVP_SCHEMA.yaml
  • Creation Rules: ai_dev_ssd_flow/01_BRD/BRD_MVP_CREATION_RULES.md
  • Validation Rules: ai_dev_ssd_flow/01_BRD/BRD_MVP_VALIDATION_RULES.md
  • Shared Standards: .claude/skills/doc-flow/SHARED_CONTENT.md

Version History

VersionDateChanges
2.72026-02-28Validator parity alignment: Removed code 33 from BRD valid element code set to match ai_dev_ssd_flow/scripts/validate_standardized_element_codes.py; clarified error-code continuity for section-element mapping checks.
2.62026-02-28Section-Element Type Mapping: Added mandatory validation that element type codes match section context (e.g., User Stories must use code 09, not 05); Added BRD-E022 error code; Updated validation workflow step 14
2.52026-02-27Hash Format Validation: Added Section 8.1 for drift cache hash validation; Added VAL-H001 (missing hash), VAL-H002 (invalid format/placeholder) error codes; Validates hash format when upstream_mode: "ref"
2.42026-02-26Added Diagram Contract Validation section aligned to ai_dev_ssd_flow/DIAGRAM_STANDARDS.md; introduced advisory BRD diagram checks and BRD-W010; updated workflow with explicit C4/DFD/sequence checks
2.32026-02-25Updated section structure to match 18-section MVP template; Added validation for sections 12-18 with required subsections; Updated PRD-Ready score to show MVP (≥70) and Full (≥90) targets
2.22026-02-24Added upstream source configuration validation (Section 8); Added VAL-U001 through VAL-U005 error codes; Updated workflow to include upstream_mode validation
2.12026-02-10Added element type code 33 (Benefit Statement) to valid BRD codes per then-current guidance (superseded in 2.7)
2.02026-02-08Complete rewrite: Added YAML frontmatter, doc-naming integration (BRD-E019/E020/E021), updated section structure to 18 sections, fixed file paths with numbered prefixes, added PRD-Ready score validation
1.02025-01-06Initial version (outdated 12-section structure)

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

34.97%
按下载量换算31

Claude

29.78%
按下载量换算26

Cursor

19%
按下载量换算17

Gemini CLI

8.72%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills