diff --git a/.github/prompts/actions.prompt.yml b/.github/prompts/actions.prompt.yml new file mode 100644 index 0000000..8365cbe --- /dev/null +++ b/.github/prompts/actions.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a CreateInvoice Action class. It receives an Order, creates an Invoice, and returns it. + Use execute() method and constructor dependency injection. No HTTP concerns. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/albatros.prompt.yml b/.github/prompts/albatros.prompt.yml new file mode 100644 index 0000000..a7f257d --- /dev/null +++ b/.github/prompts/albatros.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an AlbatrosConnector extending Saloon Connector. Use config('albatros.base_url'), Mandant header, Bearer token. + Use Cache for reference data. German domain terms in DTOs are acceptable. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/blade.prompt.yml b/.github/prompts/blade.prompt.yml new file mode 100644 index 0000000..4f7402f --- /dev/null +++ b/.github/prompts/blade.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a Blade component that displays a user's name and email. Use {{ }} for escaped output. + No inline style or script tags. Use x-component syntax. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/commands.prompt.yml b/.github/prompts/commands.prompt.yml new file mode 100644 index 0000000..7339676 --- /dev/null +++ b/.github/prompts/commands.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an Artisan command invoices:send-reminders with required email argument and --dry-run option. + Delegate to SendInvoiceReminderAction. Return self::SUCCESS or self::FAILURE. Validate input. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/controllers.prompt.yml b/.github/prompts/controllers.prompt.yml new file mode 100644 index 0000000..0b30014 --- /dev/null +++ b/.github/prompts/controllers.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an invokable StoreInvoiceController that receives StoreInvoiceRequest, calls a CreateInvoice action, + and returns a JsonResponse with InvoiceResource. No business logic in the controller. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/design.prompt.yml b/.github/prompts/design.prompt.yml new file mode 100644 index 0000000..f658312 --- /dev/null +++ b/.github/prompts/design.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an anonymous Blade button component with @props for variant and size. Merge $attributes with defaults. + Use min-h-[44px] for touch target, focus-visible:ring-2. Mobile-first. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/docuware.prompt.yml b/.github/prompts/docuware.prompt.yml new file mode 100644 index 0000000..513e1c3 --- /dev/null +++ b/.github/prompts/docuware.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a DocuWareService that wraps the DocuWare connector. Constructor accepts optional connector for testability. + Use config('laravel-docuware.credentials.*') not env(). Include fetchDocument or similar method signature. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/dto.prompt.yml b/.github/prompts/dto.prompt.yml new file mode 100644 index 0000000..5579d6b --- /dev/null +++ b/.github/prompts/dto.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a readonly CustomerData DTO with id, name, email. Include fromArray() factory that handles + PascalCase and snake_case API field names. Use nullable for optional fields. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/dusk.prompt.yml b/.github/prompts/dusk.prompt.yml new file mode 100644 index 0000000..8f92d68 --- /dev/null +++ b/.github/prompts/dusk.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a Dusk test that logs in, visits /invoices/create, uses dusk="" selectors, calls assertNoJavaScriptErrors(). + Use DatabaseTruncation. Use loginAs(), waitForText, never pause(). +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/enums.prompt.yml b/.github/prompts/enums.prompt.yml new file mode 100644 index 0000000..85984b1 --- /dev/null +++ b/.github/prompts/enums.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a Status enum with Draft, Active, Archived. Include label() and color() methods using match expressions. + Use backed string enum. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/events.prompt.yml b/.github/prompts/events.prompt.yml new file mode 100644 index 0000000..2c67ac5 --- /dev/null +++ b/.github/prompts/events.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an InvoicePaid event (plain data container with Invoice) and a SendInvoicePaidNotification listener. + Event uses Dispatchable, SerializesModels. Listener has single responsibility. Use past-tense for event name. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/exceptions.prompt.yml b/.github/prompts/exceptions.prompt.yml new file mode 100644 index 0000000..493c99b --- /dev/null +++ b/.github/prompts/exceptions.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an InvoiceAlreadyPaidException that extends RuntimeException. It receives an Invoice as readonly property + and sets a clear message via parent::__construct(). Use a named failure state. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/formrequests.prompt.yml b/.github/prompts/formrequests.prompt.yml new file mode 100644 index 0000000..50dd9f9 --- /dev/null +++ b/.github/prompts/formrequests.prompt.yml @@ -0,0 +1,17 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a StoreInvoiceRequest with authorize() and rules() returning array-based rules. + Rules: order_id required exists in orders, amount required numeric min 0. + Add PHPDoc @return for rules(). +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/general.prompt.yml b/.github/prompts/general.prompt.yml new file mode 100644 index 0000000..eb0559e --- /dev/null +++ b/.github/prompts/general.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Add a Stripe API key to the Laravel config and show how to read it in a controller. + Use the correct helper for config access. Show the config file addition and one line of controller code. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/helperfunctions.prompt.yml b/.github/prompts/helperfunctions.prompt.yml new file mode 100644 index 0000000..9106477 --- /dev/null +++ b/.github/prompts/helperfunctions.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write PHP code to filter an array of users to only active ones, then get their email addresses as a comma-separated string. + Use Laravel Arr and Str helpers instead of native PHP functions. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/helpers.prompt.yml b/.github/prompts/helpers.prompt.yml new file mode 100644 index 0000000..9916643 --- /dev/null +++ b/.github/prompts/helpers.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a DateHelper class with a static format() method that accepts a date and format string, returns formatted string or null. + Use Carbon. No business logic, no database queries. PascalCase with Helper suffix. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/interfaces.prompt.yml b/.github/prompts/interfaces.prompt.yml new file mode 100644 index 0000000..1474d0a --- /dev/null +++ b/.github/prompts/interfaces.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a PaymentGateway interface in app/Contracts/ with charge(Order, int) and refund(string, int) methods. + Return a PaymentResult. No implementation. Clear noun describing the capability. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/jobs.prompt.yml b/.github/prompts/jobs.prompt.yml new file mode 100644 index 0000000..49b05f9 --- /dev/null +++ b/.github/prompts/jobs.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a ProcessInvoicePaymentJob that implements ShouldQueue. Delegate to ProcessInvoicePayment action. + Use Dispatchable, InteractsWithQueue, Queueable, SerializesModels. Set tries, backoff, queue. Add failed() method. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/livewire.prompt.yml b/.github/prompts/livewire.prompt.yml new file mode 100644 index 0000000..54e63c7 --- /dev/null +++ b/.github/prompts/livewire.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a Livewire InvoiceList component with search property, #[Computed] invoices(), and wire:model/wire:click. + Keep logic in PHP, template declarative. Use wire:model for search binding. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/middleware.prompt.yml b/.github/prompts/middleware.prompt.yml new file mode 100644 index 0000000..290c471 --- /dev/null +++ b/.github/prompts/middleware.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an EnsureUserIsSubscribed middleware. If user is not subscribed, return 403 JSON response. + Otherwise call $next($request). Clear descriptive name. No business logic inside. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/migrations.prompt.yml b/.github/prompts/migrations.prompt.yml new file mode 100644 index 0000000..da7aeb7 --- /dev/null +++ b/.github/prompts/migrations.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a migration to create an invoices table with id, order_id (foreign key), status (string default draft), amount (decimal), timestamps. + Use foreignId()->constrained()->cascadeOnDelete(). Include both up() and down() methods. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/models.prompt.yml b/.github/prompts/models.prompt.yml new file mode 100644 index 0000000..3ad494e --- /dev/null +++ b/.github/prompts/models.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a minimal Invoice Eloquent model with guarded, casts as method, and a belongsTo Order relationship. + Use typed return type on the relationship. Include section comment headers. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/observers.prompt.yml b/.github/prompts/observers.prompt.yml new file mode 100644 index 0000000..6596e0b --- /dev/null +++ b/.github/prompts/observers.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a UserObserver with created() that sends WelcomeNotification, and updated()/deleted() that clear cache. + Use Observer suffix. Only define methods you need. No business logic. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/pesttesting.prompt.yml b/.github/prompts/pesttesting.prompt.yml new file mode 100644 index 0000000..15faa12 --- /dev/null +++ b/.github/prompts/pesttesting.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a Pest test it('creates an invoice for the given order') with AAA pattern and Arrange/Act/Assert comments. + Use uses(RefreshDatabase::class), postJson, assertCreated(), expect()->toBe(). Plain English description. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/php.prompt.yml b/.github/prompts/php.prompt.yml new file mode 100644 index 0000000..e46c1b9 --- /dev/null +++ b/.github/prompts/php.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a process(Order $order) method with early returns. If !$order->isPaid() throw exception and return. + If !$order->hasItems() throw and return. Then happy-path logic. No else/elseif. Use guard clauses. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/phpstan.prompt.yml b/.github/prompts/phpstan.prompt.yml new file mode 100644 index 0000000..4bcab75 --- /dev/null +++ b/.github/prompts/phpstan.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a method process(Order $order): Invoice with full type hints. Add PHPDoc @return array> for a rules() method. + Use union types instead of mixed. No @phpstan-ignore. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/phpunit.prompt.yml b/.github/prompts/phpunit.prompt.yml new file mode 100644 index 0000000..4f079f8 --- /dev/null +++ b/.github/prompts/phpunit.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a feature test test_user_can_create_invoice. Use RefreshDatabase, factories, actingAs. + Assert 201 and assertDatabaseHas. Use test_ prefix and : void return type. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/policies.prompt.yml b/.github/prompts/policies.prompt.yml new file mode 100644 index 0000000..fdfb351 --- /dev/null +++ b/.github/prompts/policies.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an InvoicePolicy with viewAny (admin only), view (owner or admin), create (authenticated). + Use Policy suffix. Standard ability names. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/requests.prompt.yml b/.github/prompts/requests.prompt.yml new file mode 100644 index 0000000..4584210 --- /dev/null +++ b/.github/prompts/requests.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a StoreInvoiceRequest with authorize() using can('create', Invoice::class) and rules() with array-based definitions. + Add PHPDoc @return for rules(). Never use $request->validate() in controller. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/resources.prompt.yml b/.github/prompts/resources.prompt.yml new file mode 100644 index 0000000..c7e6db8 --- /dev/null +++ b/.github/prompts/resources.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a UserResource extending JsonResource. Return id, name, email, posts (whenLoaded), created_at (formatted). + Use whenLoaded for relations. Use when() for conditional admin-only secret field. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/routing.prompt.yml b/.github/prompts/routing.prompt.yml new file mode 100644 index 0000000..5265a06 --- /dev/null +++ b/.github/prompts/routing.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write API routes for invoices: index and store. Use auth:sanctum middleware, apiResource, and resourceful route names. + Group them properly. Use kebab-case for URL. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/saloon.prompt.yml b/.github/prompts/saloon.prompt.yml new file mode 100644 index 0000000..9d01368 --- /dev/null +++ b/.github/prompts/saloon.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a StripeConnector extending Saloon Connector with resolveBaseUrl and defaultHeaders. + Write a ListChargesRequest for GET. No Http::get() or raw HTTP. Use Saloon pattern. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/services.prompt.yml b/.github/prompts/services.prompt.yml new file mode 100644 index 0000000..f8524a3 --- /dev/null +++ b/.github/prompts/services.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write a PaymentService that orchestrates CreateInvoice, ChargePaymentMethod, SendPaymentConfirmation actions. + Method processOrderPayment(Order) uses DB::transaction. Inject actions via constructor. No Manager/Handler suffix. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 512 diff --git a/.github/prompts/tailwind.prompt.yml b/.github/prompts/tailwind.prompt.yml new file mode 100644 index 0000000..460c1e7 --- /dev/null +++ b/.github/prompts/tailwind.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write the resources/css/app.css for Tailwind v4 with @theme directive setting --color-primary-500 and --font-sans. + Include @source for views and Livewire. No custom CSS classes. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/traits.prompt.yml b/.github/prompts/traits.prompt.yml new file mode 100644 index 0000000..dcf4a2e --- /dev/null +++ b/.github/prompts/traits.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write an Archivable trait with archive(), unarchive(), isArchived() methods for models with archived_at. + Use -able suffix. Single responsibility. No complex business logic. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/prompts/translations.prompt.yml b/.github/prompts/translations.prompt.yml new file mode 100644 index 0000000..b9ca04c --- /dev/null +++ b/.github/prompts/translations.prompt.yml @@ -0,0 +1,16 @@ +messages: + - role: system + content: | + You are a Laravel developer. Apply these guidelines exactly: + + {{skill_content}} + + Respond with only the requested code. No explanations unless asked. + - role: user + content: | + Write lang/en/invoices.php with create_success key using :name placeholder. + Show usage with __('invoices.create_success', ['name' => $name]). Use namespaced keys. +model: openai/gpt-4o-mini +modelParameters: + temperature: 0.2 + maxCompletionTokens: 384 diff --git a/.github/scripts/validate-skill-response.sh b/.github/scripts/validate-skill-response.sh new file mode 100755 index 0000000..2de934a --- /dev/null +++ b/.github/scripts/validate-skill-response.sh @@ -0,0 +1,133 @@ +#!/bin/bash +# Validates AI response against skill-specific rules. +# Usage: validate-skill-response.sh +# Exits 0 if valid, 1 if invalid. + +skill="$1" +response="$2" + +if [ -z "$response" ]; then + echo "::error::[$skill] Empty response" + exit 1 +fi + +case "$skill" in + general) + echo "$response" | grep -q 'env(' && { echo "::error::[$skill] Should use config() not env()"; exit 1; } + echo "$response" | grep -q 'config(' || { echo "::error::[$skill] Missing config()"; exit 1; } + ;; + helperfunctions) + echo "$response" | grep -qE 'Arr::|Str::|collect\(' || { echo "::error::[$skill] Should use Laravel helpers"; exit 1; } + ;; + models) + echo "$response" | grep -qE 'extends Model|BelongsTo|HasMany|HasOne' || { echo "::error::[$skill] Needs Model with relationship"; exit 1; } + ;; + controllers) + echo "$response" | grep -qE '__invoke|JsonResponse' || { echo "::error::[$skill] Needs invokable or JsonResponse"; exit 1; } + ;; + migrations) + echo "$response" | grep -qE 'foreignId|constrained|cascadeOnDelete' || { echo "::error::[$skill] Needs proper foreign key"; exit 1; } + echo "$response" | grep -qE 'function (up|down)\s*\(\)' || { echo "::error::[$skill] Needs up() and down()"; exit 1; } + ;; + routing) + echo "$response" | grep -qE 'Route::|Route::apiResource|middleware' || { echo "::error::[$skill] Needs Route definitions"; exit 1; } + ;; + formrequests|requests) + echo "$response" | grep -qE 'authorize\(\)|rules\(\)' || { echo "::error::[$skill] Needs authorize and rules"; exit 1; } + ;; + actions) + echo "$response" | grep -q 'execute(' || { echo "::error::[$skill] Action needs execute()"; exit 1; } + echo "$response" | grep -qE 'InvoiceAction|UserHandler' && { echo "::error::[$skill] Avoid vague names"; exit 1; } || true + ;; + commands) + echo "$response" | grep -qE 'self::SUCCESS|self::FAILURE' || { echo "::error::[$skill] Must return SUCCESS or FAILURE"; exit 1; } + ;; + dto) + echo "$response" | grep -q 'fromArray' || { echo "::error::[$skill] DTO needs fromArray()"; exit 1; } + echo "$response" | grep -q 'readonly' || { echo "::error::[$skill] DTO should be readonly"; exit 1; } + ;; + enums) + echo "$response" | grep -qE 'label\(\)|color\(\)' || { echo "::error::[$skill] Enum needs label() and color()"; exit 1; } + echo "$response" | grep -q 'match' || true + ;; + events) + echo "$response" | grep -qE 'Dispatchable|SerializesModels' || true + ;; + exceptions) + echo "$response" | grep -q 'Exception' || { echo "::error::[$skill] Needs Exception suffix"; exit 1; } + ;; + helpers) + echo "$response" | grep -qE 'Helper|format' || true + ;; + interfaces) + echo "$response" | grep -q 'interface' || { echo "::error::[$skill] Needs interface"; exit 1; } + ;; + jobs) + echo "$response" | grep -qE 'ShouldQueue|Dispatchable|Queueable' || { echo "::error::[$skill] Job needs queue traits"; exit 1; } + ;; + middleware) + echo "$response" | grep -q '\$next(\$request)' || { echo "::error::[$skill] Middleware must call next"; exit 1; } + ;; + observers) + echo "$response" | grep -qE 'Observer|created|updated' || { echo "::error::[$skill] Needs Observer and lifecycle methods"; exit 1; } + ;; + policies) + echo "$response" | grep -qE 'viewAny|view|create' || { echo "::error::[$skill] Policy needs ability methods"; exit 1; } + ;; + resources) + echo "$response" | grep -qE 'whenLoaded|when\(|JsonResource' || { echo "::error::[$skill] Resource needs whenLoaded/when"; exit 1; } + ;; + services) + echo "$response" | grep -qE 'DB::transaction|Service' || { echo "::error::[$skill] Service needs DB::transaction or Service class"; exit 1; } + ;; + traits) + echo "$response" | grep -q 'trait' || { echo "::error::[$skill] Needs trait"; exit 1; } + ;; + blade) + echo "$response" | grep -q '{{' || { echo "::error::[$skill] Blade needs {{ }} escaping"; exit 1; } + ;; + design) + echo "$response" | grep -qE '\$attributes|@props|min-h-\[44px\]' || true + ;; + livewire) + echo "$response" | grep -qE 'wire:model|wire:click|Computed' || { echo "::error::[$skill] Livewire needs wire: or Computed"; exit 1; } + ;; + tailwind) + echo "$response" | grep -qE '@theme|@source|tailwind' || { echo "::error::[$skill] Needs @theme or Tailwind setup"; exit 1; } + ;; + translations) + echo "$response" | grep -qE '__\(|trans\(' || { echo "::error::[$skill] Needs __() or trans()"; exit 1; } + ;; + phpunit) + echo "$response" | grep -qE 'test_|assertStatus|assertDatabaseHas|RefreshDatabase' || { echo "::error::[$skill] Needs test structure"; exit 1; } + ;; + pesttesting) + echo "$response" | grep -qE 'it\(|expect\(|assertCreated|Arrange|Act|Assert' || { echo "::error::[$skill] Needs Pest syntax"; exit 1; } + ;; + phpstan) + echo "$response" | grep -qE 'array config('albatros.mandant'), + 'Authorization' => 'Bearer ' . config('albatros.token'), + ]; + } +} +``` + +```php +// List request with pagination +class ListAdressenRequest extends Request +{ + protected Method $method = Method::GET; + + public function __construct( + protected string $lastIndex = '', + protected int $pageSize = 100, + ) {} + + public function resolveEndpoint(): string + { + return '/Adresse'; + } + + protected function defaultQuery(): array + { + return array_filter([ + 'lastIndex' => $this->lastIndex, + 'pageSize' => $this->pageSize, + ]); + } +} +``` + +```php +// DTO with German domain terms — acceptable for Albatros API +readonly class AdresseData +{ + public function __construct( + public string $ID, + public ?string $Name, + public ?string $Strasse, + public ?string $PLZ, + public ?string $Ort, + ) {} + + public static function fromArray(array $data): static + { + return new static( + ID: (string) ($data['ID'] ?? $data['id'] ?? ''), + Name: $data['Name'] ?? $data['name'] ?? null, + Strasse: $data['Strasse'] ?? $data['strasse'] ?? null, + PLZ: $data['PLZ'] ?? $data['plz'] ?? null, + Ort: $data['Ort'] ?? $data['ort'] ?? null, + ); + } +} +``` + +```php +// Service with caching +public function getAdressen(): Collection +{ + return Cache::remember('albatros.adressen', 3600, fn () => + $this->fetchAllPages(fn ($lastIndex) => new ListAdressenRequest(lastIndex: $lastIndex)) + ); +} + +public function clearCache(): void +{ + Cache::forget('albatros.adressen'); +} +``` + +## Anti-Patterns + +- Making uncached API calls for reference data that rarely changes +- Not using `fetchAllPages()` for paginated endpoints — manual pagination loops +- Translating German API field names to English in DTOs (keep matching API) +- Not handling API field name casing variations in `fromArray()` +- Storing monetary values as float or string instead of `decimal:2` +- Forgetting to call `clearCache()` when reference data is updated + +## References + +- [Saloon Documentation](https://docs.saloon.dev/) +- Related: `Saloon/SKILL.md` — Saloon connector and request patterns +- Related: `DTO/SKILL.md` — DTO conventions with fromArray factory +- Related: `Services/SKILL.md` — service class wrapping API calls diff --git a/skills/Blade/SKILL.md b/resources/boost/skills/blade/SKILL.md similarity index 94% rename from skills/Blade/SKILL.md rename to resources/boost/skills/blade/SKILL.md index 2d12644..8b8e0f1 100644 --- a/skills/Blade/SKILL.md +++ b/resources/boost/skills/blade/SKILL.md @@ -1,4 +1,7 @@ -# Blade +--- +name: blade +description: Laravel Blade template conventions covering components, output escaping, security, structure, and formatting. +--- **Name:** Blade Templates **Description:** Laravel Blade template conventions covering components, output escaping, security, structure, and formatting. diff --git a/skills/Commands/SKILL.md b/resources/boost/skills/commands/SKILL.md similarity index 93% rename from skills/Commands/SKILL.md rename to resources/boost/skills/commands/SKILL.md index df646d2..7359f4a 100644 --- a/skills/Commands/SKILL.md +++ b/resources/boost/skills/commands/SKILL.md @@ -1,4 +1,7 @@ -# Commands +--- +name: commands +description: Artisan console command classes that serve as the CLI entry point for operations. Commands validate input and delegate all business logic to Actions or Services. +--- **Name:** Commands **Description:** Artisan console command classes that serve as the CLI entry point for operations. Commands validate input and delegate all business logic to Actions or Services. diff --git a/skills/Controllers/SKILL.md b/resources/boost/skills/controllers/SKILL.md similarity index 94% rename from skills/Controllers/SKILL.md rename to resources/boost/skills/controllers/SKILL.md index 5fe6ef9..b6da9d0 100644 --- a/skills/Controllers/SKILL.md +++ b/resources/boost/skills/controllers/SKILL.md @@ -1,4 +1,7 @@ -# Controllers +--- +name: controllers +description: Thin HTTP entry points that validate input, delegate to Actions or Services, and return a response. Controllers contain no business logic. +--- **Name:** Controllers **Description:** Thin HTTP entry points that validate input, delegate to Actions or Services, and return a response. Controllers contain no business logic. diff --git a/resources/boost/skills/design/SKILL.md b/resources/boost/skills/design/SKILL.md new file mode 100644 index 0000000..ccb35a1 --- /dev/null +++ b/resources/boost/skills/design/SKILL.md @@ -0,0 +1,87 @@ +--- +name: design +description: Component-first design system for Blade views. Use when creating UI components, designing responsive layouts, or implementing accessible interfaces. +--- + +**Name:** Design System +**Description:** Component-first design system for Blade views. Use when creating UI components, designing responsive layouts, or implementing accessible interfaces. +**Compatible Agents:** general-purpose, frontend +**Tags:** resources/views/**/*.blade.php, laravel, blade, design-system, components, responsive, accessibility + +## Rules + +- Every UI element MUST use a Blade component — no raw `