Skip to content

Add feature-scaffolder custom agent, instructions and skill - #56

Open
brunosilvaJava wants to merge 2 commits into
masterfrom
brunosilvajava-feature-scaffolder-agent
Open

Add feature-scaffolder custom agent, instructions and skill#56
brunosilvaJava wants to merge 2 commits into
masterfrom
brunosilvajava-feature-scaffolder-agent

Conversation

@brunosilvaJava

Copy link
Copy Markdown
Owner

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 via applyTo a qualquer edição em src/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

copilot --agent feature-scaffolder

e descrever a nova feature (nome, campos, regras de negócio).

Validação

  • Testado com copilot --agent feature-scaffolder -p "..." — agente carrega e responde corretamente, sem erros de parsing do frontmatter.
  • Nenhuma alteração em código de produção do projeto.

- .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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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,
Comment on lines +61 to +62
- `{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:
Comment on lines +34 to +36
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)
@brunosilvaJava

Copy link
Copy Markdown
Owner Author

@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>

Copilot AI commented Aug 30, 2026

Copy link
Copy Markdown

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested chang...

Fixed all items from the linked review thread in commit 928429f with only the requested scope changes (.github/skills/feature-scaffolding/SKILL.md and .github/agents/feature-scaffolder.agent.md).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants