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 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/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.
<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="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.5 | $0.00015 | $0.01404 |
| Sonnet 5.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 1mo 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.
- 1mo 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 (180 stars, last pushed 7d ago), licensed Apache-2.0. It adds 38 tokens to every session and 3,510 once invoked, about $0.0002 per session on Opus 5.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
phpunit-unit-test-reviewing
Internal sub-skill. Do not auto-activate. Use only when explicitly invoked by name by another skill or agent.
phpunit-integration-test-generation
Use this skill when the user asks to generate, write, or create integration tests for a Shopware 6 source class whose contract requires wired-up code — phrases like "generate integration tests for X", "write an integration test for this controller", "test this indexer", "create an integration test for the message…
phpunit-unit-test-writing
Use this skill when the user asks to write, generate, create, or add PHPUnit unit tests for a Shopware 6 source class — phrases like "write unit tests for X", "generate tests for ClassName", "create PHPUnit tests", "add test coverage", "test this class", "cover this with tests", "I need tests for", "unit test this"…
unit-test
A Go testing workflow for writing unit tests: small tests that check individual functions or components. It supports table-driven cases, where many inputs and expected results are organised in one test, and subtests.
fuzzing-test
A Go testing guide for generating fuzz tests, which repeatedly try varied inputs to find crashes and unexpected behavior. It first checks whether the code is suitable for fuzzing.
go-test-review
Review Go test code for quality including table-driven tests, t.Helper usage, assertion completeness, boundary cases, benchmarks, fuzz tests, and coverage targets. Trigger when PR contains test.go files, test helpers, httptest usage, testing.B, testing.F, or testdata directories. Use for test-quality focused review.