mcpField
L
laravel:performance-select-columns

laravel:performance-select-columns

github.com/jpcaparasDevelopment157135 installsUpdated 17w ago
Repository

About laravel:performance-select-columns

A Laravel development skill for reducing query payloads by selecting only the fields an application needs. It also recommends aligning DTOs and resources with selected fields and using eager loading to avoid N+1 queries.

Key features

  1. 01Select exact columns in queries
  2. 02Select related-model columns
  3. 03Align DTOs and resources with fields
  4. 04Combine eager loading to avoid N+1

Use cases

  1. 01Paginating users with only required fields
  2. 02Loading posts with selected author fields

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel:performance-select-columns

After installing, type/laravel:performance-select-columnsin Claude Code to confirm it loaded.

Details

From the project README

Select Only Needed Columns

Reduce payloads by selecting exact fields:

User::select(['id', 'name'])->paginate();

Post::with(['author:id,name'])->select(['id','author_id','title'])->get();
  • Avoid *; keep DTOs/resources aligned with selected fields
  • Combine with eager loading to avoid N+1

Comments

Markdown supported