@diegosouzapw/adr-scaffold
BSpecializes in generating Action-Domain-Responder (ADR) boilerplate for Gravito projects. Trigger this when adding new features or modules using the ADR pattern.
Install
agr install @diegosouzapw/adr-scaffold --target claudeWrites 2 files into .claude/skills/, pinned to git-044ed04a.
- .claude/skills/adr-scaffold/SKILL.md
- .claude/skills/adr-scaffold/metadata.json
Document
name: adr-scaffold description: Specializes in generating Action-Domain-Responder (ADR) boilerplate for Gravito projects. Trigger this when adding new features or modules using the ADR pattern.
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.
Trustgrade B
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- warnLicenseno SPDX license detected
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged โ not that the artifact is safe.
Versions
git-044ed04abef62026-07-31