/php:php-refactoringfrom php
Provides PHP/Symfony-specific examples for cross-language refactoring rules, covering business flow tracing, consumer-driven value objects, and import coupling signals.
Ships in php. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The rules are defined in
craft:refactoring-principles(cross-language). This skill provides PHP / Symfony examples only. Load both for the full picture.
// ❌ AVOID — refactoring a controller without understanding the full flow
$uploadFile = new UploadFile($content, $fileName);
// ...but UploadFile is also created in downloadExistingFiles() with
// different data. Two inconsistent creation paths.
//
// Sources you must identify BEFORE refactoring:
// - form upload: UploadedFile (Symfony) → UploadFile
// - API download: binary content → UploadFile
//
// → The abstraction must unify both sources.
// ❌ AVOID — VO defined only from its creation point
final readonly class UploadFile
{
public function __construct(
public string $content,
public string $originalFileName,
) {}
}
// Later, a consumer needs the file type → external mapping required.
// repository->upload($file, $request)
// uses $file->content, $file->originalFileName, $request->fileType
// → fileType comes from the file itself, NOT the request.
// ✅ CORRECT — include FileTypeEnum because a consumer needs it
final readonly class UploadFile
{
public function __construct(
public FileTypeEnum $type,
public string $content,
public string $originalFileName,
) {}
}
// ❌ AVOID — controller importing a form-internal type
use Symfony\Component\HttpFoundation\File\UploadedFile;
// The controller manipulates UploadedFile (form-internal) instead of
// model objects. The import betrays a leaking abstraction.
// ✅ CORRECT — the controller imports a model
use App\Model\UploadFile;
// The controller only manipulates model objects.
// UploadedFile → UploadFile conversion happens in the FormType
// (via a DataTransformer).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/php-8-0ACTIVATE when calling a constructor, method or function with four or more arguments in a PHP 8.0+ project — value objects, contract requests, factories, projections, test fixtures. Covers: mandatory named arguments from the fourth argument on. DO NOT use for: calls of three arguments or fewer, PHP 8.1 features (see php-8-1), PHP 8.2 features (see php-8-2), PHP 8.3 features (see php-8-3)./php-8-1ACTIVATE when passing a method as a callback in a PHP 8.1+ project — event listeners, validator callbacks, Twig functions, array_map/usort callables. Covers: mandatory first-class callable syntax (`$this` method reference with `(...)`) over array/string callables. DO NOT use for: general PHP syntax, PHP 8.2 features (see php-8-2), PHP 8.3 features (see php-8-3)./php-Other plugins' skills for the same job
npx claudepluginhub fabiensalles/claude-marketplace --plugin php