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

doc-ears-autopilot博士耳朵自动驾驶仪

Agent Skill

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

总安装

635

周安装

27

GitHub Stars

14

下载量

222
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于自动化生成EARS需求语句,支持BDD-Ready评分。

  • 适合从PRD文档提取正式需求,并按类别组织成结构化语句。
  • 可处理--ref、--prompt和--iplan三种输入模式,优先级依次递减。
  • 需确保上游BRD和PRD文档存在且有效,否则无法生成合格EARS。
  • doc-ears-autopilot 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

doc-ears-autopilot

Purpose

Automated EARS (Easy Approach to Requirements Syntax) generation pipeline that processes PRD documents and generates formal EARS statements with readiness validation, statement categorization, and BDD-Ready score compliance.

Layer: 3 (EARS Generation)

Upstream: BRD (Layer 1), PRD (Layer 2)

Downstream Artifacts: BDD (Layer 4), ADR (Layer 5), SYS (Layer 6)


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 (EARS.NN.25.SS), threshold tags, category ID rangesAll Phases
doc-prd-validatorValidate PRD EARS-Ready scorePhase 2: PRD Readiness
doc-earsEARS creation rules, WHEN-THE-SHALL syntax, template, section structurePhase 3: EARS Generation
quality-advisorReal-time quality feedback during EARS generationPhase 3: EARS Generation
doc-ears-validatorValidate EARS structure, content, BDD-Ready scorePhase 4: EARS Validation
doc-ears-reviewerContent review, link validation, quality scoringPhase 5: Review
doc-ears-auditUnified validator+reviewer audit report generationPhase 5: Review
doc-ears-fixerApply fixes from audit/review report, create missing filesPhase 5: Fix

Delegation Principle: The autopilot orchestrates workflow but delegates:

  • EARS structure/content rules -> doc-ears skill
  • Real-time quality feedback -> quality-advisor skill
  • EARS validation logic -> doc-ears-validator skill
  • Content review and scoring -> doc-ears-reviewer skill
  • Issue resolution and fixes -> doc-ears-fixer skill
  • PRD validation logic -> doc-prd-validator skill
  • Element ID standards -> doc-naming skill

Document Type Contract (MANDATORY)

When generating EARS document instances, the autopilot MUST:

  1. Read instance_document_type from template:

- Source: ai_dev_ssd_flow/03_EARS/EARS-MVP-TEMPLATE.yaml - Field: metadata.instance_document_type: "ears-document"

  1. Set document_type in generated document frontmatter: custom_fields: document_type: ears-document # NOT "template" artifact_type: EARS layer: 3
  2. Validation: Generated documents MUST have document_type: ears-document

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

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


Smart Document Detection

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

Input Type Recognition

InputDetected AsAction
EARS-NNSelf typeReview existing EARS document
PRD-NNUpstream typeGenerate if missing, review if exists

Detection Algorithm

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

File Existence Check

# Check for nested folder structure (mandatory)
ls docs/03_EARS/EARS-{NN}_*/

Examples

# Review mode (same type - EARS input)
/doc-ears-autopilot EARS-01          # Reviews existing EARS-01

# Generate/Find mode (upstream type - PRD input)
/doc-ears-autopilot PRD-01           # Generates EARS-01 if missing, or reviews existing EARS-01

# Multiple inputs
/doc-ears-autopilot PRD-01,PRD-02    # Generates/reviews EARS-01 and EARS-02
/doc-ears-autopilot EARS-01,EARS-02  # Reviews EARS-01 and EARS-02

Action Determination Output

Input: PRD-01
├── Detected Type: PRD (upstream)
├── Expected EARS: EARS-01
├── EARS Exists: Yes → docs/03_EARS/EARS-01_f1_iam/
└── Action: REVIEW MODE - Running doc-ears-reviewer on EARS-01

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

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

When to Use This Skill

Use doc-ears-autopilot when:

  • You have one or more completed PRD documents ready for EARS generation
  • You want automated requirement categorization (Event, State, Unwanted, Ubiquitous)
  • You need EARS-Ready score validation before generation
  • You want automatic BDD-Ready score validation after EARS creation
  • You need to generate formal WHEN-THE-SHALL-WITHIN statements from PRD features

Do NOT use when:

  • Creating a single EARS with extensive manual customization (use doc-ears directly)
  • PRDs are incomplete or in Draft status
  • You need fine-grained control over each EARS statement
  • PRD EARS-Ready score is below 90%

