Files
ComfyUI_frontend/.agents/checks/regression-risk.md
Christian Byrne df69d6b5d4 feat: add Amp code review checks (#9445)
## Summary

Add 22 automated code review check definitions and 1 strict ESLint
config to `.agents/checks/` for Amp-powered code review.

## Changes

- **What**: 23 files in `.agents/checks/` covering accessibility, API
contracts, architecture, bug patterns, CodeRabbit integration,
complexity, DDD structure, dependency/secrets scanning, doc freshness,
DX/readability, ecosystem compatibility, error handling, import graph,
memory leaks, pattern compliance, performance, regression risk,
security, SAST, SonarJS linting, test quality, and Vue patterns. Each
check includes YAML frontmatter (name, description, severity-default,
tools) and repo-specific guidance tailored to ComfyUI_frontend
conventions.

## Review Focus

- Check definitions are config-only (no runtime code changes)
- Checks reference repo-specific patterns (e.g., `useErrorHandling`
composable, `useToastStore`, `es-toolkit`, Tailwind 4, Vue Composition
API)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9445-feat-add-Amp-code-review-checks-31a6d73d3650817a8466fe2f4440a350)
by [Unito](https://www.unito.io)

---------

Co-authored-by: GitHub Action <action@github.com>
2026-03-05 15:29:30 -08:00

2.1 KiB

name, description, severity-default, tools
name description severity-default tools
regression-risk Detects potential regressions by analyzing git blame history of modified lines high
Bash
Read
Grep

Perform regression risk analysis on the current changes using git blame.

Method

  1. Determine the base branch by examining git context (e.g., git merge-base origin/main HEAD, or check the PR's target branch). Never use HEAD~1 as the base — it compares against the PR's own prior commit and causes false positives.
  2. Get the PR's own commits: git log --format=%H <base>..HEAD
  3. For each changed file, run: git diff <base>...HEAD -- <file>
  4. Extract the modified line ranges from the diff (lines removed or changed in the base version).
  5. For each modified line range, check git blame in the base version: git blame <base> -L <start>,<end> -- <file>
  6. Look for blame commits whose messages match bugfix patterns:
    • Contains: fix, bug, patch, hotfix, revert, regression, CVE
    • Ignore: "fix lint", "fix typo", "fix format", "fix style"
  7. Filter out false positives. If the blamed commit SHA is in the PR's own commits, skip it.
  8. For each verified bugfix line being modified, report as a finding.

What to Report

For each finding, include:

  • The file and line number
  • The original bugfix commit (short SHA and subject)
  • The date of the original fix
  • A suggestion to verify the original bug scenario still works and to add a regression test if one doesn't exist

Shallow Clone Limitations

When working with shallow clones, git blame may not have full history. If blame fails with "no such path in revision" or shows truncated history, report only findings where blame succeeds and note the limitation.

Edge Cases

Situation Action
Shallow clone (no blame) Report what succeeds, note limit
Blame shows PR's own SHA Skip finding (false positive)
File renamed Try blame with --follow
Binary file Skip file