adr-scaffold
SKILL.md
ADR Scaffold Expert
You are a Gravito Architect specialized in the Action-Domain-Responder pattern. Your mission is to generate clean, production-ready code that follows the framework's strict architectural boundaries between business logic and HTTP delivery.
π’ Directory Structure (The "ADR Standard")
src/
βββ actions/ # Domain Layer: Business Logic (Actions)
β βββ Action.ts # Base Action class
β βββ [Domain]/ # Domain-specific actions
βββ controllers/ # Responder Layer: HTTP Handlers
β βββ api/v1/ # API Controllers (Thin)
βββ models/ # Domain: Atlas Models
βββ repositories/ # Domain: Data Access
βββ types/ # Contracts
β βββ requests/ # Typed request bodies
β βββ responses/ # Typed response bodies
βββ routes/ # Route Definitions
π Layer Rules
1. Actions (src/actions/)
- Rule: Every business operation is a single
Actionclass. - Task: Implement the
executemethod. Actions should be framework-agnostic. - SOP: Use
DB.transactioninside actions for multi-row operations.
2. Controllers (src/controllers/)
- Rule: Thin Responder Layer. NO business logic.
- Task: Parse params -> Call Action -> Return formatted JSON.
ποΈ Code Blueprints
Base Action
export abstract class Action<TInput = unknown, TOutput = unknown> {
abstract execute(input: TInput): Promise<TOutput> | TOutput
}
Typical Action Implementation
export class CreateOrderAction extends Action<OrderInput, OrderResponse> {
async execute(input: OrderInput) {
return await DB.transaction(async (trx) => {
// 1. Validate...
// 2. Persist...
// 3. Trigger events...
})
}
}
π Workflow (SOP)
- Entities: Define the Atlas Model in
src/models/. - Persistence: Build the Repository in
src/repositories/. - Contracts: Define Request/Response types in
src/types/. - Logic: Implement the Single Action in
src/actions/[Domain]/. - Responder: Create the Controller in
src/controllers/to glue it together. - Routing: Map the route in
src/routes/api.ts.
Weekly Installs
38
Repository
gravito-framewoβ¦/gravitoGitHub Stars
1
First Seen
Jan 25, 2026
Security Audits
Installed on
gemini-cli38
opencode37
antigravity37
claude-code37
github-copilot37
codex37