Component Design Patterns
Rules for designing self-contained, composable React components.
Curated rules and prompts to make your AI coding assistants behave like senior engineers. Copy these to your .cursorrules or system prompt.
56 skills
Rules for designing self-contained, composable React components.
When to use local state, context, or global stores like Zustand/Redux.
Clean patterns for fetching, caching, and handling loading/error states in the browser.
Maintainable styling using TailwindCSS or design systems.
Mandatory accessibility checks for web applications.
Building robust, user-friendly forms with validation.
Proper resource naming, status codes, and endpoint structure.
Never trust the client. Rule set for strict backend validation.
Decoupling HTTP transport logic from business logic.
Catching and formatting errors systematically without leaking internals.
Offloading slow processes to message queues or workers.
Guiding the user's eye using size, weight, color, and spacing.
Designing satisfying hover, focus, and loading states.
Communicating failure gracefully without frustrating the user.
Rules for scaling interfaces seamlessly across devices.
Best practices for designing logical dark themes without eyestrain.
Decoupling components by injecting their dependencies.
The 5 foundational object-oriented design principles.
Abstracting database access behind a clean domain interface.
Using events to decouple side effects from main business logic.
Managing multiple packages and apps in a single repository.
Secure storage and transmission of authentication tokens.
Role-based access control and enforcing permissions securely.
Protecting passwords and sensitive data at rest and in transit.
Guarding against common web vulnerabilities like XSS, CSRF, and SQLi.
Configuring Helmet or Next.js to set appropriate security headers.
Keeping the initial JavaScript payload small and fast.
Implementing Redis, CDN, and browser caching correctly.
Fixing N+1 queries, adding indexes, and avoiding full table scans.
Preventing unnecessary re-renders using memo, useMemo, and useCallback.
Using Promise.all and avoiding synchronous blocking operations.
Writing effective, isolated tests for pure functions and components.
Testing how the database, routing, and services work together.
Testing UI components with React Testing Library.
Writing Cypress or Playwright tests for critical user flows.
Rules for normalizing data, constraints, and relationships.
Managing schema changes safely across environments.
Ensuring multi-step writes succeed or fail together.
When to use Document databases and how to model data.
Writing secure, minimal, cache-optimized Dockerfiles.
Automating tests, linting, and safe cloud deployments.
Structured logging and application performance monitoring.
Managing cloud resources using Terraform, CDK, or Pulumi.
Rules for producing highly readable, descriptive names.
When to extract abstractions and when to leave duplication alone.
Rules for writing comments that add value rather than clutter.
Writing atomic commits and descriptive commit messages.
Rules for creating helpful, actionable error responses.
How to build custom CLI tools or endpoints for AI agents to consume.
Guiding the AI to synthesize only relevant files.
Forcing agents to produce a verified sequence before execution.
Prompts and techniques for self-auditing generated code.
Constructing robust .cursorrules files and system constraints.
Preventing UI thread blocking and managing list rendering.
Architecting apps that work in tunnels, airplanes, and bad networks.
Requesting permissions and handling app lifecycles correctly.