lc-api-docs
Generate API documentation from routes, controllers, and form requests.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Generate API documentation from routes, controllers, and form requests.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Create a Larascraper scraper (v2 or v3) for a target website, chaining browser actions (click, type, wait, scroll), conditional flow (when/repeatUntil), captcha solving, and file/PDF downloads. Detects the installed major and generates the matching style.
Add or edit a Laracrate file collection in config/laracrate.php with the correct anatomy (disk, access, types, variants, previews, extract/embed, flags, per-model scoping).
Runtime-verified Laravel inspection using the Laravel Boost MCP server (Tinker, Database Query/Schema, Last Error) instead of static grep. Falls back to Docker/Tinker if Boost is not installed.
Scaffold spatie/laravel-permission setup - add the HasRoles trait to a model and generate a roles & permissions seeder.
Audit spatie/laravel-permission usage - permissions used in code but undefined, defined but unused, unprotected routes, guard mismatches, and cache pitfalls.
Extract business logic from a controller or Livewire component method into a Laractions Action class.
| name | lc:api-docs |
| description | Generate API documentation from routes, controllers, and form requests. |
| argument-hint | [all | route-prefix] |
| user-invocable | true |
| allowed-tools | Read Grep Bash Edit Write Glob |
Generate API documentation by analyzing route definitions, controller methods, form request validation rules, and response structures.
| Subcommand | Description |
|---|---|
| (no argument) | Generate documentation for all API routes. |
all | Same as no argument -- document all API routes. |
[route-prefix] | Document only routes matching the given prefix (e.g., api/v1/properties). |
This is a generator skill -- it produces documentation output.
Use Read to load routes/api.php and any included route files.
Use Bash to get the full route list from Laravel (if Docker is available):
docker exec {container} php artisan route:list --json --path=api
If Docker is unavailable, parse route files manually to extract:
/api/v1/properties/{property})If a [route-prefix] argument is provided, filter routes to only those matching the prefix.
For each API route, use Read to load the controller and extract:
{property}, {id})$request->query(), $request->input() in GET handlersrules() method$request->validate([...]) inline validation$request->input('field') or $request->only([...]) for expected fieldsFor each validated field, extract:
Analyze the controller method's return statements:
return response()->json($data) -> extract $data structurereturn new JsonResource($model) -> read the resource class's toArray() methodreturn Model::collection($models) -> read the resource collection200, 201, 204, 404, 422)auth:sanctum, auth:api, or custom auth middleware$this->authorize(), Gate::allows()Output structured markdown documentation:
# API Documentation
## Authentication
All API endpoints require authentication via Bearer token (Laravel Sanctum).
Include the token in the `Authorization` header:
Authorization: Bearer {your-api-token}
---
## Properties
### List Properties
`GET /api/v1/properties`
**Query Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| page | integer | No | Page number for pagination |
| per_page | integer | No | Items per page (default: 15) |
| search | string | No | Search by name or reference |
| status | string | No | Filter by status (active, draft, archived) |
**Response (200):**
```json
{
"data": [
{
"id": 1,
"name": "Beach Villa",
"reference": "AB0012",
"status": "active",
"price": 450000,
"created_at": "2026-01-15T10:30:00Z"
}
],
"meta": {
"current_page": 1,
"last_page": 5,
"per_page": 15,
"total": 72
}
}
POST /api/v1/properties
Request Body:
| Field | Type | Required | Rules |
|---|---|---|---|
| name | string | Yes | max:255 |
| address | string | Yes | max:500 |
| price | decimal | Yes | min:0 |
| status | string | No | in:active,draft |
Response (201):
{
"data": {
"id": 73,
"name": "New Property",
"reference": "AB0073",
"status": "draft"
}
}
Error Response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": ["The name field is required."],
"price": ["The price must be at least 0."]
}
}
### Step 4: Include Example Requests
For each endpoint, generate example curl commands:
```bash
# List properties
curl -X GET "https://api.example.com/api/v1/properties?page=1&status=active" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
# Create property
curl -X POST "https://api.example.com/api/v1/properties" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{"name": "Beach Villa", "address": "123 Coast Rd", "price": 450000}'
Present the full documentation as formatted markdown in the response. If the user wants to save it to a file, offer to write it to a specified location (e.g., docs/api.md), but do not create files unless asked.
JsonResource) are used, read the toArray() method for accurate response structures.$hidden and $visible on the model.