php-auto-fixer
CRITICAL: Read BEFORE writing or modifying any PHP file. A PostToolUse hook automatically runs nette/coding-standard (ECS) on every PHP file after each Edit or Write. The fixer removes unused `use` statements - so never add `use` statements in a separate edit before the code that references them. Always include `use` imports in the same edit as the referencing code, or add the code first then `use` statements. This skill should be used whenever creating new PHP files, editing existing PHP code, adding methods, refactoring, or fixing bugs in PHP - even for small one-line changes.
What this skill does
# PHP Auto-Fixer
A PostToolUse hook runs `ecs fix` on every PHP file after each Edit or Write operation. The file is automatically reformatted and cleaned up - no manual formatting needed.
## Editing Order for `use` Statements
The fixer removes any `use` statement not referenced in the file. This creates a timing trap between consecutive edits:
1. Edit adds `use App\Model\Foo;`
2. Hook runs → `Foo` is not used anywhere → **removes the `use` statement**
3. Next Edit adds code using `Foo` → **fails because the `use` is gone**
### The Rule
Always add `use` statements in the same Edit as the code that references them. Alternatively, add the code first, then add the `use` statement in a follow-up edit.
Never add `use` statements alone in a separate Edit - they will be removed before the next edit adds the referencing code.
### Safe Patterns
**Single edit with both `use` and code** (preferred):
```php
use App\Model\UserRepository;
public function getUsers(UserRepository $repo): array
{
return $repo->findAll();
}
```
**Code first, `use` second** (also safe):
1. First Edit: add the method body referencing `UserRepository`
2. Second Edit: add `use App\Model\UserRepository;` - now it's referenced, fixer keeps it
**`use` first, code second** (broken):
1. First Edit: add `use App\Model\UserRepository;` - fixer removes this immediately
2. Second Edit: add method body - `UserRepository` undefined
### Multiple Classes in One Edit
When adding code that references several new classes, include all their `use` statements in the same edit. Do not split `use` statements and code across separate edits.
## What the Fixer Does
- Removes unused `use` statements
- Sorts `use` statements alphabetically
- Fixes indentation, spacing, and line breaks
- Enforces PSR-12 with Nette modifications (e.g., no space before parentheses in arrow functions)
Do not manually fix formatting - the fixer handles it automatically after every edit.
## What Not to Do
- Do not remove `use` statements manually - the fixer handles unused imports
- Do not sort `use` statements manually - the fixer sorts them
- Do not fix whitespace or indentation manually - the fixer fixes it
## When the Fixer Reports Errors
The hook exits with an error when ECS cannot auto-fix all issues. Common causes:
- **PHP syntax error** in the file - fix the syntax first, fixer will run again on the next edit
- **Conflicting rules** - rare, usually resolved by re-running (edit the file again)
## Installation
If the fixer is not installed, run `/php-fixer:install-php-fixer`.
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.