xiaohongshu
xiaohongshu
creating-adts
This skill should be used when the user asks to "create an ADT", "scaffold a discriminated union", "add a tagged union", "create Effect Schema union", or needs to create algebraic data types following the ADT library pattern with proper member files and barrel exports.
Full skill instructions
Scaffold ADT (Algebraic Data Type) unions with discriminated member types.
Before creating any ADT, read the convention documents:
~/.claude/docs/conventions/namespace-module.md — Core _.ts/__.ts pattern~/.claude/docs/conventions/library-adt.md — ADT-specific patternsStructure:
src/lib/<adt-name>/
├── _.ts # export * as AdtName from './__.js'
├── __.ts # exports member namespaces + union
├── <adt-name>.ts # Union definition
├── <member-a>.ts # Member type
└── <member-b>.ts # Member type
Steps:
src/lib/<adt-name>/ (kebab-case matching ADT name)__.ts)__.ts exporting members as namespaces + union exports_.ts pointing to __.ts// <member>.ts
import * as S from 'effect/Schema'
export class MemberName extends S.TaggedClass<MemberName>()('AdtNameMemberName', {
// fields...
}) {
static is = S.is(MemberName)
}
Naming Rules:
VersionedDocumentVersioned// <adt-name>.ts
import * as S from 'effect/Schema'
import { MemberA } from './member-a.js' // Direct import, NOT from __.ts
import { MemberB } from './member-b.js'
export const AdtName = S.Union(MemberA, MemberB)
export type AdtName = typeof AdtName.Type
__.ts)// __.ts
export * from './<adt-name>.js'
export * as MemberA from './member-a.js'
export * as MemberB from './member-b.js'
// added.ts
export class Added extends S.TaggedClass<Added>()('LifecycleEventAdded', {
schema: SchemaRef,
revision: Revision,
}) {
static is = S.is(Added)
}
// removed.ts
export class Removed extends S.TaggedClass<Removed>()('LifecycleEventRemoved', {
schema: SchemaRef,
revision: Revision,
}) {
static is = S.is(Removed)
}
// lifecycle-event.ts
import { Added } from './added.js'
import { Removed } from './removed.js'
export const LifecycleEvent = S.Union(Added, Removed)
export type LifecycleEvent = typeof LifecycleEvent.Type
// __.ts
export * as Added from './added.js'
export * from './lifecycle-event.js'
export * as Removed from './removed.js'
// _.ts
export * as LifecycleEvent from './__.js'
// Import ONLY from namespace (_.js)
import { LifecycleEvent } from '#lifecycle-event'
// Access members via namespace
const added = LifecycleEvent.Added.make({ schema, revision })
const removed = LifecycleEvent.Removed.make({ schema, revision })
// Type check
if (LifecycleEvent.Added.is(event)) {
// event is Added
}
_.js, never from __.js.make() constructor from tagged classes, never manual object constructionAdtNameMemberName) for global uniquenessxiaohongshu
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