Back to list
pcortes

qa-regression-scanner

by pcortes

0🍴 0📅 Jan 6, 2026

SKILL.md


name: qa-regression-scanner description: > Analyzes code diffs to identify affected endpoints and prioritize regression testing. Focuses QA effort on changed areas. allowed-tools: Read,Glob,Grep,Bash

Regression Scanner Agent

You analyze code changes to identify what needs regression testing.

Diff Analysis

1. Get the diff

# Get changed files
git diff main...HEAD --name-only

# Get full diff for analysis
git diff main...HEAD

2. Handle Git Edge Cases

Dirty worktree:

git status --porcelain
# If output, warn: "Working tree has uncommitted changes"

Detached HEAD:

git symbolic-ref -q HEAD || echo "detached"
# If detached, use: git diff main...$(git rev-parse HEAD)

Missing base branch:

# Try branches in order: main, master, develop
git rev-parse --verify main 2>/dev/null || \
git rev-parse --verify master 2>/dev/null || \
git rev-parse --verify develop 2>/dev/null

Shallow clone:

git rev-parse --is-shallow-repository
# If true, warn: "Shallow clone - history may be incomplete"

Change Categorization

Categorize each changed file:

CategoryFile PatternsImpact Level
API Routes**/api/**, **/routes/**, **/controllers/**Direct (100)
Models**/models/**, **/schemas/**, **/entities/**High (80)
Services**/services/**, **/business/**Medium (60)
Utilities**/utils/**, **/helpers/**, **/lib/**Low (40)
Configconfig.*, .env*, settings.*Variable (30)
Teststest_*, *_test.*, *.spec.*None (0)
Docs*.md, docs/**None (0)

Impact Mapping

Map changes to affected endpoints:

Changed File           → Affected Endpoints
────────────────────────────────────────────────
src/api/users.py       → GET/POST/PUT/DELETE /api/users
src/models/user.py     → All endpoints using User model
src/services/auth.py   → All authenticated endpoints
src/db/migrations/     → All endpoints with DB access

Endpoint Discovery from Code

Look for route definitions:

# FastAPI
@router.get("/users/{user_id}")
@app.post("/api/v1/items")

# Flask
@app.route("/users", methods=["GET", "POST"])
@blueprint.route("/items/<id>")

# Express
router.get("/api/users", ...)
app.post("/api/items", ...)

Priority Scoring

Calculate priority (0-100) for each endpoint:

Change TypePriority Score
Direct change to endpoint handler100
Model change used by endpoint80
Service change called by endpoint60
Utility change used indirectly40
Config change affecting endpoint30

Priority Modifiers

  • Authentication endpoint: +10
  • Payment/billing endpoint: +10
  • DELETE operation: +5
  • New endpoint (added): +20

Regression Suite Selection

Based on priority scores:

must_test = []    # priority >= 80
should_test = []  # priority >= 50
may_skip = []     # priority < 50

for endpoint, priority in sorted_endpoints:
    if priority >= 80:
        must_test.append(endpoint)
    elif priority >= 50:
        should_test.append(endpoint)
    else:
        may_skip.append(endpoint)

Output Format

{
  "agent": "regression_scanner",
  "git_info": {
    "base_branch": "main",
    "head_commit": "abc123",
    "is_dirty": false,
    "warnings": []
  },
  "files_analyzed": 12,
  "endpoints_affected": 5,
  "change_categories": {
    "api_routes": ["src/api/users.py"],
    "models": ["src/models/user.py"],
    "services": [],
    "utilities": ["src/utils/validation.py"],
    "config": []
  },
  "impact_map": [
    {
      "file": "src/api/users.py",
      "endpoints": ["GET /api/users", "POST /api/users"],
      "priority": 100,
      "change_type": "direct_handler",
      "lines_changed": 45
    },
    {
      "file": "src/models/user.py",
      "endpoints": ["GET /api/users", "GET /api/users/{id}", "POST /api/users"],
      "priority": 80,
      "change_type": "model_change",
      "lines_changed": 12
    }
  ],
  "regression_suite": {
    "must_test": ["GET /api/users", "POST /api/users", "GET /api/users/{id}"],
    "should_test": ["GET /api/auth/me"],
    "may_skip": ["GET /api/health"]
  },
  "recommendation": "Run full regression on 3 endpoints, optional 1, skip 1"
}

Dependency Tracing

When a utility or model changes, trace its usage:

# Find all files importing the changed module
grep -r "from models.user import" --include="*.py"
grep -r "import.*User" --include="*.py"

Then map those files to their endpoints.

Risk Escalation

Flag high-risk changes:

  • Authentication/authorization logic
  • Payment processing
  • Data encryption
  • SQL queries (potential injection)
  • File operations (potential path traversal)

For high-risk changes, recommend DEEP testing depth.

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon