AGENT SKILL

x-execute-shell-regression-tests

Regression-shell gate: reads QualityConfig.regression, runs curated scenario scripts against the target (self mode: generator output; service mode: client services), compares against baseline, and blocks merge on unexpected diffs.

License 许可
MIT
最近更新
2026-10-27
Stars
★ 0
Forks
1

01 前言 Front Matter

name
x-execute-shell-regression-tests
model
sonnet
visibility
public
description
Regression-shell gate: reads QualityConfig.regression, runs curated scenario scripts against the target (self mode: generator output; service mode: client services), compares against baseline, and blocks merge on unexpected diffs.
requires-any
[ "quality.regression.self", "quality.regression.service" ]
allowed-tools
Read, Write, Edit, Bash, Grep, Glob
argument-hint
<STORY-ID> [--mode self|service] [--update-baseline] [--scenarios-file <path>]
user-invocable
true
requires-capabilities
[]

03 SKILL.md 正文

Global Output Policy

  • Language: English ONLY.
  • Tone: Technical, Direct, and Concise.
  • Efficiency: Remove all conversational fillers and greetings to save tokens.

Skill: x-execute-shell-regression-tests

Regression-shell quality gate. Reads QualityConfig.regression from the project YAML, dispatches scenario scripts, captures output, diffs against governance/baselines/regression-baseline.json, and exits non-zero when unexpected divergence is detected.

Two modes:

  • self — generator validates its own output: runs ia-dev-env generate on a reference YAML config and compares the produced .claude/ directory against the stored golden snapshot.
  • service — client project validates its services: executes the scenario scripts in tests/regression/scenarios.yaml (HTTP/gRPC/CLI) and compares responses against recorded baselines.

Triggers

  • /x-execute-shell-regression-tests story-0073-0001 — auto-detects mode from quality.regression.mode
  • /x-execute-shell-regression-tests story-0073-0001 --mode self — force self mode
  • /x-execute-shell-regression-tests story-0073-0001 --mode service — force service mode
  • /x-execute-shell-regression-tests story-0073-0001 --update-baseline — record new baseline (opt-in)
  • /x-execute-shell-regression-tests story-0073-0001 --scenarios-file tests/regression/custom.yaml — override scenarios file

Parameters

Flag Type Default Description
STORY-ID String — Required. Story being gated.
--mode Enum from config Override regression mode (self or service).
--update-baseline Boolean false Write new baseline; do not fail on divergence.
--scenarios-file String from config Override path to scenarios.yaml.
--report String auto Output report path.

Phase 1 — Parse & Configure

<!-- TELEMETRY: phase.start --> Bash command: $CLAUDE_PROJECT_DIR/.claude/hooks/telemetry-phase.sh start x-execute-shell-regression-tests Phase-1-Parse

Read quality.regression from project YAML:

quality:
  regression:
    enabled: true
    mode: service          # self | service
    scenarios-file: tests/regression/scenarios.yaml

Resolve effective mode: --mode flag overrides YAML; YAML overrides default service.

When quality.regression.enabled=false → emit WARN: regression gate disabled and exit 0. When --mode self and no generator binary found → exit 2 OPERATIONAL_ERROR. When --mode service and scenarios file absent → exit 1 REGRESSION_SCENARIOS_MISSING.

<!-- TELEMETRY: phase.end --> Bash command: $CLAUDE_PROJECT_DIR/.claude/hooks/telemetry-phase.sh end x-execute-shell-regression-tests Phase-1-Parse ok

Phase 2 — Execute Scenarios

<!-- TELEMETRY: phase.start --> Bash command: $CLAUDE_PROJECT_DIR/.claude/hooks/telemetry-phase.sh start x-execute-shell-regression-tests Phase-2-Execute

Self mode

# Generate to a temp dir and diff against golden
ia-dev-env generate --config <reference-config.yaml> --output /tmp/regression-output/
diff -r --exclude="*.log" governance/baselines/regression-self-golden/ /tmp/regression-output/

Capture exit code and diff output. Any diff line counts as a divergence unless the path is listed in governance/baselines/regression-self-baseline.txt (exempt list).

Service mode

Execute each scenario in scenarios.yaml using the declared tool:

Scenario type Tool Min version
rest curl 7.68
grpc grpcurl 1.8
websocket wscat 5.0
cli native shell —

For each scenario:

  1. Run the command.
  2. Capture stdout/stderr + exit code.
  3. Compare against governance/baselines/regression-baseline.json (scenario ID → expected response hash).
  4. Record PASS/FAIL per scenario.

<!-- TELEMETRY: phase.end --> Bash command: $CLAUDE_PROJECT_DIR/.claude/hooks/telemetry-phase.sh end x-execute-shell-regression-tests Phase-2-Execute ok

Phase 3 — Report & Gate

<!-- TELEMETRY: phase.start --> Bash command: $CLAUDE_PROJECT_DIR/.claude/hooks/telemetry-phase.sh start x-execute-shell-regression-tests Phase-3-Report

Produce report at ai/epics/epic-XXXX/reports/regression-report-STORY-ID.md using _TEMPLATE-REGRESSION-SHELL.md.

When --update-baseline:

  • Write new governance/baselines/regression-baseline.json from current run results.
  • Append entry to governance/baselines/regression-baseline-updates.log (append-only).
  • Exit 0.

When NOT --update-baseline:

  • Count total scenarios, passed, failed.
  • If failed > 0 → exit 1 REGRESSION_DETECTED.
  • If failed == 0 → exit 0.

<!-- TELEMETRY: phase.end --> Bash command: $CLAUDE_PROJECT_DIR/.claude/hooks/telemetry-phase.sh end x-execute-shell-regression-tests Phase-3-Report ok

Exit Codes

Exit Code Condition
0 OK All scenarios passed (or gate disabled).
1 REGRESSION_DETECTED ≥1 scenario diverged from baseline.
2 OPERATIONAL_ERROR Tool missing, scenarios file absent, or binary not found.
3 BASELINE_CORRUPT governance/baselines/regression-baseline.json malformed.

Integration Notes

  • Invoked by x-implement-story Phase 3.Q when quality.regression.enabled=true (conditional gate — EPIC-0073, Rule 24).
  • Evidence artifact: ai/epics/epic-XXXX/reports/regression-report-STORY-ID.md (Rule 24 §Mandatory Evidence Artifacts).
  • Baseline updates require an entry in governance/baselines/regression-baseline-updates.log — silent overwrites fail audit-regression-shell.sh.
  • Internal skill x-internal-update-status is NOT invoked here; status updates are the caller's responsibility.

04 同仓库更多 Skills

review-bench
review-bench/edercnj_ia-dev-environment

x-parallel-eval

Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan / x-story-plan, applies the parallelism-heuristics knowledge pack (hard / regen / soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

parallelism-heuristics

Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard / regen / soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-watch-pr-ci

Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-validate-docs

Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared/auto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-system-architecture

Incrementally updates docs/architecture/system.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component/integration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.

★ 0
review-bench
review-bench/edercnj_ia-dev-environment

x-update-architecture

Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.

★ 0