php-structured-edit

Installation
SKILL.md

PHP Structured Edit

Use normal repository discovery to find the intended code. This skill controls mutation only.

Workflow

  1. Locate the relevant PHP code using the normal search tools.
  2. Run scripts/php-ast-edit inspect at a byte offset or line/column inside the target syntax.
  3. Choose the narrowest useful AST node from the returned ancestry.
  4. Send all edits for one file in a single apply transaction when practical. Include the SHA-256 returned by inspect; later edits fail if an earlier edit detached their target node.
  5. Use compact syntactically valid PHP snippets. Do not spend tokens formatting snippets; the printer canonicalizes output.
  6. Run the project's formatter and normal validation after the AST transaction.

Do not use raw text replacement for syntactic PHP. For foreign code stored inside a PHP string, target the Scalar_String node and use set_string unless a dedicated nested-language editor is available.

Commands

Installs
1
First Seen
1 day ago
php-structured-edit — netresearch/php-ast-edit-skill