Workflow Overview

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

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

    subgraph Phase3["Phase 3: EARS Generation"]
        L --> M[Categorize Requirements]
        M --> N[Generate Event-Driven Statements]
        N --> O[Generate State-Driven Statements]
        O --> P[Generate Unwanted Behavior Statements]
        P --> Q[Generate Ubiquitous Statements]
        Q --> R[quality-advisor: Real-time Feedback]
        R --> S[Add Quality Attributes Section]
        S --> T[Add Traceability Tags]
        T --> U[Write EARS Files]
    end

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

    subgraph Phase5["Phase 5: Final Review"]
        Z --> AA[Check EARS Syntax Compliance]
        AA --> AB[Verify Threshold Consistency]
        AB --> AC[Validate Cumulative Tags]
        AC --> AD[Check Statement Atomicity]
        AD --> AE{Review Passed?}
        AE -->|No| AF[Flag Issues]
        AF --> AG[Auto-Fix or Manual]
        AG --> AE
        AE -->|Yes| AH[Mark EARS Complete]
    end

    AH --> AI{More PRDs?}
    AI -->|Yes| G
    AI -->|No| AJ[Generate Summary Report]
    AJ --> AK[Complete]

Detailed Workflow

Phase 1: PRD Analysis

Analyze PRD documents to extract requirements for EARS formalization.

Input Sources (from PRD):

PRD SectionEARS ContentMapping
Section 6: Goals & ObjectivesBusiness-driven requirementsUbiquitous statements
Section 9: Functional RequirementsFeature behaviorsEvent-Driven, State-Driven
Section 10: Customer-Facing ContentUser interactionsEvent-Driven statements
Section 11: Acceptance CriteriaValidation rulesEvent-Driven, Unwanted Behavior
Section 14: Success DefinitionGo-live criteriaUbiquitous statements
Section 20: EARS Enhancement AppendixTiming, boundary, state, fallbackAll statement types
Quality AttributesPerformance, Security, ReliabilityQuality Attributes section

Analysis Process:

# Check for PRD documents
ls -la docs/02_PRD/

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

Output: Requirement catalog with categorization hints, threshold references, and traceability links.

Phase 2: EARS Readiness Check

Validate that source PRDs meet EARS-Ready requirements before generation.

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

EARS-Ready Scoring Criteria (100%):

CategoryWeightCriteria
Business Requirements Clarity40%SMART objectives, functional requirements, acceptance criteria
Requirements Maturity35%System boundaries, stakeholder requirements, problem statement
EARS Translation Readiness20%User journeys, quality attributes quantified, timing profiles
Strategic Alignment5%Domain-specific business logic references

Minimum Score: 90% (configurable)

Auto-Fix Actions:

IssueAuto-Fix Action
Missing timing profile matrixAdd Section 20.1 template
Missing boundary value matrixAdd Section 20.2 template
Missing state transition diagramAdd Section 20.3 Mermaid template
Missing fallback documentationAdd Section 20.4 template
Incomplete acceptance criteriaFlag for manual review

Validation Command (internal):

/doc-prd-validator PRD-NN

Phase 3: EARS Generation

Generate EARS statements from validated PRD with real-time quality feedback.

Skill Delegation: This phase follows rules defined in doc-ears skill. See: .claude/skills/doc-ears/SKILL.md for complete EARS 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 EARS ID: # Check for next available ID ls docs/03_EARS/EARS-*.md docs/03_EARS/EARS-*/EARS-*.0_*.md 2>/dev/null | \ grep -oP 'EARS-\K\d+' | sort -n | tail -1 # Increment for new EARS
  2. Load EARS Template:

- Primary: ai_dev_ssd_flow/03_EARS/EARS-MVP-TEMPLATE.md - Section templates: For sectioned EARS (>800 lines)

  1. Generate Document Control Section: Field Value EARS ID EARS-NN Version 0.1.0 Date Created Current date (YYYY-MM-DD) Last Updated Current date (YYYY-MM-DD) Status Draft Priority From PRD priority Source Document @prd: PRD.NN.EE.SS (single value) BDD-Ready Score Calculated after generation
  2. Categorize Requirements: Requirement Category Detection: PRD Pattern EARS Category ID Range "when user...", "upon receiving...", "triggered by..." Event-Driven 001-099 "while connected...", "during session...", "maintaining..." State-Driven 101-199 "if error...", "prevent...", "handle failure..." Unwanted Behavior 201-299 "always...", "system-wide...", "all requests..." Ubiquitous 401-499
  3. Generate EARS Statements by Category: Event-Driven Requirements (ID Range: 001-099): #### EARS.NN.25.001: [Requirement Name] WHEN [trigger condition], THE [system component] SHALL [action 1], [action 2], and [action 3] WITHIN [timing constraint] (@threshold: PRD.NN.category.key). **Traceability**: @brd: BRD.NN.01.SS | @prd: PRD.NN.07.SS State-Driven Requirements (ID Range: 101-199): #### EARS.NN.25.101: [Requirement Name] WHILE [state condition], THE [system component] SHALL [continuous behavior] WITHIN [operational context]. **Traceability**: @brd: BRD.NN.01.SS | @prd: PRD.NN.07.SS Unwanted Behavior Requirements (ID Range: 201-299): #### EARS.NN.25.201: [Requirement Name] IF [error condition], THE [system component] SHALL [prevention/recovery action] WITHIN [timing constraint]. **Traceability**: @brd: BRD.NN.01.SS | @prd: PRD.NN.07.SS Ubiquitous Requirements (ID Range: 401-499): #### EARS.NN.25.401: [Requirement Name] THE [system component] SHALL [universal behavior] for [scope/context]. **Traceability**: @brd: BRD.NN.01.SS | @prd: PRD.NN.07.SS
  4. Real-Time Quality Feedback (via quality-advisor skill):

- Monitor EARS syntax compliance as statements are generated - Detect anti-patterns (missing SHALL, ambiguous terms, non-atomic statements) - Validate @threshold tag format and references - Check element ID format compliance (EARS.NN.25.SS) - Flag issues early to reduce post-generation rework

  1. Generate Quality Attributes Section: Performance Requirements Table: QA ID Requirement Statement Metric Target Priority Measurement Method EARS.NN.02.01 THE [component] SHALL complete [operation] Latency p95 < NNms High [method] EARS.NN.02.02 THE [component] SHALL process [workload] Throughput NN/s Medium [method] Security Requirements Table: QA ID Requirement Statement Control Compliance Priority EARS.NN.03.01 THE [component] SHALL authenticate using [method] Authentication [standard] High Reliability Requirements Table: QA ID Requirement Statement Metric Target Priority EARS.NN.04.01 THE [component] SHALL maintain availability Uptime 99.9% High
  2. Add Cumulative Traceability Tags: ## Traceability **Required Tags** (Cumulative Tagging Hierarchy - Layer 3): @brd: BRD.01.0103, BRD.01.0110 @prd: PRD.01.0702, PRD.01.0715
  3. Add Threshold References Section: ### Thresholds Referenced | Threshold ID | Category | Value | Source | |--------------|----------|-------|--------| | @threshold: PRD.01.timeout.auth.sso | Timing | 500ms | PRD Section 20.1 | | @threshold: PRD.01.perf.api.p95 | Performance | 100ms | PRD Section 14 |
  4. File Output (ALWAYS use nested folder): Nested Folder Rule: ALL EARS use nested folders (EARS-NN_{slug}/) regardless of size. This keeps companion files (review reports, fix reports, drift cache) organized with their parent document.

- Monolithic (<20k tokens): docs/03_EARS/EARS-NN_{slug}/EARS-NN_{slug}.md - Sectioned (≥20k tokens): docs/03_EARS/EARS-NN_{slug}/EARS-NN.0_index.md, EARS-NN.1_core.md, etc. - Master Index (always): docs/03_EARS/EARS-00_index.md (create or update)

Phase 4: EARS Validation

After EARS generation, validate structure and BDD-Ready score.

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

Validation Command:

python ai_dev_ssd_flow/03_EARS/scripts/validate_ears.py docs/03_EARS/EARS-NN_{slug}/EARS-NN_{slug}.md --verbose

Validation Checks:

CheckRequirementError Code
YAML FrontmatterValid metadata fieldsEARS-E001 to EARS-E005
Section StructureRequired sections presentEARS-E006
Document ControlAll required fieldsEARS-E009
EARS SyntaxWHEN-THE-SHALL-WITHIN patternsEARS-E010
Element ID FormatEARS.NN.25.SS (3-segment)EARS-E030
Source DocumentSingle @prd: PRD.NN.EE.SS valueEARS-E040, EARS-E044
Cumulative Tags@brd, @prd presentEARS-W002
BDD-Ready Score>= 90%EARS-W003

Auto-Fix Actions:

IssueAuto-Fix Action
Missing SHALL keywordAdd SHALL to statement
Invalid element ID formatConvert to EARS.NN.25.SS format
Missing traceability sectionInsert from template
Missing @threshold tagsAdd placeholder tags
Deprecated ID patternsConvert to unified format
Missing BDD-Ready ScoreCalculate and insert

