ワンクリックで
std-reviewer
Semantic QE review of STD YAML and test stubs against STP traceability, pattern correctness, and PSE quality
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Semantic QE review of STD YAML and test stubs against STP traceability, pattern correctness, and PSE quality
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Classify PR review comments on STP/STD documents into auto-fixable vs needs-human categories. Maps free-text feedback to QualityFlow domain rules for automated fix routing.
Resolve Jira ID to project configuration and load project context
Generate comprehensive v2.1-ENHANCED STD YAML with pattern metadata, variables, test structure from ALL STP scenarios (single file)
Orchestrate STP → STD pipeline (generates comprehensive STD YAML only)
Generate test stubs with PSE docstrings from STD YAML — language and framework driven by project config
Detect test conventions from a codebase to drive test generation without tier config
| name | std-reviewer |
| description | Semantic QE review of STD YAML and test stubs against STP traceability, pattern correctness, and PSE quality |
| model | claude-opus-4-6 |
| version | 1.1.0 |
Phase: Post-Generation Review User-Invocable: false
Perform a comprehensive semantic QE review of a generated STD (YAML + test stubs). This skill evaluates traceability to the source STP, pattern matching correctness, test step quality, PSE docstring quality, and code generation readiness.
Invoked by the review-std command after an STD has been generated by /std-builder.
This skill uses a two-layer review architecture:
{project_context.config_dir}/review_rules.yaml at runtime.If the review-std command has loaded a review_rules.yaml file and passed it as context,
use its contents to enhance checks with project-specific knowledge:
std_rules.patterns.keyword_to_pattern → keyword-to-pattern mapping table for Dimension 3astd_rules.patterns.pattern_to_helpers → pattern-to-helper-library mapping for Dimension 3bstd_rules.patterns.sig_to_decorator → SIG-to-decorator mapping for Dimension 3cstd_rules.patterns.closure_scope_required → required closure scope variables for Dimension 2cstd_rules.patterns.test_id_format → expected test ID format for Dimension 2bstd_rules.patterns.ginkgo_structure → expected Ginkgo structure for Dimension 6cstd_rules.timeouts → expected timeout ranges by operation type for Dimension 6dstd_rules.stub_conventions → stub file conventions (pending markers, package rules) for Dimension 5If no review_rules.yaml exists for the project, all dimensions still apply using built-in
general rules. Project-specific config adds precision (exact pattern mappings, helper library
tables) but is not required. The general rules check structural correctness, traceability,
and quality regardless of project-specific details.
std_yaml_path: "outputs/std/{JIRA_ID}/{JIRA_ID}_test_description.yaml"
stp_file_path: "outputs/stp/{JIRA_ID}/{JIRA_ID}_test_plan.md"
go_stubs_dir: "outputs/std/{JIRA_ID}/go-tests/" # may not exist
python_stubs_dir: "outputs/std/{JIRA_ID}/python-tests/" # may not exist
project_context: <from project-resolver, includes repo_rules>
review_rules: <from review_rules.yaml, if available>
When project_context.repo_rules is available, the reviewer validates stubs against
the target repository's standards:
From repo_rules.agents_rules (AGENTS.md):
tier2 marker is NOT explicitly added (it is implicit)network, storage, etc.) are NOT explicitly addedpytest.skip/skipif is NOT used anywhere__test__ = False placement follows the rules (class-level for grouped,
after function for standalone)conftest.py contains only fixtures (no helpers)@pytest.mark.incremental is used for dependent tests, not pytest-dependencyFrom repo_rules.std_format (SOFTWARE_TEST_DESCRIPTION.md):
Preconditions:, Steps:, Expected:[NEGATIVE] indicator is used for failure scenariosExpected: assertionSeverity: MAJOR for violations of repo_rules. These represent the team's own standards and failing to follow them will cause PR review friction.
A structured review report written to:
outputs/reviews/{JIRA_ID}/{JIRA_ID}_std_review.md
The review evaluates 7 dimensions. Each dimension produces findings classified as:
| Severity | Meaning | Impact on Verdict |
|---|---|---|
| CRITICAL | Missing traceability, invalid YAML, or error that would produce broken tests | Blocks approval |
| MAJOR | Quality issue, wrong pattern, or gap that should be addressed | Does not block but flags for attention |
| MINOR | Improvement suggestion or stylistic issue | Informational only |
Purpose: Verify complete bidirectional traceability between the STP and STD.
What to check:
Parse Section III of the STP (Requirements-to-Tests Mapping table). For each row:
scenarios array for a matching scenarioMatching algorithm (deterministic, applied in order):
Requirement ID exact match (required): requirement_id in STD must exactly match
a Requirement ID in the STP Section III. If no exact match, the scenario is an orphan.
Scenario text similarity (required for multi-scenario requirements): When one requirement maps to multiple STP scenarios, match each STD scenario to a specific STP scenario using keyword overlap:
shared_keywords / min(keywords_A, keywords_B)Tier match: tier must match (Tier 1 ↔ "Tier 1", Tier 2 ↔ "Tier 2").
Mismatch is a separate MAJOR finding, not a traceability failure.
Priority match: priority must match (P0/P1/P2).
Mismatch is a separate MAJOR finding, not a traceability failure.
Match result classification:
Red flags:
For each scenario in the STD YAML:
requirement_id exists in the STP Section III tableRed flags:
document_metadata.total_scenarios matches actual count of scenarios in arraydocument_metadata.tier_1_count matches count of scenarios with tier: "Tier 1"document_metadata.tier_2_count matches count of scenarios with tier: "Tier 2"document_metadata.p0_count matches count of scenarios with priority: "P0"Red flags:
document_metadata.stp_reference.file points to the actual STP fileRed flags:
For each scenario, verify that the priority assignment is consistent with testability:
Red flags:
Purpose: Verify the STD YAML conforms to v2.1-enhanced specification.
What to check:
document_metadata section exists with all required fieldsdocument_metadata.std_version is "2.1-enhanced"code_generation_config section exists (v2.1 requirement)code_generation_config.std_version is "2.1-enhanced"code_generation_config.package_name is inferred from owning_sigcommon_preconditions section existsscenarios array exists and is non-emptyFor each scenario in the scenarios array, verify presence of:
| Field | Required | Notes |
|---|---|---|
scenario_id | YES | Sequential number |
test_id | YES | Format per project config or default TS-{JIRA_ID}-{NUM:03d} |
tier | YES | "Tier 1" or "Tier 2" |
priority | YES | "P0", "P1", or "P2" |
requirement_id | YES | Jira issue key |
patterns | YES | Primary pattern + helpers |
variables | YES | v2.1: closure_scope array |
test_structure | YES | v2.1: describe/context/it |
code_structure | YES | Ginkgo structure hint |
test_objective | YES | title, what, why, acceptance_criteria |
test_data | YES | resource_definitions and/or api_endpoints |
test_steps | YES | setup, test_execution, cleanup arrays |
assertions | YES | At least 1 assertion per scenario |
If project config is loaded, use std_rules.patterns.test_id_format for the expected
test ID format. Otherwise, use the default TS-{JIRA_ID}-{NUM:03d}.
Red flags:
test_id does not follow the expected formatscenario_id or test_id valuestier value not "Tier 1" or "Tier 2"Universal checks (all tiers):
variables.closure_scope includes required variables appropriate for the tierIf project config is loaded, use std_rules.patterns.closure_scope_required for the
required closure scope variables.
Tier 1 (Go/Ginkgo) checks — apply ONLY to scenarios with tier: "Tier 1":
test_structure.context.decorators includes: Ordered= (not :=) for closure variablesExpect(err) calls use ExpectWithOffset(1, err)variables.closure_scope includes ctx and namespace (or per project config)Tier 2 (Python/pytest) checks — apply ONLY to scenarios with tier: "Tier 2":
@pytest.mark.incremental used for dependent tests (not pytest-dependency)pytest.skip or pytest.skipif used (per repo_rules.agents_rules if available)Red flags:
pytest-dependency used instead of @pytest.mark.incremental in Tier 2:= used for closure variable in Tier 1 (should be =)Purpose: Verify that the auto-generated pattern metadata is correct for each scenario.
What to check:
For each scenario, read the test_objective.title and test_steps, then verify the primary pattern assignment.
If project config is loaded, use std_rules.patterns.keyword_to_pattern for the
keyword-to-pattern mapping table. Otherwise, apply general heuristics: the primary
pattern should match the dominant action/domain of the test scenario based on keywords
in the title and steps.
Red flags:
Verify that patterns.helpers_required includes the correct libraries for the
matched patterns.
If project config is loaded, use std_rules.patterns.pattern_to_helpers for the
pattern-to-helper mapping table. Otherwise, verify that helper libraries referenced
in the scenario are consistent with the primary pattern and the test steps described.
Red flags:
Verify decorators are correct.
If project config is loaded, use std_rules.patterns.sig_to_decorator for the
SIG-to-decorator mapping. Otherwise, verify that:
General decorator checks (always apply):
| Condition | Expected |
|---|---|
| Tier 1 scenario | Tier 1 decorator |
| Tier 2 scenario | Tier 2 decorator |
| All ordered tests | Ordered decorator |
Red flags:
If the pattern library exists at {project_context.config_dir}/patterns/tier1_patterns.yaml,
verify that all pattern_id values in test_steps reference actual patterns in the library.
Red flags:
Purpose: Evaluate the quality of setup → execution → cleanup steps.
What to check:
For each scenario:
test_steps.setup has at least 1 steptest_steps.test_execution has at least 1 steptest_steps.cleanup has at least 1 step (resource cleanup)Red flags:
For each step, evaluate:
action is specific and actionable (not "Do the test")command or code reference is provided where applicablevalidation describes the expected outcomeRed flags:
Test steps and assertions should use user-observable language, not internal component references.
Red flags (MAJOR):
Acceptable:
Verify the step sequence makes sense:
Red flags:
When the STP is available, cross-reference each scenario's test setup against the STP's customer use case descriptions. Test setup should reflect realistic user workflows, not arbitrary technical sequences.
Red flags (MAJOR):
Red flags (MINOR):
If the STD contains upgrade-related scenarios (Tier 2 scenarios with "upgrade" in title or test_objective), verify they follow the before/after pattern:
Required structure for upgrade scenarios:
Red flags:
If multiple scenarios within the STD have explicit or implicit ordering dependencies (e.g., scenario B uses resources created by scenario A), verify the dependency is justified.
Acceptable dependencies:
Red flags (MAJOR):
Red flags (MINOR):
depends_on or ordering note)For each assertion:
description is specific (not "Verify it works")condition is measurable (not "Should be correct")priority is assigned (P0 or P1)Red flags:
Purpose: Verify that STD artifacts (YAML and stubs) contain only design-level content and do not include implementation details, invalid references, or content that belongs in other pipeline phases.
What to check:
Check both the STD YAML document_metadata and stub file docstrings for content that
does not belong in the STD phase:
STD YAML red flags (MAJOR):
related_prs or any PR URL list in document_metadata — PR URLs are implementation
artifacts that belong in the STP (which references them in Section I), not in the STD.
The STD describes what to test, not what code changed.Stub file red flags (MAJOR):
PR #16412, github.com/.../pull/...) in docstrings —
STD is a design document, not tied to specific PRsRed flags (MINOR):
Stub files should describe what to test, not how to implement it. Stubs are design artifacts for review, not implementation code.
Red flags (MAJOR):
Acceptable in stubs:
std_rules.stub_conventions for the expected pending markers (e.g., PendingIt()
for Go, pass for Python).STD stubs should NOT include test environment setup details. Tests assume all infrastructure is already in place.
Red flags (MAJOR):
Red flags (MINOR):
Purpose: Evaluate the Preconditions/Steps/Expected docstrings in generated test stubs.
What to check:
Read each *_stubs_test.go file in the go-stubs directory.
For each pending test block:
Additional checks:
Read each test_*_stubs.py file in the python-stubs directory.
For each test function:
Apply strict PSE section classification rules. Misclassified items cause confusion during implementation and human review.
Preconditions must describe what must be true BEFORE the test begins:
Steps must describe ACTIONS the test performs:
Expected must describe OBSERVABLE OUTCOMES to verify:
Classification red flags:
Red flags:
Verify that stubs cover all integration areas defined in the STD scenarios. Common integration areas that require dedicated stubs:
Check for missing stubs:
Red flags:
Purpose: Evaluate whether the STD YAML will produce valid, compilable test code when passed to the test generation commands.
What to check:
For each scenario's variables.closure_scope:
initialized_in references a valid lifecycle hookused_in references valid lifecycle hooksRed flags:
Check code_generation_config.imports against the helpers used across all scenarios:
patterns.helpers_required against available importsRed flags:
For each scenario's code_structure:
std_rules.patterns.ginkgo_structure for the expected structure pattern.Red flags:
Check timeout references in test steps:
If project config is loaded, use std_rules.timeouts for expected timeout ranges
by operation type. Otherwise, apply general heuristics: long-running operations
(resource creation, migration) should have larger timeouts than quick operations
(API calls, status checks).
Red flags:
Generate the review report as markdown:
# STD Review Report: {JIRA_ID}
**Reviewed:**
- STD YAML: {STD_YAML_PATH}
- STP Source: {STP_FILE_PATH}
- Go Stubs: {GO_STUBS_DIR or "N/A"}
- Python Stubs: {PYTHON_STUBS_DIR or "N/A"}
**Date:** {YYYY-MM-DD}
**Reviewer:** QualityFlow Automated Review (v1.1.0)
**Review Rules Schema:** {review_rules._extraction_metadata.schema_version or "N/A"}
---
## Verdict: {APPROVED | APPROVED_WITH_FINDINGS | NEEDS_REVISION}
## Summary
| Metric | Value |
|:-------|:------|
| Dimensions reviewed | {X}/7 |
| Critical findings | {count} |
| Major findings | {count} |
| Minor findings | {count} |
| Confidence | {HIGH / MEDIUM / LOW} |
## Traceability Summary
| Metric | Value |
|:-------|:------|
| STP scenarios | {count} |
| STD scenarios | {count} |
| Forward coverage (STP→STD) | {X}/{Y} ({percent}%) |
| Reverse coverage (STD→STP) | {X}/{Y} ({percent}%) |
| Orphan STD scenarios | {count} |
| Missing STD scenarios | {count} |
---
## Findings by Dimension
### Dimension 1: STP-STD Traceability
{traceability matrix and findings}
### Dimension 2: STD YAML Structure
{structural findings}
### Dimension 3: Pattern Matching Correctness
| Scenario | Primary Pattern | Helpers | Decorators | Status |
|:---------|:----------------|:--------|:-----------|:-------|
| {scenario_id} | {pattern} | {count} | {count} | {PASS/WARN/FAIL} |
{per-scenario findings}
### Dimension 4: Test Step Quality
| Scenario | Setup | Execution | Cleanup | Assertions | Status |
|:---------|:------|:----------|:--------|:-----------|:-------|
| {scenario_id} | {count} | {count} | {count} | {count} | {PASS/WARN/FAIL} |
{per-scenario findings}
### Dimension 4.5: STD Content Policy
{content policy findings: banned references, implementation details, environment separation}
### Dimension 5: PSE Docstring Quality
**Go Stubs:**
{findings per stub file}
**Python Stubs:**
{findings per stub file}
### Dimension 6: Code Generation Readiness
{readiness assessment and findings}
---
## Recommendations
{numbered list of actionable recommendations, ordered by severity}
1. **[CRITICAL]** {recommendation}
2. **[MAJOR]** {recommendation}
3. **[MINOR]** {recommendation}
---
## Confidence Notes
| Factor | Status |
|:-------|:-------|
| STD YAML parseable | {YES/NO} |
| STP file available | {YES/NO} |
| Go stubs present | {YES/NO} |
| Python stubs present | {YES/NO} |
| Pattern library available | {YES/NO} |
| All scenarios reviewed | {YES/NO} |
| Project review rules loaded | {YES/NO} |
**Confidence rationale:** {explanation of why confidence is HIGH/MEDIUM/LOW}
| Verdict | Criteria |
|---|---|
APPROVED | 0 critical findings, 0 major findings |
APPROVED_WITH_FINDINGS | 0 critical findings, 1+ major or minor findings |
NEEDS_REVISION | 1+ critical findings |
| Level | Criteria |
|---|---|
HIGH | STD YAML valid, STP available, stub files present, pattern library available, all 7 dimensions reviewed, review rules default_ratio <= 0.30 |
MEDIUM | STD YAML valid and STP available, but stubs or pattern library missing, OR review rules default_ratio <= 0.60 |
LOW | STD YAML valid but STP unavailable (review based on STD alone), OR review rules default_ratio > 0.60 |
When review_rules._extraction_metadata.default_ratio > 0.50, include a note in
Confidence Notes: "Review precision reduced: {X}% of rules using generic defaults.
Consider adding project-specific review_rules.yaml or enabling repo_files_fetch."
End of STD Reviewer Skill