generating-data-layer
Skill2 starsChanged 4 months agoMITView on GitHub
Gera a camada de dados frontend (Model, Service HTTP, Facade com signals) para uma feature Angular. Use quando o usuario pede "crie a camada de dados", "gere model service e facade", "data layer", "frontend data access" ou "generate-data-layer".
In this repository18 other files it gives its agents.
- agents/AGENTS.mdAGENTS.md
- ai-operating-protocolSkill
- angular-feature-architectureSkill
- angular-primeng-auditSkill
- angular-primeng-uiSkill
- angular-testing-patternsSkill
- commit-and-branch-conventionsSkill
- frontend-auth-bootstrapSkill
- generating-backend-moduleSkill
- generating-dumb-createSkill
- generating-dumb-editSkill
- generating-dumb-listSkill
- generating-smart-pageSkill
- monorepo-workspace-standardsSkill
- nestjs-api-standardsSkill
- prisma-migration-disciplineSkill
- rbac-security-auditorSkill
- shared-contracts-librarySkill
The file
Files
Gerando Frontend Data Layer (Angular)
Inicio rapido
Pedir o nome da entidade em PascalCase. Gera 3 arquivos em data-access/:
apps/<frontend-app>/src/app/{dominio}/data-access/
{kebab}.model.ts
{kebab}.service.ts
{kebab}.facade.tsModel ({kebab}.model.ts)
// Re-exportar da lib compartilhada quando a interface ja existe la
export type { I{Entity} } from '@org/shared';
// Interfaces locais: payloads de UI que o backend nao conhece
export interface I{Entity}CreatePayload {
name: string;
description: string;
status: boolean;
}Regra: export type { } e nao export { } para interfaces (exigencia de isolatedModules).
Guardrail: se o payload/resposta do endpoint ainda nao existe em @org/shared, criar a
interface compartilhada primeiro. O *.model.ts nunca duplica contrato publico do backend.
Service e Facade
- Service HTTP: SERVICE-TEMPLATE
- Facade com signals: FACADE-TEMPLATE
Divisao de responsabilidade
| Camada | Faz | Nao faz |
| Service | HTTP, desembrulhar o envelope de resposta, mapear erro | guardar estado, exibir toast |
| Facade | estado em signals, orquestrar chamadas, notificar | montar URL, tocar em HttpClient |
| Componente | renderizar, emitir eventos | chamar Service direto |
Regras obrigatorias
inject(), nunca injecao por construtor.@Injectable({ providedIn: 'root' })em service e facade.- Signals privados gravaveis:
_items,_isLoading,_selectedItem,_createDialogOpen,_editDialogOpen. Publicos sempre readonly via.asReadonly(). firstValueFrom()para consumir Observable dentro da facade.try/finallypara garantir que o loading sempre baixa.- Nunca duplicar tipos que ja existem em
@org/shared. - Componente nunca chama Service direto: sempre via Facade.
Placeholders
<frontend-app>, {Entity}, {kebab}, @org/shared, NotificationService
(wrapper de toast do projeto), ErrorHandlingService (tratamento central de erro HTTP).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

