qcsd-refinement-swarm

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

QCSD Refinement Swarm v1.0

QCSD梳理Swarm v1.0

Shift-left quality engineering swarm for Sprint Refinement sessions.

面向Sprint梳理会议的左移质量工程Swarm。

Overview

概述

The Refinement Swarm takes user stories that passed Ideation and prepares them for Sprint commitment. Where the Ideation Swarm asks "Should we build this?" using HTSM quality criteria, the Refinement Swarm asks "How should we test this?" using SFDIPOT product factors, BDD scenarios, and INVEST validation.
梳理Swarm会接收已通过构思阶段的用户故事,为Sprint交付承诺做准备。构思Swarm基于HTSM质量标准判断“我们是否应该构建这个需求”,而梳理Swarm则基于SFDIPOT产品因子、BDD场景和INVEST验证规则回答“我们应该如何测试这个需求”。

Key Differentiators from Ideation Swarm

与构思Swarm的核心差异

DimensionIdeation SwarmRefinement Swarm
FrameworkHTSM v6.3 (10 categories)SFDIPOT (7 factors, 37 subcategories)
Agents9 (3 core + 6 conditional)10 (3 core + 6 conditional + 1 transformation)
Core OutputQuality Criteria HTML reportBDD Gherkin scenarios
DecisionGO / CONDITIONAL / NO-GOREADY / CONDITIONAL / NOT-READY
FlagsHAS_UI, HAS_SECURITY, HAS_UX, HAS_MIDDLEWARE, HAS_SAP_INTEGRATION, HAS_AUTHORIZATIONHAS_API, HAS_REFACTORING, HAS_DEPENDENCIES, HAS_SECURITY, HAS_MIDDLEWARE, HAS_SAP_INTEGRATION, HAS_AUTHORIZATION
PhasePI Planning / Sprint PlanningSprint Refinement
Final StepReport generationTest idea rewriter transformation

维度构思Swarm梳理Swarm
框架HTSM v6.3 (10个分类)SFDIPOT (7个因子,37个子分类)
Agent数量9个(3个核心 + 6个条件触发)10个(3个核心 + 6个条件触发 + 1个转换Agent)
核心输出质量标准HTML报告BDD Gherkin场景
决策结果GO / CONDITIONAL / NO-GOREADY / CONDITIONAL / NOT-READY
标识HAS_UI, HAS_SECURITY, HAS_UX, HAS_MIDDLEWARE, HAS_SAP_INTEGRATION, HAS_AUTHORIZATIONHAS_API, HAS_REFACTORING, HAS_DEPENDENCIES, HAS_SECURITY, HAS_MIDDLEWARE, HAS_SAP_INTEGRATION, HAS_AUTHORIZATION
所属阶段PI规划 / Sprint规划Sprint梳理
最终步骤报告生成测试思路重写转换

ENFORCEMENT RULES - READ FIRST

强制执行规则 - 请优先阅读

These rules are NON-NEGOTIABLE. Violation means skill execution failure.
RuleEnforcement
E1You MUST spawn ALL THREE core agents (qe-product-factors-assessor, qe-bdd-generator, qe-requirements-validator) in Phase 2. No exceptions.
E2You MUST put all parallel Task calls in a SINGLE message.
E3You MUST STOP and WAIT after each batch. No proceeding early.
E4You MUST spawn conditional agents if flags are TRUE. No skipping.
E5You MUST apply READY/CONDITIONAL/NOT-READY logic exactly as specified in Phase 5.
E6You MUST generate the full report structure. No abbreviated versions.
E7Each agent MUST read its reference files before analysis.
E8You MUST apply qe-test-idea-rewriter transformation on ALL test ideas in Phase 8. Always.
E9You MUST execute Phase 7 learning persistence. Store refinement findings to memory BEFORE Phase 8. No skipping.
PROHIBITED BEHAVIORS:
  • Summarizing instead of spawning agents
  • Skipping agents "for brevity"
  • Proceeding before background tasks complete
  • Providing your own analysis instead of spawning specialists
  • Omitting report sections
  • Using placeholder text like "[details here]"
  • Skipping the test idea rewriter transformation
  • Skipping learning persistence (Phase 7) or treating it as optional
  • Generating BDD scenarios yourself instead of using qe-bdd-generator

这些规则不可协商,违反将导致技能执行失败。
规则执行要求
E1你必须在阶段2启动全部3个核心Agent(qe-product-factors-assessor、qe-bdd-generator、qe-requirements-validator),无例外。
E2你必须将所有并行任务调用放在同一条消息中。
E3每批次执行完成后你必须停止等待,不得提前推进。
E4如果对应标识为TRUE,你必须启动条件Agent,不得跳过。
E5你必须严格按照阶段5的规则执行READY/CONDITIONAL/NOT-READY判断逻辑。
E6你必须生成完整的报告结构,不得输出精简版本。
E7每个Agent在分析前必须读取其参考文件。
E8你必须在阶段8对所有测试思路执行qe-test-idea-rewriter转换,无例外。
E9你必须执行阶段7的学习持久化操作,在阶段8之前将梳理结果存储到内存中,不得跳过。
禁止行为:
  • 仅输出总结而不启动Agent
  • 以“精简”为由跳过Agent启动
  • 后台任务未完成就推进流程
  • 输出你自己的分析结果而不启动专业Agent处理
  • 省略报告章节
  • 使用“[此处填写详情]”这类占位文本
  • 跳过测试思路重写转换步骤
  • 跳过学习持久化(阶段7)或将其视为可选步骤
  • 自行生成BDD场景而不使用qe-bdd-generator

PHASE 1: Analyze Story Content (Flag Detection)

阶段1:分析故事内容(标识检测)

MANDATORY: You must complete this analysis before Phase 2.
Scan the story content and SET these flags. Do not skip any flag.
强制要求:你必须在进入阶段2前完成本分析。
扫描故事内容并设置以下标识,不得跳过任何标识。

Flag Detection (Check ALL SEVEN)

标识检测(检查全部7个标识)

HAS_API = FALSE
  Set TRUE if story contains ANY of: API, endpoint, REST, GraphQL, contract,
  integration, webhook, microservice, service-to-service, HTTP, gRPC,
  request, response, payload, schema, OpenAPI, Swagger, consumer, provider

HAS_REFACTORING = FALSE
  Set TRUE if story contains ANY of: refactor, rearchitect, rewrite,
  migrate, modernize, tech debt, legacy, restructure, decouple,
  consolidate, simplify, extract, decompose, re-engineer

HAS_DEPENDENCIES = FALSE
  Set TRUE if story contains ANY of: dependency, coupling, module,
  package, library, import, shared, cross-team, upstream, downstream,
  third-party, external, vendor, SDK, plugin, middleware

HAS_SECURITY = FALSE
  Set TRUE if story contains ANY of: auth, security, credential, token,
  encrypt, PII, compliance, password, login, session, OAuth, JWT,
  permission, role, access control, RBAC, sensitive, private

HAS_MIDDLEWARE = FALSE
  Set TRUE if story contains ANY of: middleware, ESB, message broker, MQ,
  Kafka, RabbitMQ, integration bus, API gateway, message queue, pub/sub

HAS_SAP_INTEGRATION = FALSE
  Set TRUE if story contains ANY of: SAP, RFC, BAPI, IDoc, OData,
  S/4HANA, EWM, ECC, ABAP, CDS view, Fiori

HAS_AUTHORIZATION = FALSE
  Set TRUE if story contains ANY of: SoD, segregation of duties,
  role conflict, authorization object, T-code, user role,
  access control matrix, GRC
HAS_API = FALSE
  Set TRUE if story contains ANY of: API, endpoint, REST, GraphQL, contract,
  integration, webhook, microservice, service-to-service, HTTP, gRPC,
  request, response, payload, schema, OpenAPI, Swagger, consumer, provider

HAS_REFACTORING = FALSE
  Set TRUE if story contains ANY of: refactor, rearchitect, rewrite,
  migrate, modernize, tech debt, legacy, restructure, decouple,
  consolidate, simplify, extract, decompose, re-engineer

HAS_DEPENDENCIES = FALSE
  Set TRUE if story contains ANY of: dependency, coupling, module,
  package, library, import, shared, cross-team, upstream, downstream,
  third-party, external, vendor, SDK, plugin, middleware

HAS_SECURITY = FALSE
  Set TRUE if story contains ANY of: auth, security, credential, token,
  encrypt, PII, compliance, password, login, session, OAuth, JWT,
  permission, role, access control, RBAC, sensitive, private

HAS_MIDDLEWARE = FALSE
  Set TRUE if story contains ANY of: middleware, ESB, message broker, MQ,
  Kafka, RabbitMQ, integration bus, API gateway, message queue, pub/sub

HAS_SAP_INTEGRATION = FALSE
  Set TRUE if story contains ANY of: SAP, RFC, BAPI, IDoc, OData,
  S/4HANA, EWM, ECC, ABAP, CDS view, Fiori

HAS_AUTHORIZATION = FALSE
  Set TRUE if story contains ANY of: SoD, segregation of duties,
  role conflict, authorization object, T-code, user role,
  access control matrix, GRC

Validation Checkpoint

验证检查点

Before proceeding to Phase 2, confirm:
+-- I have read the entire story content
+-- I have evaluated ALL SEVEN flags
+-- I have recorded which flags are TRUE
+-- I understand which conditional agents will be needed
DO NOT proceed to Phase 2 until all checkboxes are confirmed.
进入阶段2之前,请确认:
+-- 我已阅读完整的故事内容
+-- 我已评估全部7个标识
+-- 我已记录所有值为TRUE的标识
+-- 我清楚需要启动哪些条件Agent
确认所有检查项之前,不得进入阶段2。

MANDATORY: Output Flag Detection Results

强制要求:输出标识检测结果

