project-api
FreeNo executable scriptsNot checkedComplete API lifecycle management for Laravel applications — from OpenAPI design through governance and security hardening. Covers seven phases: design…
by nasrulhazim★ 26 GitHub starsAbout this skill
API Lifecycle Manager
A seven-phase methodology for designing, building, testing, deploying, documenting, governing, and securing production-ready REST APIs in Laravel — anchored on OpenAPI 3.1 as the single source of truth.
Command Reference
| Command | Phase | Description |
|---|---|---|
/api design |
Design | Interview + generate OpenAPI 3.1 spec |
/api develop |
Develop | Scaffold controllers, requests, resources from OpenAPI |
/api test |
Test | Generate Pest API tests + contract tests |
/api deploy |
Deploy | Versioned deployment, feature flags, zero-downtime |
/api docs |
Documentation | Auto-generate docs via Scribe/Scramble |
/api govern |
Governance | Breaking change detection, deprecation, review |
/api security |
Security | OWASP API Top 10 audit + hardening |
1. /api design — OpenAPI Spec Generation
1.1 API Discovery Interview
Ask the user for the following in three blocks, one at a time:
Block 1 — API Identity
- What is the API name and purpose? (one sentence)
- Who are the consumers? (SPA, mobile app, third-party, internal service)
- What authentication method? (Sanctum for SPA/mobile, Passport for third-party, API keys)
- What base URL / server environments? (local, staging, production)
Block 2 — Resources & Operations
- List the primary resources (e.g., users, orders, products)
- For each resource: which CRUD operations are needed?
- Are there any non-CRUD actions? (e.g., approve, publish, archive)
- What relationships exist between resources? (belongs-to, has-many, many-to-many)
Block 3 — Behaviour & Constraints
- Versioning strategy: URI-based (
/api/v1/) or header-based (Accept: application/vnd.app.v1+json)? - Pagination style: cursor-based or offset-based? Default page size?
- Filtering and sorting requirements?
- Rate limiting tiers? (public vs authenticated vs admin)
- Error response format: RFC 7807 Problem Details or custom?
If the user already provided context, extract what you can and only ask for what is missing.
1.2 Generate OpenAPI 3.1 Specification
Read references/openapi-template.md for the base template structure.
Generate a complete OpenAPI 3.1 YAML specification with:
infoblock with title, description, version, contact, licenseserversfor each environmentpathsfor every resource and operation identifiedcomponents/schemasfor request bodies, response bodies, error objectscomponents/securitySchemesfor the chosen auth methodcomponents/parametersfor reusable query parameters (pagination, filtering, sorting)- Proper HTTP status codes: 200, 201, 204, 400, 401, 403, 404, 409, 422, 429, 500
- RFC 7807 error response schema (if selected)
- Pagination envelope schema
Naming conventions (enforce on every path):
- Plural nouns for collections:
/api/v1/ordersnot/api/v1/order - Kebab-case for multi-word:
/api/v1/order-itemsnot/api/v1/orderItems - Nested resources max 2 levels:
/api/v1/orders/{order}/items - No verbs in paths: use HTTP methods instead
1.3 Present Design Output
Save the spec as openapi.yaml. Present it and ask:
"Review the spec. Want to adjust any resources, add fields, or change behaviour? Once confirmed,
I can scaffold the Laravel code with /api develop."
2. /api develop — Laravel Scaffolding from OpenAPI
2.1 Pre-flight Checks
Before scaffolding, verify:
- An
openapi.yamlexists in the project (or user provides one) - Laravel version (10 or 11) — check
composer.json - Auth package installed (Sanctum or Passport)
2.2 Generate Per-Resource Files
For each resource in the OpenAPI spec, generate:
| File | Location | Purpose |
|---|---|---|
| Controller | app/Http/Controllers/Api/V1/{Resource}Controller.php |
RESTful actions |
| Form Request (Store) | app/Http/Requests/Api/V1/Store{Resource}Request.php |
Create validation |
| Form Request (Update) | app/Http/Requests/Api/V1/Update{Resource}Request.php |
Update validation |
| API Resource | app/Http/Resources/Api/V1/{Resource}Resource.php |
Response transformation |
| Resource Collection | app/Http/Resources/Api/V1/{Resource}Collection.php |
Paginated collection |
| Policy | app/Policies/{Resource}Policy.php |
Authorization |
| Migration | database/migrations/{timestamp}_create_{table}_table.php |
Database schema |
| Model | app/Models/{Resource}.php |
Eloquent model |
2.3 Controller Pattern
<?php
namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests\Api\V1\StoreOrderRequest;
use App\Http\Requests\Api\V1\UpdateOrderRequest;
use App\Http\Resources\Api\V1\OrderCollection;
use App\Http\Resources\Api\V1\OrderResource;
use App\Models\Order;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Spatie\QueryBuilder\QueryBuilder;
class OrderController extends Controller
{
public function __construct()
{
$this->authorizeResource(Order::class, 'order');
}
Install project-api in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the project-api skill do?
Complete API lifecycle management for Laravel applications — from OpenAPI design through governance and security hardening. Covers seven phases: design (OpenAPI 3.1 spec generation via interview), develop (controller/request/resource scaffolding with Sanctum/Passport auth), test (Pest API test generation with contract testing), deploy (versioned deployment with feature flags and zero-downtime migration), docs (auto-generated documentation with Scribe/Scramble), govern (breaking change detection, deprecation policy, API review), and security (OWASP API Top 10, input validation, rate limiting tiers). Use this skill whenever the user asks to design an API, generate OpenAPI specs, scaffold API endpoints, write API tests, deploy API versions, generate API documentation, review API changes, or harden API security — including requests like "design a REST API for X", "scaffold CRUD endpoints", "generate Pest tests for my API", "set up API versioning", "check my API for breaking changes", "generate API docs", "secure my API", or "review my API design". Also triggers for Malay requests like "reka bentuk API untuk X", "buat ujian API", "jana dokumentasi API", "semak keselamatan API saya", or "sediakan endpoint CRUD". Compatible with Laravel 10/11 projects using Sanctum, Passport, Scribe, and Scramble.
How do I install the project-api skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the project-api skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
by Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
by Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
by Anthropic