php-codeigniter-tdd

php-codeigniter-tdd is a skill for Claude Code from shennawardana23/skillme. It costs 87 tokens per session (1,892 once invoked), scanned A, original, Apache-2.0.

A test-development guide for CodeIgniter 4, a PHP web framework, using the red-green-refactor method known as test-driven development, or TDD. It covers framework-specific database tests and full HTTP request tests.

In plain words
What is it for?
Use it when writing or fixing CodeIgniter 4 tests, especially tests involving databases or HTTP behavior.
Why use it?
It helps tests use the correct framework base classes, database setup, test database, and request-level checks without adding slow database setup to tests that do not need it.

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

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.

agentmods
npx agentmods add skills/shennawardana23/skillme/php-codeigniter-tdd
Any agent
npx skills add shennawardana23/skillme --skill php-codeigniter-tdd
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-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/php-codeigniter-tdd.svg)](https://agentmods.dev/skills/shennawardana23/skillme/php-codeigniter-tdd)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/php-codeigniter-tdd"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/php-codeigniter-tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,892 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00087 $0.01892
Opus 5 $0.00044 $0.00946
Sonnet 5 $0.00017 $0.00378
Haiku 4.5 $0.00009 $0.00189

Measured 3d ago against content hash 5381114c2e56, 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-tdd 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-tdd/SKILL.md · 179 lines

How it starts

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

PHP CodeIgniter TDD

Red-green-refactor for CodeIgniter 4 (CI4), with the framework-specific parts: which trait wires up the database per test, why CI4 insists on a separate tests database group, and how to assert against a full HTTP request/response cycle instead of calling a controller method directly.

For the generic RED-GREEN-REFACTOR cycle, see skills/test-driven-development/. This skill covers what's specific to CI4 on top of that cycle.

Base class and traits

Every CI4 test extends CodeIgniter\Test\CIUnitTestCase. Add CodeIgniter\Test\DatabaseTestTrait only when the test actually touches the database — it adds real per-test cost (migration/refresh/seed), so a pure unit test (a value object, a calculator) should not use it.

use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\DatabaseTestTrait;

final class ReservationModelTest extends CIUnitTestCase
{
    use DatabaseTestTrait;

    protected $refresh = true;
    protected $seed    = 'ReservationSeeder';

    public function testCreateRejectsCheckOutBeforeCheckIn(): void
    {
        $model = new \App\Models\ReservationModel();

        $result = $model->insert([
            'guest_id'  => 1,
            'check_in'  => '2026-06-10',
            'check_out' => '2026-06-05',
        ]);

        $this->assertFalse($result);
        $this->assertArrayHasKey('check_out', $model->errors());
    }
}

The tests database group — not optional, not decorative

DatabaseTestTrait requires a dedicated tests connection group defined in app/Config/Database.php, separate from default. Per the CI4 user guide, this exists specifically so database tests never touch "your other data" — the trait's $migrate/$refresh/$seed behavior runs migrations, seeds, and (with $refresh = true) rolls back or re-migrates the schema, against whichever connection the tests group actually points to.

// app/Config/Database.php
public array $tests = [
    'DSN'      => '',
    'hostname'  => 'localhost',
    'database'  => 'app_test',        // a real, separate database
    'username'  => 'root',
    'password'  => '',
    'DBDriver'  => 'MySQLi',
    'port'      => 3306,
];

Read the full file on GitHub · 179 lines

Files

What ships with it

1 file 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 · 179 lines · 87 tokens per session scan A 5381114c2e56

Subscribe to this mod's changes

php-codeigniter-tdd is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 9d ago), licensed Apache-2.0. It adds 87 tokens to every session and 1,892 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.