本文へ移動
cccskills
無料GitHub で公開

use-cases-and-orchestration

Orchestrate services and repositories through use cases to implement application-level workflows and business scenarios.

日本語の概要は準備中です。原文の説明を表示しています。

Authula/authulaスター 273(GitHub 273 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(2)

  • SKILL.md2.3 KB
  • examples/todo_usecases.go1.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Use Cases & Orchestration

When to use this skill

  • Implement workflows that span multiple services
  • Define reusable operations that handlers invoke
  • Keep handlers thin by moving logic into use cases if multiple services are needed/used
  • Encapsulate business logic and orchestration in a single place
  • Coordinate complex operations that require multiple steps and services

Key principles

  1. Service orchestration: Use cases call multiple services
  2. Business-focused: Methods represent user actions, not HTTP operations
  3. Dependency injection: Services passed at construction
  4. Pure domain: No HTTP, no routing, just business logic delegated to services. Usecases simply orchestrate services and handle validation, errors, and return domain models
  5. Testable: Can be tested independently by mocking services as services are interfaces

Pattern

Use cases orchestrate services:

  • Implement as structs with service dependencies
  • Single public Execute or action method e.g. RegisterUseCase with Execute(ctx context.Context, reqCtx *models.RequestContext) (res *someStructType, error). The res can be a domain model that returns the data from each service's method output, but should not be an HTTP response. The handler can convert it to an HTTP response if needed.
  • Handle validation such as checking request parameters passed down from the handler.
  • Coordinate multiple services sequentially
  • Handle errors and return domain models

Example

See examples/todo_usecases.go for:

  • CreateTodoUseCase orchestrating TodoService
  • MarkTodoCompleteUseCase patterns
  • Request/response types and error handling

Common mistakes

  1. Use cases returning HTTP status codes
  2. Validation in handlers instead of use cases
  3. Use cases calling other use cases
  4. Creating new services instead of injecting
  5. Use cases with no clear purpose

References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Wire dependencies using constructor-based dependency injection throughout services, repositories, and handlers.

日本語の概要は準備中です。原文の説明を表示しています。

Authula/authula2732026年10月24日 更新

Use this skill when answering questions, explaining concepts, writing technical responses, reviewing code, or helping with development tasks. Communicate in clear, simple, standard English. Keep answers concise and focused, remove unnecessary filler and repetition, explain technical ideas in plain language, and structure information so it is easy to read and understand. When showing code, present it clearly with enough context for the developer to understand what it does and where it belongs.

日本語の概要は準備中です。原文の説明を表示しています。

Authula/authula2732026年10月24日 更新

grill-me

無料

A relentless interview to sharpen a plan or design.

日本語の概要は準備中です。原文の説明を表示しています。

Authula/authula2732026年10月24日 更新

grilling

無料

Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

日本語の概要は準備中です。原文の説明を表示しています。

Authula/authula2732026年10月24日 更新

Implement HTTP handlers that parse requests, invoke use cases, and format responses following REST conventions.

日本語の概要は準備中です。原文の説明を表示しています。

Authula/authula2732026年10月24日 更新

handoff

無料

Compact the current conversation into a handoff document for another agent to pick up.

日本語の概要は準備中です。原文の説明を表示しています。

Authula/authula2732026年10月24日 更新

Authula のスキルをすべて見る

このスキルの問題を報告する