usecase-design

usecase-design is a skill for Claude Code from parisgroup-ai/imersao-ia-setup. It costs 64 tokens per session (3,091 once invoked), scanned A, original, MIT.

A backend design guide for putting business rules in separate use-case modules while keeping tRPC routers thin. A tRPC router is the API layer that validates a request and calls the code handling the actual operation.

In plain words
What is it for?
Use it when organizing backend features into use cases, repositories, data-transfer objects, and tRPC endpoints.
Why use it?
It keeps request handling separate from business logic, making backend features easier to understand and change. The structure also defines clear boundaries for data access and application code.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the imersao plugin — 74 skills, 7 commands shipped together

Good fit Use it when organizing backend features into use cases, repositories, data-transfer objects, and tRPC endpoints.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/parisgroup-ai/imersao-ia-setup/usecase-design
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add parisgroup-ai/imersao-ia-setup --skill usecase-design
Clone the repo
git clone --depth 1 https://github.com/parisgroup-ai/imersao-ia-setup

Made for: Claude Code.

Or install imersao, the plugin that ships this one along with the rest of its 74 skills, 7 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for usecase-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/parisgroup-ai/imersao-ia-setup/usecase-design/github.svg)](https://agentmods.dev/skills/parisgroup-ai/imersao-ia-setup/usecase-design)
Your own site
<a href="https://agentmods.dev/skills/parisgroup-ai/imersao-ia-setup/usecase-design"><img src="https://agentmods.dev/badge/skills/parisgroup-ai/imersao-ia-setup/usecase-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for usecase-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/parisgroup-ai/imersao-ia-setup/usecase-design"><img src="https://agentmods.dev/badge/skills/parisgroup-ai/imersao-ia-setup/usecase-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.03091
Opus 5.5 $0.00026 $0.01236
Sonnet 5.5 $0.00013 $0.00618
Haiku 4.5 $0.00006 $0.00309

Measured 21d ago against content hash 316c80aae93d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

usecase-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/imersao/skills/usecase-design/SKILL.md · 399 lines

How it starts

The opening of the file, as written. The whole thing — 399 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Use Case Design (tRPC + Modules)

Overview

Use cases encapsulam lógica de negócio na camada application. tRPC routers são thin - apenas validam input e chamam use cases.

Estrutura: packages/api/src/modules/{module}/application/use-cases/

The Iron Law

ZERO LÓGICA DE NEGÓCIO NO TRPC ROUTER

O critério NÃO é contagem de linhas. É: pode um dev júnior entender o router em 5 segundos sem conhecer Prisma ou regras de negócio?

Se a resposta é não, refatore.

Quick Reference

Camada Responsabilidade Exemplo
Router (tRPC) Validar input, chamar use case orderRouter.ts
Use Case Orquestrar lógica de negócio CreateOrderUseCase.ts
Repository Interface Contrato de acesso a dados IOrderRepository.ts
Repository Impl Implementação (Prisma, etc) PrismaOrderRepository.ts

Estrutura de Módulo

packages/api/src/modules/orders/
├── application/
│   ├── use-cases/
│   │   ├── CreateOrderUseCase.ts
│   │   └── GetOrderUseCase.ts
│   ├── dtos/
│   │   ├── CreateOrderInput.ts
│   │   └── CreateOrderOutput.ts
│   └── ports/
│       └── IOrderRepository.ts
├── domain/
│   └── Order.ts
├── infrastructure/
│   └── PrismaOrderRepository.ts
└── presentation/
    └── order.router.ts

Padrão de Use Case

// application/use-cases/CreateOrderUseCase.ts
export class CreateOrderUseCase {
  constructor(
    private readonly orderRepository: IOrderRepository,
    private readonly productRepository: IProductRepository,
    private readonly userRepository: IUserRepository
  ) {}

  async execute(input: CreateOrderInput): Promise<CreateOrderOutput> {
    // 1. Validar usuário
    const user = await this.userRepository.findById(input.userId);
    if (!user) throw new UserNotFoundError(input.userId);

    // 2. Validar produtos e calcular
    const products = await this.productRepository.findByIds(input.productIds);
    const total = this.calculateTotal(products, input.items);

    // 3. Criar pedido
    const order = Order.create({ userId: user.id, items: input.items, total });
    await this.orderRepository.save(order);

    return { orderId: order.id, total };
  }

  private calculateTotal(products: Product[], items: OrderItem[]): number {
    // lógica de cálculo
  }
}

Read the full file on GitHub · 399 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago First seen · 399 lines · 64 tokens per session scan A 316c80aae93d

Subscribe to this mod's changes

usecase-design is a skill published in the GitHub repository parisgroup-ai/imersao-ia-setup (1 stars, last pushed 20d ago), licensed MIT. It adds 64 tokens to every session and 3,091 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-06.

Related

Other skills, from other repositories

design-code-architecture

Guided journey from an app idea to a deliberate architecture: boundaries, domain model, data decisions, and resilience, making only the expensive-to-reverse decisions and deferring the rest. Orchestrates eight skills phase by phase - clean-architecture, domain-driven-design, system-design, ddia-systems…

wondelai/skills · 220 tokens

system-design

Design scalable distributed systems using structured approaches for load balancing, caching, database scaling, and message queues. Use when the user mentions "system design", "scale this", "high availability", "rate limiter", "design a URL shortener", "design Twitter", "design Uber", "design a news feed", "system…

wondelai/skills · 139 tokens

add-request-protection

Deprecated: use the arcjet skill instead. Adds security protection to a server-side route or endpoint — rate limiting, bot detection, email validation, and abuse prevention.

arcjet/arcjet-plugin · 40 tokens

list-connections

Lists Power Platform connections in the current environment. Use when you need a connection ID before adding a connector to a code app.

microsoft/power-platform-skills · 29 tokens

top-design

Create award-winning, immersive web experiences at the level of Awwwards-featured agencies. Use when the user mentions "Awwwards quality", "make my site stunning", "scroll animations", "parallax storytelling", "cinematic web design", "portfolio site", or "brand experience". Also trigger when elevating a standard…

wondelai/skills · 113 tokens

traction-eos

Implement the Entrepreneurial Operating System (EOS) to align vision and execution across a company. Use when the user mentions "EOS", "Entrepreneurial Operating System", "V/TO", "quarterly rocks", "Level 10 meetings", "accountability chart", "IDS process", "my company feels chaotic", "we keep having the same…

wondelai/skills · 147 tokens