creating-elysia-domains

Scaffold Nexus Elysia API feature domains with typed Eden Treaty patterns.

2|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/saavy1/sb --skill creating-elysia-domains
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-elysia-domains
Source: https://github.com/saavy1/sb/tree/main/docs/.claude/skills/creating-elysia-domains
Command: npx skills add https://github.com/saavy1/sb --skill creating-elysia-domains

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured, type-safe blueprint for adding new feature domains to the Nexus Elysia API, ensuring consistent architecture and Eden Treaty compatibility across dashboards and the Discord bot.

Core Features & Use Cases

  • Create domain directory structure
  • Define Drizzle database schemas
  • Create Elysia t.* types for API contracts
  • Implement repository and service layers
  • Build typed route handlers
  • Enable Eden Treaty type inference for consumers

Quick Start

Follow the Domain Structure guide to scaffold a new domain under apps/nexus/src/domains/<domain-name>/ with the defined files and wire it into apps/nexus/src/app.ts.

Frequently Asked Questions about creating-elysia-domains

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new Elysia domain module with Drizzle and Eden Treaty?

Scaffolding an Elysia domain module involves generating a structured directory under apps/nexus/src/domains/<domain-name>/ with schema.ts, types.ts, service.ts, repository.ts, routes.ts, and index.ts files. This enforces strict Drizzle schema typing and enables Eden Treaty type inference for API consumers.

What is the best way to structure an Elysia API for Eden Treaty type inference?

Structuring an Elysia API for Eden Treaty type inference requires separating code into repository, service, and route layers while defining strict Elysia t.* types for API contracts. This architecture guarantees type safety propagates automatically to consumers.

How does domain scaffolding work with Drizzle schemas in an Elysia API?

Domain scaffolding with Drizzle schemas works by enforcing strict type usage within Elysia API modules. It provides templates for repository and service layers that wrap Drizzle database schemas, ensuring consistent architecture and type-safe database interactions across the application.

Can I use Elysia t.* types to define API contracts for multiple consumers?

Yes, you can use Elysia t.* types to define API contracts serving multiple consumers like dashboards and Discord bots. By applying strict type definitions in domain routes.ts and types.ts files, Eden Treaty compatibility is maintained across all consumer applications.

Do I need to manually wire domain modules into my Elysia app?

Yes, after scaffolding a new domain under apps/nexus/src/domains/<domain-name>/, you need to manually wire it into apps/nexus/src/app.ts. This integration step connects typed route handlers, service layers, and Drizzle schemas to the main Elysia application instance.