ワンクリックで
goravel-enum
Create a Go enum type and automatically generate the TypeScript equivalent. Produces union types and option arrays for forms.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Create a Go enum type and automatically generate the TypeScript equivalent. Produces union types and option arrays for forms.
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-enum |
| description | Create a Go enum type and automatically generate the TypeScript equivalent. Produces union types and option arrays for forms. |
| argument-hint | [EnumName] [value1,value2,value3] |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob |
Create Go enum and TypeScript equivalent for $ARGUMENTS.
Create the enum in app/http/requests/<enum_name>.go:
package requests
type EnumName string
const (
EnumNameValue1 EnumName = "VALUE_1"
EnumNameValue2 EnumName = "VALUE_2"
EnumNameValue3 EnumName = "VALUE_3"
)
GenderType, BookStatus, ConfigTypes)// Simple enum
type GenderType string
const (
GenderTypeMale GenderType = "MALE"
GenderTypeFemale GenderType = "FEMALE"
GenderTypeOther GenderType = "OTHER"
)
// Status enum
type BookStatus string
const (
BookStatusAvailable BookStatus = "AVAILABLE"
BookStatusBorrowed BookStatus = "BORROWED"
BookStatusMaintenance BookStatus = "MAINTENANCE"
BookStatusReserved BookStatus = "RESERVED"
)
// Category enum (Title Case values)
type ConfigTypes string
const (
ConfigTypeFinancing ConfigTypes = "Financing"
ConfigTypeImprovementAspects ConfigTypes = "Improvement Aspects"
ConfigTypeBusinessCategories ConfigTypes = "Business Categories"
)
After creating the Go enum, run the TypeScript generator:
go run . artisan make:ts-enums --source=app/http/requests --output=resources/js/types
This scans app/http/requests/ for Go enum patterns and generates TypeScript files in resources/js/types/.
For each Go enum, it produces a file like resources/js/types/gender_type.ts:
// Auto-generated from Go enum: GenderType
export type GenderType = 'MALE' | 'FEMALE' | 'OTHER';
export const GENDER_TYPE_OPTIONS: Array<{label: string; value: GenderType}> = [
{ label: 'Male', value: 'MALE' },
{ label: 'Female', value: 'FEMALE' },
{ label: 'Other', value: 'OTHER' },
];
import { GenderType, GENDER_TYPE_OPTIONS } from '@/types/gender_type';
<Select
value={formData.gender}
onValueChange={(value) => setFormData({ ...formData, gender: value as GenderType })}
>
<SelectTrigger>
<SelectValue placeholder="Select gender" />
</SelectTrigger>
<SelectContent>
{GENDER_TYPE_OPTIONS.map((option) => (
<SelectItem key={option.value} value={option.value}>
{option.label}
</SelectItem>
))}
</SelectContent>
</Select>
Reference the enum in your request validation:
func (r *EntityCreateRequest) Rules(ctx http.Context) map[string]string {
return map[string]string{
"gender": "required|in:MALE,FEMALE,OTHER",
"status": "required|in:AVAILABLE,BORROWED,MAINTENANCE,RESERVED",
}
}
For broader Go-to-TypeScript type conversion (not just enums), consider the guts library from Coder:
go get github.com/coder/guts
guts converts full Go type definitions (structs, interfaces, enums) to TypeScript. It's a Go library (not CLI) - you import it into a generator program. Useful when you need to sync entire model definitions, not just enums.
See: https://github.com/coder/guts
app/http/requests/resources/js/types/