php-saloon
php-saloon
Use this skill when building or debugging PHP API integrations and SDKs with Saloon, including connectors, requests, authentication, request bodies, testing, pagination, Laravel integration, and plugin workflows.
Rules
Standalone API Clients
- Start with
references/standalone-sdk-guidance.mdandreferences/building-sdks.md. - Build the SDK around a Saloon
Connector, and keep it easy to expand with resource classes, request classes, and strongly typed DTOs. - Always use strongly typed DTOs for responses. Prefer
github.com/Crell/Serdefor response DTO serialization. - If a request needs more than 2 or 3 parameters, or a DTO materially improves DX, use a typed DTO instead of a long parameter list.
- Everything must be strongly typed. Follow the nearby
php-proskill for PHP typing expectations when it is available. - Add docblocks anywhere generics are required.
- If the API supports authentication, add it. Let developers pass strongly typed auth details instead of loose arrays.
- Always support pagination if the API supports it.
- Always add rate limiting.
- Support caching as an optional dependency, and let developers pass their own cache implementation.
- Let developers register their own middleware.
- Add custom exceptions, with a base SDK exception plus specific exceptions for common failures.
- Put the request and response on exceptions so developers can inspect them.
- Always write tests without hitting the real API.
Laravel Support
- Keep Laravel support optional and isolated in its own namespace.
- Add the Laravel plugin as an optional dependency.
- Implement a facade and config.
- Auto-wire the SDK through a wrapper class that applies optional concerns like auth, caching, and middleware composition.
- Use
spatie/laravel-package-toolsfor package wiring.
References
- Read
references/index.mdfor the full page-by-page map. - Read
references/standalone-sdk-guidance.mdbefore designing a standalone client or package. - Read
references/connectors.md,references/requests.md, andreferences/sending-requests.mdbefore writing core Saloon code. - Read
references/data-transfer-objects.md,references/middleware.md,references/building-sdks.md, andreferences/laravel-integration.mdbefore building an SDK package. - Read
references/testing.md,references/handling-failures.md, andreferences/handling-rate-limits.mdbefore shipping production integrations.
More from aaronflorey/agent-skills
amber-lang
Write, debug, and explain Amber code, the `amber` language that compiles `.ab` files to Bash. Use this skill when the user asks to write an Amber script, convert Bash to Amber, compile Amber to Bash, debug Amber syntax or type errors, or asks about Amber 0.5.1-alpha syntax, functions, types, error handling, the standard library, or the `amber` CLI.
26go-cobra
Write, scaffold, and debug Go CLI applications with `github.com/spf13/cobra`. Use this skill whenever the user mentions Cobra, `cobra.Command`, a Go command-line app, subcommands, persistent or local flags, required flags, argument validation, shell completions, generated docs, or wants to build or refactor a cobra-based CLI.
24laravel-actions
Write, scaffold, explain, and refactor code using the `lorisleiva/laravel-actions` package. Use this skill whenever the user mentions Laravel Actions, `AsAction`, `php artisan make:action`, action classes, converting a controller, job, listener, or command into an action, dispatching an action as a job, using an action as a controller or listener, or adding validation, authorization, testing, or mocking around an action.
24num30-config
Write, debug, and explain Go configuration code using `github.com/num30/config`. Use this skill when the user mentions `num30/config`, wants config structs, file plus env plus CLI flag loading, validation, config watching, precedence rules, or asks how to integrate the num30/config package into a Go application.
22pelican-panel-plugins
Write, scaffold, explain, and debug plugins for the Pelican gaming panel. Use this skill whenever the user mentions Pelican plugins, extending Pelican, FilamentPHP resources or pages for Pelican, plugin service providers, custom permissions, plugin settings, routes, models, widgets, or asks how to add new functionality to the Pelican panel.
21go-viper
Write, debug, and explain Go configuration code with `github.com/spf13/viper`. Use this skill whenever the user mentions Viper, `viper`, config structs, reading config from files plus env vars plus flags, Cobra or `pflag` integration, unmarshaling into structs, env key replacers, config precedence, config watching, or a clean Viper bootstrap.
20