Add feature-scaffolder custom agent, instructions and skill - #56
Add feature-scaffolder custom agent, instructions and skill#56brunosilvaJava wants to merge 2 commits into
Conversation
- .github/agents/feature-scaffolder.agent.md: custom agent that scaffolds a complete new domain feature following project conventions. - .github/instructions/feature-scaffolding.instructions.md: standing rules for layers, naming, migrations and tests, applied to Java/SQL files. - .github/skills/feature-scaffolding/SKILL.md: reusable operational skill generating Entity, Repository, Mapper, DTOs, Service, Controller+ApiDocs, Flyway migration and unit tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The scaffolding instructions contain conflicting mapper, endpoint, persistence, and soft-delete requirements that can generate incorrect or uncompilable code.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adiciona automação para gerar novas features conforme a arquitetura do Personal Budget.
Changes:
- Adiciona agente customizado de scaffolding.
- Define convenções permanentes para Java, Flyway e testes.
- Adiciona skill com fluxo completo de geração e validação.
File summaries
| File | Description |
|---|---|
.github/agents/feature-scaffolder.agent.md |
Define o agente e seu fluxo operacional. |
.github/instructions/feature-scaffolding.instructions.md |
Centraliza convenções arquiteturais. |
.github/skills/feature-scaffolding/SKILL.md |
Especifica os artefatos e etapas de geração. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 6
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| ### 3.1 Migration Flyway | ||
| `src/main/resources/db/migration/V{n}__create_table_{feature_snake_case}.sql` | ||
| - Tabela com PK `id BIGINT AUTO_INCREMENT`, `code CHAR(36)` (UUID) único, |
| - `{Feature}Entity toEntity({Feature}Request request)` | ||
| - `{Feature} toDomain({Feature}Entity entity)` |
| `core/domain/service/{feature}/{Feature}Service.java` | ||
| - `@Slf4j`, `@RequiredArgsConstructor`, `@Transactional` nos métodos de escrita. | ||
| - Log `log.info("m={método}, param={valor}")` no início de cada método público. | ||
| - Métodos: `create`, `update` (soft delete via `flagActive=false` quando aplicável), `findByCode`, `findAll`/`findAllPaged`. |
|
|
||
| ## 3. Gerar os arquivos | ||
|
|
||
| Para uma feature `{Feature}` (ex.: `Category`), gerar, nesta ordem: |
| 3. **Gerar todos os arquivos** conforme a skill `feature-scaffolding`: | ||
| Entity, Repository, Mapper, DTOs, Service, Controller + `{Feature}ControllerApiDocs`, | ||
| migration Flyway e testes unitários com factory. |
| - `{Feature}Entity toEntity({Feature}Request request)` | ||
| - `{Feature} toDomain({Feature}Entity entity)` | ||
| - `{Feature}Response toResponse({Feature} domain)` | ||
| - `Paged{Feature}Response toPagedResponse(Page<{Feature}> page)` (se houver listagem) |
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Co-authored-by: brunosilvaJava <12662607+brunosilvaJava@users.noreply.github.com>
Fixed all items from the linked review thread in commit |
Resumo
Adiciona um conjunto de artefatos para automatizar a criação de novas features de domínio no Personal Budget, seguindo as convenções documentadas em
.kiro/steering/*.md.Arquivos adicionados
.github/agents/feature-scaffolder.agent.md— agente customizado que define o papel e o fluxo de trabalho (levantar requisitos → inspecionar convenções existentes → gerar código via a skill → resumir resultado)..github/instructions/feature-scaffolding.instructions.md— regras permanentes de convenção (camadas, nomenclatura, migrations Flyway, JSON snake_case, testes), aplicadas viaapplyToa qualquer edição emsrc/main/java, migrations e testes — valem independente do agente ser usado..github/skills/feature-scaffolding/SKILL.md— lógica operacional reutilizável que gera, com código completo (sem placeholders): Entity, Repository, Mapper, DTOs, Service, Controller + ApiDocs, migration Flyway numerada corretamente e testes unitários com factory.Uso
e descrever a nova feature (nome, campos, regras de negócio).
Validação
copilot --agent feature-scaffolder -p "..."— agente carrega e responde corretamente, sem erros de parsing do frontmatter.