regression-selection-agent

$npx mdskill add Agile-V/agile_v_skills/regression-selection-agent

Selects and prioritizes regression tests using impact maps and dependency graphs.

  • Identifies which existing tests to run after a code change.
  • Depends on impact maps, affected components, and test inventory.
  • Uses graph dependencies and impact analysis to prioritize tests.
  • Outputs required test lists and flags coverage gaps for review.

SKILL.md

.github/skills/regression-selection-agentView on GitHub ↗
---
name: regression-selection-agent
description: Select and prioritize regression tests based on the impact map and graph dependency relationships, flagging coverage gaps before the Red Team step.
license: CC-BY-SA-4.0
compatibility: opencode
metadata:
  version: "1.0"
  standard: "Agile V"
  author: agile-v.org
---

# Skill: regression-selection-agent

## Purpose

Select and prioritize regression tests based on the impact map and graph dependency relationships.
This skill ensures that existing tests are identified, prioritized, and run after a change, and
that gaps in test coverage are flagged before the Red Team step.

---

## Trigger conditions

Use this skill when:

- Existing behavior must not break (regression risk).
- An impact map is available.
- The change affects shared modules, services, or APIs.
- The system has existing tests that need to be triaged.
- The Test Designer needs to know which existing tests to include.
- A release gate requires documented regression-test coverage.

---

## Inputs

```text
- .agile-v/impact/impact_map.md                 required
- .agile-v/impact/affected_components.json      required
- test inventory (discovered from test/ directory or graph test nodes)   required
- .agile-v/understanding/normalized_graph.json  optional but preferred
- previous test results (if available)          optional
```

---

## Outputs

All outputs are written to `.agile-v/regression/`.

```text
required_regression_tests.md
selected_tests.json
regression_coverage_rationale.md
missing_regression_tests.md
```

---

## Required behavior

### Step 1: Discover existing tests

1. Search the repository for test files (`.spec.ts`, `.test.ts`, `_test.py`, `test_*.py`, etc.).
2. If a normalized graph is available, use test nodes from the graph.
3. Build a test inventory: `test_path → linked_components` (from imports and graph edges).

### Step 2: Select tests linked to impacted components

For each test:
1. Check whether it imports, references, or tests any affected component.
2. Prioritize tests that directly test affected entry points.
3. Assign priority: High (direct), Medium (indirect), Low (general).

### Step 3: Identify gaps

For each affected component in `affected_components.json`:
1. Check whether any selected test covers it.
2. If no test is found, record a gap in `missing_regression_tests.md`.
3. Suggest a test name and structure for the missing coverage.

### Step 4: Build rationale

For each selected test, record:
- Why it was selected.
- Which requirement or risk it covers.
- Which component it links to.

---

## Output template: required_regression_tests.md

```markdown
# Required Regression Tests

| Test | Linked Component | Linked Requirement | Risk Covered | Priority |
|---|---|---|---|---|
| tests/auth/session.test.ts | src/auth/session.ts | REQ-003 | Session regression | High |

## Missing Regression Tests

| Required behavior | Reason | Suggested test |
|---|---|---|
| Rate limit boundary (5th pass, 6th fail) | No existing test | auth.e2e-spec.ts::boundary_test |
```

---

## Output schema: selected_tests.json

```json
[
  {
    "test_path": "test/auth/auth.e2e-spec.ts",
    "test_name": "should login with valid credentials",
    "linked_component_ids": ["node-042"],
    "linked_requirement_ids": ["REQ-001"],
    "risk_covered": "Core login path not broken",
    "priority": "high",
    "selection_reason": "Directly tests the affected login endpoint."
  }
]
```

---

## Anti-patterns to avoid

- Do not select all tests in the repository. Select only tests linked to affected components.
- Do not skip gap identification even if the test suite seems comprehensive.
- Do not assign High priority to tests with no clear link to affected components.
- Do not generate new test implementations in this skill (that is `test-designer`).

---

## Compatible tools

Claude Code, Cursor, Copilot, Codex, Gemini CLI, OpenCode, Cline.

More from Agile-V/agile_v_skills

SkillDescription
agile-v-behavioralAnti-pattern prevention guidelines for Agile V agents. Prevents common LLM coding mistakes while maintaining Agile V traceability. Use when implementing requirements to avoid overcomplication, silent assumptions, scope creep, and verification failures.
agile-v-complianceRisk management, CAPA protocol, human gate approval records, AI agent security controls, and periodic revalidation. Load when running gates, handling CAPAs, or auditing compliance and security posture.
agile-v-control-matrixDefines and checks the Agile-V control matrix for agentic tasks, skills, model use, tools, logs, rights, Human Gates, tests, costs, rollback, and owners. Load when creating, reviewing, or enforcing `.agile-v/CONTROL_MATRIX.yaml` or runtime governance for agentic execution.
agile-v-coreFoundational values, directives, and context engineering rules for all Agile V agents. Load first in every Agile V session.
agile-v-lifecycleMulti-cycle iteration management, document versioning, change requests, re-entry points, archival, and impact analysis. Load when starting a new cycle (C2+), processing change requests, or managing cross-cycle traceability.
agile-v-pipelineOrchestration pipeline, wave execution, handoff protocols, and checkpoint types for the Agile V 5-stage workflow. Load when orchestrating multi-agent pipelines or managing stage transitions.
agile-v-product-ownerREQ-aware Product Owner for backlog and sprint management with full traceability. Use for sprint planning, backlog prioritization, or converting REQs to INVEST stories.
agile-v-quality-gatesQuality validation gates for Agile V agents. Adds interface validation, test quality checks, data type awareness, and time allocation guidance to prevent common failure patterns identified in comprehensive testing.
build-agentGenerates code, firmware, HDL, or other technical artifacts strictly derived from approved requirements. Language-agnostic. Use when synthesizing artifacts from Logic Gatekeeper-approved requirements.
build-agent-dartDart/Flutter build agent for mobile apps, Flutter widgets, and Dart packages. Extends build-agent with Dart-specific conventions. Use when building Flutter apps, Dart packages, or mobile (iOS/Android) features.