xiaohongshu
xiaohongshu
ddd-context-generator
Generate complete DDD bounded context with all 4 layers (Domain, Application, Infrastructure, Presentation). Use when user wants to create new business capability, scaffold complete context with CRUD, or build full feature from scratch (e.g., "Create Order context", "Generate Product context with...
Full skill instructions
Generate complete Domain-Driven Design bounded contexts with all 4 architectural layers (Domain, Application, Infrastructure, Presentation) for Bun.js + Express + routing-controllers backend applications.
This skill generates production-ready code for a complete bounded context following DDD and Clean Architecture principles. It creates:
Use this skill when you need to:
Examples:
The skill will ask you to clarify:
The skill generates code in this order:
Directory Structure - Shows complete file tree
Domain Layer - Pure business logic with zero dependencies
Application Layer - Use cases and orchestration
Infrastructure Layer - Persistence implementation
Presentation Layer - HTTP API
Integration Code
The skill provides a checklist to verify:
This skill follows the patterns defined in the project's CLAUDE.md:
Presentation → Application → Domain
↓ ↓
Infrastructure
Entity Pattern:
export class EntityName {
private constructor(...) {}
static create(data): EntityName {
// Validation and creation
}
static reconstitute(data): EntityName {
// Load from database
}
// Getters and business methods
}
Value Object Pattern:
export class ValueObject {
private readonly value: string;
private constructor(value: string) {
this.value = value;
}
static create(value: string): ValueObject {
// Validation
return new ValueObject(value);
}
equals(other: ValueObject): boolean {
return this.value === other.value;
}
}
UseCase Pattern:
@injectable()
export class ActionEntityUseCase {
constructor(
@inject('IEntityRepository')
private readonly repo: IEntityRepository
) {}
async execute(input: Input): Promise<Output> {
// Business logic
await eventBus.emit('EventName', event);
return output;
}
}
API Pattern:
// Versioned routes with Swagger
new Elysia({ prefix: '/v1/entities' })
.post('/', controller.create.bind(controller), {
body: CreateSchema,
detail: {
summary: 'Create entity',
tags: ['Entities'],
responses: { 201: {}, 400: {}, 409: {} }
}
})
/src/contexts/{ContextName}/
├── domain/
│ ├── entities/
│ │ └── {entity}.entity.ts
│ ├── value-objects/
│ │ └── {vo}.vo.ts
│ ├── repositories/
│ │ └── {entity}.repository.interface.ts
│ ├── events/
│ │ └── {event}.event.ts
│ ├── errors/
│ │ └── {context}.errors.ts
│ └── index.ts
├── application/
│ ├── usecases/
│ │ ├── create-{entity}.usecase.ts
│ │ ├── find-{entity}.usecase.ts
│ │ ├── update-{entity}.usecase.ts
│ │ └── delete-{entity}.usecase.ts
│ ├── listeners/
│ │ └── {event}.listener.ts
│ └── index.ts
├── infrastructure/
│ ├── models/
│ │ └── {entity}.model.ts
│ ├── repositories/
│ │ └── {entity}.repository.ts
│ └── mappers/
│ └── {entity}.mapper.ts
└── presentation/
├── schemas/
│ ├── create-{entity}.schema.ts
│ ├── update-{entity}.schema.ts
│ ├── query-{entity}.schema.ts
│ └── {entity}-response.schema.ts
├── {context}.controller.ts
└── {context}.routes.ts
All generated code follows:
any types, use unknown if needed@injectable() on all DI classesAfter generation, you need to:
/src/global/container/container.ts):container.registerSingleton<IEntityRepository>(
'IEntityRepository',
EntityRepository
);
/src/main.ts):import { registerEntityRoutes } from '@/contexts/entity/presentation/entity.routes';
app.use(registerEntityRoutes());
/src/main.ts):import { EntityCreatedListener } from '@/contexts/entity/application';
const listener = container.resolve(EntityCreatedListener);
eventBus.on('EntityCreated', listener.handle.bind(listener));
Ensure you have:
CLAUDE.md architecture guidexiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience