AgentSkillsCN

cpet-db-react-best-practices

针对CPET.db,提供React与Next.js性能优化指南。特别适用于三层架构:前端采用Vercel,后端部署于Google Cloud Run,数据库则选用Supabase。无论是在编写、审查,还是重构React组件、优化数据获取流程,抑或是提升整体性能,此工具都将是您的得力助手。

SKILL.md
--- frontmatter
name: cpet-db-react-best-practices
description: React and Next.js performance optimization guidelines for CPET.db. Tailored for three-tier architecture with Vercel frontend, Google Cloud Run backend, and Supabase database. Use when writing, reviewing, or refactoring React components, data fetching, or optimizing performance.
license: MIT
metadata:
  author: cpet-db-team
  version: "1.0.0"

CPET.db React Best Practices

Comprehensive performance optimization guide for React and Next.js applications in CPET.db, optimized for AI-assisted development with Vercel, Google Cloud Run, and Supabase.

When to Apply

Reference these guidelines when:

  • Writing new React components or Next.js pages
  • Implementing data fetching (client or server-side)
  • Reviewing code for performance issues
  • Refactoring existing React/Next.js code
  • Optimizing bundle size or load times
  • Working with Supabase real-time subscriptions
  • Integrating with Cloud Run APIs

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Eliminating WaterfallsCRITICALasync-
2Bundle Size OptimizationCRITICALbundle-
3Server-Side PerformanceHIGHserver-
4Client-Side Data FetchingMEDIUM-HIGHclient-
5Re-render OptimizationMEDIUMrerender-
6Rendering PerformanceMEDIUMrendering-
7JavaScript PerformanceLOW-MEDIUMjs-
8Advanced PatternsLOWadvanced-
9CPET-Specific PatternsMEDIUMcpet-

How to Use

Read individual rule files for detailed explanations and code examples:

code
rules/async-parallel.md
rules/bundle-barrel-imports.md
rules/cpet-supabase-queries.md
rules/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md