generating-dumb-edit
Skill2 starsChanged 4 months agoMITView on GitHub
Gera Dumb Component de edicao Angular + PrimeNG - p-dialog com Reactive Form pre-preenchido via effect() e padrao dialogVisible signal. Use quando o usuario pede "crie o componente de edicao", "dialog de editar", "dumb edit component" ou "generate-dumb-edit".
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-data-layerSkill
- generating-dumb-createSkill
- 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 Dumb Edit Component
Inicio rapido
Pedir o nome da entidade em PascalCase e gerar 3 arquivos:
apps/<frontend-app>/src/app/{dominio}/ui/{kebab}-edit/
{kebab}-edit.component.ts
{kebab}-edit.component.html
{kebab}-edit.component.scss <- vazioTemplate TypeScript
import { ChangeDetectionStrategy, Component, effect, inject, input, output, signal } from '@angular/core';
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
import { ButtonModule } from 'primeng/button';
import { DialogModule } from 'primeng/dialog';
import { InputTextModule } from 'primeng/inputtext';
import { TextareaModule } from 'primeng/textarea';
import { ProgressBarModule } from 'primeng/progressbar';
import { HasPermissionDirective } from '@/app/shared/directives/has-permission.directive';
import { I{Entity} } from '../../data-access/{kebab}.model';
@Component({
selector: 'app-{kebab}-edit',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
DialogModule, ReactiveFormsModule, InputTextModule, TextareaModule,
ButtonModule, ProgressBarModule, HasPermissionDirective,
],
templateUrl: './{kebab}-edit.component.html',
styleUrl: './{kebab}-edit.component.scss',
})
export class {Entity}EditComponent {
private fb = inject(FormBuilder);
isLoading = input<boolean>(false);
item = input<I{Entity} | null>(null);
save = output<Partial<I{Entity}>>();
cancel = output<void>();
dialogVisible = signal<boolean>(true);
form: FormGroup = this.fb.group({
name: ['', [Validators.required, Validators.minLength(3)]],
description: ['', [Validators.required, Validators.minLength(3)]],
});
constructor() {
effect(() => {
const current = this.item();
if (current) {
this.form.patchValue({
name: current.name,
description: current.description,
});
}
});
}
closeDialog(): void {
this.dialogVisible.set(false);
}
onDialogHide(): void {
this.form.reset();
this.cancel.emit();
}
submit(): void {
if (this.form.valid) {
this.save.emit({ id: this.item()?.id, ...this.form.value });
}
}
}Diferencas em relacao ao create
- Input
itemcom a entidade selecionada, vinda da smart page. effect()no construtor fazpatchValuesempre que a entidade muda.- Titulo "Editar" e permissao
'{kebab}:update'no botao Salvar. - O payload de
saveinclui oid.
Template HTML
Mesmo padrao do create: ver DIALOG-PATTERN.
Regras
effect()noconstructor()para opatchValue: garante reatividade quando a entidade muda.- No
patchValue, mapear apenas campos editaveis (foraid,createdAt, chaves de escopo). - Mesmo padrao
dialogVisibledo create: nunca emitircanceldireto do X. - Se o form tiver estado sujo, avaliar confirmacao antes de fechar (nao incluido no template).
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.

