SL

streeboga/laravel-api-skill

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

22 stars 品質 67 トレンド 30MIT

Laravel API制作-Readyアーキテクチャー — クロードコードのJSON:API v1.1スキル

概要

Открытый проект EQ プラットフォーム — страциа проекта Laravel APIプロジェクトにおけるアーキテクチャの規準を強化するAIコーディングエージェント(クロードコード、カーソル、コピロットなど)のスキル:JSON:API v1.1、レイヤードアーキテクチャ、厳格なタイプ、フルテストカバレッジ。 まず、このスキルはプロジェクトの CLAUDE.md: - — Laravelのアーキテクチャルールでテンプレート/CLAUDE.mdから1つを生成します。 — Laravelのセクションを追加します。 — 通常どおりに作成します。 CLAUDE.md テンプレートは、あなたが何をしているかを検知します(エンティティティを宣言し、コードを見直し、テストを書きます)。そして、エージェントがコードを書く前に正しい参照ファイルを読むように強制します。 アクティブにすると、Laravel APIプロジェクトごとに厳格なレイヤードアーキテクチャが強化されます。 エージェントが新しいエンティティティティティを生成し、アーキテクチャの後に生成します。 1. 移行 2. モデル (ULID 公開鍵付き) 3. Enum(s) 4. DTO + 更新 DTO (Spatie データ) 5. ストアリクエスト + 更新リクエスト (toDto()) 6. QueryBuilder 7.

概要(AI 翻訳)

Открытый проект EQ プラットフォーム — страц проекта

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

Laravel APIプロジェクトにおけるアーキテクチャの規準を強化するAIコーディングエージェント(クロードコード、カーソル、コピロットなど)のスキル:JSON:API v1.1、レイヤードアーキテクチャ、厳格なタイプ、フルテストカバレッジ。

インストール

ステップ1:スキルのインストール

ステップ 2: セットアップ CLAUDE.md (自動)

最初に使うと、自動的にプロジェクトの[CLAUDE.mdをチェックします。

  • ** CLAUDE.md?** — Laravelアーキテクチャルールで[[T1]から1つを作成
  • CLAUDE.md は存在しますが、Laravelセクションはありませんか? — Laravelセクションに追加
  • 既に設定されていますか? — 通常通り

[CLAUDE.md テンプレートは、phaseディスパッチャとして機能します — それはあなたが何をしているかを検知します (エンティティティティを編集し、コードを見直し、テストを書く) そして、任意のコードを書く前に、エージェントが正しい参照ファイルを読み込むように強制します。

##手動設定(代替)

手動で設定したい場合:

または既存の CLAUDE.md に追加します。

それが何をしているか

アクティブにすると、Laravel APIプロジェクトごとに厳格なレイヤードアーキテクチャが強化されます。

##レイヤー境界

| レイヤー | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | は | お問い合わせ

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

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 (readonly classes)
  5. Store Request + Update Request (with toDto())
  6. QueryBuilder
  7. Repository (interface only with a second implementation)
  8. Service
  9. Controller (thin, JSON:API compliant)
  10. JsonApiResource
  11. Routes (versioned, PATCH for updates)
  12. Feature Tests

Code Review

GitHub で README 全文を見る

推奨ツール

別のキーワードを試すか、フィルタを外してください。

インストール

npx skillfish add streeboga/laravel-api-skill
MCP 初心者?mcpskill.org のガイドから始めましょう →