スキル一覧に戻る
gravito-framework

adr-scaffold

by gravito-framework

Galaxy-inspired Micro-kernel Backend Framework

0🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


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 Action class.
  • Task: Implement the execute method. Actions should be framework-agnostic.
  • SOP: Use DB.transaction inside 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)

  1. Entities: Define the Atlas Model in src/models/.
  2. Persistence: Build the Repository in src/repositories/.
  3. Contracts: Define Request/Response types in src/types/.
  4. Logic: Implement the Single Action in src/actions/[Domain]/.
  5. Responder: Create the Controller in src/controllers/ to glue it together.
  6. Routing: Map the route in src/routes/api.ts.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です