ワンクリックで
api-hardening-patterns
Review Laravel API endpoints for validation, authorization, abuse resistance, and safer defaults.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Review Laravel API endpoints for validation, authorization, abuse resistance, and safer defaults.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Plan safe Laravel data migrations with phased rollout, backfills, double writes, verification, and rollback.
Review Laravel frontend performance, responsiveness, and Lighthouse-impacting best practices.
Review a Laravel app for deployment blockers across config, queues, caching, operations, and rollback readiness.
Review Laravel migrations and query paths for missing, redundant, or risky indexes before production.
Review Laravel workflows for retries, timeouts, idempotency, and graceful failure under partial outages.
Plan a Laravel or PHP upgrade by identifying blockers, risky code paths, and the safest execution order.
| name | api-hardening-patterns |
| description | Review Laravel API endpoints for validation, authorization, abuse resistance, and safer defaults. |
| license | MIT |
| tags | ["laravel","php"] |
| version | 0.1.1 |
| compatible_agents | ["laravel/boost"] |
Use this skill when building or reviewing Laravel APIs that need stronger security, safer defaults, and better abuse resistance. It is most useful for public APIs, partner integrations, mobile backends, webhook endpoints, or any route group under routes/api.php.
routes/api.php, route groups, middleware, controllers, form requests, resources, policies, guards, and exception handling. Note which endpoints are public, authenticated, tenant-scoped, admin-only, or webhook-driven.FormRequest classes, policy methods, gates, route model binding constraints, signed routes, and explicit authorization checks over ad-hoc controller logic.$fillable or $guarded, over-broad API resources, user-controlled filters and sorts, weak pagination defaults, unconstrained uploads, and inconsistent exception rendering.toArray().Critical issues, Hardening improvements, and Tests to add. Point each recommendation to the Laravel file or layer where the fix belongs, and prefer concrete changes such as FormRequest, policy, middleware, resource, cast, or hidden-attribute updates.Output expectations: return prioritized Laravel-specific issues first, then concrete fixes and tests to add, not a generic API security checklist.
Prompt 1:
Use api-hardening-patterns on our public Laravel API. Focus on validation, authorization, throttling, and resource/data exposure.
Prompt 2:
Review these Sanctum-protected endpoints for abuse resistance and safer error handling. Suggest concrete Laravel fixes, not just generic advice.
JSON:
{
"skill": "api-hardening-patterns",
"context": {
"auth": "sanctum",
"exposure": "public",
"focus": ["validation", "authorization", "rate_limiting", "error_contracts"],
"files": ["routes/api.php", "app/Http/Controllers/Api", "app/Http/Requests"],
"concerns": ["resource_exposure", "pagination_limits", "token_abilities"]
}
}
Code example:
public function store(StorePostRequest $request): PostResource
{
$this->authorize('create', Post::class);
return new PostResource(Post::create($request->validated()));
}
Run the skill on a Laravel API controller with inline validation, missing policy checks, unsafe resource serialization, and unlimited pagination. Verify that the response returns concrete Laravel fixes such as FormRequest, policy, middleware, resource, or model-visibility changes instead of generic security advice.