pure-admin-crud-generator
Pure Admin Thin CRUD Generator
Overview
Generate runnable Vue pages under src/views/<module>/ and route modules under src/router/modules/ from local swagger-ts-api output in src/api/swagger/Api.ts and API wrapper behavior in src/api/api.ts.
This is an AI-first generator skill. Do not use external OpenAPI generators and do not add helper codegen scripts.
When to Use
ALWAYS use this skill when the user asks to scaffold or update pure-admin-thin admin pages, including:
- CRUD pages (
index.vue,edit.vue, optionaldetail.vue) - dashboard-first admin pages
- route module files under
src/router/modules - action buttons backed by non-CRUD APIs (retry/enable/disable/export etc.)
- ANY admin management interface in a pure-admin-thin project
Trigger examples:
- "Generate admin pages for user management"
- "Create CRUD for voice-features module"
- "Add dashboard view for analytics"
- "Scaffold edit and detail pages for product management"
- "Generate route module and views for order management"
Hard Gates
These are non-optional. If any gate fails, stop and report blocking issues.
- Parse and generate from local
Api.ts+api.tsonly. - Do not regenerate API clients with external tools.
- Do not create reusable business UI component libraries.
- Use Element Plus components for page UI.
- Do not add runtime dependencies only for generated pages.
- Keep repository conventions first; only fallback to generic heuristics if local patterns are missing.
- Page
namemust match routenamefor keepAlive to work. - Route
namemust be unique across the application. - Use
satisfies RouteConfigsTablefor route module type safety.
If the module name is too vague (e.g., just "management"), ask for clarification before proceeding. If the API definition file doesn't exist, ask if the user wants to generate with generic REST patterns (noting the limitation in output).
Progressive Reference Loading
Phase 1: Always Read First
- references/output-contract.md - Output format requirements
- references/api-parsing-rules.md - API classification rules
Phase 2: Load On Demand
pageMode=crudormixed: references/page-generation-spec.mdpageMode=dashboard: references/dashboard-best-practices.md- Need RBAC permissions: references/rbac-permissions.md
- Need type declarations: references/type-declarations.md
Phase 3: Final Gate
Run through references/completion-checklist.md before output.
Input Contract
Required and optional generation inputs:
moduleSelector(required): module tag/entity/path keyword (e.g., "user", "voice-features", "order").selectorMode(optional, defaultauto):auto | tag | entity | path.forceDetailPage(optional, defaultauto):auto | true | false.pageMode(optional, defaultcrud):crud | dashboard | mixed.routeBase(optional, default/<kebab-module>).outputMode(fixed): full file contents only.
Examples:
- User says: "Generate pages for user management" →
moduleSelector="user", infer module from API tags - User says: "Create dashboard for voice-generate-text" →
moduleSelector="voice-generate-text",pageMode="dashboard" - User says: "Add edit page for product module" →
moduleSelector="product", generate edit.vue + route module
If the user provides only a vague module name, resolve with selectorMode=auto and explicitly state matched methods.
Repository Facts
Use these local assumptions first:
- API calls go through
APIfromsrc/api/api.ts. APIalready unwraps axios response once.- Swagger methods are under
new Api().apiinsrc/api/swagger/Api.ts. - Method doc blocks include
@tags,@name,@summary,@request. - Routes are auto-collected via
import.meta.glob("./modules/**/*.ts"); route index edits are usually unnecessary.
Workflow
Quick Path (Simple CRUD)
For simple CRUD operations with clear API patterns:
- Parse API definitions (list, detail, create, update, delete endpoints)
- Infer data structures from response types
- Generate standard file set:
index.vue,edit.vue, route module - Skip detailed validation notes
- Use condensed output format
Full Path (Complex/Dashboard)
For dashboard pages, custom actions, or complex workflows:
- Parse API definitions with full classification
- Analyze data structures and relationships
- Plan file set based on
pageMode - Generate pages with full error/retry handling
- Apply dashboard best practices if needed
- Use full output format with capability matrix
Output Contract
Condensed Output (Simple Tasks)
For straightforward CRUD with clear API patterns, use:
- Recognized APIs - Brief list of matched endpoints
- Files - File paths
- File Contents - Full Vue files
- Route Registration - Brief route module
Full Output (Complex Tasks)
For dashboards or complex pages, include all sections:
- Scaffold Fit Decision - Module config summary
- Recognized APIs - Full endpoint list with classification
- API Capability Matrix - What operations are available
- Files - File paths
- File Contents - Full Vue files
- Route Registration - Full route module with meta
- Validation Notes - Assumptions and risks
- Blocking Issues - Only if any gate fails
Use references/output-contract.md for detailed format.
Degrade Gracefully
When full CRUD is not available:
- Generate only valid pages/operations based on available endpoints
- Remove unsupported actions from UI (e.g., no delete button if no delete endpoint)
- Explicitly report missing CRUD endpoints in output
- Keep code runnable even when some operations are unavailable
Common degradation scenarios:
- Only list endpoint → generate list page only, disable create/edit/delete buttons
- List + create only → generate index + edit (create mode), no edit for existing items
- No detail endpoint → omit detail page or disable view action
Optional VueUse Policy
VueUse composables are optional. Use them only when complexity justifies it and @vueuse/core already exists in the project.
- do not add dependency automatically
- keep manual
ref/reactiveflow for simple pages - when available in this session,
vueuse-functionscan be used for composable selection patterns
Completion Checklist
Before returning, verify ALL of the following:
- Output format: Section order matches output contract (condensed or full based on task complexity)
- Type safety: Generated files compile under
pnpm typecheck - Pagination: Internal state is 0-based, UI displays 1-based (
pageIndex + 1) - Route id handling: Invalid id shows error message, does NOT silently fallback to create mode
- Filters: Only include filters that match real API query parameters
- Delete safety: All delete/destructive actions use
ElMessageBox.confirm - Runtime safety: Uncertain API fields use
Array.isArray()guards - Missing endpoints: Explicitly report which CRUD operations are unavailable
- Route module: Root route redirects to
/index, hidden routes useshowLink: false - Page name: Vue component
namematches routenamefor keepAlive - Dashboard quality (if dashboard mode): Has filter + metrics + main content + actions, per-region retry
- Route uniqueness: No duplicate route names across the application
More from go-sphere/skills
ent-seed-sql-generator
Generate deterministic INSERT SQL seed data from Go Ent schemas and mixed inputs. This skill is REQUIRED whenever you need to create seed SQL for development or testing - it handles entity inference, relationship integrity, stable IDs, and dialect-specific SQL generation including JSON, arrays, and complex types. Use this skill for any task involving seed data, test fixtures, demo initialization, or database population from Ent schema definitions, even if the user doesn't explicitly mention "seed" or "SQL".
27proto-api-generator
Design proto3 + HTTP API contracts for go-sphere scaffold projects from prompts, input folders, or requirement docs with mock data. Use when defining service APIs, selecting between entpb/shared/custom messages, and enforcing scaffold conventions, router-safety rules, and service-local error placement. This skill is REQUIRED for any proto API design task in go-sphere scaffold - always use it instead of writing proto files from scratch.
21sphere-feature-workflow
Implement end-to-end feature changes in go-sphere scaffold projects by following sphere-layout conventions and generation workflow. Use when adding or modifying APIs, protobuf contracts, Ent schemas, bind/map registration, service logic, or cross-layer refactors that must stay protocol-first and avoid manual edits to generated files. This skill is REQUIRED for any task involving go-sphere proto files, Ent schemas, service implementations, or generation commands (make gen/proto, make gen/docs, make gen/wire).
19proto-service-generator
Generate or complete Go service implementations from protobuf-generated HTTP interfaces in go-sphere scaffold projects. Use when you need to create `internal/service/<module>/*.go` files, add missing method implementations to existing services, or generate compilable stubs for new proto endpoints. Trigger for: service implementation, proto handler, append-only update, interface assertion, CRUD via Ent, stub method generation.
18ent-schema-generator
Design and generate Go + Ent database schemas for sphere-layout projects from requirements. Use when users describe data models, entity relationships, database tables, or schema changes — including prompts, Markdown docs, existing proto/service files, or demo behavior. Produces implementation-ready schema plans with field definitions, ID strategies, relation designs, indexes, entproto annotations, and bind/render/service integration guidance.
16project-intake
Organize scattered project inputs and generate standardized intake documents. Use when users mention project kickoff, requirement initialization, PRD preparation, input organization, requirement gathering, or turning prototypes/demos/drafts into structured documents. Apply to new feature development, project initialization, requirement clarification, and similar scenarios. Always complete intake before writing PRD or any detailed design.
6