一键导入
goravel-crud-page
Generate page controller and UI files for a Goravel entity's admin page. Creates Inertia page controller and React components.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate page controller and UI files for a Goravel entity's admin page. Creates Inertia page controller and React components.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create a broadcast notification system that sends notifications and messages to eligible users based on entity-specific criteria. Use when adding a new entity type that needs to notify users when records are created, updated, or published.
Guide for building non-CRUD pages with consistent design. Use when creating portal pages, custom views, detail modals, sidebar widgets, notification drawers, or any page that is not a standard CRUD table. Covers fullscreen modals, minimal text patterns, calendar widgets, doorbell notifications, optimistic updates, and CrudPage read-only integration.
Guide for building dashboards, charts, KPI cards, and data visualizations. Use when creating dashboard pages, adding charts to features, building stat displays, aggregating data for visual presentation, or implementing export (CSV/PNG/fullscreen) for charts. Based on the Books dashboard implementation using Recharts and shadcn/ui chart components.
Deploy the application to staging or production. Validates, builds, pushes Docker image, deploys via Helm, and runs smoke tests.
Run a comprehensive E2E browser test suite for a newly scaffolded Goravel entity. Tests navigation, CRUD operations, search, filters, row actions, form validation, FK dropdowns, and cross-entity integration using Playwright MCP.
Create a Go database seeder for a Goravel entity with 25+ realistic records. Covers all status/enum values, diverse data for sorting/pagination testing, and proper nullable field handling.
| name | goravel-crud-page |
| description | Generate page controller and UI files for a Goravel entity's admin page. Creates Inertia page controller and React components. |
| argument-hint | [EntityName] |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob |
Generate page controller and UI for $ARGUMENTS.
go run . artisan make:page-ctrl --controller=$ARGUMENTS
This creates app/http/controllers/<entity>s/<entity>s_page_controller.go.
Edit the page controller to configure:
func NewEntityPageController() *EntityPageController {
entityService := services.NewEntityService()
return &EntityPageController{
GenericPageController: contracts.NewGenericPageController(contracts.GenericPageConfig{
ResourceType: "entities", // Plural snake_case
PageComponent: "Entity/Index", // React component path
Service: entityService,
ServiceIdentifier: auth.ServiceEntity, // From permission_constants.go
StatsEnabled: false, // Set true if you have statistics
// Optional: Stats builder
// StatsBuilder: func(controller *contracts.GenericPageController) map[string]interface{} {
// stats, _ := entityService.GetEntityStatistics()
// return stats
// },
}),
entityService: entityService,
}
}
go run . artisan make:ui --page=$ARGUMENTS --request=$ARGUMENTS
This creates the React component hierarchy:
resources/js/pages/<Entity>/
├── Index.tsx # Main page component
└── sections/
├── <Entity>Columns.tsx # Table column definitions
├── <Entity>CreateForm.tsx # Create form
├── <Entity>DetailView.tsx # Detail/view modal
├── <Entity>EditForm.tsx # Edit form
├── <Entity>PageConfig.tsx # Page configuration
└── index.ts # Barrel exports
In routes/web.go, add the page route inside the authenticated group:
// Import
entityPageController := entitynames.NewEntityPageController()
// Route (inside authenticated group)
router.Get("/admin/<entity-names>", entityPageController.Index)
Edit <Entity>Columns.tsx to match your model fields:
export const entityColumns: ColumnDef<Entity>[] = [
{ accessorKey: "title", header: "Title" },
{ accessorKey: "status", header: "Status" },
{ accessorKey: "created_at", header: "Created", cell: ({ row }) => formatDate(row.original.created_at) },
];
Edit create/edit forms to include correct field types:
/goravel-enum to generate options)Create/update resources/js/types/<entity>.ts:
export interface Entity extends BaseModel {
title: string;
description: string;
status: string;
tags: string[];
}
If entity has enum fields, add filter buttons in PageConfig:
export const entitySimpleFilters = (stats: any): SimpleFilterConfig[] => [
{
key: 'status-active',
label: 'Active',
value: 'ACTIVE',
badge: stats?.activeCount || 0,
filterParams: { status: 'ACTIVE' },
},
];
After all page generation steps:
# Backend compiles (page controller + web route)
go build ./...
# Frontend compiles (generated UI components)
npx tsc --noEmit
Run /goravel-crud-nav to add navigation and search integration.