backend-api-integration
为 Laravel 项目生成可用于生产的基于 Saloon 的 API 集成,包括连接器类、请求类、只读 DTO、具有全面错误处理功能的服务层方法以及完整的 Pest 测试套件。使用 Saloon 集成外部 API、创建 API 请求/响应处理程序、向现有服务添加新的 API 端点、为第三方服务构建 API 客户端包装器或通过适当的错误处理和测试设置 API 通信时,请使用此技能。此技能适用于处理 app/Services/Api/、app/DataTransferObjects/Api/ 中的文件、创建 Saloon 连接器和请求、实施 API 服务方法或编写 API 集成测试。
📖 中文导读:为 Laravel 项目生成可用于生产的基于 Saloon 的 API 集成,包括连接器类、请求类、只读 DTO、具有全面错误处理功能的服务层方法以及完整的 Pest 测试套件。使用 Saloon 集成外部 API、创建 API 请求/响应处理程序、向现有服务添加新的 API 端点、为第三方服务构建 API 客户端包装器或通过适当的错误处理和测试设置 API 通信时,请使用此技能。此技能适用于处理 app/Services/Api/、app/DataTransferObjects/Api/ 中的文件、创建 Saloon 连接器和请求、实施 API 服务方法或编写 API 集成测试。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Backend API Integration description: Generate production-ready Saloon-based API integrations for Laravel projects including connector classes, request classes, readonly DTOs, service layer methods with comprehensive error handling, and complete Pest test suites. Use this skill when integrating external APIs using Saloon, creating API request/response handlers, adding new API endpoints to existing services, building API client wrappers for third-party services, or setting up API communication with proper error handling and testing. This skill applies when working on files in app/Services/Api/, app/DataTransferObjects/Api/, creating Saloon connectors and requests, implementing API service methods, or writing API integration tests.
Backend API Integration
When to use this skill
- When integrating a new external API endpoint using Saloon in your Laravel project
- When adding new requests to an existing Saloon connector
- When creating API client wrappers for third-party services (payment gateways, shipping providers, etc.)
- When building DTOs for API request/response data structures
- When implementing service layer methods that call external APIs
- When writing comprehensive Pest tests for API integrations with mocking
- When working on files in app/Services/Api/ directory
- When creating or editing Saloon connector classes (e.g., ExampleApiConnector.php)
- When creating or editing Saloon request classes (e.g., GetUserRequest.php)
- When creating DTOs in app/DataTransferObjects/Api/ directory
This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle backend API integration.
Instructions
For details, refer to the information provided in this file: backend API integration