Skip to content

hackbrasil-2026-bora/OiTenta / .agents/skills/shared-validation-rule

shared-validation-rule

Unverified

Cria regras de validação reutilizáveis no pacote compartilhado da aplicação, seguindo o padrão existente de contratos, utilitários, códigos de erro, exports e testes unitários completos.

references/few-shots/range-length.rule.test.example.ts

View on GitHub
import { RangeLengthRule } from "../../../src/index";

describe("RangeLengthRule", () => {
  test("deve validar valores dentro do intervalo", () => {
    const rule = new RangeLengthRule(3, 5);

    expect(rule.validate("ab")).toBe("range.length");
    expect(rule.validate("abcd")).toBeNull();
    expect(rule.validate("abcdef")).toBe("range.length");
  });

  test("deve validar arrays dentro do intervalo", () => {
    const rule = new RangeLengthRule(2, 3);

    expect(rule.validate(["a"])).toBe("range.length");
    expect(rule.validate(["a", "b"])).toBeNull();
    expect(rule.validate(["a", "b", "c", "d"])).toBe("range.length");
  });

  test("deve reprovar valores sem length e ignorar vazios", () => {
    const rule = new RangeLengthRule(3, 5);

    expect(rule.validate({})).toBe("range.length");
    expect(rule.validate("")).toBeNull();
    expect(rule.validate(null)).toBeNull();
  });
});
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