con un clic
performance-review
// Review frontend code changes for performance anti-patterns and guideline compliance. Checks query hooks, stale times, bundle impact, rendering patterns, and Zustand selectors.
// Review frontend code changes for performance anti-patterns and guideline compliance. Checks query hooks, stale times, bundle impact, rendering patterns, and Zustand selectors.
Run a frontend load testing audit. Seeds data, tests all pages via Chrome DevTools MCP, records network calls, TanStack queries, DOM sizes, and generates a timestamped report.
Creating components (inline/docker). Dynamic ports, retry policies, PTY patterns, IsolatedContainerVolume.
| name | performance-review |
| description | Review frontend code changes for performance anti-patterns and guideline compliance. Checks query hooks, stale times, bundle impact, rendering patterns, and Zustand selectors. |
| user_invocable | true |
Reference: frontend/docs/performance.md
When invoked, perform the following checks in order. Report PASS/FAIL/WARN for each. Group failures by severity: CRITICAL (must fix before merge), WARNING (should fix), INFO (consider).
Read the diff or the files specified by the user. If no files specified, use git diff --name-only to find changed frontend files. Identify which categories apply: query hooks, page routes, stores, real-time, bundle.
useState + useEffect + api. within 20 lines of each other in changed files. If found: CRITICAL — should be a TanStack Query hook.useQuery calls reference a key from queryKeys.ts, not an inline array. If inline: CRITICAL.use<Domain>Queries.ts and placed in src/hooks/queries/. If misplaced: WARNING.useMutation calls include onSuccess with queryClient.invalidateQueries(). If missing: WARNING.skipToken usage on conditional queries vs. enabled: false. Flag enabled: false without skipToken as WARNING.useQuery, check if staleTime is set explicitly or inherits the 30s default appropriately.staleTime: Infinity as CRITICAL.executionQueryOptions.ts factories rather than inline values. Flag inconsistency as WARNING.terminalStaleTime() is used rather than a hardcoded number.App.tsx: verify it uses React.lazy(() => import(...)). Static imports are CRITICAL.routePrefetchMap in src/lib/prefetch-routes.ts. Missing entry is WARNING.@xterm, posthog-js, lucide-react barrel imports): flag as WARNING — consider deferred load pattern.const [*, set*] = useState followed by set* inside a useEffect that references query data — CRITICAL (should use useMemo).useMemo involving array operations (filter, sort, reduce) — WARNING.React.memo usage on new components in timeline/ or workflow/ directories that re-render frequently — INFO if missing.const store = use<X>Store() or destructuring from use<X>Store() without a selector — full store subscription. WARNING.persist, verify partialize is present. Missing is WARNING.persist stores, verify action functions are excluded from partialize.Format the output as follows:
## Performance Review: [description of scope]
### Critical (must fix before merge)
- [file:line] Description of issue. See: performance.md § [section]
### Warnings (should fix)
- [file:line] Description of issue. See: performance.md § [section]
### Info (consider)
- [file:line] Description. See: performance.md § [section]
### Passed Checks
- [n] query hooks using TanStack Query correctly
- [n] page routes using React.lazy
- [n] Zustand selectors properly scoped
- staleTime: appropriate tiers applied
### Summary
[1-2 sentences on overall performance hygiene of the change]
frontend/docs/performance.md for the relevant pattern section