kiro-rails: Command for Claude Code

.claude/commands/review-frontend-performance.md

review-frontend-performance is a command for Claude Code from sourjya/kiro-rails. It costs 29 tokens per session (2,956 once invoked), scanned A, original, MIT.

A code review that checks a frontend—the part of an app users see and interact with—for slow loading, rendering, and data-fetching patterns.

In plain words
What is it for?
Use it to inspect bundles, React re-renders, render waterfalls, repeated data requests, memory leaks, and missing lazy loading, then create a prioritized fix plan.
Why use it?
It helps find causes of sluggish pages, large downloads, wasted browser work, and poor Core Web Vitals, which are measurements of loading and interaction speed.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is sourjya/kiro-rails's own configuration. It tells Claude Code how to work on kiro-rails itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kiro-rails configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/commands/review-frontend-performance.md
Clone the repo
git clone --depth 1 https://github.com/sourjya/kiro-rails

Made for: Claude Code.

Wrote 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.

agentmods badge for review-frontend-performance

README.md
[![agentmods](https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-frontend-performance/github.svg)](https://agentmods.dev/commands/sourjya/kiro-rails/review-frontend-performance)
Your own site
<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.

agentmods 80×15 button for review-frontend-performance

Your own site · 80×15
<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>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,956 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 10d ago against content hash 8fc289b088a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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.

.claude/commands/review-frontend-performance.md · 241 lines

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:

  1. Components missing React.memo() that receive stable props but re-render due to parent changes. Focus on list item components rendered inside .map() loops.
  2. Inline object/array literals in JSX props (style={{...}}, options={[...]}) that create new references every render.
  3. Callbacks defined inline in JSX without useCallback - especially in .map() loops where each iteration creates a new function.
  4. useEffect dependencies that change on every render (objects, arrays, functions not wrapped in useMemo/useCallback).
  5. Expensive computations inside render bodies that should be wrapped in useMemo.
  6. Components that subscribe to broad context values but only use a small slice - causing re-renders on unrelated context changes.
  7. Missing useTransition for non-urgent state updates - search/filter inputs that trigger expensive re-renders should use startTransition to keep the input responsive.
  8. Missing useDeferredValue for derived expensive renders - values driving expensive child renders (search queries, filter criteria) that block input responsiveness.
  9. 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.

Read the full file on GitHub · 241 lines

Changes

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.

  1. 10d ago First seen · 241 lines · 29 tokens per session scan A 8fc289b088a2

Subscribe to this mod's changes

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.