一键导入
goravel-crud-routes
Register API and web routes for a Goravel entity. Adds endpoints to routes/api.go and routes/web.go.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Register API and web routes for a Goravel entity. Adds endpoints to routes/api.go and routes/web.go.
用 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-routes |
| description | Register API and web routes for a Goravel entity. Adds endpoints to routes/api.go and routes/web.go. |
| argument-hint | [entity_name] |
| allowed-tools | Read, Write, Edit, Grep, Glob |
Register routes for $ARGUMENTS.
routes/api.goimport (
// ... existing imports
"<module>/app/http/controllers/<entity_name>s"
)
The module path is books-database.
Add inside the Api() function, with other controller initializations:
entityController := entitynames.NewEntityController()
Add inside the router.Middleware(optionalAuth).Group(...) block:
// Entity routes
optionalAuthRouter.Get("/<entity-names>", entityController.Index)
optionalAuthRouter.Get("/<entity-names>/search", entityController.Search)
optionalAuthRouter.Get("/<entity-names>/filters", entityController.FilterMetadata)
optionalAuthRouter.Get("/<entity-names>/{id}", entityController.Show)
Add inside the router.Middleware(jwtAuth, require2FA).Group(...) block:
// Entity routes
protectedRouter.Get("/<entity-names>/statistics", entityController.Statistics) // Must be before {id}
protectedRouter.Post("/<entity-names>", entityController.Store)
protectedRouter.Put("/<entity-names>/{id}", entityController.Update)
protectedRouter.Delete("/<entity-names>/{id}", entityController.Delete)
Statistics endpoints go in protectedRouter, not optionalAuthRouter — they expose aggregate data that should require authentication.
/business-formalisations NOT /business_formalisations/books, /lenders, /configs{id} to avoid route conflictsroutes/web.go (for Inertia pages)import (
// ... existing imports
"<module>/app/http/controllers/<entity_name>s"
)
entityPageController := entitynames.NewEntityPageController()
Inside the authenticated routes group:
router.Get("/admin/<entity-names>", entityPageController.Index)
See routes/api.go and routes/web.go for existing patterns:
API routes (routes/api.go):
Web routes (routes/web.go):
router.Get("/admin/...")After registering all routes:
# This is critical — catches import errors, missing controllers, wrong method signatures
go build ./...
If the build fails, check:
{id})Run /goravel-crud-test to generate and run comprehensive CRUD tests. All API tests MUST pass before starting any UI/frontend work. This catches data-flow bugs (Bind, validation keys, GORM mapping) that are much harder to debug through the UI.