Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Shift-left quality engineering swarm for Sprint Refinement sessions.
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.
These rules are NON-NEGOTIABLE. Violation means skill execution failure.
Rule
Enforcement
E1
You MUST spawn ALL THREE core agents (qe-product-factors-assessor, qe-bdd-generator, qe-requirements-validator) in Phase 2. No exceptions.
E2
You MUST put all parallel Task calls in a SINGLE message.
E3
You MUST STOP and WAIT after each batch. No proceeding early.
E4
You MUST spawn conditional agents if flags are TRUE. No skipping.
E5
You MUST apply READY/CONDITIONAL/NOT-READY logic exactly as specified in Phase 5.
E6
You MUST generate the full report structure. No abbreviated versions.
E7
Each agent MUST read its reference files before analysis.
E8
You MUST apply qe-test-idea-rewriter transformation on ALL test ideas in Phase 8. Always.
E9
You 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
PHASE 1: Analyze Story Content (Flag Detection)
MANDATORY: You must complete this analysis before Phase 2.
Scan the story content and SET these flags. Do not skip any flag.
Flag Detection (Check ALL SEVEN)
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.
MANDATORY: Output Flag Detection Results
You MUST output flag detection results before proceeding:
DO NOT proceed to Phase 2 without outputting flag detection results.
PHASE 2: Spawn Core Agents (PARALLEL BATCH 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. |
+-------------------------------------------------------------+
Domain Context
Agent
Domain
MCP Tool Mapping
qe-product-factors-assessor
requirements-validation
requirements_validate
qe-bdd-generator
requirements-validation
test_generate_enhanced
qe-requirements-validator
requirements-validation
requirements_validate
Agent 1: Product Factors Assessor (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.
## 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.
## STORY TO ANALYZE
=== STORY CONTENT START ===
[PASTE THE COMPLETE STORY CONTENT HERE - DO NOT SUMMARIZE]
=== STORY CONTENT END ===
## REQUIRED OUTPUT (ALL SECTIONS MANDATORY)
You MUST analyze ALL 7 SFDIPOT product factors. For each factor, analyze
its subcategories and assign a priority.
### 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
### 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
### 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
### 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
### 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
### 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
### 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
## SCORING REQUIREMENTS
For each of the 7 factors, provide:
| Field | Requirement |
|-------|-------------|
| Factor Name | One of the 7 SFDIPOT factors |
| Priority | P0, P1, P2, or P3 with justification |
| Subcategories Assessed | Count of subcategories analyzed |
| Coverage Depth | Shallow / Adequate / Deep |
| Key Findings | Top 3 findings for this factor |
| Test Focus Areas | Specific areas requiring test coverage |
## 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.
## 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
})
Agent 2: BDD Scenario Generator
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.
## METHODOLOGY
Apply Behaviour-Driven Development (BDD) principles to generate
comprehensive Gherkin scenarios from the story and its acceptance criteria.
## STORY TO ANALYZE
=== STORY CONTENT START ===
[PASTE THE COMPLETE STORY CONTENT HERE - DO NOT SUMMARIZE]
=== STORY CONTENT END ===
## REQUIRED OUTPUT (ALL SECTIONS MANDATORY)
### 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]
### 2. Scenario Categories (ALL MANDATORY)
You MUST generate scenarios in ALL of these categories:
#### Category A: Happy Path Scenarios (minimum 2)
- Primary success flow
- Variant success flows
#### Category B: Error/Negative Path Scenarios (minimum 2)
- Invalid input handling
- System error handling
- Boundary violations
#### Category C: Boundary/Edge Case Scenarios (minimum 1)
- Minimum and maximum values
- Empty states
- Null/undefined handling
#### Category D: Security Scenarios (if HAS_SECURITY flag is TRUE)
- Authentication failures
- Authorization violations
- Data protection scenarios
### 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"
### 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 |
### 5. Traceability Matrix
Map each scenario back to acceptance criteria:
| Scenario | Acceptance Criterion | Category |
|----------|---------------------|----------|
| Scenario 1 | AC-1 | Happy Path |
| Scenario 2 | AC-1, AC-3 | Error Path |
| ... | ... | ... |
### 6. Summary Metrics
| Metric | Value |
|--------|-------|
| Total Scenarios | __ |
| Happy Path | __ |
| Error Path | __ |
| Boundary | __ |
| Security | __ |
| Scenario Outlines | __ |
| Total Examples | __ |
| AC Coverage | __% |
**MINIMUM: 5 total scenarios. Target: 10+ scenarios.**
## 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.
## 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
})
Agent 3: Requirements Validator (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.
## METHODOLOGY
Apply INVEST validation and testability-scoring principles.
## STORY AND ACCEPTANCE CRITERIA TO VALIDATE
=== STORY CONTENT START ===
[PASTE THE COMPLETE STORY + ACCEPTANCE CRITERIA HERE - DO NOT SUMMARIZE]
=== STORY CONTENT END ===
## REQUIRED OUTPUT (ALL SECTIONS MANDATORY)
### 1. INVEST Validation (MANDATORY - ALL SIX CRITERIA)
Score each INVEST criterion 0-100:
| Criterion | Score | Evidence | Issues |
|-----------|-------|----------|--------|
| **I**ndependent | X/100 | Can this story be developed and tested independently of other stories? | [issues found] |
| **N**egotiable | X/100 | Is the story expressed as intent (not implementation detail)? | [issues found] |
| **V**aluable | X/100 | Does it deliver clear value to users or the business? | [issues found] |
| **E**stimable | X/100 | Can the team estimate effort with confidence? | [issues found] |
| **S**mall | X/100 | Can it be completed in a single sprint? | [issues found] |
| **T**estable | X/100 | Are there clear, verifiable acceptance criteria? | [issues found] |
**INVEST COMPLETENESS SCORE: XX/100** (average of all six criteria)
### 2. Acceptance Criteria Assessment
For EACH acceptance criterion:
| AC ID | Text | Testable? | Issues | Suggested 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)
Identify ALL gaps in the story:
#### Missing Requirements
- [Gap 1: Description of what is missing]
- [Gap 2: ...]
#### Ambiguous Language
- [Ambiguity 1: Quote the ambiguous text and explain]
- [Ambiguity 2: ...]
#### Missing Edge Cases
- [Edge Case 1: Scenario not covered by current ACs]
- [Edge Case 2: ...]
#### 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"**
### 4. Definition of Ready (DoR) Checklist
| DoR Item | Status | Notes |
|----------|--------|-------|
| Story has clear title and description | Pass/Fail | ... |
| Acceptance criteria are defined | Pass/Fail | ... |
| ACs are testable | Pass/Fail | ... |
| Dependencies are identified | Pass/Fail | ... |
| Story is estimated | Pass/Fail | ... |
| Story fits in a sprint | Pass/Fail | ... |
| UX designs available (if needed) | Pass/Fail/N/A | ... |
| API contracts defined (if needed) | Pass/Fail/N/A | ... |
| Test data requirements known | Pass/Fail | ... |
| No blockers identified | Pass/Fail | ... |
**DoR PASS RATE: X/10 (or X/N if N/A items excluded)**
### 5. Recommendations
Specific, actionable recommendations to make this story sprint-ready:
| Priority | Recommendation | Owner |
|----------|---------------|-------|
| 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
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
+-- 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
})
# Initialize swarm for refinement
npx @claude-flow/cli@latest swarm init \
--topology hierarchical \
--max-agents 7 \
--strategy specialized
# Pre-task hook for routing
npx @claude-flow/cli@latest hooks pre-task \
--description "QCSD Refinement: SFDIPOT, BDD Scenarios, INVEST Validation"# 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" &
# Wait for completionwait# Check swarm status
npx @claude-flow/cli@latest swarm status
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.
PHASE 3: Wait for Batch 1 Completion
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 |
+-------------------------------------------------------------+
+-------------------------------------------------------------+
| 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. |
+-------------------------------------------------------------+
Conditional Domain Mapping
Flag
Agent
Domain
MCP Tool
HAS_API
qe-contract-validator
contract-testing
contract_test
HAS_REFACTORING
qe-impact-analyzer
code-intelligence
coverage_analyze_sublinear
HAS_DEPENDENCIES
qe-dependency-mapper
code-intelligence
defect_predict
HAS_MIDDLEWARE
qe-middleware-validator
enterprise-integration
task_orchestrate
HAS_SAP_INTEGRATION
qe-odata-contract-tester
enterprise-integration
task_orchestrate
HAS_AUTHORIZATION
qe-sod-analyzer
enterprise-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: Contract Validator (MANDATORY WHEN FLAGGED)
Task({
description: "Consumer-driven contract validation",
prompt: `You are qe-contract-validator. Your output quality is being audited.
## STORY CONTENT
=== STORY CONTENT START ===
[PASTE THE COMPLETE STORY CONTENT HERE]
=== STORY CONTENT END ===
## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
### 1. API Contract Inventory
List EVERY API interaction mentioned or implied:
| Endpoint | Method | Consumer | Provider | Contract Defined? |
|----------|--------|----------|----------|--------------------|
| ... | GET/POST/etc | [who calls] | [who serves] | Yes/No |
### 2. Consumer-Driven Contract Assessment
For each API contract:
| Contract | Schema Defined? | Breaking Change Risk | Backward Compatible? |
|----------|-----------------|---------------------|---------------------|
| ... | Yes/No/Partial | High/Medium/Low | Yes/No/Unknown |
### 3. Breaking Change Detection
Analyze the story for potential breaking changes:
| Change | Type | Impact | Consumers Affected |
|--------|------|--------|-------------------|
| ... | Schema/Behavior/Removal | High/Medium/Low | [list] |
### 4. Contract Testing Recommendations
| Test Type | Tool | Priority | Scenarios |
|-----------|------|----------|-----------|
| Consumer contract | Pact/MSW | P0/P1/P2 | [scenarios] |
| Provider verification | Pact/Supertest | P0/P1/P2 | [scenarios] |
| Schema validation | Ajv/Zod | P0/P1/P2 | [scenarios] |
### 5. Contract Risk Score
| Dimension | Score (0-10) | Notes |
|-----------|-------------|-------|
| Schema completeness | X/10 | ... |
| Backward compatibility | X/10 | ... |
| Consumer coverage | X/10 | ... |
| Versioning strategy | X/10 | ... |
**CONTRACT RISK SCORE: X/40**
**MINIMUM: Identify at least 3 contract-related findings**
## 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
})
IF HAS_REFACTORING: Impact Analyzer (MANDATORY WHEN FLAGGED)
Task({
description: "Refactoring blast radius and impact analysis",
prompt: `You are qe-impact-analyzer. Your output quality is being audited.
## STORY CONTENT
=== STORY CONTENT START ===
[PASTE THE COMPLETE STORY CONTENT HERE]
=== STORY CONTENT END ===
## REQUIRED ANALYSIS (ALL SECTIONS MANDATORY)
### 1. Blast Radius Assessment
Identify all components affected by the refactoring:
| Component | Direct/Indirect | Change Type | Risk Level |
|-----------|----------------|-------------|------------|
| ... | Direct | Modified/Renamed/Moved/Deleted | High/Medium/Low |
### 2. Affected Test Inventory
| Test File/Suite | Status | Action Required |
|-----------------|--------|-----------------|
| ... | Will Break / May Break / Safe | Update / Rewrite / None |
### 3. Dependency Chain Analysis
Map the dependency chain for affected components:
If recommendation is CONDITIONAL, provide specific blockers:
Blocker
Current Value
Required Value
Owner
Action
...
...
...
[who]
[what to do]
If recommendation is NOT-READY, provide mandatory remediation:
Remediation
Priority
Effort
Deadline
...
P0
[hours/days]
[before next refinement]
PHASE 6: Generate Refinement Report
ENFORCEMENT: COMPLETE REPORT STRUCTURE
ALL sections below are MANDATORY. No abbreviations.
# QCSD Refinement Report: [Story Name]**Generated**: [Date/Time]
**Recommendation**: [READY / CONDITIONAL / NOT-READY]
**Agents Executed**: [List all agents that ran]
**Parallel Batches**: [2 or 3 depending on conditional agents]
---
## Executive Summary
| Metric | Value | Threshold | Status |
|--------|-------|-----------|--------|
| SFDIPOT Coverage | X/7 | >=7 | PASS/WARN/FAIL |
| BDD Scenarios | X | >=10 | PASS/WARN/FAIL |
| INVEST Completeness | X% | >=90% | PASS/WARN/FAIL |
| Critical Gaps | X | 0 | PASS/WARN/FAIL |
**Recommendation Rationale**: [1-2 sentences explaining why READY/CONDITIONAL/NOT-READY]
---
## SFDIPOT Product Factors Analysis
[EMBED or LINK the full report from qe-product-factors-assessor]
### Factor Priority Summary
| Factor | Priority | Key Finding | Test Focus |
|--------|----------|-------------|------------|
| 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
[EMBED the full Gherkin from qe-bdd-generator]
### Scenario Coverage Summary
| Category | Count | AC Coverage |
|----------|-------|-------------|
| Happy Path | X | [ACs covered] |
| Error Path | X | [ACs covered] |
| Boundary | X | [ACs covered] |
| Security | X | [ACs covered] |
| **Total** | **X** | **X%** |
---
## Requirements Validation### INVEST Score: X/100
| Criterion | Score | Status |
|-----------|-------|--------|
| Independent | X/100 | PASS/WARN/FAIL |
| Negotiable | X/100 | PASS/WARN/FAIL |
| Valuable | X/100 | PASS/WARN/FAIL |
| Estimable | X/100 | PASS/WARN/FAIL |
| Small | X/100 | PASS/WARN/FAIL |
| Testable | X/100 | PASS/WARN/FAIL |
### AC Assessment
| AC | Testable? | Issues | Rewrite Needed? |
|----|-----------|--------|-----------------|
[All ACs evaluated]
### Gaps Identified1. [Gap 1]
2. [Gap 2]
[All gaps from qe-requirements-validator]
### Definition of Ready: X/10 passing
---
## Conditional Analysis
[INCLUDE ONLY IF APPLICABLE - based on which conditional agents ran]
### Contract Validation (IF HAS_API)
[Full output from qe-contract-validator]
### Impact Analysis (IF HAS_REFACTORING)
[Full output from qe-impact-analyzer]
### Dependency Map (IF HAS_DEPENDENCIES)
[Full output from qe-dependency-mapper]
---
## Recommended Actions
### Before Sprint Commitment
- [ ] [Action based on findings]
- [ ] [Action based on findings]
### Sprint Planning Notes
- [ ] [Testing approach recommendation]
- [ ] [Dependency coordination needed]
### During Sprint
- [ ] [Action based on findings]
---
## Appendix: Agent Outputs
[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
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.
PHASE 7: Store Learnings & Persist State
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. |
+-------------------------------------------------------------+
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
Auto-Execution Steps (ALL THREE are MANDATORY)
Step 1: Store refinement findings to memory
You MUST execute this MCP call with actual values from the refinement analysis:
+-- 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.
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
PHASE 8: Apply Test Idea Rewriter (Transformation)
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:
Pattern
Transform To
Example
"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 voice
Active voice
"Data is validated" -> "Validate data against schema constraints"
Vague assertion
Concrete assertion
"Works correctly" -> "Returns HTTP 200 with expected JSON payload"
Agent Spawn
Task({
description: "Transform test ideas with action verbs",
prompt: `You are qe-test-idea-rewriter. Your output quality is being audited.
## PURPOSE
Transform ALL test ideas generated during this refinement session from
passive/vague descriptions into active, specific, actionable test
specifications.
## INPUT: RAW TEST IDEAS
Collect test ideas from ALL previous agent outputs:
### From SFDIPOT Analysis (02-sfdipot-analysis.md):
[List all test focus areas identified per factor]
### From BDD Scenarios (03-bdd-scenarios.md):
[List all scenario names as test ideas]
### From Requirements Validation (04-requirements-validation.md):
[List all gap-driven test ideas and recommendations]
### From Conditional Agents (if applicable):
[List all test recommendations from contract/impact/dependency analysis]
## 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)
## REQUIRED OUTPUT
### Rewritten Test Ideas Table
| # | Original Test Idea | Rewritten Test Idea | Source Agent | Priority |
|---|-------------------|---------------------|-------------|----------|
| 1 | [original] | [rewritten with action verb + concrete assertion] | [agent] | P0/P1/P2 |
| 2 | ... | ... | ... | ... |
### Transformation Metrics
| Metric | Value |
|--------|-------|
| 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
| Dimension | Before | After |
|-----------|--------|-------|
| Action verb usage | __% | 100% |
| Concrete assertions | __% | __% |
| Specific test data | __% | __% |
| Observable outcomes | __% | __% |
**OVERALL TEST IDEA QUALITY: __/100**
## OUTPUT FORMAT
Save to: ${OUTPUT_FOLDER}/08-rewritten-test-ideas.md
Use the Write tool to save BEFORE completing.
## 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
})
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. |
+-------------------------------------------------------------+
PHASE 9: Final Output
At the very end of swarm execution, ALWAYS output this completion summary:
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.
Report Filename Mapping
Agent
Report Filename
Phase
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
DDD Domain Integration
This swarm operates across 1 primary domain, 3 conditional domains,
and 1 transformation domain: