Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

install-php-fixer

БесплатноБез исполняемых скриптовНе проверен

Install DressCode, globally or into a project with PHPStan, for automatic PHP code style fixing

netteот nette★ 47 звёзд на GitHub

Об этом скилле

Install DressCode

Install the dresscode/dresscode package for automatic PHP code style fixing after supported edits.

Use this skill only when explicitly requested. Run commands with the client's available shell tool and ask questions through its available question tool or chat. In Codex, the plugin's hooks must also be reviewed and trusted via /hooks before automatic fixing runs. Hooks cover Claude Code Edit/Write and Codex apply_patch, not edits made through shell commands.


Step 0: Pre-flight Checks

  1. Check PHP availability (requires PHP 8.4+)

    php --version
    
    • If fails or version < 8.4: Stop and inform user.
  2. Check Composer availability

    composer --version
    
  3. Detect existing installation: composer global show dresscode/dresscode, and vendor/bin/dresscode in the project.

    • If already installed: Inform user and ask if they want to update (same install command updates to latest). A version older than 1.3 must be updated, the hook needs it.
  4. Detect the old fixer: composer global show nette/coding-standard.

    • If installed: the user comes from version 1 of the plugin, whose global installation conflicts with DressCode. Follow the migrate-to-dresscode skill instead of this one.

Step 1: Installation

DressCode goes globally by default, together with PHPStan, from which it takes the types of the code. When the current project has PHPStan (phpstan/phpstan in require or require-dev of its composer.json), recommend installing it into the project instead, so that it uses the project's PHPStan and its extensions. Let the user choose.

  • Globally:
    composer global require dresscode/dresscode:^1.3 phpstan/phpstan
    
  • Into the project, in its root:
    composer require --dev dresscode/dresscode:^1.3
    

Step 2: Verification

For a project installation, run php vendor/bin/dresscode --version in the project root. For the global one, run dresscode from the Composer global bin directory:

# Bash
php "$(composer global config home)/vendor/bin/dresscode" --version
# PowerShell
$composerDir = composer global config home
php "$composerDir/vendor/bin/dresscode" --version

The fix-php-style hook finds dresscode automatically, in the project's vendor/bin first and in the Composer home directory otherwise – PATH configuration is not needed. The project's copy wins, so its configuration may name extensions the global installation does not have.

If verification succeeds, confirm to the user that DressCode is installed and the fix-php-style hook will automatically fix code style after editing PHP files: by the project's dresscode.neon (or dresscode.php) when there is one, by the Nette coding standard otherwise.


Step 3: Configuration

When the current project has no dresscode.neon or dresscode.php (nor a .dist variant) in its root, offer to create dresscode.neon there. Without it the hook uses the Nette coding standard without the types of the code. Only if the user agrees, write:

use: nette

paths:
	- app
	- tests

typeAnalysis: phpstan

paths lists the directories with the project's PHP code; take them from the autoload and autoload-dev sections of composer.json plus the tests directory, and list only those that exist. When the tests are .phpt files (Nette Tester), add fileExtensions: [php, phpt]. typeAnalysis: phpstan needs PHPStan beside DressCode, which Step 1 installed.


Step 4: GitHub Star (Optional)

  1. Check if gh CLI is available

    gh --version
    
    • If not available: Skip this step entirely (don't ask the user)
  2. If gh is available, ask the user:

    • Question: "Would you like to support these projects with a GitHub star?"
    • Options: "Yes, I'd love to!" / "No, thanks"
  3. Only if user explicitly says yes, run:

    gh api -X PUT /user/starred/dg/dresscode
    gh api -X PUT /user/starred/nette/agent-plugins
    

Troubleshooting

Permission denied during installation

  • Unix: Fix ownership of Composer home: sudo chown -R $(whoami) "$(composer global config home)"
  • Windows: Run terminal as Administrator
Полный SKILL.md на GitHub

Установить install-php-fixer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash
Read
Write
AskUserQuestion

Вложенные файлы

agents/openai.yaml

FAQ

Что делает скилл install-php-fixer?

Install DressCode, globally or into a project with PHPStan, for automatic PHP code style fixing

Как установить скилл install-php-fixer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл install-php-fixer запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить install-php-fixer с