| name | scaffold-domain |
| description | Bootstrap DDD 4-layer domain structure. Use when (1) starting new domain implementation, (2) during v0.1.x PROJECT phase, (3) need to create repositories/api-clients/hooks/components with __tests__ and index.ts exports. |
| tools | ["Bash","Write"] |
๐ ์์คํ
๋ฉ์์ง: ์ด Skill์ด ํธ์ถ๋๋ฉด [SEMO] Skill: scaffold-domain ํธ์ถ - {๋๋ฉ์ธ๋ช
} ์์คํ
๋ฉ์์ง๋ฅผ ์ฒซ ์ค์ ์ถ๋ ฅํ์ธ์.
Scaffold Domain Skill
@./../_shared/ddd-patterns.md
@./../_shared/test-templates.md
Purpose: Generate complete DDD 4-layer architecture structure for a new domain
When to Use
Agents should invoke this skill when:
- Starting new domain implementation
- During v0.1.x PROJECT phase
- Implementing feature in new domain
- Refactoring existing code to DDD
Quick Start
Generated Structure
app/{domain}/
โโโ _repositories/
โ โโโ __tests__/
โ โโโ index.ts
โโโ _api-clients/
โ โโโ index.ts
โโโ _hooks/
โ โโโ __tests__/
โ โโโ index.ts
โโโ _components/
โ โโโ __tests__/
โ โโโ index.ts
โโโ page.tsx
Usage
skill: scaffoldDomain("posts");
Standard Components Created
Each domain gets 6 standard components:
| Component | Purpose |
|---|
{Domain}Header | Page header with title and actions |
{Domain}Filter | Filter controls (search, sort) |
{Domain}List | Main list/grid display |
{Domain}EmptyState | Empty state UI |
{Domain}LoadingState | Loading skeletons |
{Domain}ErrorState | Error display |
Critical Rules
- All 4 Layers: Must create repositories, api-clients, hooks, components
- Test Directories: Always create
__tests__/ for testable layers
- Index Exports: Always create
index.ts for clean imports
- Factory Pattern: API clients must export singleton instances
Constitution Compliance
- Principle I: DDD Architecture (4-layer structure)
- Creates proper separation of concerns
- Follows established patterns
Dependencies
- File system operations
- Template files (optional, can use inline templates)
Related Skills
implement - Uses this skill during v0.1.x PROJECT phase
fetch-supabase-example - Used to implement Repository
validate-architecture - Validates created structure
References