name: forge-codegen-crud
Generate Forge-compliant CRUD artifacts from business requirements without re-discovering project rules. Treat AGENTS.md as the highest priority source; this skill only codifies the repeatable codegen workflow.
AGENTS.md, code-copilot/memory/pitfalls.md, code-copilot/memory/decisions.md, and code-copilot/memory/preferences.md before generating code.single-table, master-detail, or left-tree-right-table.references/sql-seeds.md and references/validation-checklist.md. For single-table CRUD, also read references/single-table-crud.md.forge/db/migration/ for all schema and built-in data changes.tenant_id = 1 for all built-in business data, dictionaries, and resources. Do not seed tenant 0.del_flag and an explicit @TableLogic to logical-delete business/configuration/design tables. For active-only business uniqueness with a numeric primary key, use BIGINT/Long del_flag, UNIQUE (..., del_flag), and @TableLogic(value = "0", delval = "<primary-key-column>"); custom deletes must write the row primary key. Never generate logic_delete_active, generated/function/partial indexes, (business_key, deleted_at) with active rows stored as NULL, or a fixed delete value of 1 for tombstone-indexed tables. Follow references/sql-seeds.md for the decision rules and string-primary-key exception.LambdaQueryWrapper query chains except MyBatis-Plus built-in selectById, insert, updateById, and deleteById style operations.pageNum and pageSize; never generate backend page as the page parameter.:id or :${rowKey}. Do not generate {id} placeholders.POST /getByIdPOST /addPOST /editPOST /remove/{id} and post@.../remove/:id
Do not generate PUT or DELETE endpoints for generated CRUD modules.DictSelect, DictTag, and useDict() for dictionary fields. Do not hardcode frontend options or status label maps.sys_dict_type and sys_dict_data seed SQL for new dictionaries, or explicitly reuse an existing dictionary type discovered in migrations.sys_excel_export_config and sys_excel_column_config seed SQL when import/export is enabled.sys_resource seed SQL for menus and permissions after the page/API contract is known.@ApiDecrypt and @ApiEncrypt for sensitive or encrypted endpoints, and use encrypted frontend request modes consistently.references/single-table-crud.md: generated file layout, backend/frontend CRUD contract, batch delete, import/export endpoint shape.references/sql-seeds.md: table DDL, dictionary inserts, Excel config inserts, resource/menu inserts.references/validation-checklist.md: final review checklist for generated artifacts.When generating a CRUD module, provide: