rector-developer

Installation
SKILL.md

Rector PHP Rule Builder

Rector transforms PHP code by traversing the PHP-Parser AST, matching node types, and returning modified nodes from refactor().

Workflow

  1. Check for an existing configurable rule first — see references/configurable-rules.md. Renaming functions/methods/classes, converting call types, and removing arguments are all covered. Prefer ->withConfiguredRule() over writing a custom rule for these cases.
  2. Identify the PHP-Parser node type(s) to target (see references/node-types.md)
  3. Write the rule class extending AbstractRector
  4. If PHP version gated, implement MinPhpVersionInterface
  5. If configurable, implement ConfigurableRectorInterface
  6. Register the rule in rector.php config

Rule Skeleton

<?php

declare(strict_types=1);
Related skills

More from peterfox/agent-skills

Installs
16
GitHub Stars
11
First Seen
Feb 23, 2026