Validation Loop:

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

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

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

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

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

    F -->|Yes| G[Run doc-ears-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-ears-audit to execute validator + reviewer and generate a combined report.

/doc-ears-audit EARS-NN

Output: EARS-NN.A_audit_report_v001.md (legacy-compatible reviewer report may still exist)

Review Checks:

  1. EARS Syntax Compliance:

- All statements use WHEN-THE-SHALL-WITHIN format - SHALL/SHOULD/MAY keywords used correctly - No ambiguous terms ("fast", "efficient", "user-friendly") - All constraints quantifiable

  1. Threshold Consistency:

- All @threshold tags reference valid PRD thresholds - Threshold values match PRD source - No orphan threshold references

  1. Cumulative Tag Validation:

- @brd tags reference valid BRD elements - @prd tags reference valid PRD elements - Tag format uses pipe separators for inline

  1. Statement Atomicity:

- Each EARS statement defines one testable concept - No compound requirements in single statements - Clear trigger-action-constraint structure

5.2 Fix Cycle

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

/doc-ears-fixer EARS-NN --revalidate

Fix Categories:

CategoryFixes Applied
Missing FilesCreate glossary, reference docs
Broken LinksUpdate paths, create targets
Element IDsConvert legacy patterns (ER-XXX, SR-XXX, UB-XXX, UQ-XXX)
ContentReplace template placeholders, dates
ReferencesUpdate traceability tags (@brd, @prd)
ThresholdsAdd missing @threshold references

Output: EARS-NN.F_fix_report_v001.md

5.3 Re-Review

After fixes, automatically re-run reviewer.

/doc-ears-audit EARS-NN

Output: EARS-NN.A_audit_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 82 (3 errors, 5 warnings)
  Fix v001: Fixed 6 issues, added 4 threshold references

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

5.5 Quality Checks (Post-Fix)

After passing the fix cycle:

  1. BDD-Ready Report: BDD-Ready Score Breakdown ========================= Requirements Clarity: 40/40 EARS Syntax Compliance: 20/20 Statement Atomicity: 15/15 Quantifiable Constraints: 5/5 Testability: 35/35 BDD Translation Ready: 15/15 Observable Verification: 10/10 Edge Cases Specified: 10/10 Quality Attributes: 15/15 Performance Targets: 5/5 Security Requirements: 5/5 Reliability Targets: 5/5 Strategic Alignment: 10/10 Business Objective Links: 5/5 Implementation Paths: 5/5 ---------------------------- Total BDD-Ready Score: 100/100 (Target: >= 90) Status: READY FOR BDD GENERATION
  2. Traceability Matrix Update: # Update EARS-00_TRACEABILITY_MATRIX.md python ai_dev_ssd_flow/scripts/update_traceability_matrix.py \ --ears docs/03_EARS/EARS-NN_{slug}.md \ --matrix docs/03_EARS/EARS-00_TRACEABILITY_MATRIX.md

EARS Statement Types Reference

1. Event-Driven Requirements

Pattern: WHEN [trigger] THE [system] SHALL [action] WITHIN [constraint]

Keywords: "when", "upon", "triggered by", "on receipt of", "after"

Example:

WHEN user submits authentication request,
THE identity service SHALL validate credentials,
generate session token,
and return authentication response
WITHIN 100ms (@threshold: PRD.01.auth.response.p95).

Use Cases:

  • User-initiated actions
  • External system events
  • Timer-triggered operations
  • Message receipt handling

2. State-Driven Requirements

Pattern: WHILE [state] THE [system] SHALL [behavior] WITHIN [context]

Keywords: "while", "during", "as long as", "when in state"

Example:

WHILE user session is active,
THE session manager SHALL maintain heartbeat connection
and refresh token before expiration.

Use Cases:

  • Continuous monitoring
  • Persistent connections
  • Background processes
  • State maintenance

3. Unwanted Behavior Requirements

Pattern: IF [condition] THEN THE [system] SHALL [prevention/recovery]

Keywords: "if error", "when failure", "prevent", "handle", "recover from"

Example:

IF authentication timeout occurs,
THEN THE identity service SHALL retry authentication once
and log failure event
WITHIN 50ms (@threshold: PRD.01.auth.retry.timeout).

Use Cases:

  • Error handling
  • Failure recovery
  • Prevention mechanisms
  • Fallback behaviors

4. Ubiquitous Requirements

Pattern: THE [system] SHALL [behavior] for [scope]

Keywords: "always", "all", "every", "system-wide", "unconditionally"

Example:

THE logging service SHALL record all authentication events
with timestamp, user ID, and outcome status.

Use Cases:

  • System-wide policies
  • Compliance requirements
  • Universal behaviors
  • Cross-cutting concerns

Execution Modes

Single PRD Mode

Generate EARS from one PRD document.

# Example: Generate EARS from PRD-01
/doc-ears-autopilot PRD-01

Batch Mode

Generate EARS from multiple PRDs in sequence.

# Example: Generate EARS from all PRDs
/doc-ears-autopilot all --auto

Batch Configuration (config/ears_batch.yaml):

ears_generation:
  - id: "01"
    slug: "f1_iam_requirements"
    prd: "PRD-01"
    priority: 1

  - id: "02"
    slug: "f2_data_requirements"
    prd: "PRD-02"
    priority: 2

  - id: "03"
    slug: "f3_api_requirements"
    prd: "PRD-03"
    priority: 2

execution:
  parallel: false
  fail_fast: true

Dry Run Mode

Preview execution plan without generating files.

/doc-ears-autopilot PRD-01 --dry-run

Mode 4: Review Mode (v2.1)

Validate existing EARS documents without modification. Generates quality report with actionable recommendations.

Command:

# Review single EARS
/doc-ears-autopilot EARS-01 --review

# Review all EARS in directory
/doc-ears-autopilot docs/03_EARS/ --review --all

# Review with detailed report
/doc-ears-autopilot EARS-01 --review --verbose

Review Process:

flowchart TD
    A[Input: EARS Document] --> B[Load EARS Content]
    B --> C[Validate EARS Syntax]
    C --> D[Check BDD-Ready Score]
    D --> E[Verify Cumulative Tags]
    E --> F[Validate Element IDs]
    F --> G[Check Threshold References]
    G --> H[Validate Statement Atomicity]
    H --> I[Generate Review Report]
    I --> J{Issues Found?}
    J -->|Yes| K[Categorize Issues]
    K --> L[Generate Fix Recommendations]
    L --> M[Output Review Report]
    J -->|No| M

Review Report Template:

# EARS Review Report: EARS-NN_{slug}

## Summary
- **BDD-Ready Score**: NN% (✅/🟡/❌)
- **Total Issues**: N (E errors, W warnings)
- **Auto-Fixable**: N issues
- **Manual Review**: N issues

## Score Breakdown
| Category | Score | Max | Status |
|----------|-------|-----|--------|
| EARS Syntax Compliance | NN | 25 | ✅/🟡/❌ |
| Statement Atomicity | NN | 20 | ✅/🟡/❌ |
| Quantifiable Constraints | NN | 15 | ✅/🟡/❌ |
| BDD Translation Ready | NN | 15 | ✅/🟡/❌ |
| Traceability Tags | NN | 15 | ✅/🟡/❌ |
| Threshold References | NN | 10 | ✅/🟡/❌ |

## Issues by Category

### Auto-Fixable Issues
| Issue | Location | Fix Action |
|-------|----------|------------|
| Legacy ID pattern | EARS.01.25001 | Convert ER-001 → EARS.01.25001 |
| Missing @threshold | Line 45 | Add @threshold: PRD.01.xx.yy |

### Manual Review Required
| Issue | Location | Recommendation |
|-------|----------|----------------|
| Ambiguous term | Line 23 | Replace "fast" with quantified value |
| Compound requirement | Line 67 | Split into atomic statements |

Score Indicators:

  • ✅ Green (>=90%): BDD-Ready
  • 🟡 Yellow (70-89%): Needs improvement
  • ❌ Red (<70%): Significant issues

Review Configuration:

review_mode:
  enabled: true
  checks:
    - ears_syntax          # WHEN-THE-SHALL-WITHIN patterns
    - statement_atomicity  # One testable concept per statement
    - threshold_refs       # @threshold tag validation
    - cumulative_tags      # @brd, @prd presence
    - element_ids          # EARS.NN.25.SS format
    - quantifiable         # No ambiguous terms
  output:
    format: markdown       # markdown, json, html
    include_recommendations: true
    include_fix_commands: true

Mode 5: Fix Mode (v2.1)

Auto-repair existing EARS documents with backup and content preservation.

Command:

# Fix single EARS
/doc-ears-autopilot EARS-01 --fix

# Fix with backup
/doc-ears-autopilot EARS-01 --fix --backup

# Fix all EARS
/doc-ears-autopilot docs/03_EARS/ --fix --all

# Fix specific categories only
/doc-ears-autopilot EARS-01 --fix --only element_ids,thresholds

# Dry-run fix (preview changes)
/doc-ears-autopilot EARS-01 --fix --dry-run

Fix Process:

flowchart TD
    A[Input: EARS Document] --> B[Create Backup]
    B --> C[Load EARS Content]
    C --> D[Run Review Analysis]
    D --> E{Auto-Fixable Issues?}
    E -->|No| F[Report: No Fixes Needed]
    E -->|Yes| G[Apply Fixes by Category]

    subgraph FixCategories["Fix Categories"]
        G --> H[Fix Element IDs]
        H --> I[Fix EARS Syntax]
        I --> J[Fix Threshold References]
        J --> K[Add Missing Tags]
        K --> L[Fix Section Structure]
    end

    L --> M[Validate Fixed Document]
    M --> N{Validation Passed?}
    N -->|No| O[Rollback to Backup]
    O --> P[Report: Fix Failed]
    N -->|Yes| Q[Save Fixed Document]
    Q --> R[Generate Fix Report]

EARS-Specific Fix Categories:

CategoryDescriptionAuto-Fix Actions
element_idsElement ID formatConvert legacy patterns to EARS.NN.25.SS
ears_syntaxEARS statement formatAdd missing SHALL, fix WHEN-THE-SHALL structure
thresholds@threshold tagsAdd missing threshold references from PRD
cumulative_tagsTraceability tagsAdd missing @brd, @prd tags
sectionsSection structureAdd missing Quality Attributes, Traceability sections
atomicityStatement atomicityFlag compound statements (manual split required)
ambiguous_termsVague languageFlag "fast", "efficient", etc. (manual fix)

Element ID Migration (Layer 3):

Legacy PatternNew FormatExample
ER-XXXEARS.NN.25.0XXER-001 → EARS.01.25001
SR-XXXEARS.NN.25.1XXSR-101 → EARS.01.25101
UB-XXXEARS.NN.25.2XXUB-201 → EARS.01.25201
UQ-XXXEARS.NN.25.4XXUQ-401 → EARS.01.25401
QA-XXXEARS.NN.02.SSQA-001 → EARS.01.0201

Content Preservation Rules:

Content TypePreservation Rule
Custom EARS statementsNever delete, only enhance
Business contextPreserve all domain-specific content
Threshold valuesUpdate format, preserve values
PRD referencesValidate and update format only
Quality AttributesAdd missing, preserve existing
Traceability sectionAppend missing tags, keep existing

Fix Configuration:

fix_mode:
  enabled: true
  backup:
    enabled: true
    location: "tmp/backups/"
    timestamp: true
  fix_categories:
    element_ids: true      # Convert legacy ID patterns
    ears_syntax: true      # Fix WHEN-THE-SHALL structure
    thresholds: true       # Add @threshold references
    cumulative_tags: true  # Add @brd, @prd tags
    sections: true         # Add missing sections
    atomicity: false       # Manual only (flag but don't auto-fix)
    ambiguous_terms: false # Manual only (flag but don't auto-fix)
  validation:
    post_fix: true         # Validate after fixes
    rollback_on_fail: true # Restore backup if validation fails
  preserve:
    custom_statements: true
    domain_content: true
    threshold_values: true

Fix Report Template:

# EARS Fix Report: EARS-NN_{slug}

## Summary
- **Backup Created**: tmp/backups/EARS-NN_{slug}_20260209_143022.md
- **Issues Fixed**: N of M auto-fixable issues
- **Manual Review**: N issues flagged

## Fixes Applied

### Element ID Migration
| Original | Fixed | Location |
|----------|-------|----------|
| ER-001 | EARS.01.25001 | Line 45 |
| SR-101 | EARS.01.25101 | Line 78 |

### Threshold References Added
| Statement | Threshold Added |
|-----------|-----------------|
| EARS.01.25001 | @threshold: PRD.01.auth.p95 |

### Cumulative Tags Added
- @brd: BRD.01.0103 (added)
- @prd: PRD.01.0702 (verified)

## Manual Review Required

### Compound Statements (Split Required)
| Statement ID | Issue | Recommendation |
|--------------|-------|----------------|
| EARS.01.25015 | Multiple actions | Split into EARS.01.25015, .016 |

### Ambiguous Terms
| Location | Term | Suggested Replacement |
|----------|------|----------------------|
| Line 89 | "quickly" | "WITHIN 100ms" |
| Line 156 | "efficiently" | Remove or quantify |

## Validation Results
- **BDD-Ready Score**: Before: 78% → After: 94%
- **Syntax Errors**: Before: 5 → After: 0
- **Status**: ✅ All auto-fixes validated

Command Line Options (Review/Fix Modes):

OptionDefaultDescription
--reviewfalseRun review mode only
--fixfalseRun fix mode
--backuptrueCreate backup before fixing
--dry-runfalsePreview fixes without applying
--onlyallComma-separated fix categories
--verbosefalseDetailed output
--allfalseProcess all EARS in directory
--output-formatmarkdownReport format (markdown, json)

Configuration

Default Configuration

# config/ears_autopilot.yaml
ears_autopilot:
  version: "1.0"

  scoring:
    ears_ready_min: 90
    bdd_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_prd: 300  # seconds

  output:
    structure: auto  # auto, monolithic, sectioned
    size_threshold_lines: 800
    report_format: markdown

  validation:
    skip_validation: false
    fix_iterations_max: 3

  review:
    enabled: true
    check_syntax: true
    check_thresholds: true
    check_atomicity: true
    check_tags: true
    auto_fix_syntax: true

Command Line Options

OptionDefaultDescription
--min-ears-ready90Minimum EARS-Ready score (PRD)
--min-bdd-ready90Minimum BDD-Ready score (EARS)
--no-auto-fixfalseDisable auto-fix (manual only)
--continue-on-errorfalseContinue if one PRD fails
--dry-runfalsePreview execution plan only
--output-formatautoForce monolithic or sectioned output
--skip-reviewfalseSkip final review phase

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 PRD documents into chunks of maximum 3 at a time
  2. Sequential Chunk Processing: Process one chunk at a time, completing all EARS 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/5: Processing PRD-04, PRD-05, PRD-06")

Execution Pattern:

PRDs: PRD-01, PRD-02, PRD-03, PRD-04, PRD-05, PRD-06, PRD-07

Chunk 1: [PRD-01, PRD-02, PRD-03] → Process → Summary → Pause
Chunk 2: [PRD-04, PRD-05, PRD-06] → Process → Summary → Pause
Chunk 3: [PRD-07]                  → Process → Summary → Complete

Chunk Completion Summary Template:

Chunk N/M Complete:
├── Generated: EARS-01, EARS-02, EARS-03
├── BDD-Ready Scores: 94%, 92%, 91%
├── Status: All validated
└── Next: Continue with Chunk N+1? [Y/n]

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

Output Artifacts

Generated Files

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

FilePurposeLocation
EARS-NN_{slug}/EARS folder (ALWAYS created)docs/03_EARS/
EARS-NN_{slug}.mdMain EARS document (monolithic <20k tokens)docs/03_EARS/EARS-NN_{slug}/
EARS-NN.0_index.mdSection index (sectioned ≥20k tokens)docs/03_EARS/EARS-NN_{slug}/
EARS-NN.S_{section}.mdSection files (sectioned ≥20k tokens)docs/03_EARS/EARS-NN_{slug}/
EARS-NN.A_audit_report_v{VVV}.mdCombined audit report (preferred)docs/03_EARS/EARS-NN_{slug}/
EARS-NN.R_review_report_v{VVV}.mdReviewer report (legacy-compatible)docs/03_EARS/EARS-NN_{slug}/
EARS-NN.F_fix_report_v{VVV}.mdFix reportdocs/03_EARS/EARS-NN_{slug}/
.drift_cache.jsonDrift detection cachedocs/03_EARS/EARS-NN_{slug}/

Validation Reports

ReportPurposeLocation
ears_validation_report.jsonValidation resultstmp/
bdd_ready_score.jsonBDD-Ready breakdowntmp/
autopilot_log.mdExecution logtmp/

Error Handling

Error Categories

CategoryHandlingExample
PRD MissingAbort with messageNo PRD document found
EARS-Ready Below 90%Auto-fix PRD, retryPRD score at 85%
Validation FailureAuto-fix, retryMissing required section
BDD-Ready Below 90%Enhance statements, retryScore at 88%
Max Retries ExceededFlag for manual reviewPersistent validation errors

Recovery Actions

def handle_error(error_type: str, context: dict) -> Action:
    match error_type:
        case "PRD_MISSING":
            return Action.ABORT_WITH_MESSAGE
        case "EARS_READY_LOW":
            return Action.AUTO_FIX_PRD
        case "VALIDATION_FAILURE":
            if context["retry_count"] < 3:
                return Action.AUTO_FIX_RETRY
            return Action.FLAG_MANUAL_REVIEW
        case "BDD_READY_LOW":
            return Action.ENHANCE_STATEMENTS
        case _:
            return Action.FLAG_MANUAL_REVIEW

Integration Points

Pre-Execution Hooks

# Hook: pre_ears_generation
# Runs before EARS generation starts
./hooks/pre_ears_generation.sh

# Example: Validate PRD exists and is ready
if [ ! -d "docs/02_PRD/PRD-01_*" ]; then
  echo "ERROR: PRD-01 required"
  exit 1
fi

Post-Execution Hooks

# Hook: post_ears_generation
# Runs after EARS generation completes
./hooks/post_ears_generation.sh

# Example: Trigger BDD autopilot for validated EARS
if [ "$EARS_VALIDATED" = "true" ]; then
  /doc-bdd-autopilot "$EARS_ID"
fi

CI/CD Integration

# .github/workflows/ears_autopilot.yml
name: EARS Autopilot

on:
  push:
    paths:
      - 'docs/02_PRD/**'

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

      - name: Run EARS Autopilot
        run: |
          /doc-ears-autopilot all --auto

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

Quality Gates

Phase Gates

PhaseGateCriteria
Phase 1Input GateAt least one PRD document found
Phase 2Readiness GatePRD EARS-Ready Score >= 90%
Phase 3Generation GateAll statement categories populated
Phase 4Validation GateBDD-Ready Score >= 90%
Phase 5Review GateNo blocking issues remaining

Blocking vs Non-Blocking

Issue TypeBlockingAction
Missing required sectionYesMust fix before proceeding
BDD-Ready Score < 90%YesMust enhance statements
Invalid EARS syntaxYesMust correct statement format
Missing @threshold tagsNoLog warning, continue
Style/formatting issuesNoAuto-fix, continue

Validation Checklist

After autopilot completion:

  • All target EARS documents generated
  • Each EARS has BDD-Ready score >= 90%
  • Traceability matrix updated (EARS-00_TRACEABILITY_MATRIX.md)
  • Each EARS references upstream PRD with @prd tags
  • Each EARS references upstream BRD with @brd tags
  • All statements use WHEN-THE-SHALL-WITHIN syntax
  • All constraints have @threshold references
  • No ambiguous terms in statements
  • Each statement is atomic (one testable concept)
  • Quality Attributes section uses tabular format
  • Element IDs use EARS.NN.25.SS format
  • Source Document has single @prd value

Quick Reference

InputOutputKey Metric
PRD(s)EARS(s)BDD-Ready >= 90%

Usage:

/doc-ears-autopilot <PRD-LIST> [OPTIONS]

Common Commands:

# Single PRD
/doc-ears-autopilot PRD-01

# All PRDs (automatic)
/doc-ears-autopilot all --auto

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

# Resume after failure
/doc-ears-autopilot resume

Related Resources

Skills (Delegated)

  • EARS Skill: .claude/skills/doc-ears/SKILL.md - EARS creation rules and WHEN-THE-SHALL syntax
  • EARS Validator Skill: .claude/skills/doc-ears-validator/SKILL.md - Validation rules and error codes
  • PRD Validator Skill: .claude/skills/doc-prd-validator/SKILL.md - PRD 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

  • EARS Template: ai_dev_ssd_flow/03_EARS/EARS-MVP-TEMPLATE.md
  • EARS Schema: ai_dev_ssd_flow/03_EARS/EARS_MVP_SCHEMA.yaml
  • EARS Creation Rules: ai_dev_ssd_flow/03_EARS/EARS-MVP-TEMPLATE.md
  • EARS Validation Rules: ai_dev_ssd_flow/03_EARS/EARS_MVP_SCHEMA.yaml

Section Templates (for documents >800 lines)

  • Index template: ai_dev_ssd_flow/03_EARS/EARS-SECTION-0-TEMPLATE.md
  • Content template: ai_dev_ssd_flow/03_EARS/EARS-SECTION-TEMPLATE.md

Framework References

  • SDD Workflow: ai_dev_ssd_flow/SPEC_DRIVEN_DEVELOPMENT_GUIDE.md
  • MVP Autopilot: ai_dev_ssd_flow/AUTOPILOT/MVP_AUTOPILOT.md
  • PRD Autopilot Skill: .claude/skills/doc-prd-autopilot/SKILL.md
  • BRD Autopilot Skill: .claude/skills/doc-brd-autopilot/SKILL.md

Review Document Standards (v2.2)

IMPORTANT: Audit/review reports generated by this autopilot are formal project documents.

See: .claude/skills/REVIEW_DOCUMENT_STANDARDS.md for complete standards.

Quick Reference

RequirementValue
Storage LocationSame folder as reviewed EARS
File NameEARS-NN.A_audit_report_vNNN.md (preferred), EARS-NN.R_review_report_vNNN.md (legacy)
YAML FrontmatterMANDATORY - see shared standards
Parent ReferenceMANDATORY - link to EARS document

Example Location:

docs/03_EARS/
├── EARS-03_f3_observability.md
├── EARS-03.A_audit_report_v001.md    # ← Preferred report stored here
└── EARS-03.R_review_report_v001.md    # ← Legacy-compatible reviewer report

Version History

VersionDateChanges
2.42026-02-26Migrated frontmatter to metadata; switched active references to ai_dev_ssd_flow; integrated doc-ears-audit with .A_audit_report preferred and .R_review_report legacy compatibility
2.32026-02-11Smart Document Detection: Added automatic document type recognition; Self-type input (EARS-NN) triggers review mode; Upstream-type input (PRD-NN) triggers generate-if-missing or find-and-review; Updated input patterns table with type-based actions
2.22026-02-10Review & Fix Cycle: Replaced Phase 5 (Final Review) with iterative Review -> Fix cycle using doc-ears-reviewer and doc-ears-fixer; Added doc-ears-fixer skill dependency; Added iteration control with max 3 cycles and 90% target score; Added Review Document Standards
2.12026-02-09Added Mode 4: Review Mode for validation-only analysis with visual score indicators; Added Mode 5: Fix Mode for auto-repair with backup and content preservation; Element ID migration (ER-XXX→EARS.NN.25.0XX, SR-XXX→EARS.NN.25.1XX, UB-XXX→EARS.NN.25.2XX, UQ-XXX→EARS.NN.25.4XX)
1.02026-02-08Initial skill creation with 5-phase workflow; Integrated doc-naming, doc-ears, doc-ears-validator, quality-advisor skills; Added EARS statement type reference (Event-Driven, State-Driven, Unwanted Behavior, Ubiquitous); Added requirement categorization and ID range mapping

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.86%
按下载量换算82

Claude

29.74%
按下载量换算66

Cursor

17.77%
按下载量换算39

Gemini CLI

10.05%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

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

安装前确认

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

来源信息

继续浏览同类 Skills