How this skill is triggered — by the user, by Claude, or both
Slash command
/monotemplate:crudThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
---
This skill guides implementing CRUD operations following the layered architecture pattern.
1. Prisma Schema → apps/server/src/db/prisma/schema.prisma
2. Zod Types → packages/common/src/contracts/v1/<entity>/types.ts
3. oRPC Contract → packages/common/src/contracts/v1/<entity>/router.ts
4. Repository Layer → apps/server/src/repositories/
5. Controller Layer → apps/server/src/controllers/
6. oRPC Router (impl) → apps/server/src/routers/v1/<entity>/router.ts
7. DI Container → apps/server/src/di/container.ts
apps/server/src/db/prisma/schema.prismacd apps/server && bun run db:migratecd apps/server && bun run db:generatepackages/common/src/contracts/v1/<entity>/types.tspackages/common/src/contracts/v1/<entity>/router.tspackages/common/src/contracts/index.tspackages/common/src/contracts/app-contract.tsapps/server/src/repositories/ (with @injectable())apps/server/src/controllers/ (with @injectable())apps/server/src/routers/v1/<entity>/router.tsapps/server/src/routers/orpc.tscd apps/server && bun run buildorg_xxxxx format. Use z.string().min(1) not z.string().uuid()context.orgId in router handlersgetOrCreate patterns for users/orgs when webhooks aren't guaranteedusers (e.g., created_by), user must exist firstensureUser and ensureOrganization utilities before creating recordsapps/server/src/utils/ensure-user.ts and ensure-organization.tsauthed middleware from orpc-middleware.ts for authenticated routes — no manual auth checksunwrapResult(result) to convert Result<T> into a thrown ORPCError on failuremethod: 'GET', path: '/v1/entities')packages/common/src/contracts/errors.ts via oc.errors()For detailed implementation patterns, see reference.md.
npx claudepluginhub firstloophq/claude-code-plugins --plugin monotemplateGenerates production-ready CRUD scaffolding and API endpoints for entities, including validation (Zod), authorization, tests, and relational support. Detects and adapts to existing schema (Prisma, Drizzle, raw SQL) and framework (Next.js, Express, Hono).
Guides domain-driven design and hexagonal architecture with functional core pattern. Use when designing features, modeling domains, breaking down tasks, or evaluating component responsibilities.
Implements Clean Architecture, Hexagonal Architecture, and Domain-Driven Design for backend systems. Use when architecting new systems or refactoring for maintainability.