mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## 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>
2.1 KiB
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 |
|
Perform regression risk analysis on the current changes using git blame.
Method
- Determine the base branch by examining git context (e.g.,
git merge-base origin/main HEAD, or check the PR's target branch). Never useHEAD~1as the base — it compares against the PR's own prior commit and causes false positives. - Get the PR's own commits:
git log --format=%H <base>..HEAD - For each changed file, run:
git diff <base>...HEAD -- <file> - Extract the modified line ranges from the diff (lines removed or changed in the base version).
- For each modified line range, check git blame in the base version:
git blame <base> -L <start>,<end> -- <file> - 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"
- Filter out false positives. If the blamed commit SHA is in the PR's own commits, skip it.
- 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 |