You MUST output flag detection results before proceeding:
+-------------------------------------------------------------+
|                    FLAG DETECTION RESULTS                    |
+-------------------------------------------------------------+
|                                                             |
|  HAS_API:          [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_REFACTORING:  [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_DEPENDENCIES: [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_SECURITY:     [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_MIDDLEWARE:       [TRUE/FALSE]                         |
|  Evidence:             [what triggered it - specific]       |
|                                                             |
|  HAS_SAP_INTEGRATION: [TRUE/FALSE]                         |
|  Evidence:             [what triggered it - specific]       |
|                                                             |
|  HAS_AUTHORIZATION:   [TRUE/FALSE]                         |
|  Evidence:             [what triggered it - specific]       |
|                                                             |
|  EXPECTED AGENTS:                                           |
|  - Core: 3 (always)                                         |
|  - Conditional: [count based on TRUE flags]                 |
|  - Transformation: 1 (always)                               |
|  - TOTAL: [3 + conditional count + 1]                       |
|                                                             |
+-------------------------------------------------------------+
DO NOT proceed to Phase 2 without outputting flag detection results.

你必须在推进流程前输出标识检测结果:
+-------------------------------------------------------------+
|                    FLAG DETECTION RESULTS                    |
+-------------------------------------------------------------+
|                                                             |
|  HAS_API:          [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_REFACTORING:  [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_DEPENDENCIES: [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_SECURITY:     [TRUE/FALSE]                             |
|  Evidence:         [what triggered it - specific patterns]  |
|                                                             |
|  HAS_MIDDLEWARE:       [TRUE/FALSE]                         |
|  Evidence:             [what triggered it - specific]       |
|                                                             |
|  HAS_SAP_INTEGRATION: [TRUE/FALSE]                         |
|  Evidence:             [what triggered it - specific]       |
|                                                             |
|  HAS_AUTHORIZATION:   [TRUE/FALSE]                         |
|  Evidence:             [what triggered it - specific]       |
|                                                             |
|  EXPECTED AGENTS:                                           |
|  - Core: 3 (always)                                         |
|  - Conditional: [count based on TRUE flags]                 |
|  - Transformation: 1 (always)                               |
|  - TOTAL: [3 + conditional count + 1]                       |
|                                                             |
+-------------------------------------------------------------+
未输出标识检测结果之前,不得进入阶段2。

PHASE 2: Spawn Core Agents (PARALLEL BATCH 1)

阶段2:启动核心Agent(并行批次1)

CRITICAL ENFORCEMENT

关键执行要求

+-------------------------------------------------------------+
|  YOU MUST INCLUDE ALL THREE TASK CALLS IN YOUR NEXT MESSAGE  |
|                                                              |
|  - Task 1: qe-product-factors-assessor                      |
|  - Task 2: qe-bdd-generator                                 |
|  - Task 3: qe-requirements-validator                         |
|                                                              |
|  If your message contains fewer than 3 Task calls, you have |
|  FAILED this phase. Start over.                              |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
|  你必须在下一条消息中包含全部3个任务调用  |
|                                                              |
|  - Task 1: qe-product-factors-assessor                      |
|  - Task 2: qe-bdd-generator                                 |
|  - Task 3: qe-requirements-validator                         |
|                                                              |
|  If your message contains fewer than 3 Task calls, you have |
|  FAILED this phase. Start over.                              |
+-------------------------------------------------------------+

Domain Context

领域上下文

AgentDomainMCP Tool Mapping
qe-product-factors-assessorrequirements-validation
requirements_validate
qe-bdd-generatorrequirements-validation
test_generate_enhanced
qe-requirements-validatorrequirements-validation
requirements_validate
Agent领域MCP工具映射
qe-product-factors-assessorrequirements-validation
requirements_validate
qe-bdd-generatorrequirements-validation
test_generate_enhanced
qe-requirements-validatorrequirements-validation
requirements_validate

Agent 1: Product Factors Assessor (SFDIPOT)

Agent 1:产品因子评估器(SFDIPOT)

This agent MUST analyze all 7 SFDIPOT factors with 37 subcategories. Fewer is a failure.
Task({
  description: "SFDIPOT Product Factors analysis",
  prompt: `You are qe-product-factors-assessor. Your output quality is being audited.
该Agent必须分析全部7个SFDIPOT因子及37个子分类,数量不足视为执行失败。
Task({
  description: "SFDIPOT Product Factors analysis",
  prompt: `You are qe-product-factors-assessor. Your output quality is being audited.

MANDATORY FIRST STEPS (DO NOT SKIP)

MANDATORY FIRST STEPS (DO NOT SKIP)

  1. READ this template file FIRST - your output MUST follow this structure: .claude/agents/v3/helpers/product-factors/sfdipot-reference-template.html
  2. READ the story content below IN FULL before starting analysis.
  1. READ this template file FIRST - your output MUST follow this structure: .claude/agents/v3/helpers/product-factors/sfdipot-reference-template.html
  2. READ the story content below IN FULL before starting analysis.

STORY TO ANALYZE

STORY TO ANALYZE

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE - DO NOT SUMMARIZE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE - DO NOT SUMMARIZE] === STORY CONTENT END ===

REQUIRED OUTPUT (ALL SECTIONS MANDATORY)

REQUIRED OUTPUT (ALL SECTIONS MANDATORY)

You MUST analyze ALL 7 SFDIPOT product factors. For each factor, analyze its subcategories and assign a priority.
You MUST analyze ALL 7 SFDIPOT product factors. For each factor, analyze its subcategories and assign a priority.

Factor 1: STRUCTURE (Internal composition)

Factor 1: STRUCTURE (Internal composition)

Subcategories to assess:
  • Code architecture and module organization
  • Database schema and data models
  • File and directory structure
  • Configuration hierarchy
  • Component relationships Priority: P0/P1/P2/P3 with justification
Subcategories to assess:
  • Code architecture and module organization
  • Database schema and data models
  • File and directory structure
  • Configuration hierarchy
  • Component relationships Priority: P0/P1/P2/P3 with justification

Factor 2: FUNCTION (What it does)

Factor 2: FUNCTION (What it does)

Subcategories to assess:
  • Core business logic
  • Input processing and validation
  • Output generation and formatting
  • Error handling and recovery
  • State management and transitions Priority: P0/P1/P2/P3 with justification
Subcategories to assess:
  • Core business logic
  • Input processing and validation
  • Output generation and formatting
  • Error handling and recovery
  • State management and transitions Priority: P0/P1/P2/P3 with justification

Factor 3: DATA (What it processes)

Factor 3: DATA (What it processes)

Subcategories to assess:
  • Data types and formats
  • Data flow and transformations
  • Data persistence and storage
  • Data validation rules
  • Data volume and growth patterns
  • Data integrity constraints Priority: P0/P1/P2/P3 with justification
Subcategories to assess:
  • Data types and formats
  • Data flow and transformations
  • Data persistence and storage
  • Data validation rules
  • Data volume and growth patterns
  • Data integrity constraints Priority: P0/P1/P2/P3 with justification

Factor 4: INTERFACES (How it connects)

Factor 4: INTERFACES (How it connects)

Subcategories to assess:
  • User interfaces (if applicable)
  • API contracts and endpoints
  • Event/message interfaces
  • File-based interfaces
  • Hardware interfaces (if applicable)
  • Inter-system communication protocols Priority: P0/P1/P2/P3 with justification
Subcategories to assess:
  • User interfaces (if applicable)
  • API contracts and endpoints
  • Event/message interfaces
  • File-based interfaces
  • Hardware interfaces (if applicable)
  • Inter-system communication protocols Priority: P0/P1/P2/P3 with justification

Factor 5: PLATFORM (What it depends on)

Factor 5: PLATFORM (What it depends on)

Subcategories to assess:
  • Operating system dependencies
  • Runtime environment (Node, JVM, etc.)
  • Cloud provider services
  • Container/orchestration platform
  • Browser/client platform
  • Network infrastructure Priority: P0/P1/P2/P3 with justification
Subcategories to assess:
  • Operating system dependencies
  • Runtime environment (Node, JVM, etc.)
  • Cloud provider services
  • Container/orchestration platform
  • Browser/client platform
  • Network infrastructure Priority: P0/P1/P2/P3 with justification

Factor 6: OPERATIONS (How it runs in production)

Factor 6: OPERATIONS (How it runs in production)

Subcategories to assess:
  • Deployment process
  • Monitoring and alerting
  • Logging and observability
  • Backup and recovery
  • Scaling and capacity
  • Incident response procedures Priority: P0/P1/P2/P3 with justification
Subcategories to assess:
  • Deployment process
  • Monitoring and alerting
  • Logging and observability
  • Backup and recovery
  • Scaling and capacity
  • Incident response procedures Priority: P0/P1/P2/P3 with justification

Factor 7: TIME (How it changes)

Factor 7: TIME (How it changes)

Subcategories to assess:
  • Scheduling and time-based triggers
  • Temporal data (timestamps, durations)
  • Concurrency and race conditions
  • Timeout and retry behavior
  • Historical data and versioning
  • Time zone handling Priority: P0/P1/P2/P3 with justification
Subcategories to assess:
  • Scheduling and time-based triggers
  • Temporal data (timestamps, durations)
  • Concurrency and race conditions
  • Timeout and retry behavior
  • Historical data and versioning
  • Time zone handling Priority: P0/P1/P2/P3 with justification

SCORING REQUIREMENTS

SCORING REQUIREMENTS

For each of the 7 factors, provide:
FieldRequirement
Factor NameOne of the 7 SFDIPOT factors
PriorityP0, P1, P2, or P3 with justification
Subcategories AssessedCount of subcategories analyzed
Coverage DepthShallow / Adequate / Deep
Key FindingsTop 3 findings for this factor
Test Focus AreasSpecific areas requiring test coverage
For each of the 7 factors, provide:
FieldRequirement
Factor NameOne of the 7 SFDIPOT factors
PriorityP0, P1, P2, or P3 with justification
Subcategories AssessedCount of subcategories analyzed
Coverage DepthShallow / Adequate / Deep
Key FindingsTop 3 findings for this factor
Test Focus AreasSpecific areas requiring test coverage

OUTPUT FORMAT

OUTPUT FORMAT

Save your complete analysis in Markdown to: ${OUTPUT_FOLDER}/02-sfdipot-analysis.md
Use the Write tool to save BEFORE completing. Report MUST be complete - no placeholders.
Save your complete analysis in Markdown to: ${OUTPUT_FOLDER}/02-sfdipot-analysis.md
Use the Write tool to save BEFORE completing. Report MUST be complete - no placeholders.

VALIDATION BEFORE SUBMITTING

VALIDATION BEFORE SUBMITTING

+-- Did I read the SFDIPOT reference template? +-- Did I analyze all 7 factors? +-- Did I assess at least 37 subcategories total? +-- Does every factor have a priority with justification? +-- Did I identify test focus areas for each factor? +-- Did I save the report to the correct output path?`, subagent_type: "qe-product-factors-assessor", run_in_background: true })
undefined
+-- Did I read the SFDIPOT reference template? +-- Did I analyze all 7 factors? +-- Did I assess at least 37 subcategories total? +-- Does every factor have a priority with justification? +-- Did I identify test focus areas for each factor? +-- Did I save the report to the correct output path?`, subagent_type: "qe-product-factors-assessor", run_in_background: true })
undefined

Agent 2: BDD Scenario Generator

Agent 2:BDD场景生成器

This agent MUST generate at least 5 Gherkin scenarios. Fewer is a failure.
Task({
  description: "BDD Gherkin scenario generation",
  prompt: `You are qe-bdd-generator. Your output quality is being audited.
该Agent必须生成至少5个Gherkin场景,数量不足视为执行失败。
Task({
  description: "BDD Gherkin scenario generation",
  prompt: `You are qe-bdd-generator. Your output quality is being audited.

METHODOLOGY

METHODOLOGY

Apply Behaviour-Driven Development (BDD) principles to generate comprehensive Gherkin scenarios from the story and its acceptance criteria.
Apply Behaviour-Driven Development (BDD) principles to generate comprehensive Gherkin scenarios from the story and its acceptance criteria.

STORY TO ANALYZE

STORY TO ANALYZE

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE - DO NOT SUMMARIZE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE - DO NOT SUMMARIZE] === STORY CONTENT END ===

REQUIRED OUTPUT (ALL SECTIONS MANDATORY)

REQUIRED OUTPUT (ALL SECTIONS MANDATORY)

1. Feature File Header

1. Feature File Header

Write a proper Gherkin feature header:
Feature: [Feature name derived from story] As a [role from story] I want [capability from story] So that [business value from story]
Write a proper Gherkin feature header:
Feature: [Feature name derived from story] As a [role from story] I want [capability from story] So that [business value from story]

2. Scenario Categories (ALL MANDATORY)

2. Scenario Categories (ALL MANDATORY)

You MUST generate scenarios in ALL of these categories:
You MUST generate scenarios in ALL of these categories:

Category A: Happy Path Scenarios (minimum 2)

Category A: Happy Path Scenarios (minimum 2)

  • Primary success flow
  • Variant success flows
  • Primary success flow
  • Variant success flows

Category B: Error/Negative Path Scenarios (minimum 2)

Category B: Error/Negative Path Scenarios (minimum 2)

  • Invalid input handling
  • System error handling
  • Boundary violations
  • Invalid input handling
  • System error handling
  • Boundary violations

Category C: Boundary/Edge Case Scenarios (minimum 1)

Category C: Boundary/Edge Case Scenarios (minimum 1)

  • Minimum and maximum values
  • Empty states
  • Null/undefined handling
  • Minimum and maximum values
  • Empty states
  • Null/undefined handling

Category D: Security Scenarios (if HAS_SECURITY flag is TRUE)

Category D: Security Scenarios (if HAS_SECURITY flag is TRUE)

  • Authentication failures
  • Authorization violations
  • Data protection scenarios
  • Authentication failures
  • Authorization violations
  • Data protection scenarios

3. Gherkin Format Requirements

3. Gherkin Format Requirements

EVERY scenario MUST follow this structure:
Scenario: [Descriptive name] Given [precondition with specific data] And [additional precondition if needed] When [action with specific input] And [additional action if needed] Then [expected outcome with specific assertion] And [additional assertion if needed]
RULES:
  • Use concrete data, not abstract descriptions
  • Include data tables where 3+ similar checks apply
  • Use Scenario Outline + Examples for parameterized cases
  • Every Then step must be verifiable/assertable
  • No vague steps like "the system works correctly"
EVERY scenario MUST follow this structure:
Scenario: [Descriptive name] Given [precondition with specific data] And [additional precondition if needed] When [action with specific input] And [additional action if needed] Then [expected outcome with specific assertion] And [additional assertion if needed]
RULES:
  • Use concrete data, not abstract descriptions
  • Include data tables where 3+ similar checks apply
  • Use Scenario Outline + Examples for parameterized cases
  • Every Then step must be verifiable/assertable
  • No vague steps like "the system works correctly"

4. Scenario Outline with Examples (minimum 1)

4. Scenario Outline with Examples (minimum 1)

At least one scenario MUST use Scenario Outline:
Scenario Outline: [Parameterized scenario name] Given [precondition with <parameter>] When [action with <input>] Then [expected <outcome>]
Examples:
  | parameter | input | outcome |
  | value1    | val1  | result1 |
  | value2    | val2  | result2 |
  | value3    | val3  | result3 |
At least one scenario MUST use Scenario Outline:
Scenario Outline: [Parameterized scenario name] Given [precondition with <parameter>] When [action with <input>] Then [expected <outcome>]
Examples:
  | parameter | input | outcome |
  | value1    | val1  | result1 |
  | value2    | val2  | result2 |
  | value3    | val3  | result3 |

5. Traceability Matrix

5. Traceability Matrix

Map each scenario back to acceptance criteria:
ScenarioAcceptance CriterionCategory
Scenario 1AC-1Happy Path
Scenario 2AC-1, AC-3Error Path
.........
Map each scenario back to acceptance criteria:
ScenarioAcceptance CriterionCategory
Scenario 1AC-1Happy Path
Scenario 2AC-1, AC-3Error Path
.........

6. Summary Metrics

6. Summary Metrics

MetricValue
Total Scenarios__
Happy Path__
Error Path__
Boundary__
Security__
Scenario Outlines__
Total Examples__
AC Coverage__%
MINIMUM: 5 total scenarios. Target: 10+ scenarios.
MetricValue
Total Scenarios__
Happy Path__
Error Path__
Boundary__
Security__
Scenario Outlines__
Total Examples__
AC Coverage__%
MINIMUM: 5 total scenarios. Target: 10+ scenarios.

OUTPUT FORMAT

OUTPUT FORMAT

Save your complete analysis in Markdown (with embedded Gherkin) to: ${OUTPUT_FOLDER}/03-bdd-scenarios.md
Use the Write tool to save BEFORE completing. Report MUST be complete - no placeholders.
Save your complete analysis in Markdown (with embedded Gherkin) to: ${OUTPUT_FOLDER}/03-bdd-scenarios.md
Use the Write tool to save BEFORE completing. Report MUST be complete - no placeholders.

VALIDATION BEFORE SUBMITTING

VALIDATION BEFORE SUBMITTING

+-- Did I generate at least 5 scenarios? +-- Did I cover Happy Path, Error Path, and Boundary categories? +-- Does every scenario have concrete data (not abstract)? +-- Did I include at least one Scenario Outline with Examples? +-- Did I map scenarios back to acceptance criteria? +-- Did I calculate AC coverage percentage? +-- Did I save the report to the correct output path?`, subagent_type: "qe-bdd-generator", run_in_background: true })
undefined
+-- Did I generate at least 5 scenarios? +-- Did I cover Happy Path, Error Path, and Boundary categories? +-- Does every scenario have concrete data (not abstract)? +-- Did I include at least one Scenario Outline with Examples? +-- Did I map scenarios back to acceptance criteria? +-- Did I calculate AC coverage percentage? +-- Did I save the report to the correct output path?`, subagent_type: "qe-bdd-generator", run_in_background: true })
undefined

Agent 3: Requirements Validator (INVEST)

Agent 3:需求验证器(INVEST)

This agent MUST provide an INVEST completeness score 0-100. No ranges.
Task({
  description: "INVEST requirements validation and testability scoring",
  prompt: `You are qe-requirements-validator. Your output quality is being audited.
该Agent必须输出0-100之间的INVEST完整性得分,不得输出区间值。
Task({
  description: "INVEST requirements validation and testability scoring",
  prompt: `You are qe-requirements-validator. Your output quality is being audited.

METHODOLOGY

METHODOLOGY

Apply INVEST validation and testability-scoring principles.
Apply INVEST validation and testability-scoring principles.

STORY AND ACCEPTANCE CRITERIA TO VALIDATE

STORY AND ACCEPTANCE CRITERIA TO VALIDATE

=== STORY CONTENT START === [PASTE THE COMPLETE STORY + ACCEPTANCE CRITERIA HERE - DO NOT SUMMARIZE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY + ACCEPTANCE CRITERIA HERE - DO NOT SUMMARIZE] === STORY CONTENT END ===

REQUIRED OUTPUT (ALL SECTIONS MANDATORY)

REQUIRED OUTPUT (ALL SECTIONS MANDATORY)

1. INVEST Validation (MANDATORY - ALL SIX CRITERIA)

1. INVEST Validation (MANDATORY - ALL SIX CRITERIA)

Score each INVEST criterion 0-100:
CriterionScoreEvidenceIssues
IndependentX/100Can this story be developed and tested independently of other stories?[issues found]
NegotiableX/100Is the story expressed as intent (not implementation detail)?[issues found]
ValuableX/100Does it deliver clear value to users or the business?[issues found]
EstimableX/100Can the team estimate effort with confidence?[issues found]
SmallX/100Can it be completed in a single sprint?[issues found]
TestableX/100Are there clear, verifiable acceptance criteria?[issues found]
INVEST COMPLETENESS SCORE: XX/100 (average of all six criteria)
Score each INVEST criterion 0-100:
CriterionScoreEvidenceIssues
IndependentX/100Can this story be developed and tested independently of other stories?[issues found]
NegotiableX/100Is the story expressed as intent (not implementation detail)?[issues found]
ValuableX/100Does it deliver clear value to users or the business?[issues found]
EstimableX/100Can the team estimate effort with confidence?[issues found]
SmallX/100Can it be completed in a single sprint?[issues found]
TestableX/100Are there clear, verifiable acceptance criteria?[issues found]
INVEST COMPLETENESS SCORE: XX/100 (average of all six criteria)

2. Acceptance Criteria Assessment

2. Acceptance Criteria Assessment

For EACH acceptance criterion:
AC IDTextTestable?IssuesSuggested Rewrite
AC-1[original text]Yes/No[issues][improved version if needed]
AC-2............
For non-testable ACs, explain WHY and provide a testable rewrite.
For EACH acceptance criterion:
AC IDTextTestable?IssuesSuggested Rewrite
AC-1[original text]Yes/No[issues][improved version if needed]
AC-2............
For non-testable ACs, explain WHY and provide a testable rewrite.

3. Gap Analysis (MANDATORY)

3. Gap Analysis (MANDATORY)

Identify ALL gaps in the story:
Identify ALL gaps in the story:

Missing Requirements

Missing Requirements

  • [Gap 1: Description of what is missing]
  • [Gap 2: ...]
  • [Gap 1: Description of what is missing]
  • [Gap 2: ...]

Ambiguous Language

Ambiguous Language

  • [Ambiguity 1: Quote the ambiguous text and explain]
  • [Ambiguity 2: ...]
  • [Ambiguity 1: Quote the ambiguous text and explain]
  • [Ambiguity 2: ...]

Missing Edge Cases

Missing Edge Cases

  • [Edge Case 1: Scenario not covered by current ACs]
  • [Edge Case 2: ...]
  • [Edge Case 1: Scenario not covered by current ACs]
  • [Edge Case 2: ...]

Missing Non-Functional Requirements

Missing Non-Functional Requirements

  • Performance: [specified? missing?]
  • Security: [specified? missing?]
  • Accessibility: [specified? missing?]
  • Error handling: [specified? missing?]
CRITICAL GAPS COUNT: __ (gaps that block sprint readiness)
MINIMUM: Identify at least 3 gaps or explicitly state "No gaps found after thorough analysis of all requirement dimensions"
  • Performance: [specified? missing?]
  • Security: [specified? missing?]
  • Accessibility: [specified? missing?]
  • Error handling: [specified? missing?]
CRITICAL GAPS COUNT: __ (gaps that block sprint readiness)
MINIMUM: Identify at least 3 gaps or explicitly state "No gaps found after thorough analysis of all requirement dimensions"

4. Definition of Ready (DoR) Checklist

4. Definition of Ready (DoR) Checklist

DoR ItemStatusNotes
Story has clear title and descriptionPass/Fail...
Acceptance criteria are definedPass/Fail...
ACs are testablePass/Fail...
Dependencies are identifiedPass/Fail...
Story is estimatedPass/Fail...
Story fits in a sprintPass/Fail...
UX designs available (if needed)Pass/Fail/N/A...
API contracts defined (if needed)Pass/Fail/N/A...
Test data requirements knownPass/Fail...
No blockers identifiedPass/Fail...
DoR PASS RATE: X/10 (or X/N if N/A items excluded)
DoR ItemStatusNotes
Story has clear title and descriptionPass/Fail...
Acceptance criteria are definedPass/Fail...
ACs are testablePass/Fail...
Dependencies are identifiedPass/Fail...
Story is estimatedPass/Fail...
Story fits in a sprintPass/Fail...
UX designs available (if needed)Pass/Fail/N/A...
API contracts defined (if needed)Pass/Fail/N/A...
Test data requirements knownPass/Fail...
No blockers identifiedPass/Fail...
DoR PASS RATE: X/10 (or X/N if N/A items excluded)

5. Recommendations

5. Recommendations

Specific, actionable recommendations to make this story sprint-ready:
PriorityRecommendationOwner
P0 - Blocker[must fix before sprint][who]
P1 - Important[should fix before sprint][who]
P2 - Nice to have[can refine during sprint][who]
Specific, actionable recommendations to make this story sprint-ready:
PriorityRecommendationOwner
P0 - Blocker[must fix before sprint][who]
P1 - Important[should fix before sprint][who]
P2 - Nice to have[can refine during sprint][who]

OUTPUT FORMAT

OUTPUT FORMAT

Save your complete analysis in Markdown to: ${OUTPUT_FOLDER}/04-requirements-validation.md
Use the Write tool to save BEFORE completing. Report MUST be complete - no placeholders.
Save your complete analysis in Markdown to: ${OUTPUT_FOLDER}/04-requirements-validation.md
Use the Write tool to save BEFORE completing. Report MUST be complete - no placeholders.

VALIDATION BEFORE SUBMITTING

VALIDATION BEFORE SUBMITTING

+-- Did I score all 6 INVEST criteria? +-- Did I calculate a single INVEST completeness score (not a range)? +-- Did I assess every AC for testability? +-- Did I provide rewrites for non-testable ACs? +-- Did I identify gaps (or explicitly confirm none)? +-- Did I count critical gaps? +-- Did I complete the DoR checklist? +-- Did I save the report to the correct output path?`, subagent_type: "qe-requirements-validator", run_in_background: true })
undefined
+-- Did I score all 6 INVEST criteria? +-- Did I calculate a single INVEST completeness score (not a range)? +-- Did I assess every AC for testability? +-- Did I provide rewrites for non-testable ACs? +-- Did I identify gaps (or explicitly confirm none)? +-- Did I count critical gaps? +-- Did I complete the DoR checklist? +-- Did I save the report to the correct output path?`, subagent_type: "qe-requirements-validator", run_in_background: true })
undefined

Alternative: MCP Tools Execution

替代方案:MCP工具执行

If using MCP instead of Task tool:
javascript
// Option 1: Orchestrate via Fleet
mcp__agentic-qe__fleet_init({
  topology: "hierarchical",
  enabledDomains: ["requirements-validation", "test-generation"],
  maxAgents: 7,
  lazyLoading: true
})

// Submit tasks to specific domains
mcp__agentic-qe__task_submit({
  type: "product-factors-assessment",
  priority: "p0",
  payload: {
    storyContent: storyContent,
    framework: "sfdipot",
    factorCount: 7
  }
})

mcp__agentic-qe__task_submit({
  type: "bdd-scenario-generation",
  priority: "p0",
  payload: {
    storyContent: storyContent,
    format: "gherkin",
    minScenarios: 5
  }
})

mcp__agentic-qe__task_submit({
  type: "requirements-validation",
  priority: "p0",
  payload: {
    storyContent: storyContent,
    validateInvest: true,
    assessDoR: true
  }
})

// Check task status
mcp__agentic-qe__task_list({ status: "pending" })
如果使用MCP而非Task工具:
javascript
// Option 1: Orchestrate via Fleet
mcp__agentic-qe__fleet_init({
  topology: "hierarchical",
  enabledDomains: ["requirements-validation", "test-generation"],
  maxAgents: 7,
  lazyLoading: true
})

// Submit tasks to specific domains
mcp__agentic-qe__task_submit({
  type: "product-factors-assessment",
  priority: "p0",
  payload: {
    storyContent: storyContent,
    framework: "sfdipot",
    factorCount: 7
  }
})

mcp__agentic-qe__task_submit({
  type: "bdd-scenario-generation",
  priority: "p0",
  payload: {
    storyContent: storyContent,
    format: "gherkin",
    minScenarios: 5
  }
})

mcp__agentic-qe__task_submit({
  type: "requirements-validation",
  priority: "p0",
  payload: {
    storyContent: storyContent,
    validateInvest: true,
    assessDoR: true
  }
})

// Check task status
mcp__agentic-qe__task_list({ status: "pending" })

Alternative: CLI Execution

替代方案:CLI执行

If using CLI instead of Task tool:
bash
undefined
如果使用CLI而非Task工具:
bash
undefined

Initialize swarm for refinement

Initialize swarm for refinement

npx @claude-flow/cli@latest swarm init
--topology hierarchical
--max-agents 7
--strategy specialized
npx @claude-flow/cli@latest swarm init
--topology hierarchical
--max-agents 7
--strategy specialized

Pre-task hook for routing

Pre-task hook for routing

npx @claude-flow/cli@latest hooks pre-task
--description "QCSD Refinement: SFDIPOT, BDD Scenarios, INVEST Validation"
npx @claude-flow/cli@latest hooks pre-task
--description "QCSD Refinement: SFDIPOT, BDD Scenarios, INVEST Validation"

Spawn agents (run in separate terminals or background)

Spawn agents (run in separate terminals or background)

npx @claude-flow/cli@latest agent spawn
--type qe-product-factors-assessor
--task "SFDIPOT 7-factor analysis for story" &
npx @claude-flow/cli@latest agent spawn
--type qe-bdd-generator
--task "Gherkin BDD scenario generation" &
npx @claude-flow/cli@latest agent spawn
--type qe-requirements-validator
--task "INVEST validation and DoR assessment" &
npx @claude-flow/cli@latest agent spawn
--type qe-product-factors-assessor
--task "SFDIPOT 7-factor analysis for story" &
npx @claude-flow/cli@latest agent spawn
--type qe-bdd-generator
--task "Gherkin BDD scenario generation" &
npx @claude-flow/cli@latest agent spawn
--type qe-requirements-validator
--task "INVEST validation and DoR assessment" &

Wait for completion

Wait for completion

wait
wait

Check swarm status

Check swarm status

npx @claude-flow/cli@latest swarm status
undefined
npx @claude-flow/cli@latest swarm status
undefined

Post-Spawn Confirmation

启动后确认

After sending all three Task calls, you MUST tell the user:
I've launched 3 core agents in parallel:

  qe-product-factors-assessor [Domain: requirements-validation]
   - Analyzing all 7 SFDIPOT factors (37 subcategories)
   - Assigning P0-P3 priorities per factor
   - Identifying test focus areas

  qe-bdd-generator [Domain: requirements-validation]
   - Generating Gherkin scenarios (happy, error, boundary, security)
   - Creating Scenario Outlines with Examples tables
   - Mapping scenarios to acceptance criteria

  qe-requirements-validator [Domain: requirements-validation]
   - Scoring INVEST criteria (6 dimensions)
   - Assessing AC testability with rewrites
   - Running Definition of Ready checklist

  WAITING for all agents to complete before proceeding...
DO NOT proceed to Phase 3 until you have sent this confirmation.

发送全部3个任务调用后,你必须告知用户:
我已并行启动3个核心Agent:

  qe-product-factors-assessor [领域: requirements-validation]
   - 分析全部7个SFDIPOT因子(37个子分类)
   - 为每个因子分配P0-P3优先级
   - 识别测试重点领域

  qe-bdd-generator [领域: requirements-validation]
   - 生成Gherkin场景(正常路径、错误路径、边界场景、安全场景)
   - 创建带示例表格的场景大纲
   - 映射场景到验收标准

  qe-requirements-validator [领域: requirements-validation]
   - 从6个维度评分INVEST标准
   - 评估验收标准可测试性并提供重写建议
   - 运行就绪定义(DoR)检查清单

  等待所有Agent执行完成后再推进流程...
发送本确认信息之前,不得进入阶段3。

PHASE 3: Wait for Batch 1 Completion

阶段3:等待批次1执行完成

ENFORCEMENT: NO EARLY PROCEEDING

执行要求:不得提前推进

+-------------------------------------------------------------+
|  YOU MUST WAIT FOR ALL THREE BACKGROUND TASKS TO COMPLETE    |
|                                                              |
|  DO NOT summarize what agents "would" find                   |
|  DO NOT proceed to Phase 4 early                             |
|  DO NOT provide your own analysis as substitute              |
|                                                              |
|  WAIT for actual agent results                               |
|  ONLY proceed when all three have returned                   |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
|  你必须等待全部3个后台任务执行完成  |
|                                                              |
|  DO NOT summarize what agents "would" find                   |
|  DO NOT proceed to Phase 4 early                             |
|  DO NOT provide your own analysis as substitute              |
|                                                              |
|  WAIT for actual agent results                               |
|  ONLY proceed when all three have returned                   |
+-------------------------------------------------------------+

Results Extraction Checklist

结果提取检查清单

When results return, extract and record:
From qe-product-factors-assessor:
[ ] sfdipotCoverage = __/7 factors analyzed
[ ] p0Count = __ P0 priority factors
[ ] subcategoriesAssessed = __/37 subcategories
[ ] testFocusAreas = __ areas identified

From qe-bdd-generator:
[ ] bddScenarioCount = __ scenarios generated
[ ] happyPathCount = __ happy path scenarios
[ ] errorPathCount = __ error path scenarios
[ ] boundaryCount = __ boundary scenarios
[ ] acCoverage = __% acceptance criteria covered

From qe-requirements-validator:
[ ] investCompleteness = __% (average of 6 INVEST criteria)
[ ] criticalGaps = __ critical gaps identified
[ ] dorPassRate = __/10 Definition of Ready items passing
[ ] untestableACs = __ acceptance criteria needing rewrite
获取结果后,请提取并记录以下信息:
从qe-product-factors-assessor提取:
[ ] sfdipotCoverage = __/7 factors analyzed
[ ] p0Count = __ P0 priority factors
[ ] subcategoriesAssessed = __/37 subcategories
[ ] testFocusAreas = __ areas identified

从qe-bdd-generator提取:
[ ] bddScenarioCount = __ scenarios generated
[ ] happyPathCount = __ happy path scenarios
[ ] errorPathCount = __ error path scenarios
[ ] boundaryCount = __ boundary scenarios
[ ] acCoverage = __% acceptance criteria covered

从qe-requirements-validator提取:
[ ] investCompleteness = __% (average of 6 INVEST criteria)
[ ] criticalGaps = __ critical gaps identified
[ ] dorPassRate = __/10 Definition of Ready items passing
[ ] untestableACs = __ acceptance criteria needing rewrite

Metrics Summary Box

指标汇总框

Output extracted metrics:
+-------------------------------------------------------------+
|                    BATCH 1 RESULTS SUMMARY                   |
+-------------------------------------------------------------+
|                                                              |
|  SFDIPOT Coverage:       __/7 factors                        |
|  P0 Factors:             __                                  |
|  Subcategories Assessed: __/37                               |
|                                                              |
|  BDD Scenarios:          __ total                            |
|  - Happy Path:           __                                  |
|  - Error Path:           __                                  |
|  - Boundary:             __                                  |
|  AC Coverage:            __%                                 |
|                                                              |
|  INVEST Completeness:    __%                                 |
|  Critical Gaps:          __                                  |
|  DoR Pass Rate:          __/10                               |
|  Untestable ACs:         __                                  |
|                                                              |
+-------------------------------------------------------------+
DO NOT proceed to Phase 4 until ALL fields are filled.

输出提取到的指标:
+-------------------------------------------------------------+
|                    BATCH 1 RESULTS SUMMARY                   |
+-------------------------------------------------------------+
|                                                              |
|  SFDIPOT Coverage:       __/7 factors                        |
|  P0 Factors:             __                                  |
|  Subcategories Assessed: __/37                               |
|                                                              |
|  BDD Scenarios:          __ total                            |
|  - Happy Path:           __                                  |
|  - Error Path:           __                                  |
|  - Boundary:             __                                  |
|  AC Coverage:            __%                                 |
|                                                              |
|  INVEST Completeness:    __%                                 |
|  Critical Gaps:          __                                  |
|  DoR Pass Rate:          __/10                               |
|  Untestable ACs:         __                                  |
|                                                              |
+-------------------------------------------------------------+
所有字段填写完成之前,不得进入阶段4。

PHASE 4: Spawn Conditional Agents (PARALLEL BATCH 2)

阶段4:启动条件Agent(并行批次2)

ENFORCEMENT: NO SKIPPING CONDITIONAL AGENTS

执行要求:不得跳过条件Agent

+-------------------------------------------------------------+
|  IF A FLAG IS TRUE, YOU MUST SPAWN THAT AGENT                |
|                                                              |
|  HAS_API = TRUE              -> MUST spawn qe-contract-validator    |
|  HAS_REFACTORING = TRUE      -> MUST spawn qe-impact-analyzer      |
|  HAS_DEPENDENCIES = TRUE     -> MUST spawn qe-dependency-mapper     |
|  HAS_MIDDLEWARE = TRUE        -> MUST spawn qe-middleware-validator  |
|  HAS_SAP_INTEGRATION = TRUE  -> MUST spawn qe-odata-contract-tester|
|  HAS_AUTHORIZATION = TRUE    -> MUST spawn qe-sod-analyzer          |
|                                                              |
|  Skipping a flagged agent is a FAILURE of this skill.        |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
|  若对应标识为TRUE,你必须启动对应的Agent  |
|                                                              |
|  HAS_API = TRUE              -> MUST spawn qe-contract-validator    |
|  HAS_REFACTORING = TRUE      -> MUST spawn qe-impact-analyzer      |
|  HAS_DEPENDENCIES = TRUE     -> MUST spawn qe-dependency-mapper     |
|  HAS_MIDDLEWARE = TRUE        -> MUST spawn qe-middleware-validator  |
|  HAS_SAP_INTEGRATION = TRUE  -> MUST spawn qe-odata-contract-tester|
|  HAS_AUTHORIZATION = TRUE    -> MUST spawn qe-sod-analyzer          |
|                                                              |
|  Skipping a flagged agent is a FAILURE of this skill.        |
+-------------------------------------------------------------+

Conditional Domain Mapping

条件领域映射

FlagAgentDomainMCP Tool
HAS_APIqe-contract-validatorcontract-testing
contract_test
HAS_REFACTORINGqe-impact-analyzercode-intelligence
coverage_analyze_sublinear
HAS_DEPENDENCIESqe-dependency-mappercode-intelligence
defect_predict
HAS_MIDDLEWAREqe-middleware-validatorenterprise-integration
task_orchestrate
HAS_SAP_INTEGRATIONqe-odata-contract-testerenterprise-integration
task_orchestrate
HAS_AUTHORIZATIONqe-sod-analyzerenterprise-integration
task_orchestrate
标识Agent领域MCP工具
HAS_APIqe-contract-validatorcontract-testing
contract_test
HAS_REFACTORINGqe-impact-analyzercode-intelligence
coverage_analyze_sublinear
HAS_DEPENDENCIESqe-dependency-mappercode-intelligence
defect_predict
HAS_MIDDLEWAREqe-middleware-validatorenterprise-integration
task_orchestrate
HAS_SAP_INTEGRATIONqe-odata-contract-testerenterprise-integration
task_orchestrate
HAS_AUTHORIZATIONqe-sod-analyzerenterprise-integration
task_orchestrate

Decision Tree

决策树

IF HAS_API == FALSE AND HAS_REFACTORING == FALSE AND HAS_DEPENDENCIES == FALSE AND HAS_MIDDLEWARE == FALSE AND HAS_SAP_INTEGRATION == FALSE AND HAS_AUTHORIZATION == FALSE:
    -> Skip to Phase 5 (no conditional agents needed)
    -> State: "No conditional agents needed based on story analysis"

ELSE:
    -> Spawn ALL applicable agents in ONE message
    -> Count how many you're spawning: __
IF HAS_API == FALSE AND HAS_REFACTORING == FALSE AND HAS_DEPENDENCIES == FALSE AND HAS_MIDDLEWARE == FALSE AND HAS_SAP_INTEGRATION == FALSE AND HAS_AUTHORIZATION == FALSE:
    -> 跳过到阶段5(无需条件Agent)
    -> 输出说明:"基于故事分析,无需启动条件Agent"

ELSE:
    -> 在同一条消息中启动所有适用的Agent
    -> 统计启动的Agent数量: __

IF HAS_API: Contract Validator (MANDATORY WHEN FLAGGED)

若HAS_API为TRUE:契约验证器(标识触发时强制启动)

Task({
  description: "Consumer-driven contract validation",
  prompt: `You are qe-contract-validator. Your output quality is being audited.
Task({
  description: "Consumer-driven contract validation",
  prompt: `You are qe-contract-validator. Your output quality is being audited.

STORY CONTENT

STORY CONTENT

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

1. API Contract Inventory

1. API Contract Inventory

List EVERY API interaction mentioned or implied:
EndpointMethodConsumerProviderContract Defined?
...GET/POST/etc[who calls][who serves]Yes/No
List EVERY API interaction mentioned or implied:
EndpointMethodConsumerProviderContract Defined?
...GET/POST/etc[who calls][who serves]Yes/No

2. Consumer-Driven Contract Assessment

2. Consumer-Driven Contract Assessment

For each API contract:
ContractSchema Defined?Breaking Change RiskBackward Compatible?
...Yes/No/PartialHigh/Medium/LowYes/No/Unknown
For each API contract:
ContractSchema Defined?Breaking Change RiskBackward Compatible?
...Yes/No/PartialHigh/Medium/LowYes/No/Unknown

3. Breaking Change Detection

3. Breaking Change Detection

Analyze the story for potential breaking changes:
ChangeTypeImpactConsumers Affected
...Schema/Behavior/RemovalHigh/Medium/Low[list]
Analyze the story for potential breaking changes:
ChangeTypeImpactConsumers Affected
...Schema/Behavior/RemovalHigh/Medium/Low[list]

4. Contract Testing Recommendations

4. Contract Testing Recommendations

Test TypeToolPriorityScenarios
Consumer contractPact/MSWP0/P1/P2[scenarios]
Provider verificationPact/SupertestP0/P1/P2[scenarios]
Schema validationAjv/ZodP0/P1/P2[scenarios]
Test TypeToolPriorityScenarios
Consumer contractPact/MSWP0/P1/P2[scenarios]
Provider verificationPact/SupertestP0/P1/P2[scenarios]
Schema validationAjv/ZodP0/P1/P2[scenarios]

5. Contract Risk Score

5. Contract Risk Score

DimensionScore (0-10)Notes
Schema completenessX/10...
Backward compatibilityX/10...
Consumer coverageX/10...
Versioning strategyX/10...
CONTRACT RISK SCORE: X/40
MINIMUM: Identify at least 3 contract-related findings
DimensionScore (0-10)Notes
Schema completenessX/10...
Backward compatibilityX/10...
Consumer coverageX/10...
Versioning strategyX/10...
CONTRACT RISK SCORE: X/40
MINIMUM: Identify at least 3 contract-related findings

OUTPUT FORMAT

OUTPUT FORMAT

Save to: ${OUTPUT_FOLDER}/05-contract-validation.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-contract-validator", run_in_background: true })
undefined
Save to: ${OUTPUT_FOLDER}/05-contract-validation.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-contract-validator", run_in_background: true })
undefined

IF HAS_REFACTORING: Impact Analyzer (MANDATORY WHEN FLAGGED)

若HAS_REFACTORING为TRUE:影响分析器(标识触发时强制启动)

Task({
  description: "Refactoring blast radius and impact analysis",
  prompt: `You are qe-impact-analyzer. Your output quality is being audited.
Task({
  description: "Refactoring blast radius and impact analysis",
  prompt: `You are qe-impact-analyzer. Your output quality is being audited.

STORY CONTENT

STORY CONTENT

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

1. Blast Radius Assessment

1. Blast Radius Assessment

Identify all components affected by the refactoring:
ComponentDirect/IndirectChange TypeRisk Level
...DirectModified/Renamed/Moved/DeletedHigh/Medium/Low
Identify all components affected by the refactoring:
ComponentDirect/IndirectChange TypeRisk Level
...DirectModified/Renamed/Moved/DeletedHigh/Medium/Low

2. Affected Test Inventory

2. Affected Test Inventory

Test File/SuiteStatusAction Required
...Will Break / May Break / SafeUpdate / Rewrite / None
Test File/SuiteStatusAction Required
...Will Break / May Break / SafeUpdate / Rewrite / None

3. Dependency Chain Analysis

3. Dependency Chain Analysis

Map the dependency chain for affected components:
[Changed Component]
  +-- [Direct Dependent 1]
  |     +-- [Transitive Dependent 1a]
  |     +-- [Transitive Dependent 1b]
  +-- [Direct Dependent 2]
        +-- [Transitive Dependent 2a]
Map the dependency chain for affected components:
[Changed Component]
  +-- [Direct Dependent 1]
  |     +-- [Transitive Dependent 1a]
  |     +-- [Transitive Dependent 1b]
  +-- [Direct Dependent 2]
        +-- [Transitive Dependent 2a]

4. Regression Risk Matrix

4. Regression Risk Matrix

AreaChange ProbabilityTest CoverageRegression Risk
...High/Medium/LowGood/Partial/NoneCritical/High/Medium/Low
AreaChange ProbabilityTest CoverageRegression Risk
...High/Medium/LowGood/Partial/NoneCritical/High/Medium/Low

5. Migration Strategy

5. Migration Strategy

PhaseActionRollback PlanVerification
1......[how to verify]
2......[how to verify]
PhaseActionRollback PlanVerification
1......[how to verify]
2......[how to verify]

6. Impact Score

6. Impact Score

DimensionScore (0-10)Notes
Blast radiusX/10Number of affected components
Test impactX/10Tests requiring updates
Rollback complexityX/10Difficulty of rollback
Data migration riskX/10Data transformation needed
IMPACT SCORE: X/40
MINIMUM: Map at least 5 affected components or explain why fewer exist
DimensionScore (0-10)Notes
Blast radiusX/10Number of affected components
Test impactX/10Tests requiring updates
Rollback complexityX/10Difficulty of rollback
Data migration riskX/10Data transformation needed
IMPACT SCORE: X/40
MINIMUM: Map at least 5 affected components or explain why fewer exist

OUTPUT FORMAT

OUTPUT FORMAT

Save to: ${OUTPUT_FOLDER}/06-impact-analysis.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-impact-analyzer", run_in_background: true })
undefined
Save to: ${OUTPUT_FOLDER}/06-impact-analysis.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-impact-analyzer", run_in_background: true })
undefined

IF HAS_DEPENDENCIES: Dependency Mapper (MANDATORY WHEN FLAGGED)

若HAS_DEPENDENCIES为TRUE:依赖映射器(标识触发时强制启动)

Task({
  description: "Dependency coupling analysis and circular detection",
  prompt: `You are qe-dependency-mapper. Your output quality is being audited.
Task({
  description: "Dependency coupling analysis and circular detection",
  prompt: `You are qe-dependency-mapper. Your output quality is being audited.

STORY CONTENT

STORY CONTENT

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

1. Dependency Inventory

1. Dependency Inventory

List ALL dependencies (direct and transitive) mentioned or implied:
DependencyTypeVersionStatusRisk
...Direct/TransitiveX.Y.ZCurrent/Outdated/DeprecatedHigh/Medium/Low
List ALL dependencies (direct and transitive) mentioned or implied:
DependencyTypeVersionStatusRisk
...Direct/TransitiveX.Y.ZCurrent/Outdated/DeprecatedHigh/Medium/Low

2. Coupling Metrics

2. Coupling Metrics

Calculate Robert C. Martin's package coupling metrics:
ModuleCa (Afferent)Ce (Efferent)I (Instability)Category
...[incoming deps][outgoing deps]Ce/(Ca+Ce)Stable/Flexible/Unstable
Where:
  • Ca = number of classes outside that depend on this
  • Ce = number of classes inside that depend on outside
  • I = Ce / (Ca + Ce), range [0,1]: 0=maximally stable, 1=maximally unstable
Calculate Robert C. Martin's package coupling metrics:
ModuleCa (Afferent)Ce (Efferent)I (Instability)Category
...[incoming deps][outgoing deps]Ce/(Ca+Ce)Stable/Flexible/Unstable
Where:
  • Ca = number of classes outside that depend on this
  • Ce = number of classes inside that depend on outside
  • I = Ce / (Ca + Ce), range [0,1]: 0=maximally stable, 1=maximally unstable

3. Circular Dependency Detection

3. Circular Dependency Detection

CycleComponents InvolvedSeverityResolution
Cycle 1A -> B -> C -> ACritical/Warning[how to break]
If no cycles: "No circular dependencies detected"
CycleComponents InvolvedSeverityResolution
Cycle 1A -> B -> C -> ACritical/Warning[how to break]
If no cycles: "No circular dependencies detected"

4. Cross-Team Dependencies

4. Cross-Team Dependencies

DependencyOwning TeamCommunication ChannelSLARisk
...[team name][Slack/Jira/etc][response time]High/Medium/Low
DependencyOwning TeamCommunication ChannelSLARisk
...[team name][Slack/Jira/etc][response time]High/Medium/Low

5. Dependency Health Dashboard

5. Dependency Health Dashboard

Health IndicatorStatusDetails
Outdated dependenciesX of Y[list]
Known vulnerabilitiesX CVEs[list]
License compliancePass/Fail[issues]
Bundle size impact+X KB[breakdown]
Health IndicatorStatusDetails
Outdated dependenciesX of Y[list]
Known vulnerabilitiesX CVEs[list]
License compliancePass/Fail[issues]
Bundle size impact+X KB[breakdown]

6. Coupling Score

6. Coupling Score

DimensionScore (0-10)Notes
Afferent couplingX/10Fan-in complexity
Efferent couplingX/10Fan-out complexity
Circular dependenciesX/10Cycle severity
Cross-team couplingX/10External team risk
COUPLING SCORE: X/40
MINIMUM: Map at least 5 dependencies or explain why fewer exist
DimensionScore (0-10)Notes
Afferent couplingX/10Fan-in complexity
Efferent couplingX/10Fan-out complexity
Circular dependenciesX/10Cycle severity
Cross-team couplingX/10External team risk
COUPLING SCORE: X/40
MINIMUM: Map at least 5 dependencies or explain why fewer exist

OUTPUT FORMAT

OUTPUT FORMAT

Save to: ${OUTPUT_FOLDER}/07-dependency-map.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-dependency-mapper", run_in_background: true })
undefined
Save to: ${OUTPUT_FOLDER}/07-dependency-map.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-dependency-mapper", run_in_background: true })
undefined

IF HAS_MIDDLEWARE: Middleware Validator (MANDATORY WHEN FLAGGED)

若HAS_MIDDLEWARE为TRUE:中间件验证器(标识触发时强制启动)

Task({
  description: "Middleware routing, transformation, and ESB flow validation",
  prompt: `You are qe-middleware-validator. Your output quality is being audited.
Task({
  description: "Middleware routing, transformation, and ESB flow validation",
  prompt: `You are qe-middleware-validator. Your output quality is being audited.

STORY CONTENT

STORY CONTENT

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

1. Middleware Topology Inventory

1. Middleware Topology Inventory

Map ALL middleware components mentioned or implied:
ComponentTypeProtocolDirectionSLA
...ESB/MQ/Gateway/BrokerAMQP/MQTT/HTTP/gRPCInbound/Outbound/Bidirectional[latency/throughput]
Map ALL middleware components mentioned or implied:
ComponentTypeProtocolDirectionSLA
...ESB/MQ/Gateway/BrokerAMQP/MQTT/HTTP/gRPCInbound/Outbound/Bidirectional[latency/throughput]

2. Message Flow Analysis

2. Message Flow Analysis

For each message flow:
FlowSourceMiddlewareTargetTransform?Error Handling
...[producer][broker/ESB][consumer]Yes/NoDLQ/Retry/Drop
For each message flow:
FlowSourceMiddlewareTargetTransform?Error Handling
...[producer][broker/ESB][consumer]Yes/NoDLQ/Retry/Drop

3. Transformation Validation

3. Transformation Validation

TransformInput FormatOutput FormatValidation RulesRisk
...JSON/XML/CSVJSON/XML/CSV[schema rules]High/Medium/Low
TransformInput FormatOutput FormatValidation RulesRisk
...JSON/XML/CSVJSON/XML/CSV[schema rules]High/Medium/Low

4. Middleware Testing Recommendations

4. Middleware Testing Recommendations

Test TypeToolPriorityScenarios
Message routingWireMock/TestcontainersP0/P1/P2[scenarios]
Transform accuracySchema validatorsP0/P1/P2[scenarios]
Dead letter queueDLQ monitorsP0/P1/P2[scenarios]
ThroughputLoad generatorsP0/P1/P2[scenarios]
Test TypeToolPriorityScenarios
Message routingWireMock/TestcontainersP0/P1/P2[scenarios]
Transform accuracySchema validatorsP0/P1/P2[scenarios]
Dead letter queueDLQ monitorsP0/P1/P2[scenarios]
ThroughputLoad generatorsP0/P1/P2[scenarios]

5. Middleware Risk Score

5. Middleware Risk Score

DimensionScore (0-10)Notes
Routing complexityX/10...
Transform accuracyX/10...
Error handling coverageX/10...
Throughput riskX/10...
MIDDLEWARE RISK SCORE: X/40
MINIMUM: Identify at least 3 middleware-related findings
DimensionScore (0-10)Notes
Routing complexityX/10...
Transform accuracyX/10...
Error handling coverageX/10...
Throughput riskX/10...
MIDDLEWARE RISK SCORE: X/40
MINIMUM: Identify at least 3 middleware-related findings

OUTPUT FORMAT

OUTPUT FORMAT

Save to: ${"$"}{OUTPUT_FOLDER}/10-middleware-validation.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-middleware-validator", run_in_background: true })
undefined
Save to: ${"$"}{OUTPUT_FOLDER}/10-middleware-validation.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-middleware-validator", run_in_background: true })
undefined

IF HAS_SAP_INTEGRATION: OData Contract Tester (MANDATORY WHEN FLAGGED)

若HAS_SAP_INTEGRATION为TRUE:OData契约测试器(标识触发时强制启动)

Task({
  description: "OData contract and SAP service validation",
  prompt: `You are qe-odata-contract-tester. Your output quality is being audited.
Task({
  description: "OData contract and SAP service validation",
  prompt: `You are qe-odata-contract-tester. Your output quality is being audited.

STORY CONTENT

STORY CONTENT

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

1. SAP Service Inventory

1. SAP Service Inventory

Map ALL SAP services and OData endpoints mentioned or implied:
ServiceTypeProtocolEntity SetOperations
...OData V2/V4/RFC/BAPIHTTP/RFC[entity]CRUD/Custom
Map ALL SAP services and OData endpoints mentioned or implied:
ServiceTypeProtocolEntity SetOperations
...OData V2/V4/RFC/BAPIHTTP/RFC[entity]CRUD/Custom

2. OData Contract Assessment

2. OData Contract Assessment

For each OData service:
Endpoint$metadata Available?Schema Validated?Breaking Change RiskPagination
...Yes/NoYes/No/PartialHigh/Medium/LowServer/Client/None
For each OData service:
Endpoint$metadata Available?Schema Validated?Breaking Change RiskPagination
...Yes/NoYes/No/PartialHigh/Medium/LowServer/Client/None

3. SAP Integration Points

3. SAP Integration Points

IntegrationSource SystemTarget SystemIDoc TypeDirection
...ECC/S4/EWM[target][type]Inbound/Outbound
IntegrationSource SystemTarget SystemIDoc TypeDirection
...ECC/S4/EWM[target][type]Inbound/Outbound

4. Contract Testing Recommendations

4. Contract Testing Recommendations

Test TypeToolPriorityScenarios
OData $metadataOData validatorP0/P1/P2[scenarios]
Entity CRUDSAP Gateway testP0/P1/P2[scenarios]
Deep entityIntegration suiteP0/P1/P2[scenarios]
Error responsesNegative testingP0/P1/P2[scenarios]
Test TypeToolPriorityScenarios
OData $metadataOData validatorP0/P1/P2[scenarios]
Entity CRUDSAP Gateway testP0/P1/P2[scenarios]
Deep entityIntegration suiteP0/P1/P2[scenarios]
Error responsesNegative testingP0/P1/P2[scenarios]

5. SAP Integration Risk Score

5. SAP Integration Risk Score

DimensionScore (0-10)Notes
Contract completenessX/10...
Schema stabilityX/10...
Error handlingX/10...
Authorization coverageX/10...
SAP INTEGRATION RISK SCORE: X/40
MINIMUM: Identify at least 3 SAP integration findings
DimensionScore (0-10)Notes
Contract completenessX/10...
Schema stabilityX/10...
Error handlingX/10...
Authorization coverageX/10...
SAP INTEGRATION RISK SCORE: X/40
MINIMUM: Identify at least 3 SAP integration findings

OUTPUT FORMAT

OUTPUT FORMAT

Save to: ${"$"}{OUTPUT_FOLDER}/11-odata-contract-validation.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-odata-contract-tester", run_in_background: true })
undefined
Save to: ${"$"}{OUTPUT_FOLDER}/11-odata-contract-validation.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-odata-contract-tester", run_in_background: true })
undefined

IF HAS_AUTHORIZATION: SoD Analyzer (MANDATORY WHEN FLAGGED)

若HAS_AUTHORIZATION为TRUE:SoD分析器(标识触发时强制启动)

Task({
  description: "Segregation of duties and authorization conflict analysis",
  prompt: `You are qe-sod-analyzer. Your output quality is being audited.
Task({
  description: "Segregation of duties and authorization conflict analysis",
  prompt: `You are qe-sod-analyzer. Your output quality is being audited.

STORY CONTENT

STORY CONTENT

=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===
=== STORY CONTENT START === [PASTE THE COMPLETE STORY CONTENT HERE] === STORY CONTENT END ===

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)

1. Authorization Object Inventory

1. Authorization Object Inventory

Map ALL authorization objects, roles, and T-codes mentioned or implied:
Auth ObjectFieldValuesRole AssignmentRisk Level
...[field][allowed values][role]Critical/High/Medium/Low
Map ALL authorization objects, roles, and T-codes mentioned or implied:
Auth ObjectFieldValuesRole AssignmentRisk Level
...[field][allowed values][role]Critical/High/Medium/Low

2. Segregation of Duties Matrix

2. Segregation of Duties Matrix

Function AFunction BConflict TypeRiskMitigation
[create PO][approve PO]SoD violationCritical[control]
...............
Function AFunction BConflict TypeRiskMitigation
[create PO][approve PO]SoD violationCritical[control]
...............

3. Role Conflict Detection

3. Role Conflict Detection

RoleConflicting RoleShared UsersViolation TypeGRC Status
......[count]SoD/Excessive/ToxicDetected/Mitigated/Open
RoleConflicting RoleShared UsersViolation TypeGRC Status
......[count]SoD/Excessive/ToxicDetected/Mitigated/Open

4. Authorization Testing Recommendations

4. Authorization Testing Recommendations

Test TypeToolPriorityScenarios
SoD simulationGRC Access RiskP0/P1/P2[scenarios]
Role testingSU53/SUIMP0/P1/P2[scenarios]
Negative authAuth traceP0/P1/P2[scenarios]
Privilege escalationPentest suiteP0/P1/P2[scenarios]
Test TypeToolPriorityScenarios
SoD simulationGRC Access RiskP0/P1/P2[scenarios]
Role testingSU53/SUIMP0/P1/P2[scenarios]
Negative authAuth traceP0/P1/P2[scenarios]
Privilege escalationPentest suiteP0/P1/P2[scenarios]

5. Authorization Risk Score

5. Authorization Risk Score

DimensionScore (0-10)Notes
SoD complianceX/10...
Role design qualityX/10...
Toxic combination riskX/10...
Audit trail coverageX/10...
AUTHORIZATION RISK SCORE: X/40
MINIMUM: Identify at least 3 authorization findings
DimensionScore (0-10)Notes
SoD complianceX/10...
Role design qualityX/10...
Toxic combination riskX/10...
Audit trail coverageX/10...
AUTHORIZATION RISK SCORE: X/40
MINIMUM: Identify at least 3 authorization findings

OUTPUT FORMAT

OUTPUT FORMAT

Save to: ${"$"}{OUTPUT_FOLDER}/12-sod-analysis.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-sod-analyzer", run_in_background: true })
undefined
Save to: ${"$"}{OUTPUT_FOLDER}/12-sod-analysis.md Use the Write tool to save BEFORE completing.`, subagent_type: "qe-sod-analyzer", run_in_background: true })
undefined

Alternative: MCP Tools for Conditional Agents

替代方案:条件Agent使用MCP工具

javascript
// IF HAS_API - Enable contract-testing domain
if (HAS_API) {
  mcp__agentic-qe__task_submit({
    type: "contract-validation",
    priority: "p0",
    payload: {
      storyContent: storyContent,
      framework: "consumer-driven",
      detectBreaking: true
    }
  })
}

// IF HAS_REFACTORING - Enable code-intelligence domain
if (HAS_REFACTORING) {
  mcp__agentic-qe__coverage_analyze_sublinear({
    target: "src/",
    detectGaps: true,
    blastRadius: true
  })
}

// IF HAS_DEPENDENCIES - Enable code-intelligence domain
if (HAS_DEPENDENCIES) {
  mcp__agentic-qe__defect_predict({
    target: "src/",
    analyzeCoupling: true,
    detectCircular: true
  })
}

// IF HAS_MIDDLEWARE - Enable enterprise-integration domain
if (HAS_MIDDLEWARE) {
  mcp__agentic_qe__task_orchestrate({
    task: "middleware-routing-validation",
    strategy: "parallel",
    payload: {
      storyContent: storyContent,
      validateRouting: true,
      validateTransforms: true
    }
  })
}

// IF HAS_SAP_INTEGRATION - Enable enterprise-integration domain
if (HAS_SAP_INTEGRATION) {
  mcp__agentic_qe__task_orchestrate({
    task: "odata-contract-validation",
    strategy: "parallel",
    payload: {
      storyContent: storyContent,
      validateMetadata: true,
      validateSchema: true
    }
  })
}

// IF HAS_AUTHORIZATION - Enable enterprise-integration domain
if (HAS_AUTHORIZATION) {
  mcp__agentic_qe__task_orchestrate({
    task: "sod-authorization-analysis",
    strategy: "parallel",
    payload: {
      storyContent: storyContent,
      detectSoD: true,
      detectToxicCombos: true
    }
  })
}
javascript
// IF HAS_API - Enable contract-testing domain
if (HAS_API) {
  mcp__agentic-qe__task_submit({
    type: "contract-validation",
    priority: "p0",
    payload: {
      storyContent: storyContent,
      framework: "consumer-driven",
      detectBreaking: true
    }
  })
}

// IF HAS_REFACTORING - Enable code-intelligence domain
if (HAS_REFACTORING) {
  mcp__agentic-qe__coverage_analyze_sublinear({
    target: "src/",
    detectGaps: true,
    blastRadius: true
  })
}

// IF HAS_DEPENDENCIES - Enable code-intelligence domain
if (HAS_DEPENDENCIES) {
  mcp__agentic-qe__defect_predict({
    target: "src/",
    analyzeCoupling: true,
    detectCircular: true
  })
}

// IF HAS_MIDDLEWARE - Enable enterprise-integration domain
if (HAS_MIDDLEWARE) {
  mcp__agentic_qe__task_orchestrate({
    task: "middleware-routing-validation",
    strategy: "parallel",
    payload: {
      storyContent: storyContent,
      validateRouting: true,
      validateTransforms: true
    }
  })
}

// IF HAS_SAP_INTEGRATION - Enable enterprise-integration domain
if (HAS_SAP_INTEGRATION) {
  mcp__agentic_qe__task_orchestrate({
    task: "odata-contract-validation",
    strategy: "parallel",
    payload: {
      storyContent: storyContent,
      validateMetadata: true,
      validateSchema: true
    }
  })
}

// IF HAS_AUTHORIZATION - Enable enterprise-integration domain
if (HAS_AUTHORIZATION) {
  mcp__agentic_qe__task_orchestrate({
    task: "sod-authorization-analysis",
    strategy: "parallel",
    payload: {
      storyContent: storyContent,
      detectSoD: true,
      detectToxicCombos: true
    }
  })
}

Alternative: CLI for Conditional Agents

替代方案:条件Agent使用CLI

bash
undefined
bash
undefined

IF HAS_API

IF HAS_API

if [ "$HAS_API" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-contract-validator
--task "Consumer-driven contract validation" & fi
if [ "$HAS_API" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-contract-validator
--task "Consumer-driven contract validation" & fi

IF HAS_REFACTORING

IF HAS_REFACTORING

if [ "$HAS_REFACTORING" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-impact-analyzer
--task "Refactoring blast radius analysis" & fi
if [ "$HAS_REFACTORING" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-impact-analyzer
--task "Refactoring blast radius analysis" & fi

IF HAS_DEPENDENCIES

IF HAS_DEPENDENCIES

if [ "$HAS_DEPENDENCIES" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-dependency-mapper
--task "Coupling metrics and circular detection" & fi
if [ "$HAS_DEPENDENCIES" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-dependency-mapper
--task "Coupling metrics and circular detection" & fi

IF HAS_MIDDLEWARE

IF HAS_MIDDLEWARE

if [ "$HAS_MIDDLEWARE" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-middleware-validator
--task "Middleware routing and ESB flow validation" & fi
if [ "$HAS_MIDDLEWARE" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-middleware-validator
--task "Middleware routing and ESB flow validation" & fi

IF HAS_SAP_INTEGRATION

IF HAS_SAP_INTEGRATION

if [ "$HAS_SAP_INTEGRATION" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-odata-contract-tester
--task "OData contract and SAP service validation" & fi
if [ "$HAS_SAP_INTEGRATION" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-odata-contract-tester
--task "OData contract and SAP service validation" & fi

IF HAS_AUTHORIZATION

IF HAS_AUTHORIZATION

if [ "$HAS_AUTHORIZATION" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-sod-analyzer
--task "Segregation of duties analysis" & fi
if [ "$HAS_AUTHORIZATION" = "TRUE" ]; then npx @claude-flow/cli@latest agent spawn
--type qe-sod-analyzer
--task "Segregation of duties analysis" & fi

Wait for conditional agents

Wait for conditional agents

wait
undefined
wait
undefined

Agent Count Validation

Agent数量验证

Before proceeding, verify agent count:
+-------------------------------------------------------------+
|                   AGENT COUNT VALIDATION                     |
+-------------------------------------------------------------+
|                                                              |
|  CORE AGENTS (ALWAYS 3):                                     |
|    [ ] qe-product-factors-assessor - SPAWNED? [Y/N]         |
|    [ ] qe-bdd-generator - SPAWNED? [Y/N]                    |
|    [ ] qe-requirements-validator - SPAWNED? [Y/N]            |
|                                                              |
|  CONDITIONAL AGENTS (based on flags):                        |
|    [ ] qe-contract-validator - SPAWNED? [Y/N] (HAS_API)     |
|    [ ] qe-impact-analyzer - SPAWNED? [Y/N] (HAS_REFACTORING)|
|    [ ] qe-dependency-mapper - SPAWNED? [Y/N] (HAS_DEPS)     |
|    [ ] qe-middleware-validator - SPAWNED? [Y/N] (HAS_MIDDLEWARE)    |
|    [ ] qe-odata-contract-tester - SPAWNED? [Y/N] (HAS_SAP_INTEG)  |
|    [ ] qe-sod-analyzer - SPAWNED? [Y/N] (HAS_AUTHORIZATION)       |
|                                                              |
|  VALIDATION:                                                 |
|    Expected agents: [3 + count of TRUE flags]                |
|    Actual spawned:  [count]                                  |
|    Status:          [PASS/FAIL]                              |
|                                                              |
|  If ACTUAL < EXPECTED, you have FAILED. Spawn missing        |
|  agents before proceeding.                                   |
|                                                              |
+-------------------------------------------------------------+
DO NOT proceed if validation FAILS.
推进流程前,请验证Agent数量:
+-------------------------------------------------------------+
|                   AGENT COUNT VALIDATION                     |
+-------------------------------------------------------------+
|                                                              |
|  核心Agent(固定3个):                                     |
|    [ ] qe-product-factors-assessor - 已启动? [Y/N]         |
|    [ ] qe-bdd-generator - 已启动? [Y/N]                    |
|    [ ] qe-requirements-validator - 已启动? [Y/N]            |
|                                                              |
|  条件Agent(基于标识触发):                        |
|    [ ] qe-contract-validator - 已启动? [Y/N] (HAS_API)     |
|    [ ] qe-impact-analyzer - 已启动? [Y/N] (HAS_REFACTORING)|
|    [ ] qe-dependency-mapper - 已启动? [Y/N] (HAS_DEPS)     |
|    [ ] qe-middleware-validator - 已启动? [Y/N] (HAS_MIDDLEWARE)    |
|    [ ] qe-odata-contract-tester - 已启动? [Y/N] (HAS_SAP_INTEG)  |
|    [ ] qe-sod-analyzer - 已启动? [Y/N] (HAS_AUTHORIZATION)       |
|                                                              |
|  验证结果:                                                 |
|    预期Agent数量: [3 + 为TRUE的标识数量]                |
|    实际启动数量:  [count]                                  |
|    状态:          [通过/失败]                              |
|                                                              |
|  若实际数量小于预期数量,视为执行失败。请启动缺失的        |
|  Agent后再推进流程。                                   |
|                                                              |
+-------------------------------------------------------------+
验证失败时,不得推进流程。

Post-Spawn Confirmation (If Applicable)

启动后确认(如有适用Agent)

I've launched [N] conditional agent(s) in parallel:

[IF HAS_API]             qe-contract-validator [Domain: contract-testing]
                         - Consumer-driven contracts, breaking changes
[IF HAS_REFACTORING]     qe-impact-analyzer [Domain: code-intelligence]
                         - Blast radius, affected tests, regression risk
[IF HAS_DEPENDENCIES]    qe-dependency-mapper [Domain: code-intelligence]
                         - Coupling metrics Ca/Ce/I, circular detection
[IF HAS_MIDDLEWARE]      qe-middleware-validator [Domain: enterprise-integration]
                         - Middleware routing, transformation, ESB flow validation
[IF HAS_SAP_INTEGRATION] qe-odata-contract-tester [Domain: enterprise-integration]
                         - OData contract, SAP service, $metadata validation
[IF HAS_AUTHORIZATION]   qe-sod-analyzer [Domain: enterprise-integration]
                         - Segregation of duties, role conflict, authorization analysis

  WAITING for conditional agents to complete...

我已并行启动 [N] 个条件Agent:

[若HAS_API为TRUE]             qe-contract-validator [领域: contract-testing]
                         - 消费者驱动契约、破坏性变更检测
[若HAS_REFACTORING为TRUE]     qe-impact-analyzer [领域: code-intelligence]
                         - 影响范围、受影响测试、回归风险
[若HAS_DEPENDENCIES为TRUE]    qe-dependency-mapper [领域: code-intelligence]
                         - 耦合指标Ca/Ce/I、循环依赖检测
[若HAS_MIDDLEWARE为TRUE]      qe-middleware-validator [领域: enterprise-integration]
                         - 中间件路由、转换、ESB流验证
[若HAS_SAP_INTEGRATION为TRUE] qe-odata-contract-tester [领域: enterprise-integration]
                         - OData契约、SAP服务、$metadata验证
[若HAS_AUTHORIZATION为TRUE]   qe-sod-analyzer [领域: enterprise-integration]
                         - 职责分离、角色冲突、授权分析

  等待条件Agent执行完成...

PHASE 5: Synthesize Results & Determine Recommendation

阶段5:汇总结果并确定推荐结论

ENFORCEMENT: EXACT DECISION LOGIC

执行要求:严格遵循决策逻辑

You MUST apply this logic EXACTLY. No interpretation.
STEP 1: Check NOT-READY conditions (ANY triggers NOT-READY)
-----------------------------------------------------------
IF sfdipotCoverage < 5          -> NOT-READY ("Insufficient factor coverage")
IF bddScenarioCount < 3         -> NOT-READY ("Too few BDD scenarios")
IF investCompleteness < 50       -> NOT-READY ("Requirements incomplete")
IF criticalGaps > 3              -> NOT-READY ("Too many critical gaps")

STEP 2: Check READY conditions (ALL required for READY)
-----------------------------------------------------------
IF sfdipotCoverage >= 7
   AND bddScenarioCount >= 10
   AND investCompleteness >= 90
   AND criticalGaps == 0         -> READY

STEP 3: Default
-----------------------------------------------------------
ELSE                             -> CONDITIONAL
你必须严格执行以下逻辑,不得自行解读。
步骤1:检查NOT-READY条件(任意满足则判定为NOT-READY)
-----------------------------------------------------------
IF sfdipotCoverage < 5          -> NOT-READY ("因子覆盖不足")
IF bddScenarioCount < 3         -> NOT-READY ("BDD场景数量过少")
IF investCompleteness < 50       -> NOT-READY ("需求不完整")
IF criticalGaps > 3              -> NOT-READY ("关键缺口过多")

步骤2:检查READY条件(全部满足则判定为READY)
-----------------------------------------------------------
IF sfdipotCoverage >= 7
   AND bddScenarioCount >= 10
   AND investCompleteness >= 90
   AND criticalGaps == 0         -> READY

步骤3:默认情况
-----------------------------------------------------------
ELSE                             -> CONDITIONAL

Decision Recording

决策记录

METRICS:
- sfdipotCoverage = __/7
- bddScenarioCount = __
- investCompleteness = __%
- criticalGaps = __

NOT-READY CHECK:
- sfdipotCoverage < 5? __ (YES/NO)
- bddScenarioCount < 3? __ (YES/NO)
- investCompleteness < 50? __ (YES/NO)
- criticalGaps > 3? __ (YES/NO)

READY CHECK (only if no NOT-READY triggered):
- sfdipotCoverage >= 7? __ (YES/NO)
- bddScenarioCount >= 10? __ (YES/NO)
- investCompleteness >= 90? __ (YES/NO)
- criticalGaps == 0? __ (YES/NO)

FINAL RECOMMENDATION: [READY / CONDITIONAL / NOT-READY]
REASON: ___
指标:
- sfdipotCoverage = __/7
- bddScenarioCount = __
- investCompleteness = __%
- criticalGaps = __

NOT-READY检查:
- sfdipotCoverage < 5? __ (是/否)
- bddScenarioCount < 3? __ (是/否)
- investCompleteness < 50? __ (是/否)
- criticalGaps > 3? __ (是/否)

READY检查(仅当未触发NOT-READY时执行):
- sfdipotCoverage >= 7? __ (是/否)
- bddScenarioCount >= 10? __ (是/否)
- investCompleteness >= 90? __ (是/否)
- criticalGaps == 0? __ (是/否)

最终推荐结论:[READY / CONDITIONAL / NOT-READY]
原因:___

Conditional Recommendations

条件类推荐说明

If recommendation is CONDITIONAL, provide specific blockers:
BlockerCurrent ValueRequired ValueOwnerAction
.........[who][what to do]
If recommendation is NOT-READY, provide mandatory remediation:
RemediationPriorityEffortDeadline
...P0[hours/days][before next refinement]

如果推荐结论为CONDITIONAL,请提供具体的阻塞项:
阻塞项当前值要求值负责人所需动作
.........[who][what to do]
如果推荐结论为NOT-READY,请提供强制修复项:
修复项优先级工作量截止时间
...P0[小时/天][下次梳理前]

PHASE 6: Generate Refinement Report

阶段6:生成梳理报告

ENFORCEMENT: COMPLETE REPORT STRUCTURE

执行要求:完整报告结构

ALL sections below are MANDATORY. No abbreviations.
markdown
undefined
以下所有章节均为必填项,不得省略。
markdown
undefined

QCSD Refinement Report: [Story Name]

QCSD梳理报告:[故事名称]

Generated: [Date/Time] Recommendation: [READY / CONDITIONAL / NOT-READY] Agents Executed: [List all agents that ran] Parallel Batches: [2 or 3 depending on conditional agents]

生成时间:[日期/时间] 推荐结论:[READY / CONDITIONAL / NOT-READY] 执行Agent:[所有运行的Agent列表] 并行批次:[2或3,取决于是否有条件Agent]

Executive Summary

执行摘要

MetricValueThresholdStatus
SFDIPOT CoverageX/7>=7PASS/WARN/FAIL
BDD ScenariosX>=10PASS/WARN/FAIL
INVEST CompletenessX%>=90%PASS/WARN/FAIL
Critical GapsX0PASS/WARN/FAIL
Recommendation Rationale: [1-2 sentences explaining why READY/CONDITIONAL/NOT-READY]

指标阈值状态
SFDIPOT覆盖度X/7>=7通过/警告/失败
BDD场景数量X>=10通过/警告/失败
INVEST完整性X%>=90%通过/警告/失败
关键缺口数量X0通过/警告/失败
推荐结论说明:[1-2句话解释推荐结论的原因]

SFDIPOT Product Factors Analysis

SFDIPOT产品因子分析

[EMBED or LINK the full report from qe-product-factors-assessor]
[嵌入或链接qe-product-factors-assessor的完整报告]

Factor Priority Summary

因子优先级汇总

FactorPriorityKey FindingTest Focus
StructureP0/P1/P2/P3[top finding][areas]
FunctionP0/P1/P2/P3[top finding][areas]
DataP0/P1/P2/P3[top finding][areas]
InterfacesP0/P1/P2/P3[top finding][areas]
PlatformP0/P1/P2/P3[top finding][areas]
OperationsP0/P1/P2/P3[top finding][areas]
TimeP0/P1/P2/P3[top finding][areas]
因子优先级核心发现测试重点
结构(Structure)P0/P1/P2/P3[top finding][areas]
功能(Function)P0/P1/P2/P3[top finding][areas]
数据(Data)P0/P1/P2/P3[top finding][areas]
接口(Interfaces)P0/P1/P2/P3[top finding][areas]
平台(Platform)P0/P1/P2/P3[top finding][areas]
运营(Operations)P0/P1/P2/P3[top finding][areas]
时间(Time)P0/P1/P2/P3[top finding][areas]

Cross-Cutting Concerns

跨领域关注点

[List any concerns that span multiple factors]

[列出跨多个因子的相关问题]

BDD Scenarios

BDD场景

[EMBED the full Gherkin from qe-bdd-generator]
[嵌入qe-bdd-generator生成的完整Gherkin内容]

Scenario Coverage Summary

场景覆盖汇总

CategoryCountAC Coverage
Happy PathX[ACs covered]
Error PathX[ACs covered]
BoundaryX[ACs covered]
SecurityX[ACs covered]
TotalXX%

分类数量验收标准覆盖
正常路径X[覆盖的AC]
错误路径X[覆盖的AC]
边界场景X[覆盖的AC]
安全场景X[覆盖的AC]
总计XX%

Requirements Validation

需求验证

INVEST Score: X/100

INVEST得分:X/100

CriterionScoreStatus
IndependentX/100PASS/WARN/FAIL
NegotiableX/100PASS/WARN/FAIL
ValuableX/100PASS/WARN/FAIL
EstimableX/100PASS/WARN/FAIL
SmallX/100PASS/WARN/FAIL
TestableX/100PASS/WARN/FAIL
标准得分状态
独立性(Independent)X/100通过/警告/失败
可协商(Negotiable)X/100通过/警告/失败
有价值(Valuable)X/100通过/警告/失败
可估算(Estimable)X/100通过/警告/失败
小体量(Small)X/100通过/警告/失败
可测试(Testable)X/100通过/警告/失败

AC Assessment

验收标准评估

ACTestable?IssuesRewrite Needed?
[All ACs evaluated]
AC可测试?问题需要重写?
[所有评估过的AC]

Gaps Identified

识别到的缺口

  1. [Gap 1]
  2. [Gap 2] [All gaps from qe-requirements-validator]
  1. [缺口1]
  2. [缺口2] [qe-requirements-validator识别到的所有缺口]

Definition of Ready: X/10 passing

就绪定义(DoR):X/10项通过



Conditional Analysis

条件分析

[INCLUDE ONLY IF APPLICABLE - based on which conditional agents ran]
[仅当对应条件Agent运行时包含本部分]

Contract Validation (IF HAS_API)

契约验证(若HAS_API为TRUE)

[Full output from qe-contract-validator]
[qe-contract-validator的完整输出]

Impact Analysis (IF HAS_REFACTORING)

影响分析(若HAS_REFACTORING为TRUE)

[Full output from qe-impact-analyzer]
[qe-impact-analyzer的完整输出]

Dependency Map (IF HAS_DEPENDENCIES)

依赖映射(若HAS_DEPENDENCIES为TRUE)

[Full output from qe-dependency-mapper]

[qe-dependency-mapper的完整输出]

Recommended Actions

推荐动作

Before Sprint Commitment

Sprint承诺前需要完成的动作

  • [Action based on findings]
  • [Action based on findings]
  • [基于发现的动作]
  • [基于发现的动作]

Sprint Planning Notes

Sprint规划注意事项

  • [Testing approach recommendation]
  • [Dependency coordination needed]
  • [测试方法建议]
  • [需要协调的依赖]

During Sprint

Sprint执行期间需要完成的动作

  • [Action based on findings]

  • [基于发现的动作]

Appendix: Agent Outputs

附录:Agent输出

[Link to or embed full outputs from each agent]

Generated by QCSD Refinement Swarm v1.0 Execution Model: Task Tool Parallel Swarm

Write the executive summary report to:
`${OUTPUT_FOLDER}/01-executive-summary.md`
[链接或嵌入每个Agent的完整输出]

由QCSD梳理Swarm v1.0生成 执行模型:Task Tool并行Swarm

将执行摘要报告写入:
`${OUTPUT_FOLDER}/01-executive-summary.md`

Report Validation Checklist

报告验证检查清单

Before presenting report:
+-- Executive Summary table is complete with all 4 metrics
+-- Recommendation matches decision logic output
+-- SFDIPOT section includes all 7 factor priorities
+-- BDD section includes scenario coverage summary
+-- INVEST score shows all 6 criteria
+-- All gaps are listed
+-- Conditional sections included for all spawned agents
+-- Recommended actions are specific (not generic)
+-- Report saved to output folder
DO NOT present an incomplete report.

展示报告前,请确认:
+-- 执行摘要表格包含全部4个指标
+-- 推荐结论与决策逻辑输出一致
+-- SFDIPOT部分包含全部7个因子的优先级
+-- BDD部分包含场景覆盖汇总
+-- INVEST得分展示全部6个标准
+-- 所有缺口均已列出
+-- 包含所有启动的条件Agent的对应章节
+-- 推荐动作具体明确(非通用描述)
+-- 报告已保存到输出目录
不得展示不完整的报告。

PHASE 7: Store Learnings & Persist State

阶段7:存储学习数据与持久化状态

ENFORCEMENT: ALWAYS RUN THIS PHASE

执行要求:始终运行本阶段

+-------------------------------------------------------------+
|  LEARNING PERSISTENCE MUST ALWAYS EXECUTE                    |
|                                                              |
|  This is NOT optional. It runs on EVERY refinement.          |
|  It stores findings for cross-phase feedback loops,          |
|  historical decision analysis, and pattern learning.         |
|                                                              |
|  DO NOT skip this phase for any reason.                      |
|  DO NOT treat this as "nice to have".                        |
|  Enforcement Rule E9 applies.                                |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
|  学习持久化必须始终执行  |
|                                                              |
|  本步骤不是可选步骤,每次梳理都必须执行。          |
|  用于存储跨阶段反馈闭环的发现、历史决策分析和模式学习。         |
|                                                              |
|  不得因任何原因跳过本阶段。                      |
|  不得将本步骤视为“锦上添花”的可选操作。                        |
|  强制执行规则E9适用。                                |
+-------------------------------------------------------------+

Purpose

目的

Store refinement findings for:
  • Cross-phase feedback loops (Development -> next Refinement cycle)
  • Historical analysis of READY/CONDITIONAL/NOT-READY decisions
  • SFDIPOT pattern learning across stories
  • BDD scenario quality improvement over time
存储梳理发现用于:
  • 跨阶段反馈闭环(开发 -> 下一个梳理周期)
  • READY/CONDITIONAL/NOT-READY决策的历史分析
  • 跨故事的SFDIPOT模式学习
  • BDD场景质量的持续优化

Auto-Execution Steps (ALL THREE are MANDATORY)

自动执行步骤(全部3步为必填项)

Step 1: Store refinement findings to memory
You MUST execute this MCP call with actual values from the refinement analysis:
javascript
mcp__agentic-qe__memory_store({
  key: `qcsd-refinement-${storyId}-${Date.now()}`,
  namespace: "qcsd-refinement",
  value: {
    storyId: storyId,
    storyName: storyName,
    recommendation: recommendation,  // READY, CONDITIONAL, NOT-READY
    metrics: {
      sfdipotCoverage: sfdipotCoverage,
      bddScenarioCount: bddScenarioCount,
      investCompleteness: investCompleteness,
      criticalGaps: criticalGaps
    },
    sfdipotPriorities: {
      structure: "P0/P1/P2/P3",
      function: "P0/P1/P2/P3",
      data: "P0/P1/P2/P3",
      interfaces: "P0/P1/P2/P3",
      platform: "P0/P1/P2/P3",
      operations: "P0/P1/P2/P3",
      time: "P0/P1/P2/P3"
    },
    flags: {
      HAS_API: HAS_API,
      HAS_REFACTORING: HAS_REFACTORING,
      HAS_DEPENDENCIES: HAS_DEPENDENCIES,
      HAS_SECURITY: HAS_SECURITY,
      HAS_MIDDLEWARE: HAS_MIDDLEWARE,
      HAS_SAP_INTEGRATION: HAS_SAP_INTEGRATION,
      HAS_AUTHORIZATION: HAS_AUTHORIZATION
    },
    agentsInvoked: agentList,
    timestamp: new Date().toISOString()
  }
})
Step 2: Share learnings with learning coordinator
You MUST execute this MCP call to propagate patterns cross-domain:
javascript
mcp__agentic-qe__memory_share({
  sourceAgentId: "qcsd-refinement-swarm",
  targetAgentIds: ["qe-learning-coordinator", "qe-pattern-learner"],
  knowledgeDomain: "refinement-patterns"
})
Step 3: Save learning persistence record to output folder
You MUST use the Write tool to save a JSON record of the persisted learnings:
Save to: ${OUTPUT_FOLDER}/09-learning-persistence.json

Contents:
{
  "phase": "QCSD-Refinement",
  "storyId": "[story ID]",
  "storyName": "[story name]",
  "recommendation": "[READY/CONDITIONAL/NOT-READY]",
  "memoryKey": "qcsd-refinement-[storyId]-[timestamp]",
  "namespace": "qcsd-refinement",
  "metrics": {
    "sfdipotCoverage": [0-7],
    "bddScenarioCount": [N],
    "investCompleteness": [0-100],
    "criticalGaps": [N],
    "testIdeaQuality": [0-100]
  },
  "sfdipotPriorities": {
    "structure": "P0/P1/P2/P3",
    "function": "P0/P1/P2/P3",
    "data": "P0/P1/P2/P3",
    "interfaces": "P0/P1/P2/P3",
    "platform": "P0/P1/P2/P3",
    "operations": "P0/P1/P2/P3",
    "time": "P0/P1/P2/P3"
  },
  "flags": {
    "HAS_API": true/false,
    "HAS_REFACTORING": true/false,
    "HAS_DEPENDENCIES": true/false,
    "HAS_SECURITY": true/false,
    "HAS_MIDDLEWARE": true/false,
    "HAS_SAP_INTEGRATION": true/false,
    "HAS_AUTHORIZATION": true/false
  },
  "agentsInvoked": ["list", "of", "agents"],
  "crossPhaseSignals": {
    "toDevelopment": "BDD scenarios as test specification",
    "toVerification": "INVEST gaps as verification focus"
  },
  "persistedAt": "[ISO timestamp]"
}
步骤1:将梳理发现存储到内存
你必须使用梳理分析的实际值执行以下MCP调用:
javascript
mcp__agentic-qe__memory_store({
  key: `qcsd-refinement-${storyId}-${Date.now()}`,
  namespace: "qcsd-refinement",
  value: {
    storyId: storyId,
    storyName: storyName,
    recommendation: recommendation,  // READY, CONDITIONAL, NOT-READY
    metrics: {
      sfdipotCoverage: sfdipotCoverage,
      bddScenarioCount: bddScenarioCount,
      investCompleteness: investCompleteness,
      criticalGaps: criticalGaps
    },
    sfdipotPriorities: {
      structure: "P0/P1/P2/P3",
      function: "P0/P1/P2/P3",
      data: "P0/P1/P2/P3",
      interfaces: "P0/P1/P2/P3",
      platform: "P0/P1/P2/P3",
      operations: "P0/P1/P2/P3",
      time: "P0/P1/P2/P3"
    },
    flags: {
      HAS_API: HAS_API,
      HAS_REFACTORING: HAS_REFACTORING,
      HAS_DEPENDENCIES: HAS_DEPENDENCIES,
      HAS_SECURITY: HAS_SECURITY,
      HAS_MIDDLEWARE: HAS_MIDDLEWARE,
      HAS_SAP_INTEGRATION: HAS_SAP_INTEGRATION,
      HAS_AUTHORIZATION: HAS_AUTHORIZATION
    },
    agentsInvoked: agentList,
    timestamp: new Date().toISOString()
  }
})
步骤2:将学习数据共享给学习协调器
你必须执行以下MCP调用,跨领域传播模式:
javascript
mcp__agentic-qe__memory_share({
  sourceAgentId: "qcsd-refinement-swarm",
  targetAgentIds: ["qe-learning-coordinator", "qe-pattern-learner"],
  knowledgeDomain: "refinement-patterns"
})
步骤3:将学习持久化记录保存到输出目录
你必须使用Write工具保存持久化学习数据的JSON记录:
保存路径:${OUTPUT_FOLDER}/09-learning-persistence.json

内容:
{
  "phase": "QCSD-Refinement",
  "storyId": "[故事ID]",
  "storyName": "[故事名称]",
  "recommendation": "[READY/CONDITIONAL/NOT-READY]",
  "memoryKey": "qcsd-refinement-[storyId]-[timestamp]",
  "namespace": "qcsd-refinement",
  "metrics": {
    "sfdipotCoverage": [0-7],
    "bddScenarioCount": [N],
    "investCompleteness": [0-100],
    "criticalGaps": [N],
    "testIdeaQuality": [0-100]
  },
  "sfdipotPriorities": {
    "structure": "P0/P1/P2/P3",
    "function": "P0/P1/P2/P3",
    "data": "P0/P1/P2/P3",
    "interfaces": "P0/P1/P2/P3",
    "platform": "P0/P1/P2/P3",
    "operations": "P0/P1/P2/P3",
    "time": "P0/P1/P2/P3"
  },
  "flags": {
    "HAS_API": true/false,
    "HAS_REFACTORING": true/false,
    "HAS_DEPENDENCIES": true/false,
    "HAS_SECURITY": true/false,
    "HAS_MIDDLEWARE": true/false,
    "HAS_SAP_INTEGRATION": true/false,
    "HAS_AUTHORIZATION": true/false
  },
  "agentsInvoked": ["list", "of", "agents"],
  "crossPhaseSignals": {
    "toDevelopment": "BDD scenarios as test specification",
    "toVerification": "INVEST gaps as verification focus"
  },
  "persistedAt": "[ISO timestamp]"
}

Fallback: CLI Memory Commands

备选方案:CLI内存命令

If MCP memory_store tool is unavailable, use CLI instead (STILL MANDATORY):
bash
npx @claude-flow/cli@latest memory store \
  --key "qcsd-refinement-${STORY_ID}-$(date +%s)" \
  --value '{"recommendation":"[VALUE]","investCompleteness":[N],"sfdipotCoverage":[N],"bddScenarioCount":[N],"criticalGaps":[N]}' \
  --namespace qcsd-refinement

npx @claude-flow/cli@latest hooks post-task \
  --task-id "qcsd-refinement-${STORY_ID}" \
  --success true
如果MCP memory_store工具不可用,改用CLI(仍为必填项):
bash
npx @claude-flow/cli@latest memory store \
  --key "qcsd-refinement-${STORY_ID}-$(date +%s)" \
  --value '{"recommendation":"[VALUE]","investCompleteness":[N],"sfdipotCoverage":[N],"bddScenarioCount":[N],"criticalGaps":[N]}' \
  --namespace qcsd-refinement

npx @claude-flow/cli@latest hooks post-task \
  --task-id "qcsd-refinement-${STORY_ID}" \
  --success true

Validation Before Proceeding to Phase 8

进入阶段8前的验证

+-- Did I execute mcp__agentic-qe__memory_store with actual values? (not placeholders)
+-- Did I execute mcp__agentic-qe__memory_share to propagate learnings?
+-- Did I save 09-learning-persistence.json to the output folder?
+-- Does the JSON contain the correct recommendation from Phase 5?
+-- Does the JSON contain actual SFDIPOT priorities from Phase 2?
+-- Does the JSON contain actual flag values from Phase 1?
If ANY validation check fails, DO NOT proceed to Phase 8.
+-- 我是否使用实际值执行了mcp__agentic-qe__memory_store?(非占位符)
+-- 我是否执行了mcp__agentic-qe__memory_share传播学习数据?
+-- 我是否将09-learning-persistence.json保存到了输出目录?
+-- JSON中是否包含阶段5输出的正确推荐结论?
+-- JSON中是否包含阶段2输出的实际SFDIPOT优先级?
+-- JSON中是否包含阶段1输出的实际标识值?
任何验证检查失败时,不得进入阶段8。

Cross-Phase Signal Consumption

跨阶段信号传递

The Refinement Swarm both consumes and produces signals for other QCSD phases:
CONSUMES (from other phases):
+-- Loop 2 (Tactical): SFDIPOT weights from Production Telemetry
|   - Production incidents inform which factors to weight higher
|   - Telemetry data adjusts P0-P3 priority thresholds
|
+-- Loop 4 (Quality-Criteria): Untestable patterns from Development
    - Patterns the Development phase flagged as hard to test
    - Feeds into INVEST testability scoring

PRODUCES (for other phases):
+-- To Development Phase: BDD scenarios as test specification
|   - Gherkin scenarios become automated test templates
|   - SFDIPOT priorities guide test depth allocation
|
+-- To Verification Phase: INVEST gaps as verification focus
    - Critical gaps become verification checkpoints
    - DoR failures become sprint exit criteria

梳理Swarm同时消费和生成其他QCSD阶段的信号:
消费信号(来自其他阶段):
+-- 循环2(战术层):来自生产遥测的SFDIPOT权重
|   - 生产事件用于确定哪些因子需要更高权重
|   - 遥测数据调整P0-P3优先级阈值
|
+-- 循环4(质量标准层):来自开发阶段的不可测试模式
    - 开发阶段标记的难以测试的模式
    - 用于优化INVEST可测试性评分

生成信号(供其他阶段使用):
+-- 发往开发阶段:BDD场景作为测试规范
|   - Gherkin场景成为自动化测试模板
|   - SFDIPOT优先级指导测试深度分配
|
+-- 发往验证阶段:INVEST缺口作为验证重点
    - 关键缺口成为验证检查点
    - DoR失败项成为Sprint退出标准

PHASE 8: Apply Test Idea Rewriter (Transformation)

阶段8:应用测试思路重写器(转换)

ENFORCEMENT: ALWAYS RUN THIS PHASE

执行要求:始终运行本阶段

+-------------------------------------------------------------+
|  THE TEST IDEA REWRITER MUST ALWAYS RUN                      |
|                                                              |
|  This is NOT conditional. It runs on EVERY refinement.       |
|  It transforms passive test ideas into active, actionable    |
|  test specifications using strong action verbs.              |
|                                                              |
|  DO NOT skip this phase for any reason.                      |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
|  测试思路重写器必须始终运行  |
|                                                              |
|  本步骤不是条件步骤,每次梳理都必须执行。       |
|  用于将被动的测试思路转换为使用强动作动词的主动、可执行测试规范。              |
|                                                              |
|  不得因任何原因跳过本阶段。                      |
+-------------------------------------------------------------+

Transformation Rules

转换规则

The qe-test-idea-rewriter transforms ALL test ideas from the refinement analysis using these rules:
PatternTransform ToExample
"Verify that X""Confirm X by [specific action]""Verify login works" -> "Confirm authentication succeeds by submitting valid credentials and observing session token"
"Check if X""Validate X by [specific action]""Check if error shows" -> "Validate error message displays by submitting empty form"
"Test X""Exercise X by [specific action]""Test pagination" -> "Exercise pagination by navigating through 5+ pages and verifying item counts"
"Ensure X""Demonstrate X by [specific action]""Ensure data saves" -> "Demonstrate data persistence by creating record and retrieving it"
Passive voiceActive voice"Data is validated" -> "Validate data against schema constraints"
Vague assertionConcrete assertion"Works correctly" -> "Returns HTTP 200 with expected JSON payload"
qe-test-idea-rewriter会基于以下规则转换梳理分析中生成的所有测试思路:
模式转换为示例
"Verify that X""Confirm X by [specific action]""Verify login works" -> "Confirm authentication succeeds by submitting valid credentials and observing session token"
"Check if X""Validate X by [specific action]""Check if error shows" -> "Validate error message displays by submitting empty form"
"Test X""Exercise X by [specific action]""Test pagination" -> "Exercise pagination by navigating through 5+ pages and verifying item counts"
"Ensure X""Demonstrate X by [specific action]""Ensure data saves" -> "Demonstrate data persistence by creating record and retrieving it"
被动语态主动语态"Data is validated" -> "Validate data against schema constraints"
模糊断言具体断言"Works correctly" -> "Returns HTTP 200 with expected JSON payload"

Agent Spawn

Agent启动

Task({
  description: "Transform test ideas with action verbs",
  prompt: `You are qe-test-idea-rewriter. Your output quality is being audited.
Task({
  description: "Transform test ideas with action verbs",
  prompt: `You are qe-test-idea-rewriter. Your output quality is being audited.

PURPOSE

PURPOSE

Transform ALL test ideas generated during this refinement session from passive/vague descriptions into active, specific, actionable test specifications.
Transform ALL test ideas generated during this refinement session from passive/vague descriptions into active, specific, actionable test specifications.

INPUT: RAW TEST IDEAS

INPUT: RAW TEST IDEAS

Collect test ideas from ALL previous agent outputs:
Collect test ideas from ALL previous agent outputs:

From SFDIPOT Analysis (02-sfdipot-analysis.md):

From SFDIPOT Analysis (02-sfdipot-analysis.md):

[List all test focus areas identified per factor]
[List all test focus areas identified per factor]

From BDD Scenarios (03-bdd-scenarios.md):

From BDD Scenarios (03-bdd-scenarios.md):

[List all scenario names as test ideas]
[List all scenario names as test ideas]

From Requirements Validation (04-requirements-validation.md):

From Requirements Validation (04-requirements-validation.md):

[List all gap-driven test ideas and recommendations]
[List all gap-driven test ideas and recommendations]

From Conditional Agents (if applicable):

From Conditional Agents (if applicable):

[List all test recommendations from contract/impact/dependency analysis]
[List all test recommendations from contract/impact/dependency analysis]

TRANSFORMATION RULES (APPLY TO EVERY TEST IDEA)

TRANSFORMATION RULES (APPLY TO EVERY TEST IDEA)

  1. Replace passive verbs with active verbs:
    • "Verify" -> "Confirm ... by [action]"
    • "Check" -> "Validate ... by [action]"
    • "Test" -> "Exercise ... by [action]"
    • "Ensure" -> "Demonstrate ... by [action]"
    • "Should" -> "[Action verb] ... to [outcome]"
  2. Add concrete actions:
    • Every test idea must specify WHAT action triggers the test
    • Every test idea must specify HOW to observe the result
    • No vague phrases: "works correctly", "functions properly", "behaves as expected"
  3. Add expected outcomes:
    • Every test idea must have a specific, verifiable assertion
    • Use concrete values where possible (HTTP codes, counts, strings)
  1. Replace passive verbs with active verbs:
    • "Verify" -> "Confirm ... by [action]"
    • "Check" -> "Validate ... by [action]"
    • "Test" -> "Exercise ... by [action]"
    • "Ensure" -> "Demonstrate ... by [action]"
    • "Should" -> "[Action verb] ... to [outcome]"
  2. Add concrete actions:
    • Every test idea must specify WHAT action triggers the test
    • Every test idea must specify HOW to observe the result
    • No vague phrases: "works correctly", "functions properly", "behaves as expected"
  3. Add expected outcomes:
    • Every test idea must have a specific, verifiable assertion
    • Use concrete values where possible (HTTP codes, counts, strings)

REQUIRED OUTPUT

REQUIRED OUTPUT

Rewritten Test Ideas Table

Rewritten Test Ideas Table

#Original Test IdeaRewritten Test IdeaSource AgentPriority
1[original][rewritten with action verb + concrete assertion][agent]P0/P1/P2
2............
#Original Test IdeaRewritten Test IdeaSource AgentPriority
1[original][rewritten with action verb + concrete assertion][agent]P0/P1/P2
2............

Transformation Metrics

Transformation Metrics

MetricValue
Total test ideas processed__
Ideas requiring rewrite__
Ideas already actionable__
New ideas added (from gaps)__
P0 test ideas__
P1 test ideas__
P2 test ideas__
MetricValue
Total test ideas processed__
Ideas requiring rewrite__
Ideas already actionable__
New ideas added (from gaps)__
P0 test ideas__
P1 test ideas__
P2 test ideas__

Test Idea Quality Score

Test Idea Quality Score

DimensionBeforeAfter
Action verb usage__%100%
Concrete assertions__%__%
Specific test data__%__%
Observable outcomes__%__%
OVERALL TEST IDEA QUALITY: __/100
DimensionBeforeAfter
Action verb usage__%100%
Concrete assertions__%__%
Specific test data__%__%
Observable outcomes__%__%
OVERALL TEST IDEA QUALITY: __/100

OUTPUT FORMAT

OUTPUT FORMAT

Save to: ${OUTPUT_FOLDER}/08-rewritten-test-ideas.md Use the Write tool to save BEFORE completing.
Save to: ${OUTPUT_FOLDER}/08-rewritten-test-ideas.md Use the Write tool to save BEFORE completing.

VALIDATION BEFORE SUBMITTING

VALIDATION BEFORE SUBMITTING

+-- Did I process ALL test ideas from ALL agent outputs? +-- Does every rewritten idea use an active verb? +-- Does every rewritten idea have a concrete assertion? +-- Did I calculate transformation metrics? +-- Did I save the report to the correct output path?`, subagent_type: "qe-test-idea-rewriter", run_in_background: true })
undefined
+-- Did I process ALL test ideas from ALL agent outputs? +-- Does every rewritten idea use an active verb? +-- Does every rewritten idea have a concrete assertion? +-- Did I calculate transformation metrics? +-- Did I save the report to the correct output path?`, subagent_type: "qe-test-idea-rewriter", run_in_background: true })
undefined

Wait for Transformation Completion

等待转换完成

+-------------------------------------------------------------+
|  WAIT for qe-test-idea-rewriter to complete before           |
|  proceeding to Phase 9.                                      |
|                                                              |
|  The rewritten test ideas are the PRIMARY deliverable of     |
|  the Refinement Swarm - they feed directly into the          |
|  Development phase as test specifications.                   |
+-------------------------------------------------------------+

+-------------------------------------------------------------+
|  等待qe-test-idea-rewriter执行完成后再进入阶段9。                                      |
|                                                              |
|  重写后的测试思路是梳理Swarm的核心交付物,会直接作为测试规范输入到开发阶段。                   |
+-------------------------------------------------------------+

PHASE 9: Final Output

阶段9:最终输出

At the very end of swarm execution, ALWAYS output this completion summary:
+---------------------------------------------------------------------+
|                  QCSD REFINEMENT SWARM COMPLETE                      |
+---------------------------------------------------------------------+
|                                                                      |
|  Story Analyzed: [Story Name/ID]                                     |
|  Reports Generated: [count]                                          |
|  Output Folder: ${OUTPUT_FOLDER}                                     |
|                                                                      |
|  REFINEMENT SCORES:                                                  |
|  +-- SFDIPOT Coverage:     __/7 factors                              |
|  +-- BDD Scenarios:        __ generated                              |
|  +-- INVEST Completeness:  __%                                       |
|  +-- Critical Gaps:        __                                        |
|  +-- Test Idea Quality:    __/100                                    |
|                                                                      |
|  RECOMMENDATION: [READY / CONDITIONAL / NOT-READY]                   |
|  REASON: [1-2 sentence rationale]                                    |
|                                                                      |
|  DELIVERABLES:                                                       |
|  +-- 01-executive-summary.md                                         |
|  +-- 02-sfdipot-analysis.md                                          |
|  +-- 03-bdd-scenarios.md                                             |
|  +-- 04-requirements-validation.md                                   |
|  [IF HAS_API]                                                        |
|  +-- 05-contract-validation.md                                       |
|  [IF HAS_REFACTORING]                                                |
|  +-- 06-impact-analysis.md                                           |
|  [IF HAS_DEPENDENCIES]                                               |
|  +-- 07-dependency-map.md                                            |
|  +-- 08-rewritten-test-ideas.md                                      |
|  +-- 09-learning-persistence.json                                    |
|                                                                      |
+---------------------------------------------------------------------+
IF recommendation is NOT-READY, ALSO output this prominent action box:
+---------------------------------------------------------------------+
|  ACTION REQUIRED: STORY IS NOT READY FOR SPRINT                      |
+---------------------------------------------------------------------+
|                                                                      |
|  The following blockers MUST be resolved before next refinement:     |
|                                                                      |
|  1. [Blocker 1 with specific remediation]                            |
|  2. [Blocker 2 with specific remediation]                            |
|  3. [Blocker 3 with specific remediation]                            |
|                                                                      |
|  NEXT STEPS:                                                         |
|  - Address all P0 blockers listed above                              |
|  - Re-run /qcsd-refinement-swarm after fixes                        |
|  - Target: INVEST completeness >= 90%, 0 critical gaps               |
|                                                                      |
+---------------------------------------------------------------------+
IF recommendation is CONDITIONAL, output this guidance box:
+---------------------------------------------------------------------+
|  CONDITIONAL: STORY NEEDS MINOR ADJUSTMENTS                          |
+---------------------------------------------------------------------+
|                                                                      |
|  The story can enter the sprint WITH these conditions:               |
|                                                                      |
|  1. [Condition 1 - must be addressed in first 2 days]                |
|  2. [Condition 2 - must be addressed before testing]                 |
|                                                                      |
|  RISK ACCEPTANCE:                                                    |
|  - Team acknowledges remaining gaps                                  |
|  - Sprint scope may need adjustment if conditions not met            |
|                                                                      |
+---------------------------------------------------------------------+
DO NOT end the swarm without displaying the completion summary.

Swarm执行完成后,必须始终输出以下完成汇总:
+---------------------------------------------------------------------+
|                  QCSD REFINEMENT SWARM COMPLETE                      |
+---------------------------------------------------------------------+
|                                                                      |
|  已分析故事:[故事名称/ID]                                     |
|  已生成报告数:[count]                                          |
|  输出目录:${OUTPUT_FOLDER}                                     |
|                                                                      |
|  梳理得分:                                                  |
|  +-- SFDIPOT覆盖度:     __/7个因子                              |
|  +-- BDD场景数量:        __个生成                              |
|  +-- INVEST完整性:  __%                                       |
|  +-- 关键缺口数量:        __                                        |
|  +-- 测试思路质量:    __/100                                    |
|                                                                      |
|  推荐结论:[READY / CONDITIONAL / NOT-READY]                   |
|  原因:[1-2句话说明]                                    |
|                                                                      |
|  交付物:                                                       |
|  +-- 01-executive-summary.md                                         |
|  +-- 02-sfdipot-analysis.md                                          |
|  +-- 03-bdd-scenarios.md                                             |
|  +-- 04-requirements-validation.md                                   |
|  [若HAS_API为TRUE]                                                        |
|  +-- 05-contract-validation.md                                       |
|  [若HAS_REFACTORING为TRUE]                                                |
|  +-- 06-impact-analysis.md                                           |
|  [若HAS_DEPENDENCIES为TRUE]                                               |
|  +-- 07-dependency-map.md                                            |
|  +-- 08-rewritten-test-ideas.md                                      |
|  +-- 09-learning-persistence.json                                    |
|                                                                      |
+---------------------------------------------------------------------+
如果推荐结论为NOT-READY,还需要输出以下醒目的动作提示框:
+---------------------------------------------------------------------+
|  需要动作:故事未达到Sprint准入要求                      |
+---------------------------------------------------------------------+
|                                                                      |
|  下次梳理前必须解决以下阻塞项:     |
|                                                                      |
|  1. [阻塞项1及具体修复方案]                            |
|  2. [阻塞项2及具体修复方案]                            |
|  3. [阻塞项3及具体修复方案]                            |
|                                                                      |
|  下一步动作:                                                         |
|  - 解决上述所有P0阻塞项                              |
|  - 修复完成后重新运行/qcsd-refinement-swarm                        |
|  - 目标:INVEST完整性 >= 90%,0个关键缺口               |
|                                                                      |
+---------------------------------------------------------------------+
如果推荐结论为CONDITIONAL,输出以下指导框:
+---------------------------------------------------------------------+
|  条件准入:故事需要少量调整                          |
+---------------------------------------------------------------------+
|                                                                      |
|  故事可进入Sprint,但需要满足以下条件:               |
|                                                                      |
|  1. [条件1 - 必须在前2天完成]                |
|  2. [条件2 - 必须在测试开始前完成]                 |
|                                                                      |
|  风险接受:                                                    |
|  - 团队已确认剩余缺口                                  |
|  - 若条件未满足,可能需要调整Sprint范围            |
|                                                                      |
+---------------------------------------------------------------------+
未展示完成汇总前,不得结束Swarm执行。

Report Filename Mapping

报告文件名映射

AgentReport FilenamePhase
qe-product-factors-assessor
02-sfdipot-analysis.md
Batch 1
qe-bdd-generator
03-bdd-scenarios.md
Batch 1
qe-requirements-validator
04-requirements-validation.md
Batch 1
qe-contract-validator
05-contract-validation.md
Batch 2 (conditional)
qe-impact-analyzer
06-impact-analysis.md
Batch 2 (conditional)
qe-dependency-mapper
07-dependency-map.md
Batch 2 (conditional)
qe-test-idea-rewriter
08-rewritten-test-ideas.md
Batch 3 (transformation)
Learning Persistence
09-learning-persistence.json
Phase 7 (auto-execute)
Synthesis
01-executive-summary.md
Phase 6

Agent报告文件名阶段
qe-product-factors-assessor
02-sfdipot-analysis.md
批次1
qe-bdd-generator
03-bdd-scenarios.md
批次1
qe-requirements-validator
04-requirements-validation.md
批次1
qe-contract-validator
05-contract-validation.md
批次2(条件触发)
qe-impact-analyzer
06-impact-analysis.md
批次2(条件触发)
qe-dependency-mapper
07-dependency-map.md
批次2(条件触发)
qe-test-idea-rewriter
08-rewritten-test-ideas.md
批次3(转换)
学习持久化
09-learning-persistence.json
阶段7(自动执行)
汇总
01-executive-summary.md
阶段6

DDD Domain Integration

DDD领域集成

This swarm operates across 1 primary domain, 3 conditional domains, and 1 transformation domain:
+-----------------------------------------------------------------------------+
|                    QCSD REFINEMENT - DOMAIN MAP                              |
+-----------------------------------------------------------------------------+
|                                                                              |
|  PRIMARY DOMAIN (Always Active)                                              |
|  +-----------------------------------------------------------------------+  |
|  |                    requirements-validation                            |  |
|  |  -----------------------------------------------------------------   |  |
|  |  - qe-product-factors-assessor (SFDIPOT 7 factors)                   |  |
|  |  - qe-bdd-generator (Gherkin scenarios)                              |  |
|  |  - qe-requirements-validator (INVEST + DoR)                          |  |
|  +-----------------------------------------------------------------------+  |
|                                                                              |
|  CONDITIONAL DOMAINS (Based on Story Content)                                |
|  +-----------------------+  +-----------------------+                        |
|  |  contract-testing     |  |  code-intelligence    |                        |
|  |  -------------------  |  |  -------------------  |                        |
|  |  qe-contract-         |  |  qe-impact-analyzer   |                        |
|  |    validator           |  |  qe-dependency-mapper |                        |
|  |  [IF HAS_API]         |  |  [IF HAS_REFACTORING  |                        |
|  |                       |  |   or HAS_DEPENDENCIES]|                        |
|  +-----------------------+  +-----------------------+                        |
|                                                                              |
|  +------------------------------------------+                                |
|  |  enterprise-integration                   |                                |
|  |  ---------------------------------------- |                                |
|  |  qe-middleware-validator                  |                                |
|  |    [IF HAS_MIDDLEWARE]                    |                                |
|  |  qe-odata-contract-tester                |                                |
|  |    [IF HAS_SAP_INTEGRATION]              |                                |
|  |  qe-sod-analyzer                         |                                |
|  |    [IF HAS_AUTHORIZATION]                |                                |
|  +------------------------------------------+                                |
|                                                                              |
|  TRANSFORMATION DOMAIN (Always Active)                                       |
|  +-----------------------------------------------------------------------+  |
|  |                      test-generation                                  |  |
|  |  -----------------------------------------------------------------   |  |
|  |  - qe-test-idea-rewriter (action verb transformation)                |  |
|  +-----------------------------------------------------------------------+  |
|                                                                              |
+-----------------------------------------------------------------------------+

本Swarm跨1个主领域3个条件领域1个转换领域运行:
+-----------------------------------------------------------------------------+
|                    QCSD REFINEMENT - DOMAIN MAP                              |
+-----------------------------------------------------------------------------+
|                                                                              |
|  主领域(始终激活)                                              |
|  +-----------------------------------------------------------------------+  |
|  |                    requirements-validation                            |  |
|  |  -----------------------------------------------------------------   |  |
|  |  - qe-product-factors-assessor (SFDIPOT 7 factors)                   |  |
|  |  - qe-bdd-generator (Gherkin scenarios)                              |  |
|  |  - qe-requirements-validator (INVEST + DoR)                          |  |
|  +-----------------------------------------------------------------------+  |
|                                                                              |
|  条件领域(基于故事内容触发)                                |
|  +-----------------------+  +-----------------------+                        |
|  |  contract-testing     |  |  code-intelligence    |                        |
|  |  -------------------  |  |  -------------------  |                        |
|  |  qe-contract-         |  |  qe-impact-analyzer   |                        |
|  |    validator           |  |  qe-dependency-mapper |                        |
|  |  [IF HAS_API]         |  |  [IF HAS_REFACTORING  |                        |
|  |                       |  |   or HAS_DEPENDENCIES]|                        |
|  +-----------------------+  +-----------------------+                        |
|                                                                              |
|  +------------------------------------------+                                |
|  |  enterprise-integration                   |                                |
|  |  ---------------------------------------- |                                |
|  |  qe-middleware-validator                  |                                |
|  |    [IF HAS_MIDDLEWARE]                    |                                |
|  |  qe-odata-contract-tester                |                                |
|  |    [IF HAS_SAP_INTEGRATION]              |                                |
|  |  qe-sod-analyzer                         |                                |
|  |    [IF HAS_AUTHORIZATION]                |                                |
|  +------------------------------------------+                                |
|                                                                              |
|  转换领域(始终激活)                                       |
|  +-----------------------------------------------------------------------+  |
|  |                      test-generation                                  |  |
|  |  -----------------------------------------------------------------   |  |
|  |  - qe-test-idea-rewriter (action verb transformation)                |  |
|  +-----------------------------------------------------------------------+  |
|                                                                              |
+-----------------------------------------------------------------------------+

Execution Model Options

执行模型选项

This skill supports 3 execution models. Choose based on your environment:
ModelWhen to UseProsCons
Task Tool (PRIMARY)Claude Code sessionsFull agent capabilities, parallel executionRequires Claude Code
MCP ToolsMCP server availableFleet coordination, memory persistenceRequires MCP setup
CLITerminal/scriptsWorks anywhere, scriptableSequential only
本技能支持3种执行模型,可根据你的环境选择:
模型适用场景优势劣势
Task Tool(主选)Claude Code会话完整Agent能力、并行执行需要Claude Code
MCP Tools可用MCP服务器集群协调、内存持久化需要MCP部署
CLI终端/脚本随处可用、支持脚本化仅支持串行执行

Quick Start by Model

按模型快速开始

Option A: Task Tool (RECOMMENDED)
Just follow the skill phases below - uses Task() calls with run_in_background: true
Option B: MCP Tools
javascript
// Initialize fleet for Refinement domains
mcp__agentic-qe__fleet_init({
  topology: "hierarchical",
  enabledDomains: ["requirements-validation", "contract-testing", "code-intelligence", "test-generation"],
  maxAgents: 7
})

// Orchestrate refinement task
mcp__agentic-qe__task_orchestrate({
  task: "qcsd-refinement-analysis",
  strategy: "parallel"
})
Option C: CLI
bash
undefined
选项A:Task Tool(推荐)
直接按照以下技能阶段执行 - 使用Task()调用并设置run_in_background: true
选项B:MCP Tools
javascript
// 为梳理领域初始化集群
mcp__agentic-qe__fleet_init({
  topology: "hierarchical",
  enabledDomains: ["requirements-validation", "contract-testing", "code-intelligence", "test-generation"],
  maxAgents: 7
})

// 编排梳理任务
mcp__agentic-qe__task_orchestrate({
  task: "qcsd-refinement-analysis",
  strategy: "parallel"
})
选项C:CLI
bash
undefined

Initialize coordination

初始化协调器

npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 7
npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 7

Route task

路由任务

npx @claude-flow/cli@latest hooks pre-task --description "QCSD Refinement for [Story]"
npx @claude-flow/cli@latest hooks pre-task --description "QCSD Refinement for [Story]"

Execute agents

执行Agent

npx @claude-flow/cli@latest agent spawn --type qe-product-factors-assessor npx @claude-flow/cli@latest agent spawn --type qe-bdd-generator npx @claude-flow/cli@latest agent spawn --type qe-requirements-validator

---
npx @claude-flow/cli@latest agent spawn --type qe-product-factors-assessor npx @claude-flow/cli@latest agent spawn --type qe-bdd-generator npx @claude-flow/cli@latest agent spawn --type qe-requirements-validator

---

Quick Reference

快速参考

Enforcement Summary

执行要求汇总

PhaseMust DoFailure Condition
1Check ALL 7 flagsMissing flag evaluation
2Spawn ALL 3 core agents in ONE messageFewer than 3 Task calls
3WAIT for completionProceeding before results
4Spawn ALL flagged conditional agentsSkipping a TRUE flag
5Apply EXACT decision logicWrong recommendation
6Generate COMPLETE reportMissing sections
7ALWAYS store learnings + save 09-learning-persistence.jsonPattern loss, missing audit trail
8ALWAYS run test idea rewriterSkipping transformation
9Output completion summaryMissing final output
阶段必须执行项失败条件
1检查全部7个标识缺失标识评估
2在同一条消息中启动全部3个核心Agent任务调用少于3个
3等待执行完成结果未返回就推进
4启动所有标识对应的条件Agent跳过值为TRUE的标识对应的Agent
5严格执行决策逻辑推荐结论错误
6生成完整报告缺失章节
7始终存储学习数据并保存09-learning-persistence.json模式丢失、缺失审计轨迹
8始终运行测试思路重写器跳过转换步骤
9输出完成汇总缺失最终输出

Quality Gate Thresholds

质量门禁阈值

MetricREADYCONDITIONALNOT-READY
SFDIPOT Coverage>=7/75-6/7<5/7
BDD Scenarios>=103-9<3
INVEST Completeness>=90%50-89%<50%
Critical Gaps01-3>3
指标READYCONDITIONALNOT-READY
SFDIPOT覆盖度>=7/75-6/7<5/7
BDD场景数量>=103-9<3
INVEST完整性>=90%50-89%<50%
关键缺口数量01-3>3

Domain-to-Agent Mapping

领域到Agent映射

DomainAgentPhaseBatch
requirements-validationqe-product-factors-assessorCore1
requirements-validationqe-bdd-generatorCore1
requirements-validationqe-requirements-validatorCore1
contract-testingqe-contract-validatorConditional (HAS_API)2
code-intelligenceqe-impact-analyzerConditional (HAS_REFACTORING)2
code-intelligenceqe-dependency-mapperConditional (HAS_DEPENDENCIES)2
enterprise-integrationqe-middleware-validatorConditional (HAS_MIDDLEWARE)2
enterprise-integrationqe-odata-contract-testerConditional (HAS_SAP_INTEGRATION)2
enterprise-integrationqe-sod-analyzerConditional (HAS_AUTHORIZATION)2
test-generationqe-test-idea-rewriterTransformation (ALWAYS)3
领域Agent阶段批次
requirements-validationqe-product-factors-assessor核心1
requirements-validationqe-bdd-generator核心1
requirements-validationqe-requirements-validator核心1
contract-testingqe-contract-validator条件触发(HAS_API)2
code-intelligenceqe-impact-analyzer条件触发(HAS_REFACTORING)2
code-intelligenceqe-dependency-mapper条件触发(HAS_DEPENDENCIES)2
enterprise-integrationqe-middleware-validator条件触发(HAS_MIDDLEWARE)2
enterprise-integrationqe-odata-contract-tester条件触发(HAS_SAP_INTEGRATION)2
enterprise-integrationqe-sod-analyzer条件触发(HAS_AUTHORIZATION)2
test-generationqe-test-idea-rewriter转换(始终执行)3

Execution Model Quick Reference

执行模型快速参考

ModelInitializationAgent SpawnMemory Store
Task ToolN/A
Task({ subagent_type, run_in_background: true })
N/A (use MCP)
MCP Tools
fleet_init({})
task_submit({})
memory_store({})
CLI
swarm init
agent spawn
memory store
模型初始化Agent启动内存存储
Task Tool
Task({ subagent_type, run_in_background: true })
无(使用MCP)
MCP Tools
fleet_init({})
task_submit({})
memory_store({})
CLI
swarm init
agent spawn
memory store

MCP Tools Quick Reference

MCP工具快速参考

javascript
// Initialization
mcp__agentic-qe__fleet_init({
  topology: "hierarchical",
  enabledDomains: ["requirements-validation", "contract-testing", "code-intelligence", "test-generation"],
  maxAgents: 7
})

// Task submission
mcp__agentic-qe__task_submit({ type: "...", priority: "p0", payload: {...} })
mcp__agentic-qe__task_orchestrate({ task: "...", strategy: "parallel" })

// Status
mcp__agentic-qe__fleet_status({ verbose: true })
mcp__agentic-qe__task_list({ status: "pending" })

// Memory
mcp__agentic-qe__memory_store({ key: "...", value: {...}, namespace: "qcsd-refinement" })
mcp__agentic-qe__memory_query({ pattern: "qcsd-refinement-*", namespace: "qcsd-refinement" })
mcp__agentic-qe__memory_share({
  sourceAgentId: "qcsd-refinement-swarm",
  targetAgentIds: ["qe-learning-coordinator"],
  knowledgeDomain: "refinement-patterns"
})
javascript
// 初始化
mcp__agentic-qe__fleet_init({
  topology: "hierarchical",
  enabledDomains: ["requirements-validation", "contract-testing", "code-intelligence", "test-generation"],
  maxAgents: 7
})

// 任务提交
mcp__agentic-qe__task_submit({ type: "...", priority: "p0", payload: {...} })
mcp__agentic-qe__task_orchestrate({ task: "...", strategy: "parallel" })

// 状态查询
mcp__agentic-qe__fleet_status({ verbose: true })
mcp__agentic-qe__task_list({ status: "pending" })

// 内存操作
mcp__agentic-qe__memory_store({ key: "...", value: {...}, namespace: "qcsd-refinement" })
mcp__agentic-qe__memory_query({ pattern: "qcsd-refinement-*", namespace: "qcsd-refinement" })
mcp__agentic-qe__memory_share({
  sourceAgentId: "qcsd-refinement-swarm",
  targetAgentIds: ["qe-learning-coordinator"],
  knowledgeDomain: "refinement-patterns"
})

CLI Quick Reference

CLI快速参考

bash
undefined
bash
undefined

Initialization

初始化

npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 7
npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 7

Agent operations

Agent操作

npx @claude-flow/cli@latest agent spawn --type [agent-type] --task "[description]" npx @claude-flow/cli@latest hooks pre-task --description "[task]" npx @claude-flow/cli@latest hooks post-task --task-id "[id]" --success true
npx @claude-flow/cli@latest agent spawn --type [agent-type] --task "[description]" npx @claude-flow/cli@latest hooks pre-task --description "[task]" npx @claude-flow/cli@latest hooks post-task --task-id "[id]" --success true

Status

状态查询

npx @claude-flow/cli@latest swarm status
npx @claude-flow/cli@latest swarm status

Memory

内存操作

npx @claude-flow/cli@latest memory store --key "[key]" --value "[json]" --namespace qcsd-refinement npx @claude-flow/cli@latest memory search --query "[query]" --namespace qcsd-refinement npx @claude-flow/cli@latest memory list --namespace qcsd-refinement

---
npx @claude-flow/cli@latest memory store --key "[key]" --value "[json]" --namespace qcsd-refinement npx @claude-flow/cli@latest memory search --query "[query]" --namespace qcsd-refinement npx @claude-flow/cli@latest memory list --namespace qcsd-refinement

---

Swarm Topology

Swarm拓扑

                 QCSD REFINEMENT SWARM v1.0
                          |
          BATCH 1 (Core - Parallel)
          +-----------+---+-----------+
          |           |               |
    +-----v-----+ +---v---+ +--------v--------+
    | Product   | |  BDD  | | Requirements    |
    | Factors   | | Gen   | | Validator       |
    | (SFDIPOT) | |(Ghrkn)| | (INVEST+DoR)   |
    |-----------| |-------| |-----------------|
    | req-valid | |req-val| | req-valid       |
    +-----+-----+ +---+---+ +--------+--------+
          |            |              |
          +------------+--------------+
                       |
                [METRICS GATE]
                       |
          BATCH 2 (Conditional - Parallel)
          +-----------+---+-----------+
          |           |               |
    +-----v-----+ +---v--------+ +---v----------+
    | Contract  | | Impact     | | Dependency   |
    | Validator | | Analyzer   | | Mapper       |
    | [IF API]  | | [IF REFAC] | | [IF DEPS]    |
    |-----------| |------------| |--------------|
    | contract  | | code-intel | | code-intel   |
    +-----------+ +------------+ +--------------+
                       |
                [SYNTHESIS]
                       |
          PHASE 7 (Learning Persistence - Always)
                       |
               +-------v-------+
               | memory_store  |
               | memory_share  |
               | 09-learning-  |
               | persistence   |
               | (ALWAYS RUNS) |
               +-------+-------+
                       |
          BATCH 3 (Transformation - Always)
                       |
               +-------v-------+
               | Test Idea     |
               | Rewriter      |
               | (ALWAYS RUNS) |
               |---------------|
               | test-gen      |
               +-------+-------+
                       |
              [FINAL REPORT]

                 QCSD REFINEMENT SWARM v1.0
                          |
          BATCH 1 (核心 - 并行)
          +-----------+---+-----------+
          |           |               |
    +-----v-----+ +---v---+ +--------v--------+
    | Product   | |  BDD  | | Requirements    |
    | Factors   | | Gen   | | Validator       |
    | (SFDIPOT) | |(Ghrkn)| | (INVEST+DoR)   |
    |-----------| |-------| |-----------------|
    | req-valid | |req-val| | req-valid       |
    +-----+-----+ +---+---+ +--------+--------+
          |            |              |
          +------------+--------------+
                       |
                [指标门禁]
                       |
          BATCH 2 (条件触发 - 并行)
          +-----------+---+-----------+
          |           |               |
    +-----v-----+ +---v--------+ +---v----------+
    | Contract  | | Impact     | | Dependency   |
    | Validator | | Analyzer   | | Mapper       |
    | [IF API]  | | [IF REFAC] | | [IF DEPS]    |
    |-----------| |------------| |--------------|
    | contract  | | code-intel | | code-intel   |
    +-----------+ +------------+ +--------------+
                       |
                [汇总分析]
                       |
          阶段7 (学习持久化 - 始终执行)
                       |
               +-------v-------+
               | memory_store  |
               | memory_share  |
               | 09-learning-  |
               | persistence   |
               | (ALWAYS RUNS) |
               +-------+-------+
                       |
          BATCH 3 (转换 - 始终执行)
                       |
               +-------v-------+
               | Test Idea     |
               | Rewriter      |
               | (ALWAYS RUNS) |
               |---------------|
               | test-gen      |
               +-------+-------+
                       |
              [最终报告]

Inventory Summary

资源汇总

Resource TypeCountPrimaryConditionalTransformation
Agents10361
Sub-agents0---
Skills33--
Domains5131
Parallel Batches3111
Skills Used:
  1. context-driven-testing
    - Context-appropriate test strategy
  2. testability-scoring
    - 10 testability principles
  3. risk-based-testing
    - Risk prioritization matrix
Frameworks Applied:
  1. SFDIPOT - 7 product factors, 37 subcategories
  2. BDD/Gherkin - Scenario specification language
  3. INVEST - Story quality validation (6 criteria)
  4. DoR - Definition of Ready checklist (10 items)
  5. Robert C. Martin coupling metrics (Ca/Ce/I)

资源类型数量核心条件触发转换
Agent10361
子Agent0---
技能33--
领域5131
并行批次3111
使用的技能:
  1. context-driven-testing
    - 上下文适配的测试策略
  2. testability-scoring
    - 10项可测试性原则
  3. risk-based-testing
    - 风险优先级矩阵
应用的框架:
  1. SFDIPOT - 7个产品因子,37个子分类
  2. BDD/Gherkin - 场景规范语言
  3. INVEST - 故事质量验证(6项标准)
  4. DoR - 就绪定义检查清单(10项)
  5. Robert C. Martin耦合指标(Ca/Ce/I)

Key Principle

核心理念

Stories enter sprints ready to test, not ready to argue about.
This swarm provides:
  1. What product factors matter? -> SFDIPOT Analysis (7 factors, 37 subcategories)
  2. How should we test it? -> BDD Scenarios (Gherkin specifications)
  3. Are requirements complete? -> INVEST Validation (6 criteria + DoR)
  4. Are contracts safe? -> Contract Validation (if APIs involved)
  5. What is the blast radius? -> Impact Analysis (if refactoring)
  6. What are the coupling risks? -> Dependency Mapping (if dependencies)
  7. Are test ideas actionable? -> Test Idea Rewriter (always)
  8. Is it sprint-ready? -> READY/CONDITIONAL/NOT-READY decision
  9. What did we learn? -> Memory persistence for future cycles
故事进入Sprint时应该是就绪可测试的,而不是就绪来争论的。
本Swarm提供:
  1. 哪些产品因子重要? -> SFDIPOT分析(7个因子,37个子分类)
  2. 我们应该如何测试? -> BDD场景(Gherkin规范)
  3. 需求是否完整? -> INVEST验证(6项标准 + DoR)
  4. 契约是否安全? -> 契约验证(涉及API时)
  5. 影响范围有多大? -> 影响分析(涉及重构时)
  6. 耦合风险有哪些? -> 依赖映射(涉及依赖时)
  7. 测试思路是否可执行? -> 测试思路重写器(始终执行)
  8. 是否达到Sprint准入标准? -> READY/CONDITIONAL/NOT-READY决策
  9. 我们学到了什么? -> 内存持久化用于未来周期