Best for
- PHP: PHPStan (static analysis), Rector (automated refactoring), ECS (coding standards)
- JS/TS: Biome (linting + formatting), TypeScript compiler (type checking), Jest/Vitest (tests)
event4u-app/agent-config/src/skills/quality-tools/SKILL.md
Use when PHPStan, Rector, or ECS output appears — "phpstan says mixed", type errors, "fix code style", "run rector" — even when Eloquent/Laravel/model code is also mentioned.
Decision brief
Use when PHPStan, Rector, or ECS output appears — "phpstan says mixed", type errors, "fix code style", "run rector" — even when Eloquent/Laravel/model code is also mentioned.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/quality-tools"Inspect the Agent Skill "quality-tools" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/quality-tools/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Run PHPStan — fix all errors 2. Run Rector + ECS with auto-fix — fix style + refactoring 3. Run PHPStan again — verify step 2 didn't introduce new issues
After JS/TS code changes, run this sequence:
Use this skill whenever running or configuring code quality tools:
Toolchains differ per language and project and are often unknown to the agent — discovering and running them burns time and tokens. Under the default, exactly three triggers justify running a quality tool:
Detect which tools to run based on what files were changed:
Permission review
The documentation asks the agent to run terminal commands or scripts.
git diff --name-only origin/main..HEAD | grep -E '\.(php)$' # → PHP toolsThe documentation asks the agent to run terminal commands or scripts.
git diff --name-only origin/main..HEAD | grep -E '\.(js|ts|tsx)$' # → JS/TS toolsThe documentation asks the agent to create, modify, or delete local files.
| `--baseline` | Generate/update phpstan baseline file |Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 95/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill whenever running or configuring code quality tools:
NEVER RUN QUALITY TOOLS PROACTIVELY WHEN quality.local_auto_run IS
false OR MISSING (THE DEFAULT). DO NOT ASK WHETHER TO RUN THEM.
THE USER RUNS THEM MANUALLY. REMOTE CI IS THE AUTHORITATIVE GATE.
Toolchains differ per language and project and are often unknown to the agent — discovering and running them burns time and tokens. Under the default, exactly three triggers justify running a quality tool:
/fix quality./fix:ci is the canonical flow).quality.local_auto_run: true restores the legacy autonomous behaviour
(run the pipeline when work is ready for verification). When runs are
suppressed, the completion message says "quality gates delegated to
remote CI" — never that the tools passed.
Detect which tools to run based on what files were changed:
# Check changed file extensions (diff against base branch)
git diff --name-only origin/main..HEAD | grep -E '\.(php)$' # → PHP tools
git diff --name-only origin/main..HEAD | grep -E '\.(js|ts|tsx)$' # → JS/TS tools
If both PHP and JS/TS files changed → run both pipelines.
verify-before-complete rule — no pass claims without fresh output; suppressed runs are surfaced as "delegated to remote CI", never claimedphp-coding rule → PHPStan section — inline ignores, PHPDoc rulescontexts/execution/verification-mechanics.md — Gate zero (local_auto_run) + timing when true (quality tools ONCE at the end, not after each edit)testing-anti-patterns and
process-anti-patterns.md —
test-side rationalizations these tools cannot catch (e.g. "CI is red,
patch first, test later").Check composer.json to determine which tools are available and how to run them.
Use the first matching command style:
composer.json contains | Command style | Example |
|---|---|---|
A project-specific quality wrapper (exposes quality:* commands) | php artisan quality:* or composer quality:* | php artisan quality:phpstan |
phpstan/phpstan or larastan/larastan | vendor/bin/phpstan | vendor/bin/phpstan analyse |
rector/rector | vendor/bin/rector | vendor/bin/rector process |
symplify/easy-coding-standard | vendor/bin/ecs | vendor/bin/ecs check --fix |
Priority: If a project ships a quality:* wrapper (Artisan or Composer script), always prefer it —
wrappers typically add git-aware execution, caching, automatic baseline regeneration, and memory
management on top of the native tools.
If none of the above is installed → skip quality checks, inform the user.
All commands run inside the Docker container if Docker is used (docker compose exec or make console).
# Native:
vendor/bin/phpstan analyse # Analyse all configured paths
vendor/bin/phpstan analyse --memory-limit=512M # With memory limit
vendor/bin/phpstan analyse --error-format=github # CI-friendly format
# With a project-specific quality wrapper:
php artisan quality:phpstan # Laravel
composer quality:phpstan # Composer
Native flags:
| Flag | Description |
|---|---|
--memory-limit=SIZE | Set memory limit (e.g. 512M, 1G) |
--debug | Activate debug mode |
--error-format=FORMAT | Output format: table (default), github, gitlab |
--pro | Toggle PHPStan Pro |
Wrapper-only flags (typical of a quality:* wrapper — verify in the project):
| Flag | Description |
|---|---|
--baseline | Generate/update phpstan baseline file |
--ignore-git | Skip Git check, analyse all files |
--xdebug | Activate Xdebug mode |
# Native:
vendor/bin/ecs check # Dry-run
vendor/bin/ecs check --fix # Auto-fix
# With a project-specific quality wrapper:
php artisan quality:ecs --fix # Laravel
composer quality:ecs -- --fix # Composer
Native flags:
| Flag | Description |
|---|---|
--fix | Fix errors automatically |
--clear-cache | Clear the ECS cache |
Wrapper-only flags (typical of a quality:* wrapper — verify in the project):
| Flag | Description |
|---|---|
--ignore-git | Skip Git check, check all files |
--paths-to-scan[=PATHS] | Custom paths, e.g. --paths-to-scan='["./core"]' |
--source-branch[=BRANCH] | Source branch (default: HEAD) |
--target-branch[=BRANCH] | Target branch to compare against |
# Native:
vendor/bin/rector process # Auto-fix
vendor/bin/rector process --dry-run # Preview changes
# With a project-specific quality wrapper:
php artisan quality:rector --fix # Laravel
composer quality:rector -- --fix # Composer
Native flags:
| Flag | Description |
|---|---|
--dry-run | Preview changes without applying |
--clear-cache | Clear the Rector cache |
Wrapper-only flags (typical of a quality:* wrapper — verify in the project):
| Flag | Description |
|---|---|
--ignore-git | Skip Git check, check all files |
--paths-to-scan[=PATHS] | Custom paths |
--source-branch[=BRANCH] | Source branch (default: HEAD) |
--target-branch[=BRANCH] | Target branch to compare against |
There is no native single command for running all three tools. Run them in sequence:
# Full pipeline (native):
vendor/bin/rector process && vendor/bin/ecs check --fix && vendor/bin/phpstan analyse
# With a project-specific quality wrapper (if it ships these combined commands):
php artisan quality:refactor --fix # Rector + ECS
php artisan quality:finalize # Rector + ECS + PHPStan (full pipeline)
If step 3 finds errors → fix and repeat from step 2.
Detect commands from project (see Tool Detection above).
Config files are typically in the project root. Do NOT modify without explicit user permission.
Detect config location:
phpstan.neon, ecs.php, rector.phpphpstan.neon.dist instead of phpstan.neon| File | Tool | Purpose |
|---|---|---|
phpstan.neon | PHPStan | Level, paths, extensions, ignoreErrors, disallowed calls |
phpstan-baseline.neon | PHPStan | Baseline for existing errors (auto-managed, do NOT edit) |
ecs.php | ECS | Code style: rule sets, configured rules, skip list |
rector.php | Rector | Refactoring: rule sets, PHP version sets, skip list |
Read the actual config files to understand what rules are active:
level, paths, ignoreErrors, includes (baselines, extensions)Common patterns across projects:
disallowedFunctionCalls banning var_dump(), dd()phpstan-baseline.neon by hand.quality:* commands), it may regenerate the baseline automatically.Priority order for dealing with PHPStan errors:
// @phpstan-ignore-next-line — false positive: reason here
phpstan.neon changes ARE allowedAdding ignoreErrors entries to phpstan.neon is allowed when:
$this at runtime, PHPStan can't resolve artisan(),
get(), etc. on PHPUnit\Framework\TestCase)If unsure whether a phpstan.neon change is appropriate → ask the user before making the change.
phpstan-baseline.neon)ignoreErrors for individual files or specific code issues that should be fixed@phpstan-ignore-next-line without a reason commentSee also: php-coding rule → PHPStan section.
tests/Unit/ automatically use UnitTestCase as the base class (configured in tests/Pest.php).ignoreErrors patterns in phpstan.neon.By default, all tools only check files changed since the last commit.
| Flag | Effect |
|---|---|
| (default) | Only changed files (fast, for iterative work) |
--ignore-git | All files (cache still applies) |
--clear-cache | Changed files, but ignore cache |
--ignore-git --clear-cache | Complete fresh run of all files |
Check package.json for available tools:
| Indicator | Tool |
|---|---|
@biomejs/biome in devDependencies | Biome — linting + formatting |
typescript in devDependencies | TypeScript — type checking |
jest or vitest in devDependencies | Test runner |
eslint in devDependencies | ESLint — legacy linting (check if Biome replaces it) |
prettier in devDependencies | Prettier — legacy formatting (check if Biome replaces it) |
Biome replaces ESLint + Prettier in one tool.
biome.json or biome.jsoncassist.actions.source.organizeImports)# Check (dry-run) — shows errors without fixing
npx biome check .
# Fix — auto-fix all fixable issues (formatting + linting + imports)
npx biome check --write .
# Format only
npx biome format --write .
# Lint only
npx biome lint .
Check package.json scripts — projects typically define:
npm run biome # Check (dry-run)
npm run biome:fix # Auto-fix
Always prefer npm scripts over raw npx commands when they exist.
# Type check without emitting files
npx tsc --noEmit
# Via npm script (preferred)
npm run tscheck
tsconfig.json (may have tsconfig.app.json, tsconfig.node.json for different targets)strict: true should be enabled in all projectscompilerOptions.paths for import aliases# Run all tests
npm test
# Run specific test file
npx jest path/to/test.spec.ts
# Run with coverage
npx jest --coverage
# Watch mode
npx jest --watch
After JS/TS code changes, run this sequence:
1. npx biome check --write . → Auto-fix formatting + linting
2. npx tsc --noEmit → Verify type safety
3. npm test → Run test suite
Or via npm scripts:
1. npm run biome:fix → Auto-fix
2. npm run tscheck → Type check
3. npm test → Tests
If step 2 finds type errors → fix them in code, then re-run step 1 (Biome may reformat).
All PHP commands run inside the Docker container (make console or docker compose exec).
JS/TS commands run on the host or in a Node container, depending on the project setup:
Makefile / Taskfile.yml has targets for linting/testing.docker-compose.yml has a Node service.quality:* wrapper may expose different flags than the native tools — check the project's wrapper before assuming flags.-T flag to avoid TTY issues in non-interactive mode.vendor/bin/phpstan or vendor/bin/ecs directly — use the wrapper.phpstan-baseline.neon — it's auto-managed.tsc --noEmit) for TypeScript projects.--write if the intent is to fix (otherwise it's dry-run only).Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
event4u-app/agent-config
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
event4u-app/agent-config
Use BEFORE editing shared code — enumerates every call site, event consumer, queue worker, API client, migration, and test that a planned change will touch, with a file:line citation per dependency.
event4u-app/agent-config
Use when the user shares a Sentry error, Jira bug ticket, or error description and wants root cause analysis. Also for proactive bug hunting and code audits for hidden bugs.