add-crud-module

Scaffolds complete CRUD modules across Go Kratos backend and React or Vue frontends.

545|146|Updated Aug 18, 2023
One-click install
npx skills add https://github.com/tx7do/go-wind-admin --skill add-crud-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-crud-module
Source: https://github.com/tx7do/go-wind-admin/tree/main/.zcode/skills/add-crud-module
Command: npx skills add https://github.com/tx7do/go-wind-admin --skill add-crud-module

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Adding a new business module to the go-wind-admin monorepo requires coordinated changes across protobuf definitions, Ent schemas, repositories, services, server wiring, and up to three different frontend frameworks, where a single missed step causes compile errors or silent refresh bugs.

Core Features & Use Cases

  • Backend scaffolding: Guides the 10-step flow from domain proto and BFF proto through Ent schema, repository, service, and server registration with make register.
  • Multi-frontend support: Provides per-framework references for React (ProTable + DrawerForm), Vue Element Plus (ProPage config-driven), and Vue Vben (VxeGrid + proxyConfig), each with its real refresh and form patterns.
  • Pitfall prevention: Documents cross-cutting rules such as mandatory updateMask on updates, new PaginationQuery(...) instantiation, and never hand-editing generated code.
  • Use Case: When asked to "add a product management page", the skill clarifies entity fields and target frontends, then walks through proto definition, code generation, repo/service creation, and framework-specific list and drawer pages.

Quick Start

Ask the assistant to add a new CRUD module named Product with fields name and status to the go-wind-admin backend and the React frontend.

Frequently Asked Questions about add-crud-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new CRUD module to go-wind-admin?

Start with the backend: create the domain proto and BFF proto, run make api, define the Ent schema, run make ent, then write the repository and service, and register with make register ENTITY=name. After that, follow the reference for each chosen frontend to build hooks, list page, and drawer form.

Why must the backend proto be done before the frontend pages?

Every frontend imports apiClient.<entity>Service, which is generated from the backend proto by make api or pnpm generate:api. Without the generated service getter and types, the frontend hooks and pages have nothing to call, so backend code generation is a hard prerequisite.

Why is my list not refreshing after create or delete in vue-element?

The vue-element frontend loads lists via fetchQuery, not a reactive useQuery subscription, so invalidateQueries has no effect. Call pageRef.value?.refresh() after the drawer emits its success event instead.

Why does my update request not change any fields?

The backend Update RPC honors google.protobuf.FieldMask, so without an updateMask no fields are written. Use the provided useUpdateXxx hook, which builds the mask via makeUpdateMask(Object.keys(values)) automatically.

Can I edit the generated code in api/gen or the frontend generated directory?

No. Generated directories are produced by protoc and Ent codegen and are overwritten on regeneration. If a type or service is wrong, fix the proto or Ent schema and rerun make api or make ent instead of editing generated files.

When should I not use this CRUD scaffolding skill?

Do not use it for bug fixes, refactors, or changes to an existing module's logic. It is designed only for creating new modules, entities, or management pages from scratch across the backend and frontends.