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-review-lensskill) - 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, Ks21Job next to GeoCaptureJob with the same shape
- allowlist constants:
private const SUPPORTED_FOO = [Type::A, Type::B]
→ Run the sniff test in