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.
npx agentmods add skills/softspark/ai-toolkit/php-rulesnpx skills add softspark/ai-toolkit --skill php-rulesgit clone --depth 1 https://github.com/softspark/ai-toolkitWrote 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.
[](https://agentmods.dev/skills/softspark/ai-toolkit/php-rules)<a href="https://agentmods.dev/skills/softspark/ai-toolkit/php-rules"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/php-rules.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00038 | $0.03510 |
| Opus 5 | $0.00019 | $0.01755 |
| Sonnet 5 | $0.00008 | $0.00702 |
| Haiku 4.5 | $0.00004 | $0.00351 |
Grade A, and why
php-rules 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 293 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PHP Rules
These rules come from app/rules/php/ in ai-toolkit. They cover
the project's standards for coding style, frameworks, patterns,
security, and testing in PHP. Apply them when writing or
reviewing PHP code.
PHP Coding Style
Standards
- Follow PSR-12 extended coding style.
- Use
declare(strict_types=1)at the top of every file. - Use PHP 8.1+ features: enums, fibers, readonly properties, intersection types.
- Use PHP CS Fixer or Pint for automated formatting.
Naming
- PascalCase: classes, interfaces, traits, enums.
- camelCase: methods, functions, variables.
- UPPER_SNAKE: class constants (
public const MAX_RETRIES = 3). - snake_case: not used for methods. PSR convention is camelCase.
- Suffix interfaces with
Interfaceor prefix with contract name (project convention).
Type System
- Use typed properties:
private readonly string $name;. - Use union types:
string|int. Use intersection types:Countable&Iterator. - Use
enum(PHP 8.1) for fixed sets of values. Use backed enums for persistence. - Use
readonlyclasses (PHP 8.2) for immutable DTOs. - Use constructor promotion:
public function __construct(private string $name). - Use
neverreturn type for functions that throw or exit.
Functions
- Use typed parameters and return types on all functions/methods.
- Use named arguments for readability:
new User(name: 'Ada', age: 36). - Use null-safe operator:
$user?->address?->city. - Use match expression over switch for value mapping.
- Use first-class callable syntax:
array_map($this->transform(...), $items).
Imports and Namespaces
- Use PSR-4 autoloading via Composer.
- Group
usestatements: classes, functions, constants. - Never use
require/includefor class loading. Use Composer autoloader. - Use one class per file. File name matches class name.
Error Handling
- Use exceptions for error conditions. Never return error codes.
- Create domain exception hierarchies extending
RuntimeExceptionorLogicException. - Use
matchwiththrowfor exhaustive error mapping. - Log exceptions with context using PSR-3 logger.
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.
- 2d ago First seen · 293 lines · 38 tokens per session scan A 9458e9d79b4f
php-rules is a skill published in the GitHub repository softspark/ai-toolkit (169 stars, last pushed yesterday), licensed Apache-2.0. It adds 38 tokens to every session and 3,510 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-09-03.
Other skills, from other repositories
php
PHP development: code quality, PSR standards, testing with PHPUnit.
laravel
Laravel mastery skill. Eloquent ORM, service container, queues, events, Sanctum/Passport auth, Pest testing. Triggers on: /godmode:laravel, "laravel app", "eloquent", "artisan", "blade".
first-plan-lens-php
Stack lens para PHP. Use durante Discovery quando composer.json for detectado. Cobre Laravel, Symfony, Slim, Hyperf, Laminas, raw PHP. Identifica PSR compliance, ORM, padrões de fila.
architecture-patterns
Use this skill when choosing a system-level architecture (monolith, modular monolith, microservices, event-driven, serverless, clean/hexagonal, or DDD) for a new or growing PHP application, or when weighing a premature move to a more distributed style. Provides a decision guide and the common pitfalls that cause…
application-layer
Use this skill when writing controllers, structuring use cases, or implementing Service Layer / Application Layer and Command/Query/Handler (CQRS) patterns in PHP applications. Triggers on questions about thin controllers, handler responsibilities, service definition, or DTO usage.
event-sourcing
Use this skill when evaluating or implementing Event Sourcing in a PHP application. Triggers on questions about event stores, aggregates, projections, snapshots, event replay, temporal queries, CQRS with event sourcing, or PHP event-sourcing libraries (Ecotone, Prooph, EventSauce, Patchlevel). Distinguishes Event…