Skip to content

Viniciustda/OiTenta / .agents/skills/module-entity

module-entity

Verified

Cria entidades de domínio padronizadas para os módulos da aplicação, com estado tipado, herança da entidade base, validação explícita orientada por regras reutilizáveis do projeto e testes unitários completos para garantir segurança de evolução.

FileKindSize
SKILL.mdskill md10.9 KB
agents/openai.yamlconfig441 B
references/user-entity-pattern.mdmarkdown1.9 KB
references/validation-inference-guide.mdmarkdown2.1 KB

references/validation-inference-guide.md

View on GitHub
# Validation Inference Guide

Use este guia junto com as regras reais em `packages/shared/src/validation/rules/`.

## Processo de escolha

1. Identifique a semantica do campo pelo nome.
2. Cruze com o tipo TypeScript.
3. Procure primeiro uma regra compartilhada existente.
4. Combine regras simples em vez de criar regra nova cedo demais.
5. So crie uma nova regra compartilhada quando a necessidade for generica e recorrente.

## Mapeamentos comuns

- `name`, `fullName`, `ownerName`
  - `RequiredRule`
  - `MinLengthRule`
  - `MaxLengthRule`
  - `PersonNameRule`
- `email`
  - `RequiredRule`
  - `EmailRule`
- `passwordHash`, `hashedPassword`
  - `BcryptHashRule`
- `password`
  - `RequiredRule`
  - `StrongPasswordRule`
  - `NoCommonPasswordRule`
- `slug`
  - `RequiredRule`
  - `SlugRule`
- `url`, `website`
  - `RequiredRule`
  - `UrlRule`
- `domain`
  - `RequiredRule`
  - `DomainRule`
- `phone`
  - `RequiredRule`
  - `PhoneRule`
  - `PhoneBrRule` quando a semantica for brasileira
- `cpf`, `cnpj`, `cep`, `rg`
  - usar a regra especifica existente
- `id`, `userId`, `customerId`, `transactionId`
  - `RequiredRule`
  - `UuidRule`
- `quantity`, `count`, `installments`
  - `RequiredRule`
  - `IntegerRule`
  - `PositiveRule`
- `amount`, `price`, `total`
  - `RequiredRule`
  - `PositiveRule`
  - `PrecisionRule` quando houver escala monetaria definida
- `createdOn`, `expiresAt`, `birthDate`
  - `RequiredRule`
  - `DateRule`
  - `PastDateRule` ou `FutureDateRule` conforme o caso
- arrays como `tags`, `items`, `emails`
  - `RequiredRule` se nao puder faltar
  - `MinItemsRule`
  - `MaxItemsRule`
  - `UniqueItemsRule`

## Sinais de que vale criar regra compartilhada nova

- a validacao nao depende da entidade atual
- o nome da regra faz sentido em qualquer modulo
- a regra pode ser testada isoladamente no `shared`
- a regra representa formato, faixa, combinacao ou politica generica

## Sinais de que nao vale criar regra compartilhada nova

- a regra menciona contexto exclusivo de um agregado
- o erro faria sentido apenas para uma entidade
- a necessidade pode ser atendida combinando regras existentes
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: 197kUpdated 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