scaffold
Scaffold a new service, module, or feature with full layered architecture. Auto-invoke when the user says "create a new service", "add a module for X", "scaffold a feature", or "set up the structure f
SKILL.mdskills/scaffold/SKILL.md
GitHubScaffold Skill
Generate a fully layered module/service for the given domain and stack.
Arguments
$ARGUMENTS— e.g.order nodejs,payment laravel,user golang
Step 1 — Parse Arguments
Identify:
- Domain name (e.g.
order,user,payment) - Stack (
nodejs|laravel|golang) — if not provided, detect from the project (check forpackage.json,go.mod,composer.json)
Step 2 — Read the Relevant Process File
Before generating anything, read the matching process file:
- Node.js →
@~/.claude/process/node_process.md - Golang →
@~/.claude/process/go_process.md - Laravel →
@~/.claude/process/php_process.md
Step 3 — Confirm Structure Before Generating
Present the proposed file tree and the interface/contract list to the user. Wait for explicit approval before writing any files.
Example for order nodejs:
src/
interfaces/
IOrderRepository.ts
IOrderService.ts
dtos/
CreateOrderDTO.ts
OrderResponseDTO.ts
repositories/
OrderRepository.ts
services/
OrderService.ts
controllers/
OrderController.ts
errors/
OrderNotFoundError.ts
tests/
unit/
services/OrderService.test.ts
integration/
repositories/OrderRepository.test.ts
Step 4 — Generate Files in This Order
- Interface / contract files first
- DTOs
- Custom error classes
- Repository (implementing the interface)
- Service (injecting the repository interface)
- Controller (injecting the service interface)
- Unit test for the service (mock the repository)
- Integration test stub for the repository
Rules
- Every class receives its dependencies via constructor injection — no
new ConcreteClass()inside classes - Service depends on the interface, never the concrete repository
- Controller must not contain business logic
- Every file starts with the file path as a comment on line 1
- Use the naming conventions from
~/.claude/CLAUDE.md - Generated tests must follow the
it should <behaviour> when <condition>naming format - After generating, print a summary of: files created, interfaces defined, what still needs wiring (DI binding, routes, etc.)