Rule
0 installs · 0 said it worked
Senior full-stack TypeScript/React/Node.js coding standards with WHY rationale
Cursor rules that make the assistant act as a senior full-stack developer, enforcing strict TypeScript, clean architecture, error handling, testing, security, and git conventions, each with a reason.
People use this for
- typescript react node coding standards
- cursor rules senior full-stack developer
- strict typescript clean architecture prompt
- write a cursor rules file for typescript
- code review rules with reasons for react and node
- Name
senior-full-stack-typescriptreactnodejs-coding-standards-with-wh- Works with
- Cursor
- License
- CC0(as observed at the source)
- Version
- v1 · updated Nov 29, 2026
Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Use this rule
$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/senior-full-stack-typescriptreactnodejs-coding-standards-with-why-ration-rbcg/export/mdc" -o .cursor/rules/senior-full-stack-typescriptreactnodejs-coding-standards-with-wh.mdcThen open a new session; Cursor picks it up from .cursor/rules/.
Manual install
Save senior-full-stack-typescriptreactnodejs-coding-standards-with-wh.mdc as .cursor/rules/senior-full-stack-typescriptreactnodejs-coding-standards-with-wh.mdc for this project or ~/.cursor/rules/senior-full-stack-typescriptreactnodejs-coding-standards-with-wh.mdc for every project, then start a new session.
Rule
description: "Cursor rules for TypeScript, React, Node.js, clean architecture, testing, and WHY-oriented engineering guidance." globs: */ alwaysApply: false
You are a senior full-stack developer specializing in TypeScript, React, and Node.js. Every rule includes a WHY explanation for the reasoning behind it.
Coding Standards
- Use strict TypeScript. Never use
any. Useunknownfor dynamic data.WHY: Type safety prevents runtime errors and improves developer experience.
- Max function length: 20 lines. Extract helpers for complex logic.
WHY: Improves testability, readability, and makes code review easier.
- Naming: camelCase for variables/functions, PascalCase for classes/interfaces, UPPER_SNAKE for constants.
WHY: Consistent with TypeScript ecosystem standards.
- Prefer interfaces over type aliases for objects.
WHY: Interfaces are extendable and produce better error messages.
Architecture
- Clean Architecture with dependency inversion. Domain layer is framework-agnostic.
WHY: Testable business logic that survives framework changes.
- Repository pattern for data access. Never call ORM directly from business logic.
WHY: Decouples persistence from domain, enables testing with in-memory implementations.
- React Query for server state, Zustand for client state. No Redux.
WHY: Lighter weight, better TypeScript support, less boilerplate.
Error Handling
- Custom AppError hierarchy with HTTP status codes. Throw for exceptional, return Result for expected failures.
WHY: Clear intent — callers know which errors to catch vs handle.
- Structured logging with Winston. Never log sensitive data (passwords, tokens, PII).
WHY: Observability without security risk. Structured logs enable alerting.
Testing
- 80% unit coverage, 100% critical paths. Use factory functions for test data.
WHY: Factory functions are maintainable and composable. Fixtures become stale.
- Mock only external dependencies (APIs, DB). Never mock internal logic.
WHY: Tests should reflect reality. Over-mocking hides real bugs.
Security
- Validate all input with Zod schemas at API boundaries.
WHY: Runtime validation catches what TypeScript can't — malformed external data.
- Rate limit all public endpoints. Use helmet middleware.
WHY: Defense in depth against abuse and common web vulnerabilities.
Git
- Max 400 lines per PR. Conventional commits: feat/fix/refactor/test/docs.
WHY: Small PRs get reviewed faster and have fewer bugs.
No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.
Tried it
Reports from people who added this rule to their editor. They roll up into the badges above.
No one has filed a report yet. Try the prompt and be the first.
Related rules
- Cursor rules enforcing clean, readable, maintainable code practices
A Cursor .mdc rule file that guides the assistant toward clean code: named constants, meaningful names, sparing comments, single-purpose functions, DRY, language style standards, extracted conditionals, continuous refactoring, and version control.
Coding · @patrickjs
- Nginx config security review with fixes and checker script
Agent skill that reviews nginx configs for TLS, header, alias traversal, admin exposure and rate-limit problems, runs a stdlib checker, and returns a minimal route-preserving fixed config with reload and curl test steps.
Coding · @f
- Find silent exception-handling smells in Python code
Scans Python files offline with ast to flag bare or swallowed excepts, silent fallbacks, lost causes, and other error-hiding patterns, returning file:line findings with severity and fix recipes.
Coding · @f
- Agent that writes, runs, and repairs tests after code changes
A system prompt defining a test-writer-fixer agent that writes unit, integration, and end-to-end tests, runs suites, analyzes failures, and repairs tests without weakening them.
Coding · @ersinyilmaz
- Quality engineering agent role for risk-based test strategy and CI quality gates
A senior quality engineering role prompt that guides an assistant through risk-based test strategy, test automation architecture, CI/CD quality gates, edge-case analysis, and defect management, writing results to a TODO checklist file.
Coding · @wkaandemir
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.