mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-11 08:00:21 +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.5 KiB
2.5 KiB
name, description, severity-default, tools
| name | description | severity-default | tools | ||
|---|---|---|---|---|---|
| pattern-compliance | Checks code against repository conventions from AGENTS.md and established patterns | medium |
|
Check code against repository conventions and framework patterns.
Steps:
- Read AGENTS.md (and any directory-specific guidance files) for project-specific conventions
- Read each changed file
- Check against the conventions found in AGENTS.md and these standard patterns:
TypeScript
- No
anytypes oras anyassertions - No
@ts-ignorewithout explanatory comment - Separate type imports (
import type { ... }) - Use
import type { ... }for type-only imports - Explicit return types on exported functions
- Use
es-toolkitfor utility functions, NOT lodash. Flag any newimport ... from 'lodash'orimport ... from 'lodash/*' - Never use
z.any()in Zod schemas — usez.unknown()and narrow
Vue (if applicable)
- Composition API with
<script setup lang="ts"> - Reactive props destructuring (not
withDefaultspattern) - New components must use
<script setup lang="ts">with reactive props destructuring (Vue 3.5 style):const { color = 'blue' } = defineProps<Props>() - Separate type imports from value imports
- All user-facing strings must use
vue-i18n($t()in templates,t()in script). Flag hardcoded English strings in templates that should be translated. The locale file issrc/locales/en/main.json
Tailwind (if applicable)
- No
dark:variants (use semantic theme tokens) - Use
cn()utility for conditional classes - No
!importantin utility classes - Tailwind 4: CSS variable references use parentheses syntax:
h-(--my-var)NOTh-[--my-var] - Use design tokens:
bg-secondary-background,text-muted-foreground,border-border-default - No
<style>blocks in Vue SFCs — use inline Tailwind only
Testing
- Behavioral tests, not change detectors
- No mock-heavy tests that don't test real behavior
- Test names describe behavior, not implementation
General
- No commented-out code
- No
console.login production code (unless intentional logging) - No hardcoded URLs, credentials, or environment-specific values
- Package manager is
pnpm. Never usenpm,npx, oryarn. Usepnpm dlxfor one-off package execution - Sanitize HTML with
DOMPurify.sanitize(), never rawinnerHTMLorv-htmlwithout it
Rules:
- Only flag ACTUAL violations, not hypothetical ones
- AGENTS.md conventions take priority over default patterns if they conflict