Loading...
Loading...
Found 4 Skills
Migrate codebase from try/catch or Promise-based error handling to better-result. Use when adopting Result types, converting thrown exceptions to typed errors, or refactoring existing error handling to railway-oriented programming.
[Pragmatic DDD Architecture] How to structure **Use Cases** using DDD and Railway-Oriented Programming (neverthrow Result types). Tailored for TypeScript + drizzle-orm + node-postgres stack. **Use whenever creating or modifying any Use Case class — even simple ones like "Exists" or "List" operations — to ensure type-safe error unions, proper transactional boundaries, Value Object-only contracts, auth-first patterns, and Result-based error handling.** Includes references to working examples (Create, List, Exists patterns). Depends on 'repositories' skill.
[Pragmatic DDD Architecture] Guide for creating DDD Repositories (Interfaces and Infrastructure). Use when creating repository contracts or implementing them using Drizzle ORM, Zod, and Postgres. Enforces completely typed transactions with Drizzle Transaction types (no 'unknown'), Result returns for Railway-oriented programming via neverthrow, and mapping pg node errors to domain errors. Fits our docker-compose / drizzle-kit standard testing workflow.
[Pragmatic DDD Architecture] Guide for creating DDD Value Objects (VOs). Use when defining a new Value Object in a domain layer. Covers immutability patterns, private constructors, random/from builders, Railway-oriented error handling via neverthrow Result, TypeScript branded error types, and co-locating errors within the VO file.