agentleFS
eusouwilsoneusouwilson/angular-nest-ai-kit/skills/angular-primeng-ui/SKILL.md

angular-primeng-ui

Skill2 starsChanged 4 months agoMITView on GitHub

Create or refactor Angular + PrimeNG UI following smart/dumb boundaries. Use when working on templates, smart pages, dumb list/create/edit components, p-table, p-dialog, p-select, p-multiselect, p-button, PrimeNG module imports, Angular signal input()/output(), or the dialogVisible close pattern.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use esta skill antes de implementar ou refatorar UI Angular com PrimeNG.

    line 8
  2. Very specific:

    Create/Edit: p-dialog, Reactive Forms, dialogVisible interno, ProgressBarModule.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Angular + PrimeNG UI

Use esta skill antes de implementar ou refatorar UI Angular com PrimeNG.

Fontes obrigatorias

  • references/primeng-checklist.md (nesta skill) para o checklist rapido.
  • Se o projeto tiver um doc proprio de templates de UI, ler primeiro e tratar como fonte de verdade; esta skill vale como default quando nao houver.

Fluxo

  1. Confirmar escopo: lista, lista server-side, dialog create/edit, grid de campos, select/multiselect, botoes de acao ou smart page.
  2. Ler a secao correspondente do checklist.
  3. Manter a fronteira Smart/Dumb:
    • Smart pages injetam facades, coordenam dialogs, confirmacoes e loading.
    • Dumb components usam input()/output() e nunca injetam facade/service.
  4. Arquivos separados: .component.ts, .component.html, .component.scss.
  5. Importar os modulos PrimeNG exatos dos seletores usados.
  6. Visibilidade RBAC via diretiva estrutural (*hasPermission="'resource:action'").
  7. Dialogs controlados por @if no pai: usar dialogVisible = signal(true) interno e emitir cancel/close apenas no (onHide).
  8. Validar rodando o target de teste/build mais focado que existir.

Regras rigidas

  • ChangeDetectionStrategy.OnPush em dumb components.
  • input() / output(), nunca @Input() / @Output().
  • inject(), nunca DI por construtor.
  • @if / @for, nunca *ngIf / *ngFor.
  • SelectModule + p-select; DropdownModule esta deprecado desde PrimeNG 18.
  • templateUrl e styleUrl; evitar template: / styles: inline.
  • Nunca chamar cancel.emit() ou close.emit() direto do X/footer do dialog.
  • Nao esconder o botao de submit em form invalido/carregando: desabilitar com [disabled].
  • Nao injetar service/facade em dumb component.
  • Todo overlay (p-select, p-multiselect, p-datepicker) dentro de dialog ou tabela: appendTo="body" para evitar clipping.

Infra de UI que a skill assume

Se o projeto destino tiver equivalentes, usar os dele; se nao tiver, vale criar antes de espalhar solucao ad-hoc:

  • NotificationService: wrapper unico de toast. Componente e facade nunca chamam o MessageService do PrimeNG direto; centralizar e o que permite trocar o mecanismo depois.
  • BaseFacade<T>: signals items, selectedItem, isLoading, error e CRUD comum.
  • BasePaginatedListComponent<T>: base para lista server-side com p-table lazy.
  • Servico de layout unico como fonte da verdade do tema (claro/escuro). Nao criar alternador de tema paralelo por pagina.
  • Servico de loading global com suppress() / restore(): telas que ja tem skeleton proprio suprimem o overlay global no ngOnInit e restauram no destroy (DestroyRef.onDestroy), senao o usuario ve dois indicadores de carregamento ao mesmo tempo.
  • Interceptor de erro que trata API fora do ar (status === 0) redirecionando para uma rota publica dedicada, sem facade nem service de dominio.

Padrao de topbar

Quando a plataforma tem varios frontends, a topbar segue o mesmo desenho em todos: titulo/breadcrumb a esquerda; a direita, na ordem, seletores de escopo (visiveis conforme permissao), acoes especificas do app, notificacoes e avatar. Botao de topbar sempre e o componente de botao da lib de UI, nunca <button> com CSS proprio: icone-only usa text rounded com aria-label; acao com label usa text e severidade refletindo estado.

Sidebar pode variar por app; a topbar nao.

Mapa de referencia

  • Lista: p-table, TableModule, toolbar com busca, p-tag, botoes de acao.
  • Lista server-side: paginacao lazy com [lazy]="true" e (onLazyLoad).
  • Create/Edit: p-dialog, Reactive Forms, dialogVisible interno, ProgressBarModule.
  • Selects: SelectModule, MultiSelectModule, appendTo="body", optionLabel, optionValue.
  • Smart page: orquestracao de facade, p-toast, p-confirmDialog, ConfirmationService.

Alinhamento de arquitetura

Estrutura assumida (ajustar se o projeto destino usar outra):

  • Frontend: <dominio>/ com data-access/, feature/, ui/.
  • Backend: modulo com dto/ e services.
  • Contratos HTTP publicos vivem na lib compartilhada, nunca duplicados nos dois lados.

Nao introduzir novas camadas de rede ou contratos duplicados sem aprovacao explicita.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.