Laravel Packages

An Opinionated Agent Skill for Building REST APIs in Laravel

Published
An Opinionated Agent Skill for Building REST APIs in Laravel image

Steve McDougall has released api-skill, a Claude Code skill that captures his production API conventions for Laravel 13+. Steve is well-known in the Laravel community for his work around API design, so this one is worth paying attention to.

The idea behind skills is that once installed, Claude Code picks them up automatically. Rather than explaining your preferred patterns at the start of every session, the skill keeps the agent on the same page across all your projects.

This particular skill is pretty opinionated. Here's a taste of what it enforces:

  • Auto-increment IDs are out — HasUlids on every model.
  • paginate() is prohibited in favour of simplePaginate().
  • All error responses follow RFC 9457 Problem Details.
  • Controllers are final single-action invokables — no resource controllers, no multi-method classes.
  • Deprecated API versions advertise their removal date via RFC 8594 Sunset middleware instead of just disappearing quietly.
  • Routes are split into one file per resource under routes/api/, with no global api prefix and throttle:api on every group.
  • Authentication uses Sanctum with stateless tokens. Authorization goes through Laravel Policies, checked in the Form Request's authorize() method — never inside an Action.
  • Background jobs return 202 Accepted immediately. Synchronous processing is reserved for auth flows only.
  • Model::shouldBeStrict() is set globally, preventing lazy loading, silently discarded attributes, and missing attribute access.
  • declare(strict_types=1) on every file, final on every class, and match over ternary chains throughout.

Installation is just a git clone:

# Global
git clone https://github.com/juststeveking/api-skill.git ~/.claude/skills/api-skill
 
# Project-level
git clone https://github.com/juststeveking/api-skill.git .claude/skills/api-skill

Alongside the main SKILL.md ruleset, there's a references/CONVENTIONS.md with directory layouts, naming tables, and worked examples if you want to dig into the reasoning or use it as a base for your own skill.

You can see the full list of rules, along with worked examples, on GitHub.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Sponsored

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
Validate and Convert HEIC Images in Laravel image

Validate and Convert HEIC Images in Laravel

Read article
Saga Lara Flow: Durable Workflows and Compensating Transactions on Laravel Queues image

Saga Lara Flow: Durable Workflows and Compensating Transactions on Laravel Queues

Read article
Reject Unexpected Array Keys with Laravel Validation image

Reject Unexpected Array Keys with Laravel Validation

Read article
Major performance improvements & security patches for Filament v4.12 and v5.7! image

Major performance improvements & security patches for Filament v4.12 and v5.7!

Read article
Laravel Boost Project Rules: Teach Agents Your Conventions image

Laravel Boost Project Rules: Teach Agents Your Conventions

Read article
Extract an Image's Dominant Color in Laravel image

Extract an Image's Dominant Color in Laravel

Read article