laravel-database-optimization

laravel-database-optimization is a skill for Claude Code, Codex from AsyrafHussin/agent-skills. It costs 55 tokens per session (1,777 once invoked), scanned A, original, MIT.

A set of guidelines for improving database work in Laravel 13, a PHP web framework. It covers queries, database changes, indexes, caching with Redis, pagination, transactions, and diagnosing slow queries.

In plain words
What is it for?
Use it when writing Eloquent or query-builder code, creating migrations, adding indexes, using Redis caching, paginating data, handling transactions, or investigating slow queries.
Why use it?
It helps avoid common causes of slow or inefficient applications, such as N+1 queries, missing indexes, and poor handling of large datasets. It gives developers framework-specific rules while they write or review database code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

not rated 74repo +2 13d ago A scan Socket: passSnyk: passSkillSpector: warn 55 tokens original MIT

Good fit Use it when writing Eloquent or query-builder code, creating migrations, adding indexes, using Redis caching, paginating data, handling transactions, or investigating slow queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/asyrafhussin/agent-skills/laravel-database-optimization
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.

Any agent
npx skills add AsyrafHussin/agent-skills --skill laravel-database-optimization
Clone the repo
git clone --depth 1 https://github.com/AsyrafHussin/agent-skills

Made for: Claude Code, Codex.

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 laravel-database-optimization

README.md
[![agentmods](https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/laravel-database-optimization/github.svg)](https://agentmods.dev/skills/asyrafhussin/agent-skills/laravel-database-optimization)
Your own site
<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/laravel-database-optimization"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/laravel-database-optimization/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 laravel-database-optimization

Your own site · 80×15
<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/laravel-database-optimization"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/laravel-database-optimization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,777 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. Third-party audits
  • Socket pass 26 Mar 2026
  • Snyk pass 26 Mar 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 81
    Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.
    Fix: Set explicit rate limits, timeouts, and resource quotas for API calls, file operations, and compute. Implement circuit breakers for runaway loops.
How audits are shown
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.00055 $0.01777
Opus 5 $0.00028 $0.00889
Sonnet 5 $0.00011 $0.00355
Haiku 4.5 $0.00006 $0.00178

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

Security

Grade A, and why

laravel-database-optimization 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 9d 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.

skills/laravel-database-optimization/SKILL.md · 236 lines

How it starts

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

Laravel Database Optimization

Comprehensive database optimization guide for Laravel 13 applications. Contains 33 rules across 9 categories for writing performant database queries, proper indexing, efficient caching, naming conventions, and debugging slow queries in Laravel 13.

Metadata

  • Version: 1.1.0
  • Framework: Laravel 13.x
  • PHP: 8.3+

When to Apply

Reference these guidelines when:

  • Writing Eloquent queries or using the query builder
  • Diagnosing and fixing N+1 query problems
  • Adding database indexes to migrations
  • Implementing Redis or cache-based optimizations
  • Paginating or processing large datasets
  • Wrapping operations in database transactions
  • Creating or modifying migrations for production databases
  • Debugging slow queries with EXPLAIN or Laravel Debugbar

Rule Categories by Priority

Priority Category Impact Prefix
1 Query Performance & N+1 CRITICAL query-
2 Indexing Strategies CRITICAL index-
3 Eloquent Optimization HIGH eloquent-
4 Caching with Redis HIGH cache-
5 Pagination & Large Datasets HIGH data-
6 Transactions & Locking HIGH lock-
7 Migrations HIGH migrate-
8 Query Debugging MEDIUM debug-
9 Naming & Structure HIGH naming-

Quick Reference

1. Query Performance & N+1 (CRITICAL)

  • query-eager-loading - Use eager loading to eliminate N+1 queries
  • query-prevent-lazy-loading - Prevent lazy loading in development
  • query-auto-eager-loading - Configure automatic eager loading on models
  • query-select-columns - Select only needed columns instead of SELECT *

2. Indexing Strategies (CRITICAL)

  • index-foreign-keys - Index all foreign key columns
  • index-composite-indexes - Create composite indexes for multi-column queries
  • index-covering-indexes - Use covering indexes for read-heavy queries
  • index-full-text - Use full-text indexes for search functionality

Read the full file on GitHub · 236 lines

Files

What ships with it

38 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 236 lines · 55 tokens per session scan A bc5850c4e05b

Subscribe to this mod's changes

laravel-database-optimization is a skill published in the GitHub repository AsyrafHussin/agent-skills (74 stars, last pushed 13d ago), licensed MIT. It adds 55 tokens to every session and 1,777 once invoked, about $0.0003 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 skills, from other repositories

golang-samber-hot

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…

emilioforrer/go-stack · 122 tokens

golang-samber-hot

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…

samber/cc-skills-golang · 122 tokens

truss-schema

Ground a database schema change in this application's real structure using Laravel Truss. Use when adding or altering tables, columns, indexes, or foreign keys, when a migration needs to match what is already there, or when you need to know what a migration actually changed. Structure only, never data.

albertoarena/laravel-truss · 63 tokens

laravel-auditor-development

Integrate and apply the Laravel Auditor package in Laravel applications: installation, setup, the MCP tools, and the audit workflow. Use when setting up Laravel Auditor or wiring it into a Laravel app.

MrPunyapal/laravel-auditor · 46 tokens

activerecord

This skill should be used when the user asks to "write a migration", "add a column", "add column to table", "create an index", "add a foreign key", "set up associations", "fix N+1 queries", "optimize queries", "add validations", "create callbacks", "use eager loading", or mentions ActiveRecord, belongsto, hasmany…

hoblin/claude-ruby-marketplace · 180 tokens

check-batch-processing

Analyzes PHP code for batch processing issues. Detects single-item vs bulk operations, missing batch inserts, individual API calls in loops, transaction overhead.

dykyi-roman/awesome-claude-code · 35 tokens