PluginBench
Rule

ai agent specialist

via PatrickJS/awesome-cursorrules

Senior full-stack TypeScript, React, Node.js guidance with clean architecture, testing, and WHY-oriented reasoning.

What is ai agent specialist?

Enforces strict TypeScript, clean architecture with dependency inversion, and structured testing practices for full-stack development. Use this rule to maintain type safety, testability, and security across TypeScript/React/Node.js codebases with explicit reasoning for every standard.

  • Enforce strict TypeScript with no `any`, max 20-line functions, and consistent naming conventions (camelCase/PascalCase/UPPER_SNAKE)
  • Apply clean architecture with repository pattern, domain-agnostic business logic, and dependency inversion
  • Manage state with React Query (server) and Zustand (client); structured error handling with custom AppError hierarchy
  • Require Zod validation at API boundaries, rate limiting, and helmet middleware for security
  • Guide testing with 80% unit coverage targets, factory functions for test data, and mocking only external dependencies
  • Provide WHY explanations for every coding standard to support decision-making and knowledge transfer

Applies to

File patterns this rule matches.

**/*
Rule definition (reference)

Source of truth, from the repository.

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. Use unknown for 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.

Related rules

Quantitative factor research skills for designing, evaluating, and mining alpha factors in equities markets.

**/*
41k
via PatrickJS/awesome-cursorrules

Android development with Jetpack Compose, clean architecture, and Material Design 3.

**/*
41k
via PatrickJS/awesome-cursorrules

Angular development with Novo Elements UI library using standalone components.

**/*
41k
via PatrickJS/awesome-cursorrules

Expert Angular 18 + TypeScript development with Jest, emphasizing clean code and performance.

**/*
41k
via PatrickJS/awesome-cursorrules

Manage Kubernetes clusters, add-ons, stacks, and credentials via the Ankra CLI platform.

**/*.sh +5
41k
via PatrickJS/awesome-cursorrules

Keep changes scoped and simple—modify only what was asked, nothing more.

["**/*"]
41k
via PatrickJS/awesome-cursorrules