hackbrasil-2026-bora/OiTenta / .agents/skills/module-repository
module-repository
UnverifiedCria contratos de repositório padronizados para agregados dos módulos de negócio, reaproveitando interfaces compartilhadas de persistência e gerando também uma implementação em memória para apoiar testes dos casos de uso.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.4 KB |
| agents/openai.yaml | config | 312 B |
| references/few-shots/fake-user.repository.example.ts | script | 1.3 KB |
| references/few-shots/user.repository.example.ts | script | 257 B |
| references/mandatory-readings.md | markdown | 1.2 KB |
| references/repository-pattern.md | markdown | 1.6 KB |
references/few-shots/fake-user.repository.example.ts
View on GitHubimport { PageResult } from "@poupig/shared";
import { User, UserPageParams, UserRepository } from "../../src";
export class FakeUserRepository implements UserRepository {
private readonly storage = new Map<string, User>();
constructor(initialUsers: User[] = []) {
for (const user of initialUsers) {
this.storage.set(user.id, user);
}
}
get users(): User[] {
return Array.from(this.storage.values());
}
async create(data: User): Promise<User> {
this.storage.set(data.id, data);
return data;
}
async update(data: User): Promise<User> {
if (!this.storage.has(data.id)) {
throw new Error(`User with id "${data.id}" was not found.`);
}
this.storage.set(data.id, data);
return data;
}
async delete(id: string): Promise<void> {
this.storage.delete(id);
}
async findById(id: string): Promise<User | null> {
return this.storage.get(id) ?? null;
}
async findPage(params: UserPageParams): Promise<PageResult<User>> {
const page = Math.max(params.page, 1);
const perPage = Math.max(params.perPage, 1);
const start = (page - 1) * perPage;
const items = this.users.slice(start, start + perPage);
return {
items,
page,
perPage,
total: this.storage.size,
};
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |