php-codeigniter-patterns

php-codeigniter-patterns is a skill for Claude Code from shennawardana23/skillme. It costs 78 tokens per session (2,843 once invoked), scanned A, original, Apache-2.0.

An architecture guide for CodeIgniter 4 PHP applications. It explains how routes, filters, controllers, models, entities, validation, and services fit together, including how its query builder handles related data.

In plain words
What is it for?
Building or reviewing CodeIgniter 4 routes, controllers, models, entities, filters, validation, and custom services.
Why use it?
It prevents code from being placed in the wrong layer and avoids applying Laravel-style ORM patterns that CodeIgniter 4 does not provide.

Skill for Claude Code

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

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit Building or reviewing CodeIgniter 4 routes, controllers, models, entities, filters, validation, and…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shennawardana23/skillme/php-codeigniter-patterns
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 shennawardana23/skillme --skill php-codeigniter-patterns
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

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 php-codeigniter-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/php-codeigniter-patterns.svg)](https://agentmods.dev/skills/shennawardana23/skillme/php-codeigniter-patterns)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/php-codeigniter-patterns"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/php-codeigniter-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,843 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.00078 $0.02843
Opus 5 $0.00039 $0.01422
Sonnet 5 $0.00016 $0.00569
Haiku 4.5 $0.00008 $0.00284

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

Security

Grade A, and why

php-codeigniter-patterns 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 3d 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/php-codeigniter-patterns/SKILL.md · 294 lines

How it starts

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

PHP CodeIgniter Patterns

This is the architecture layer for CodeIgniter 4 (CI4) applications: how a request flows from Router → Filters → Controller → Model → Entity, and where each concern belongs. It is not a testing guide (php-codeigniter-tdd), not a security checklist (php-codeigniter-security), and not a pre-deploy verification pipeline (php-codeigniter-verification) — apply those alongside this one.

The single biggest CI4-vs-Laravel difference: CI4's Model class is not an ORM. It has no relationship methods (hasMany, belongsTo), no eager loading, and no Active Record-style object graph. A Model is a thin wrapper that exposes Query Builder plus a handful of lifecycle conveniences (mass-assignment guarding, timestamps, soft deletes, validation). Per the CI4 Model user guide: "Once you get the Query Builder instance, you can call methods of the Query Builder. However, since Query Builder is not a Model, you cannot call methods of the Model." Related rows are fetched with an explicit second query or a manual JOIN in the Query Builder call — there is no ->with() to reach for, and no N+1-via-eager-loading gotcha to guard against, because eager loading doesn't exist. The N+1 risk in CI4 is the mirror image: a developer coming from Laravel/Eloquent instinctively expects a relationship method to exist and is surprised when it doesn't.

Layering

app/Controllers/  → routing + request/response shaping only
app/Filters/       → CI4's middleware equivalent (auth, rate limiting, CORS)
app/Models/        → Query Builder wrapper: allowedFields, validation, casts
app/Entities/      → typed row objects (optional; set via Model::$returnType)
app/Config/        → Services.php, Filters.php, Validation.php, Routes.php

Models: Query Builder, not an ORM

namespace App\Models;

use CodeIgniter\Model;

class ReservationModel extends Model
{
    protected $table            = 'reservations';
    protected $primaryKey       = 'id';
    protected $returnType       = \App\Entities\Reservation::class;
    protected $useTimestamps    = true;
    protected $useSoftDeletes   = true;

    // Fields the model will accept from insert()/update()/save() arrays.
    // Never include $primaryKey here.
    protected $allowedFields = ['guest_id', 'hotel_id', 'check_in', 'check_out', 'status'];

    protected $validationRules = [
        'guest_id'  => 'required|integer',
        'check_in'  => 'required|valid_date',
        'check_out' => 'required|valid_date',
    ];
}

Read the full file on GitHub · 294 lines

Files

What ships with it

2 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. 3d ago First seen · 294 lines · 78 tokens per session scan A 6da74490bdbf

Subscribe to this mod's changes

php-codeigniter-patterns is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 9d ago), licensed Apache-2.0. It adds 78 tokens to every session and 2,843 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

php-pro

A set of practices for building PHP applications with modern PHP, Laravel, or Symfony. PHP is a programming language commonly used for server-side web applications.

sutchan/Agent-Skills-Hub · 120 tokens

mvc-expert

Expert guidelines to refactor legacy PHP codebases into clean, modern, and scalable MVC-structured projects / Pedoman ahli untuk merefaktor codebase PHP lama menjadi proyek terstruktur MVC yang bersih, modern, dan skalabel.

roedyrustam/vibes-plug · 51 tokens

bd-better-route-bridge

Compose better-data DTOs with the better-route library — use BetterRouteBridge::{get, post, put, patch, delete} to register a REST route that hydrates the request into a DTO, validates, calls the handler with (DataObject, mixed $request), and presents returned DataObject values through Presenter with…

Lonsdale201/wp-agent-skills · 214 tokens

bd-data-object

Add or modify DataObject subclasses inside the better-data library — the immutable, attribute-decorated DTOs the whole library is built around. Every DTO is final readonly class extends DataObject with constructor-promoted typed parameters; sources hydrate via ::fromArray, sinks project via SinkProjection, the…

Lonsdale201/wp-agent-skills · 206 tokens

bd-hydration-coercion

Modify how raw values become typed property values in better-data — work in TypeCoercer (primitives + DateTime + Enum + Secret) or DataObject::coerceParameter (attribute-aware — ListOf, Encrypted, etc.). Critical layering — TypeCoercer is pure, must stay callable from a no-WordPress unit test, no side effects, no…

Lonsdale201/wp-agent-skills · 224 tokens

wp-plugin-architecture

Designs and reviews the internal architecture of a WordPress plugin — src/ folder layout, Composer PSR-4 one-class-per-file discipline, PascalCase filenames matching class names, no class-.php legacy layout, Schema/Constants placement, composition-root vs singleton decisions, conditional asset enqueueing, script…

Lonsdale201/wp-agent-skills · 129 tokens