Php coder
Writes or edits PHP code — controllers, classes, type hints, SOLID refactors, modern idioms — even without naming PHP. NOT for writing tests (use pest-testing) or explaining PHP concepts.From its SKILL.md
npx -y skills add event4u-app/agent-config --skill php-coderAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 7 stars7 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.8 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
coder
When to use
This skill applies to ALL code generation and editing tasks. Every other skill builds on top of this one.
Do NOT use when:
- Only reading/reviewing code (use
code-reviewskill) - Only running quality tools (use
quality-toolsskill)
Procedure: Before writing code
Step 0: Inspect project
- Read
AGENTS.mdand.github/copilot-instructions.mdfor project-specific rules. - If working in a module (
app/Modules/*/), checkapp/Modules/{Module}/agents/for module docs. - Look at neighboring files in the same directory — match the style.
- Read
./agents/for project-specific architecture. - Check
ecs.php/rector.php(if they exist) — code accordingly. - Read
MakefileorTaskfile.ymlfor available build/test/quality targets.
Step 1: Detect project type
artisanexists → Laravel project (Pest, Modules if present)- No
artisan+composer.json→ Standalone PHP / Composer project - Check
AGENTS.mdand./agents/for conventions
Step 2: Apply conventions
→ See php-coding rule (always loaded) for PHP coding standards.
→ See guideline php/general.md for detailed PHP conventions.
→ See guideline php/controllers.md, php/eloquent.md, etc. for domain-specific conventions.
Step 3: Stop-gate — branching on a discriminator?
Before writing a second match/switch arm, a second if/elseif
branch, or a second class hardcoded to one enum/string value (e.g.
Provider::FOO->value, 'stripe', a case Type::CSV), STOP and run the
Strategy sniff test.
Trigger keywords in the task or surrounding code:
- enum/string used as a type-tag:
Provider,Type,Channel,Format,Driver,Kind - repeated
match ($x)/switch ($x)blocks on the same value - class names that bake a single enum case in:
StripeImportService,CsvExporter,Ks21Jobnext toGeoCaptureJobwith the same shape - allowlist constants:
private const SUPPORTED_FOO = [Type::A, Type::B]
→ Run the sniff test in
docs/guidelines/php/patterns/strategy.md.
Two "yes" answers → propose Strategy + Registry before adding the new
branch. Three "yes" → it is already overdue and the refactor is the change.
This gate fires per task, not per file — once you've passed the sniff test for a given discriminator, do not re-ask on the next branch.
Core principles
- KISS — simplest solution that works. No over-engineering.
- YAGNI — only build what's needed now.
- DRY — extract shared logic. Don't abstract prematurely.
- SOLID — single responsibility, depend on abstractions, small interfaces.
Validate
- Run PHPStan on changed files — must pass at level 9.
- Run affected tests — must pass.
- Verify strict types, typed properties, return types on all new code.
- Check that no
dd(),var_dump(),print_r()remain.
Output format
- Code following project guidelines and existing patterns
- All downstream changes (callers, tests, imports) included
Verification examples
- Backend changes (service, controller, repository): probe the route with
curlor anactingAs()HTTP test underapi/; assert response shape and side effects. - Frontend-adjacent changes (Blade / Livewire component wiring): drive the component with a
livewire test, a Playwright spec, or a browserscreenshotsnapshot. - Always run the targeted test (
pest --filter=…) and the relevantphpstan/rectorchecks before claiming done.
Gotcha
- Don't introduce new patterns without being asked.
- Don't refactor code you're not working on.
- Use
Mathhelper for ALL calculations — never raw PHP arithmetic. MonitoringHelper::captureException()for Sentry reporting.
Do NOT
- Do NOT use native arithmetic (
+,-,*,/) for business calculations — useMathhelper. - Do NOT refactor code you're not actively working on.
- Do NOT use
var_dump(),print_r(),dd()— disallowed by PHPStan.
Anti-bruteforce — diagnose before retry
When PHPStan, Rector, or a test goes red after a change, do not retry blindly by toggling type hints, adding @phpstan-ignore, or shuffling arguments until it passes. Diagnose the root cause first — read the error, trace the symbol, then apply a targeted fix. Trial-and-error type narrowing hides real type errors.
Auto-trigger keywords
- PHP coding
- coding standards
- SOLID
- clean code
- best practices
What ships with it: 1 file
1.4 KB alongside SKILL.md
evals/
- triggers.json1.4 KB
Gives 0 of the 12 instructions most test skills give in ~1.1k tokens
Counted across 964 of the 1,571 authors here whose files we hold, read 2026-08-07
- Close the browser when donein 55 of 964, across 12 files
- Wait for network idle statein 51 of 964, across 6 files
- Launch Chromium in headless modein 49 of 964, across 6 files
- Use descriptive selectors for elementsin 49 of 964, across 6 files
- Run provided scripts with help flag firstin 49 of 964, across 6 files
- Add appropriate explicit waitsin 48 of 964, across 5 files
- Use bundled scripts as black boxesin 46 of 964, across 3 files
- Do not read script source codein 46 of 964, across 3 files
- Use sync playwright for scriptsin 46 of 964, across 3 files
- Inspect dom before executing actionsin 46 of 964, across 3 files
- Run the full test suitein 37 of 964
- Write the failing test firstin 29 of 964, across 23 files
Said here and by no other author read
- read project documentation before coding
- match the style of neighboring files
- choose the simplest working solution
- run PHPStan at level 9 on changed files
- run affected tests before claiming done
- verify strict types and return types
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.