skills/woltz-rich-domain/SKILL.md
Guide for @woltz/rich-domain DDD library and ecosystem. Use when building domain models, repositories, transactional outbox, or working with Prisma/TypeORM/Drizzle adapters.
npx skillsauth add tarcisioandrade/rich-domain woltz-rich-domainInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
TypeScript library for Domain-Driven Design with automatic change tracking and Standard Schema validation.
| Package | Purpose |
| --------------------------------- | ---------------------------- |
| @woltz/rich-domain | Core DDD building blocks |
| @woltz/rich-domain-prisma | Prisma ORM adapter |
| @woltz/rich-domain-drizzle | Drizzle ORM adapter |
| @woltz/rich-domain-typeorm | TypeORM adapter |
| @woltz/rich-domain-criteria-zod | Zod schemas for Criteria API |
| @woltz/rich-domain-export | Multi-format data export |
| @woltz/rich-domain-outbox | Transactional outbox pattern |
import { ValueObject } from "@woltz/rich-domain";
import { z } from "zod";
class Email extends ValueObject<string> {
protected static validation = {
schema: z.string().email(),
};
getDomain(): string {
return this.value.split("@")[1];
}
}
import { Entity, Id, type EntityValidation } from "@woltz/rich-domain";
const PostSchema = z.object({
id: z.custom<Id>(),
title: z.string().min(1),
content: z.string(),
published: z.boolean(),
});
export type PostProps = z.infer<typeof PostSchema>;
class Post extends Entity<PostProps> {
protected static validation: EntityValidation<PostProps> = {
schema: PostSchema,
};
publish(): void {
this.props.published = true;
}
get title() {
return this.props.title;
}
}
import {
Aggregate,
Id,
type EntityValidation,
type EntityHooks,
} from "@woltz/rich-domain";
import { UserCreatedEvent } from "./events";
import { Email } from "./email";
const UserSchema = z.object({
id: z.custom<Id>(),
email: z.custom<Email>(),
name: z.string().min(2),
posts: z.array(z.instanceof(Post)),
createdAt: z.date(),
});
export type UserProps = z.infer<typeof UserSchema>;
class User extends Aggregate<UserProps, "createdAt"> {
protected static validation: EntityValidation<UserProps> = {
schema: UserSchema,
};
protected static hooks: EntityHooks<UserProps, User> = {
onBeforeCreate: (props) => {
if (!props.createdAt) props.createdAt = new Date();
},
onCreate: (entity) => {
if (entity.isNew()) {
entity.addDomainEvent(new UserCreatedEvent({ id: entity.id.value }));
}
},
};
getTypedChanges() {
interface Entities {
Post: Post;
}
return this.getChanges<Entities>();
}
addPost(title: string, content: string): void {
this.props.posts.push(new Post({ title, content, published: false }));
}
get email() {
return this.props.email.value;
}
get posts() {
return this.props.posts;
}
}
const user = await userRepository.findById(userId);
// Make changes
user.addPost("New Post", "Content");
user.posts[0].publish();
// Get changes automatically
// We strongly recommend using this `getTypedChanges` helper pattern for better DX
const changes = user.getTypedChanges();
// { creates: [...], updates: [...], deletes: [...] }
// After saving
user.markAsPersisted();
import { Criteria } from "@woltz/rich-domain";
// fully type-safe, fields inferred from schema
const criteria = Criteria.create<User>()
.where("status", "equals", "active")
.whereContains("email", "@company.com")
.orderBy("createdAt", "desc")
.paginate(1, 20);
const result = await userRepository.find(criteria);
clone() to create modified copiesnew Id() for INSERT, Id.from(value) for UPDATEgetChanges() and markAsClean()For detailed documentation on specific topics:
outboxStore, decorator, and publisherDO NOT read all files at once. Load based on context.
development
React hooks and components for @woltz/rich-domain. Use when building frontend UIs with DataTable, Kanban, Timeline, or Criteria-based filtering.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.