Skip to content

hackbrasil-2026-bora/OiTenta / .agents/skills/module-use-case

module-use-case

Unverified

Cria casos de uso padronizados para agregados dos módulos de negócio, com contratos de entrada e saída consistentes, implementação inicial simples, testes unitários completos e estrutura pronta para evolução pelo time.

references/few-shots/crud-delete-user.usecase.test.example.ts

View on GitHub
import { User } from "../../../src";
import { DeleteUser } from "../../../src/user/usecase/delete-user.usecase";
import { FakeUserRepository } from "../../mock";

describe("DeleteUser", () => {
  test("deve excluir a entidade quando ela existir", async () => {
    const user = new User({
      name: "Joao Silva",
      email: "joao@silva.com",
      password: "$2b$10$abcdefghijklmnopqrstuv1234567890abcdefghijklmnopqrs",
    });
    const userRepository = new FakeUserRepository([user]);
    const useCase = new DeleteUser(userRepository);

    await expect(useCase.execute({ id: user.id })).resolves.toBeUndefined();
    await expect(userRepository.findById(user.id)).resolves.toBeNull();
  });

  test("deve continuar previsivel mesmo quando o id nao existir", async () => {
    const userRepository = new FakeUserRepository();
    const useCase = new DeleteUser(userRepository);

    await expect(useCase.execute({ id: "missing-id" })).resolves.toBeUndefined();
    expect(userRepository.users).toEqual([]);
  });
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall