resources/boost/skills/phpstan/SKILL.md
Static analysis tool configured at Level 9. All code must pass PHPStan Level 9 with strict typing, no untyped signatures, and minimal suppression of errors.
npx skillsauth add codebar-ag/coding-guidelines phpstanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
app/** or tests/**.phpstan.neon exists at repo root and is used as the default project config.phpstan.neon is missing, initialize config first; do not guess flags ad hoc:
vendor/bin/phpstan initphpstan-baseline.neon exists, it is included intentionally and reviewed before merge.vendor/bin/phpstan analyse --generate-baselinevendor/bin/phpstan analysevendor/bin/phpstan analyse app/ tests/vendor/bin/phpstan analyse app/Services/Billingmixed usage.@phpstan-ignore usage and whether it is justified.mixed types with more specific union types.array<string, mixed> or more precise shapes instead of bare array in PHPDoc.@throws annotations to methods that can throw exceptions.phpstan-assert, phpstan-param, and phpstan-return tags when generics or advanced shapes are needed.assert(), instanceof) instead of suppressing errors.vendor/bin/phpstan analyse after fixes.array has no value type specified.array<string, mixed> or specific shapes (array<int, InvoiceDto>).Cannot call method ... on mixed.instanceof, assert(), or typed wrappers.Cannot call method ... on Type|null.@template, Collection generic count/type mismatch.// ✓ Specific types instead of mixed
public function process(Order $order): Invoice { ... }
// ✓ PHPDoc with typed arrays
/**
* @return array<string, array<int, string|object>>
*/
public function rules(): array { ... }
// ✓ Union types instead of mixed
public function format(string|int|null $value): string { ... }
// ✓ Generics for collections
/**
* @return Collection<int, Invoice>
*/
public function getInvoices(): Collection { ... }
// ✓ @throws annotation
/**
* @throws InvoiceAlreadyPaidException
*/
public function markAsPaid(Invoice $invoice): void
{
if ($invoice->isPaid()) {
throw InvoiceAlreadyPaidException::for($invoice);
}
// ...
}
// ✓ Type narrowing with assert() instead of suppression
public function handle(mixed $model): void
{
assert($model instanceof Invoice);
$model->markAsPaid(); // PHPStan now knows it's an Invoice
}
// ✓ Justified suppression with comment
/** @phpstan-ignore-next-line Property accessed via magic method — documented in IDE helper */
$user->custom_attribute;
vendor/bin/phpstan analyse from repo root.phpstan.neon exists (or initialized it before applying this skill).mixed and array usages with more specific types or PHPDoc generics.@throws annotations to methods that can throw.@phpstan-ignore usages are justified with clear comments.mixed when a more specific type is possible.array without a PHPDoc generic shape such as array<string, mixed>.@phpstan-ignore without an explanation of why it is necessary.@throws annotations on methods that throw.(int) or (string) casts as substitutes for proper type narrowing.resources/boost/skills/php/SKILL.md (type-first PHP conventions)testing
Translation and localization conventions for Laravel. Use when adding user-facing strings, creating translation files, or working with lang/ directory.
tools
Reusable behaviour shared across multiple unrelated classes. Traits provide shared Eloquent scopes, accessors, lifecycle hooks, and small stateless helper methods.
development
Tailwind CSS v4 styling conventions. Use when working with CSS, Tailwind utilities, or customizing the theme in Laravel projects.
development
Orchestration classes that coordinate multiple Actions, external APIs, or domain operations into a cohesive workflow. Services own transaction boundaries and third-party API integrations.