Files
nick-tracker/agent_docs/code_patterns.md
2026-01-11 07:51:30 +00:00

521 B

Code Patterns

Project Conventions

TypeScript Guidelines

  • Use strict mode
  • No any types
  • Use interfaces for object shapes
  • Use type guards for narrowing
  • Export types from types/index.ts

API Patterns

  • Use middleware for cross-cutting concerns
  • Validate all input
  • Return consistent error responses
  • Use proper HTTP status codes
  • Log all requests

Error Handling

  • Always catch and handle errors
  • Log errors with context
  • Return user-friendly messages
  • Never expose internal details