Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 2.03 KB

File metadata and controls

28 lines (23 loc) · 2.03 KB

amqp-contract

Type-safe contracts for AMQP/RabbitMQ messaging with automatic runtime validation.

Rules

Rule Description
Project Overview Architecture, packages, monorepo structure
Commands Dev, quality, test, versioning commands
Contract Patterns Contract composition, event/command, retry, type inference
Handlers Handler signatures, Future/Result, boxed API, error types, worker exports
Code Style TypeScript rules, imports, anti-patterns, best practices
Testing Testing strategy, integration tests, fixtures, assertions
Dependencies Key deps, catalog management, monorepo tooling

Key Constraints

  • No any types — use unknown and narrow
  • Type aliases over interfaces — type Foo = {} not interface Foo {}
  • .js extensions required in all imports (ESM)
  • Handlers return Future<Result<void, HandlerError>> — not async/await
  • Standard Schema v1 for validation (Zod, Valibot, ArkType)
  • Catalog dependencies via pnpm-workspace.yaml — not hardcoded versions
  • Conventional commits required (e.g. feat, fix, docs, chore, test, refactor — full set per Conventional Commits spec)
  • Quorum queues by default — classic queues only for special cases
  • Composition pattern — define resources first, then reference
  • Git hooks: lefthook runs format, lint on pre-commit, and commitlint on commit-msg