Borrowing it
Nothing to install: this file belongs to sourjya/kiro-rails. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/commands/review-frontend-performance.mdgit clone --depth 1 https://github.com/sourjya/kiro-railsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/sourjya/kiro-rails/review-frontend-performance)<a href="https://agentmods.dev/commands/sourjya/kiro-rails/review-frontend-performance"><img src="https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-frontend-performance/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/sourjya/kiro-rails/review-frontend-performance"><img src="https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-frontend-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00029 | $0.02956 |
| Opus 5 | $0.00015 | $0.01478 |
| Sonnet 5 | $0.00006 | $0.00591 |
| Haiku 4.5 | $0.00003 | $0.00296 |
Grade A, and why
review-frontend-performance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Before scanning, read docs/decisions/ ADRs if they exist. Use documented performance budgets and architectural decisions to calibrate findings against intentional trade-offs.
Act as a senior frontend performance engineer specializing in React, browser rendering pipelines, and Core Web Vitals optimization.
Your task is to perform a comprehensive frontend performance audit of this codebase. Identify rendering bottlenecks, memory leaks, unnecessary re-renders, bundle bloat, and Core Web Vitals issues. Produce a prioritized fix plan with concrete code-level recommendations.
Phase 1: Static Analysis (no browser needed)
Scan the codebase for known performance anti-patterns:
React Rendering:
- Components missing
React.memo()that receive stable props but re-render due to parent changes. Focus on list item components rendered inside.map()loops. - Inline object/array literals in JSX props (
style={{...}},options={[...]}) that create new references every render. - Callbacks defined inline in JSX without
useCallback- especially in.map()loops where each iteration creates a new function. useEffectdependencies that change on every render (objects, arrays, functions not wrapped inuseMemo/useCallback).- Expensive computations inside render bodies that should be wrapped in
useMemo. - Components that subscribe to broad context values but only use a small slice - causing re-renders on unrelated context changes.
- Missing
useTransitionfor non-urgent state updates - search/filter inputs that trigger expensive re-renders should usestartTransitionto keep the input responsive. - Missing
useDeferredValuefor derived expensive renders - values driving expensive child renders (search queries, filter criteria) that block input responsiveness. - React Compiler awareness - if on React 19+ with compiler enabled, flag redundant manual
useMemo/useCallback. If NOT on React 19+, flag missing memoization.
DOM, CSS & Rendering:
10. Animations using height, width, top, left, margin, or padding instead of transform/opacity (triggers layout on every frame instead of compositor).
11. box-shadow, border-radius, or filter transitions that trigger paint on every frame.
12. Large DOM trees - components rendering 100+ elements when most are off-screen (candidates for virtualization or content-visibility: auto).
13. Missing CSS contain: content on independent UI islands (cards, tiles, widgets, drawers) - without containment, a change inside one card triggers layout recalculation across the entire document.
14. Missing content-visibility: auto with contain-intrinsic-size on long scrollable lists and below-fold sections - achieves virtualization-like performance without JavaScript.
15. CSS selectors with high specificity or deep nesting that force expensive style recalculation.
16. will-change applied broadly or permanently instead of only on elements that actually animate.
Resource Loading & LCP:
17. LCP image missing fetchpriority="high" attribute. LCP image with loading="lazy" (contradicts priority).
18. Missing <link rel="preconnect"> to critical origins (CDN, font provider, API) in document head.
19. Missing <link rel="preload"> for critical resources the browser can't discover from HTML parsing (CSS background images, fonts).
20. Large dependencies imported eagerly that should be lazy-loaded or code-split.
21. Barrel file re-exports (index.ts) that pull in entire feature modules when only one component is needed.
22. Duplicate utility code across features that should be in shared/.
Image & Font Optimization:
23. Images served only as JPEG/PNG without modern format alternatives (AVIF/WebP via <picture> element or framework image component).
24. Images missing srcset and sizes for responsive delivery. Images missing explicit width/height attributes (causes CLS).
25. Font files loading full Unicode ranges when only Latin subset is needed. More than 2 font families or 4 font files total.
26. @font-face using font-display: swap without metric override descriptors (size-adjust, ascent-override, descent-override) on fallback fonts - causes CLS on font swap.
27. Non-critical fonts using font-display: swap when font-display: optional (with preload) would eliminate both FOIT and CLS.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 241 lines · 29 tokens per session scan A 8fc289b088a2
review-frontend-performance is a command published in the GitHub repository sourjya/kiro-rails (9 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 2,956 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
critique
Design lens critique covering visual hierarchy, clarity, and anti-slop patterns — produces a findings table, no code edits unless asked. Use when the user wants a design review, says "what's wrong with this UI", or needs a second opinion before a handoff or presentation.
check-architecture
Angular Architecture Review.
react-patterns
Review React code for performance and composition patterns — 50+ rules ranked by impact.
fec-review
Conduct a standardized review of the specified file or recently changed front-end code, output a graded review report and save it as a Markdown file.
web-review
Review a web (HTML5) project for structure, architecture, maintainability, and risk.
ui-flow-review
Review menus, HUD, navigation, and player flow from a UX perspective.