π μμ€ν λ©μμ§: μ΄ 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
// Agent invokes this skill
skill: scaffoldDomain("posts");
// Creates:
// app/posts/_repositories/ + _api-clients/ + _hooks/ + _components/ + page.tsx
// + all test boilerplates + index.ts exports
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.tsfor 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 phasefetch-supabase-example- Used to implement Repositoryvalidate-architecture- Validates created structure
References
- Layer Templates - Repository, API Client, Hooks, Components boilerplate
- Output Format - Success output, naming conventions, error handling