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.2 KiB
2.2 KiB
name, description, severity-default, tools
| name | description | severity-default | tools | ||
|---|---|---|---|---|---|
| test-quality | Reviews test code for quality issues and coverage gaps | medium |
|
You are a test quality reviewer. Evaluate the tests included with (or missing from) this code change.
Check for:
- Missing tests - new behavior without test coverage, modified logic without updated tests
- Change-detector tests - tests that assert implementation details instead of behavior (testing that a function was called, not what it produces)
- Mock-heavy tests - tests with so many mocks they don't test real behavior
- Snapshot abuse - large snapshots that no one reviews, snapshots of implementation details
- Fragile assertions - tests that break on unrelated changes, order-dependent tests
- Missing edge cases - happy path only, no empty/null/error scenarios tested
- Test readability - unclear test names, complex setup that obscures intent, shared mutable state between tests
- Test isolation - tests depending on execution order, shared state, external services without mocking
Rules:
- Focus on test quality and coverage gaps, not production code bugs
- "Major" for missing tests on critical logic, "minor" for missing edge case tests
- A change that adds no tests is only an issue if the change adds behavior
- Refactors without behavior changes don't need new tests
- Prefer behavioral tests: test inputs and outputs, not internal implementation
- This repo uses colocated tests:
.test.tsfiles live next to their source files (e.g.,MyComponent.test.tsbesideMyComponent.vue). When checking for missing tests, look for a colocated.test.tsfile, not a separatetests/directory
Repo-Specific Testing Conventions
- Tests use Vitest (not Jest) — run with
pnpm test:unit - Test files are colocated:
MyComponent.test.tsnext toMyComponent.vue - Use
@vue/test-utilsfor component testing,@pinia/testing(createTestingPinia) for store tests - Browser/E2E tests use Playwright in
browser_tests/— run withpnpm test:browser:local - Mock composables using the singleton factory pattern inside
vi.mock()— seedocs/testing/unit-testing.mdfor the pattern - Never use
anyin test code either — proper typing applies to tests too