SL

streeboga/laravel-api-skill

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

22 stars 품질 64 트렌드 18MIT

Laravel API Production-Ready Architecture — JSON:API v1.1 skill for Claude Code

개요

Открытый проект EQ Platform — страница проекта A skill for AI coding agents (Claude Code, Cursor, Copilot, etc.) that enforces architectural discipline in Laravel API projects: JSON:API v1.1, layered architecture, strict types, full test coverage. On first use, the skill automatically checks your project's CLAUDE.md: - — Creates one from templates/CLAUDE.md with Laravel architecture rules - — Appends the Laravel section - — Proceeds normally The CLAUDE.md template acts as a — it detects what you're doing (creating an entity, reviewing code, writing tests) and forces the agent to read the correct reference files before writing any code. When activated, the skill enforces a strict layered architecture for every Laravel API project: Ask the agent to create a new entity and it generates following the architecture: 1. Migration 2. Model (with ULID public keys) 3. Enum(s) 4. Create DTO + Update DTO (Spatie Data) 5. Store Request + Update Request (with toDto()) 6. QueryBuilder 7.

README

원문 README의 일부입니다. 원문 보기.

Laravel API Production-Ready Architecture Skill

Открытый проект EQ Platform — страница проекта

Читать на русском (README.ru.md)

A skill for AI coding agents (Claude Code, Cursor, Copilot, etc.) that enforces architectural discipline in Laravel API projects: JSON:API v1.1, layered architecture, strict types, full test coverage.

Installation

Step 1: Install the skill

npx skills add streeboga/laravel-api-skill

Step 2: Setup CLAUDE.md (automatic)

On first use, the skill automatically checks your project’s CLAUDE.md:

  • No CLAUDE.md? — Creates one from templates/CLAUDE.md with Laravel architecture rules
  • CLAUDE.md exists but no Laravel section? — Appends the Laravel section
  • Already configured? — Proceeds normally

The CLAUDE.md template acts as a phase dispatcher — it detects what you’re doing (creating an entity, reviewing code, writing tests) and forces the agent to read the correct reference files before writing any code.

Manual setup (alternative)

If you prefer to set it up manually:

# Copy the template to your project root
cp ~/.claude/skills/laravel-api/templates/CLAUDE.md ./CLAUDE.md

Or append to an existing CLAUDE.md:

cat ~/.claude/skills/laravel-api/templates/CLAUDE.md >> ./CLAUDE.md

What It Does

When activated, the skill enforces a strict layered architecture for every Laravel API project:

HTTP Request → Route → Middleware → Controller → Service → Repository → QueryBuilder → Model → DB
Response    ← JsonApiResource      ← Service   ← Repository ← QueryBuilder

Layer Boundaries

Layer Does Does NOT
Controller Accept request, call Service, return JsonApiResource Access DB, inject Repository/Model, contain logic
Service Business logic, transactions, events, caching Query DB directly, grow into God Class
Repository CRUD operations, delegates queries to QueryBuilder Contain business logic
QueryBuilder Scopes, filters, sorts, eager loading, pagination Contain CRUD or business logic
Model Relations, casts, accessors. NO scopes Contain scopeXxx() methods
DTO Type-safe data transfer between layers –
JsonApiResource Transform model to JSON:API format –
Enum All constants, statuses, cache keys –

New Entity Generation

Ask the agent to create a new entity and it generates 14 files following the architecture:

  1. Migration
  2. Model (with ULID public keys)
  3. Enum(s)
  4. Create DTO + Update DTO (Spatie Data)
  5. Store Request + Update Request (with toDto())
  6. QueryBuilder
  7. Repository Interface + Implementation
  8. Service
  9. Controller (thin, JSON:API compliant)
  10. JsonApiResource
  11. Routes (versioned, PATCH for updates)
  12. Service Provider binding
  13. Feature Tests

Code Review

GitHub에서 전체 README 보기

추천 도구

다른 키워드를 입력하거나 필터를 제거해 보세요.

설치

npx skillfish add streeboga/laravel-api-skill
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →