agentleFS
gabriellstgabriellst/codm/.claude/skills/usecase/SKILL.md

usecase

Skill4 starsChanged 2 months agoMITView on GitHub

Create an application use case. Use when implementing business operations like CreateOrder, ProcessPayment, CancelBooking. Use this skill for any command/mutation that orchestrates domain logic, whether simple CRUD or complex multi-step transactions with sagas. Dispatch hub — routes to typescript/go variants by file extension.

Files
SKILL.md

Use Case

A single business operation (command) wrapped in a transaction + outbox. Orchestrates entities, repositories, and services; raises domain events; commits atomically. Never validates field formats imperatively inside the operation body — format validation is declarative, and where the declaration lives differs by language, intentionally (see below).

The shape and idioms of this primitive differ per backend language; the lang-specific playbooks below carry the concrete rules, code, and bad practices.

TS ↔ Go divergence (intentional) — format-validation placement

  • TypeScript: the controller is the sole format-validation site. Use-case InputSchemas describe shape only and carry no format refinements — TS use cases are reachable only through HTTP controllers (and the typed SDK), so the controller gate always runs first.
  • Go: validate tags live on both the controller request struct and the use-case Input struct. Go use cases ingest from non-HTTP paths — webhook choreography, Kafka/integration-event handlers, sync workers calling use cases directly — where no controller sits in front; the Input struct's tags are the only format gate on those paths.

This is not drift — it mirrors the entity hub's documented event-birth divergence: same primitive, deliberately different placement per backend. Atlas axis: VALIDATION-PLACEMENT.

Language variants

BackendPlaybookRegistry
TypeScript — packages/api/typescript/typescript/SKILL.mdtypescript/registry.yaml
Go — packages/api/go/go/SKILL.mdgo/registry.yaml

How dispatch works

scripts/review.ts infers the language from the file extension (.ts / .go) and loads the matching <lang>/registry.yaml. The CLI scaffolder takes a --lang flag (--lang=typescript / --lang=go) or infers it from cwd. When editing or reviewing code, open the lang playbook matching the file you're touching — patterns and bad practices are coded per-language (e.g. UC-GO-01).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.