pern-stack
Use this skill when working on a full-stack web application built with or intended to use the PERN stack:
Use this skill for projects, feature development, refactoring, debugging, code review, architecture decisions and production improvements.
When to Use
Use this skill for PERN applications, including new projects, feature development, refactoring, debugging, code review, architecture decisions, and production improvements.
Instructions
Understand the Project
- Review requirements, project structure, existing conventions, and the current frontend, backend, API, and database setup.
Design the Architecture
- Keep frontend, backend, business logic, API, and data-access responsibilities clear.
- Prefer simple, maintainable, domain-focused architecture.
Backend & API
- Design consistent APIs and validate requests at the boundary.
- Keep business logic separate from routes.
- Handle authentication, authorization, errors, and transactions properly.
- Use parameterized queries or a trusted ORM/query builder.
Database
- Design PostgreSQL schemas with appropriate types, relationships, constraints, indexes, and migrations.
- Consider data integrity and query performance.
Frontend
- Build maintainable React components with clear responsibilities.
- Handle loading, error, empty, and success states.
- Manage client/server state appropriately and avoid unnecessary complexity.
Security
- Never trust client input.
- Protect sensitive routes and credentials.
- Use secure authentication, password hashing, validation, CORS, and rate limiting where required.
- Never expose sensitive internal errors.
Testing & Review
- Test critical business logic, APIs, authentication, authorization, validation, and database workflows.
- When debugging, trace the full data flow, identify the root cause, check edge cases, and prevent regressions.
Performance & Production
- Optimize queries, indexes, API requests, and React rendering.
- Use pagination and caching when justified.
- Verify migrations, security, logging, environment configuration, tests, and deployment before production.
General Principles
- Prefer correctness, maintainability, and security.
- Reuse sound existing patterns.
- Avoid unnecessary dependencies and abstractions.
- Keep changes focused and reviewable.
- Do not rewrite working code without a clear reason.
- Consider scalability and failure scenarios.
- Explain important trade-offs when multiple approaches are valid.
1---2name: pern-stack3description: Build, review, debug, and improve full-stack applications using PostgreSQL, Express.js, React, and Node.js with maintainable and production-ready practices.4---56# pern-stack78Use this skill when working on a full-stack web application built with or intended to use the PERN stack:910- PostgreSQL for data storage.1112- Express.js for backend APIs.1314- React for the frontend.1516- Node.js as the runtime.1718Use this skill for projects, feature development, refactoring, debugging, code review, architecture decisions and production improvements.1920## When to Use2122Use this skill for PERN applications, including new projects, feature development, refactoring, debugging, code review, architecture decisions, and production improvements.2324## Instructions25261. **Understand the Project**2728 * Review requirements, project structure, existing conventions, and the current frontend, backend, API, and database setup.29302. **Design the Architecture**3132 * Keep frontend, backend, business logic, API, and data-access responsibilities clear.33 * Prefer simple, maintainable, domain-focused architecture.34353. **Backend & API**3637 * Design consistent APIs and validate requests at the boundary.38 * Keep business logic separate from routes.39 * Handle authentication, authorization, errors, and transactions properly.40 * Use parameterized queries or a trusted ORM/query builder.41424. **Database**4344 * Design PostgreSQL schemas with appropriate types, relationships, constraints, indexes, and migrations.45 * Consider data integrity and query performance.46475. **Frontend**4849 * Build maintainable React components with clear responsibilities.50 * Handle loading, error, empty, and success states.51 * Manage client/server state appropriately and avoid unnecessary complexity.52536. **Security**5455 * Never trust client input.56 * Protect sensitive routes and credentials.57 * Use secure authentication, password hashing, validation, CORS, and rate limiting where required.58 * Never expose sensitive internal errors.59607. **Testing & Review**6162 * Test critical business logic, APIs, authentication, authorization, validation, and database workflows.63 * When debugging, trace the full data flow, identify the root cause, check edge cases, and prevent regressions.64658. **Performance & Production**6667 * Optimize queries, indexes, API requests, and React rendering.68 * Use pagination and caching when justified.69 * Verify migrations, security, logging, environment configuration, tests, and deployment before production.7071## General Principles7273* Prefer correctness, maintainability, and security.74* Reuse sound existing patterns.75* Avoid unnecessary dependencies and abstractions.76* Keep changes focused and reviewable.77* Do not rewrite working code without a clear reason.78* Consider scalability and failure scenarios.79* Explain important trade-offs when multiple approaches are valid.