Download the PHP package typedduck/consult-rector without Composer

On this page you can find all versions of the php package typedduck/consult-rector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package consult-rector

consult-rector

Refactor PHP by telling your AI agent what you want changed — it picks the Rector rule (or composes a custom AST transform), shows you the diff, and applies it only once you approve. consult-rector is an Agent Skill plus the CLI it drives. Edits are AST transforms, never text munging.

Talk to your agent, not to a config file

You do not hand-write rector.php or memorise rule FQCNs. You say what you want, in plain language, to a coding agent that has the skill (Claude Code, Cursor, …):

Convert the one-line closures in src/ to arrow functions.

The skill takes it from there: it searches the installed Rector rules, runs a dry-run, shows you the diff, and — only after you approve — applies it. Every step is the consult-rector CLI returning structured JSON the agent reads; you stay in the review-and-approve seat.

It works in your language — the request is just natural language:

src/ の中の、1 行で値を返すクロージャを全部アロー関数にして。

The flagship: a breaking change, propagated and verified

Changing a declaration and chasing every call site by hand is where refactors go wrong. Describe the intent instead:

Order::setStatus(string $status)Status enum を受け取るように変えて、 'paid''shipped' を渡している呼び出し側も対応する enum ケースに直して。

The skill (1) changes the declaration, (2) rewrites the call-site literals to enum cases — the AST pass alone knows which case each literal becomes — and (3) runs PHPStan as a completeness oracle: the error delta against a pre-change baseline enumerates any site it could not reach, so nothing is silently missed (see docs/adr/0004-*).

Install

consult-rector is a Composer package; the agent drives its CLI, so install it in the project you want to refactor:

That brings the consult-rector binary, the skill instructions (SKILL.md), the MCP server, and the bundled rule references — a skill-aware agent discovers the skill from there. To drop the skill straight into any agent's skill directory, use vercel-labs/skills:

Requirements: PHP 8.2+ and rector/rector ^2.5 (installed as a dependency).

What you can ask for

The agent finds the right rule through references/rectors-by-category.md, a recipe book, or consult-rector search; you only describe the goal.

Under the hood — the CLI the agent drives

You rarely type these yourself; the skill does. They exist so the loop stays reviewable and scriptable:

Command What the agent uses it for
search <keyword> find an installed Rector rule
dry-run <path> --rules=FQCN propose changes (JSON) without writing files
apply <path> --rules=FQCN rewrite files (--verify runs the PHPStan oracle)
ast <path> '<dsl-json>' a custom AST transform (dry-run by default; --apply)
doc index\|section <file> page through the large rule references
phpstan <path> [--baseline=…] the completeness oracle: all errors, or the delta

An MCP server (consult-rector-mcp) exposes the same operations as rector_* tools over stdio for MCP-native clients.

Development

bamarni/composer-bin-plugin isolates the dev tooling under .vendor-bin/:

Design decisions live in docs/adr/; the domain glossary is CONTEXT.md.

License

MPL-2.0.


All versions of consult-rector with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-json Version *
mcp/sdk Version ^0.6
rector/rector Version ^2.5
symfony/console Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package typedduck/consult-rector contains the following files

Loading the files please wait ...