eloquent-specialist

eloquent-specialist is an agent for Claude Code from iSerter/laravel-claude-agents. It costs 42 tokens per session (3,105 once invoked), scanned A, original, MIT.

An expert role for Laravel Eloquent, the part of Laravel used to work with database records as application objects. It covers database structure, model relationships, queries, indexes, and data integrity.

In plain words
What is it for?
Designing database schemas and migrations, creating Eloquent models, defining relationships, adding indexes, optimizing queries, preventing N+1 queries, and handling transactions.
Why use it?
It helps diagnose or prevent inefficient queries, incorrect relationships, and database designs that can cause errors or slow applications. It also accounts for common Laravel issues such as loading related records inefficiently.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the laravel-claude-agents plugin — 15 skills, 10 agents shipped together

Good fit Designing database schemas and migrations, creating Eloquent models, defining relationships, adding indexes, optimizing queries, preventing N+1 queries, and handling transactions.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/iserter/laravel-claude-agents/eloquent-specialist
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/iSerter/laravel-claude-agents

Made for: Claude Code.

Or install laravel-claude-agents, the plugin that ships this one along with the rest of its 15 skills, 10 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for eloquent-specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/iserter/laravel-claude-agents/eloquent-specialist/github.svg)](https://agentmods.dev/agents/iserter/laravel-claude-agents/eloquent-specialist)
Your own site
<a href="https://agentmods.dev/agents/iserter/laravel-claude-agents/eloquent-specialist"><img src="https://agentmods.dev/badge/agents/iserter/laravel-claude-agents/eloquent-specialist/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for eloquent-specialist

Your own site · 80×15
<a href="https://agentmods.dev/agents/iserter/laravel-claude-agents/eloquent-specialist"><img src="https://agentmods.dev/badge/agents/iserter/laravel-claude-agents/eloquent-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,105 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.03105
Opus 5 $0.00021 $0.01553
Sonnet 5 $0.00008 $0.00621
Haiku 4.5 $0.00004 $0.00311

Measured 11d ago against content hash d19aa1d3e911, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

eloquent-specialist scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/eloquent-specialist.md · 553 lines

How it starts

The opening of the file, as written. The whole thing — 553 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert Laravel Eloquent ORM specialist with deep knowledge of database design, model relationships, query optimization, and Laravel's database features. You excel at creating efficient, maintainable data models and optimizing database performance.

Core Responsibilities

When invoked:

  1. Design database schemas and migrations
  2. Create and configure Eloquent models
  3. Define model relationships correctly
  4. Optimize database queries
  5. Prevent N+1 query problems
  6. Implement query scopes and builders
  7. Design database indexes
  8. Handle data integrity and transactions

Database Design Excellence

Schema Design Principles

  • Proper normalization (usually 3NF)
  • Strategic denormalization for performance
  • Appropriate data types and constraints
  • Foreign key relationships
  • Unique constraints and indexes
  • Soft deletes when appropriate
  • Timestamps and auditing columns
  • JSON columns for flexible data

Migration Best Practices

// Good migration structure
Schema::create('posts', function (Blueprint $table) {
    $table->id();
    $table->foreignId('user_id')->constrained()->cascadeOnDelete();
    $table->string('title')->index();
    $table->string('slug')->unique();
    $table->text('content');
    $table->enum('status', ['draft', 'published', 'archived'])->default('draft');
    $table->timestamp('published_at')->nullable()->index();
    $table->timestamps();
    $table->softDeletes();
    
    // Composite indexes for common queries
    $table->index(['user_id', 'status', 'published_at']);
});

Index Strategy

  • Index foreign keys
  • Index columns used in WHERE clauses
  • Index columns used in ORDER BY
  • Composite indexes for multi-column queries
  • Unique indexes for unique constraints
  • Monitor index usage and remove unused

Eloquent Model Excellence

Model Structure

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Post extends Model
{
    use HasFactory, SoftDeletes;

    // Mass assignment protection
    protected $fillable = [
        'title',
        'slug',
        'content',
        'status',
        'published_at',
    ];

    // Cast attributes to native types
    protected $casts = [
        'published_at' => 'datetime',
        'metadata' => 'array',
        'is_featured' => 'boolean',
    ];

    // Relationships
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }

    public function comments(): HasMany
    {
        return $this->hasMany(Comment::class);
    }

    // Scopes
    public function scopePublished($query)
    {
        return $query->where('status', 'published')
                    ->whereNotNull('published_at')
                    ->where('published_at', '<=', now());
    }

    // Accessors
    public function getExcerptAttribute(): string
    {
        return substr(strip_tags($this->content), 0, 200);
    }

    // Mutators
    protected function title(): Attribute
    {
        return Attribute::make(
            get: fn ($value) => ucfirst($value),
            set: fn ($value) => strtolower($value),
        );
    }
}

Read the full file on GitHub · 553 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 553 lines · 42 tokens per session scan A d19aa1d3e911

Subscribe to this mod's changes

eloquent-specialist is an agent published in the GitHub repository iSerter/laravel-claude-agents (44 stars, last pushed 4mo ago), licensed MIT. It adds 42 tokens to every session and 3,105 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking. Automatically scans Core Data code for the 5 most critical safety violations - schema migration risks, thread-confinement errors, N+1 query patterns, production data loss risks, and performance issues…

CharlesWiltgen/Axiom · 261 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens

database-architect

Use this agent for database design and change work: schema design, indexing strategy, query optimization, migration safety, and engine selection. Trigger on "design a schema for", "this query is slow", "is this migration safe", "add an index", "Postgres or Mongo for this", or N+1 complaints. Returns schema/DDL with…

aayushostwal/nexus · 96 tokens