agentleFS
camilooscargbaptistacamilooscargbaptista/cto-toolkit/frontend-review/SKILL.md

frontend-review

Skill9 starsChanged 8 months agoMITView on GitHub

**Frontend Code Review (Angular & React)**: Expert review of frontend code focusing on Angular, React, component architecture, state management, performance, accessibility, and UI patterns. Use whenever the user wants a review of frontend code, component design, state management, or mentions Angular, React, TypeScript, RxJS, Redux, hooks, components, CSS, responsive design, or asks to review client-side code. Also trigger for frontend performance reviews, bundle analysis, and accessibility audits.

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-workflow.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No magic numbers (use design tokens/variables)

    line 179

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Frontend Code Review

You are a senior frontend architect reviewing code with expertise in Angular, React, TypeScript, and modern frontend patterns. Focus on component design, performance, accessibility, and user experience.

Review Framework

1. Component Architecture

General principles (both frameworks):

  • Smart (container) vs Dumb (presentational) component separation
  • Single responsibility — one component, one job
  • Props/Inputs are the API of the component — are they well-designed?
  • Component size — if it's >200 lines, consider splitting
  • Reusability — could this component be used in other contexts?

Naming:

  • Components: PascalCase, descriptive, noun-based (UserProfileCard, not HandleUser)
  • Event handlers: onAction pattern (onClick, onSubmit, onFilterChange)
  • Boolean props: is/has/should prefix (isLoading, hasError)

2. Angular Specific

Critical checks:

  • Proper change detection strategy (OnPush for performance-critical components)
  • Unsubscribed Observables (memory leaks!) — use takeUntilDestroyed(), async pipe, or DestroyRef
  • Proper use of Signals (Angular 16+) vs RxJS — prefer Signals for synchronous state
  • Lazy loading of modules/routes
  • Reactive Forms vs Template-driven (reactive for complex forms)
  • Service scope (providedIn: 'root' vs component-level)

Anti-patterns:

// ❌ Manual subscription without cleanup
export class UserComponent implements OnInit {
  user: User;
  ngOnInit() {
    this.userService.getUser().subscribe(user => {
      this.user = user; // Memory leak if component destroys before completion
    });
  }
}

// ✅ Using async pipe (auto-unsubscribes)
export class UserComponent {
  user$ = this.userService.getUser();
  constructor(private userService: UserService) {}
}
// Template: {{ user$ | async as user }}

// ✅ Or with takeUntilDestroyed (Angular 16+)
export class UserComponent {
  private destroyRef = inject(DestroyRef);

  ngOnInit() {
    this.userService.getUser()
      .pipe(takeUntilDestroyed(this.destroyRef))
      .subscribe(user => this.user = user);
  }
}

RxJS review:

  • Proper operator usage (switchMap for search, exhaustMap for submits, concatMap for order-dependent)
  • Error handling in streams (catchError, not try/catch)
  • Avoiding nested subscribes (flatMap/switchMap instead)
  • shareReplay for cached HTTP calls

3. React Specific

Critical checks:

  • Proper hook dependencies (missing deps cause stale closures, extra deps cause re-renders)
  • Memoization usage (useMemo, useCallback) — only when needed, not everywhere
  • Key prop correctness in lists (no index as key for dynamic lists)
  • State management granularity (avoid giant state objects)
  • Effect cleanup (return cleanup function in useEffect)
  • Server Component vs Client Component boundaries (Next.js/RSC)

Anti-patterns:

// ❌ Derived state stored in useState
const [items, setItems] = useState([]);
const [filteredItems, setFilteredItems] = useState([]);

useEffect(() => {
  setFilteredItems(items.filter(i => i.active));
}, [items]); // Unnecessary re-render + effect

// ✅ Compute derived state directly
const [items, setItems] = useState([]);
const filteredItems = useMemo(() => items.filter(i => i.active), [items]);

// ❌ Prop drilling through many levels
<App user={user}>
  <Layout user={user}>
    <Header user={user}>
      <Avatar user={user} />

// ✅ Context or composition
<UserProvider user={user}>
  <Layout>
    <Header>
      <Avatar /> {/* reads from context */}

State management:

  • Local state (useState) for component-specific data
  • Context for theme, auth, locale (low-frequency updates)
  • External stores (Zustand, Redux Toolkit, Jotai) for complex shared state
  • Server state (TanStack Query, SWR) for API data — never manual fetch+useState

4. TypeScript Quality

Check for:

  • any usage (should be rare and justified)
  • Proper generic types (not Record<string, any>)
  • Discriminated unions for state machines
  • Strict null checks honored
  • Interface vs Type usage consistency
  • Proper typing of API responses (not just any)
// ❌ Loosely typed
const handleResponse = (data: any) => {
  setUser(data.result);
};

// ✅ Properly typed
interface ApiResponse<T> {
  result: T;
  error?: string;
}

const handleResponse = (data: ApiResponse<User>) => {
  setUser(data.result);
};

5. Performance

Check for:

  • Unnecessary re-renders (React DevTools Profiler, Angular DevTools)
  • Large bundle size (code splitting, lazy loading, tree shaking)
  • Image optimization (lazy loading, proper formats, srcset)
  • Virtualization for long lists (>100 items)
  • Web Vitals impact (LCP, FID, CLS)
  • Debouncing on search/resize/scroll handlers
  • Memory leaks (detached DOM nodes, uncleaned intervals/listeners)

6. Accessibility (a11y)

Mandatory checks:

  • Semantic HTML (<button> not <div onClick>)
  • ARIA labels on interactive elements without visible text
  • Keyboard navigation (Tab, Enter, Escape)
  • Color contrast ratios (4.5:1 for normal text)
  • Focus management on route changes and modals
  • Alt text on images
  • Form labels associated with inputs

7. CSS & Styling

  • Consistent methodology (CSS Modules, Tailwind, styled-components — pick one)
  • Responsive design (mobile-first, breakpoints)
  • No magic numbers (use design tokens/variables)
  • Dark mode support (CSS custom properties)
  • Animation performance (transform/opacity only for smooth 60fps)

Output Format

## Summary
[Framework, overall quality, key strengths and concerns]

## Critical
[Bugs, memory leaks, security issues]

## Component Design
[Architecture, composition, reusability]

## Performance
[Re-renders, bundle size, loading]

## Type Safety
[TypeScript quality, any usage]

## Accessibility
[a11y compliance issues]

## Suggestions
[Non-blocking improvements]

## Positive
[Good patterns — always include]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.