xiaohongshu
xiaohongshu
laravel-quality
Code quality tooling with PHPStan, Pint, and strict types. Use when working with code quality, static analysis, formatting, or when user mentions PHPStan, Pint, quality, static analysis, type safety, code style, linting.
Full skill instructions
Testing, static analysis, and code quality enforcement.
Related guides:
# composer.json scripts
{
"test": "pest",
"analyse": "phpstan analyse",
"format": "pint",
"quality": [
"@analyse",
"@test"
]
}
All files must have declare(strict_types=1) at top. Run quality checks before every commit.
tests/Pest.php
pest()->extend(Tests\TestCase::class)->in('Feature', 'Unit');
tests/Architecture/ActionsTest.php
<?php
declare(strict_types=1);
arch('actions are invokable')
->expect('App\Actions')
->toHaveMethod('__invoke');
arch('actions live in Actions namespace')
->expect('App\Actions')
->toBeClasses()
->toOnlyBeUsedIn('App\Actions', 'App\Http', 'App\Jobs', 'App\Listeners');
arch('actions do not use models directly')
->expect('App\Actions')
->not->toUse('Illuminate\Database\Eloquent\Model');
tests/Architecture/DataTest.php
<?php
declare(strict_types=1);
arch('data objects extend base Data class')
->expect('App\Data')
->toExtend('App\Data\Data')
->ignoring('App\Data\Data');
arch('data objects use constructor property promotion')
->expect('App\Data')
->toHaveConstructor();
tests/Architecture/StrictTypesTest.php
<?php
declare(strict_types=1);
arch('app files declare strict types')
->expect('App')
->toUseStrictTypes();
arch('test files declare strict types')
->expect('Tests')
->toUseStrictTypes();
tests/Architecture/ControllersTest.php
<?php
declare(strict_types=1);
arch('controllers do not use DB facade')
->expect('App\Http')
->not->toUse('Illuminate\Support\Facades\DB');
arch('controllers do not use models directly')
->expect('App\Http\Web\Controllers')
->not->toUse('App\Models');
tests/Architecture/NamingTest.php
<?php
declare(strict_types=1);
arch('actions end with Action suffix')
->expect('App\Actions')
->toHaveSuffix('Action');
arch('data objects end with Data suffix')
->expect('App\Data')
->toHaveSuffix('Data')
->ignoring('App\Data\Data', 'App\Data\Concerns');
arch('exceptions end with Exception suffix')
->expect('App\Exceptions')
->toHaveSuffix('Exception')
->ignoring('App\Exceptions\Concerns');
tests/Architecture/ModelsTest.php
<?php
declare(strict_types=1);
arch('models use custom query builders')
->expect('App\Models')
->toHaveMethod('newEloquentBuilder');
arch('models do not use local scopes')
->expect('App\Models')
->not->toHaveMethod('scope*');
composer require phpstan/phpstan --dev
composer require phpstan/phpstan-strict-rules --dev
composer require larastan/larastan --dev
phpstan.neon
includes:
- vendor/larastan/larastan/extension.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
parameters:
level: 8
paths:
- app
- tests
excludePaths:
- app/Providers/TelescopeServiceProvider.php
checkMissingIterableValueType: true
checkGenericClassInNonGenericObjectType: true
reportUnmatchedIgnoredErrors: false
./vendor/bin/phpstan analyse
composer require laravel/pint --dev
pint.json
{
"preset": "laravel",
"rules": {
"simplified_null_return": true,
"no_unused_imports": true,
"ordered_imports": {
"sort_algorithm": "alpha"
}
}
}
./vendor/bin/pint
./vendor/bin/pint --test # Check only
phpunit.xml
<coverage>
<report>
<html outputDirectory="coverage"/>
<text outputFile="php://stdout"/>
</report>
</coverage>
./vendor/bin/pest --coverage
./vendor/bin/pest --coverage --min=80 # Enforce minimum
.github/workflows/tests.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: xdebug
- name: Install Dependencies
run: composer install --prefer-dist --no-interaction
- name: Code Style
run: ./vendor/bin/pint --test
- name: Static Analysis
run: ./vendor/bin/phpstan analyse
- name: Run Tests
run: ./vendor/bin/pest --coverage --min=80
composer require brainmaestro/composer-git-hooks --dev
composer.json
{
"extra": {
"hooks": {
"pre-commit": [
"./vendor/bin/pint",
"./vendor/bin/phpstan analyse",
"./vendor/bin/pest"
]
}
},
"scripts": {
"post-install-cmd": "vendor/bin/cghooks add --ignore-lock",
"post-update-cmd": "vendor/bin/cghooks update"
}
}
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience