Provides React/Next.js component guidelines focusing on testability, Server Components, entity/gateway pattern, and directory structure. Use when implementing components, refactoring code, organizing project structure, extracting conditional branches, or ensuring code quality standards.
Guidelines for React/Next.js development focusing on testability, Server Components, and proper architecture. Each guideline file contains principles, code examples, and anti-patterns to avoid.
When: Writing server-side data fetching or async components Read: server-components.md
Key topics:
When: Writing "use client" components, useEffect, or event handlers Read: testability.md
Key topics:
When: Deciding whether to use useEffect, managing dependencies, or avoiding unnecessary re-renders Read: useeffect-guidelines.md
Key topics:
When: Creating files, functions, or organizing code structure Read: architecture.md
Key topics:
When: Creating or updating test code during Phase 2 (Testing & Stories) Read: test-guidelines.md
Key topics:
When: Creating Storybook stories for components with conditional rendering during Phase 2 (Testing & Stories) Read: storybook-guidelines.md
Key topics:
Are you writing a component?
├─ Does it need interactivity? (onClick, useState, useEffect)
│ ├─ YES → "use client" required
│ │ ├─ Using useEffect?
│ │ │ └─ Read: useeffect-guidelines.md (Do you really need it? + Managing dependencies)
│ │ └─ Read: testability.md
│ └─ NO → Server Component (default)
│ └─ Read: server-components.md
│
├─ Does it fetch data?
│ └─ Read: server-components.md + architecture.md (Entity/Gateway)
│
├─ Are you organizing files/functions?
│ └─ Read: architecture.md (Directory Structure)
│
├─ Are you writing tests?
│ └─ Read: test-guidelines.md (AAA Pattern, Coverage, RTL)
│
└─ Are you creating Storybook stories?
└─ Read: storybook-guidelines.md (Conditional Branching, Story Structure)