agentleFS
JetBrainsKnown publisherJetBrains/phpstorm-claude-marketplace/skills/upgrade-php/SKILL.md

upgrade-php

Skill34 starsChanged 9 months agoMITView on GitHub

PHP Upgrade Assistant. Use when upgrading PHP version, fixing deprecations for a target PHP version, or scanning for PHP compatibility issues.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Phaedra-Solutions/cursor-rules★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Enter: when the user asks to:

    line 13
  2. Distinctive:

    Exit: when all identified issues are resolved/triaged, or the user cancels.

    line 17
  3. Distinctive:

    Ask the user for the target PHP version if not already stated.

    line 23
  4. Very specific:

    If no packages are returned, warn: *"No composer.json found.

    line 41
  5. Very specific:

    Look for "require": { "php": "..." } and config.platform.php.

    line 49
  6. Very specific:

    Pattern syntax: Use $name$ for template variables (e.g., $a$->$b$() matches any method call on any object).

    line 95
  7. Distinctive:

    After all fixes in a file, re-scan it to verify fixes took effect:

    line 131
  8. Distinctive:

    If re-scan shows new issues, attempt to fix (max 3 iterations per file).

    line 135
  9. Very specific:

    When quickFixes is empty:

    line 139
  10. Very specific:

    Read the problem description — it usually names the replacement.

    line 141
  11. Very specific:

    Read the file context with get_file_text_by_path.

    line 142
  12. Very specific:

    If no replacement is documented, add a // TODO: PHP <target> - <description> comment and include in the "Remaining" report.

    line 153
  13. Distinctive:

    After code fixes, update the PHP version constraint:

    line 158
  14. Distinctive:

    Check for available test configurations:

    line 179

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PHP Upgrade Assistant

Helps upgrade a PHP project to a target PHP version by scanning for deprecations, reporting issues, applying automated fixes after confirmation, and verifying the result.

Activation and exit

  • Enter when the user asks to:
    • Upgrade to a specific PHP version (e.g., "upgrade to PHP 8.4")
    • Fix PHP deprecations or compatibility issues
    • Scan for PHP version-related problems
  • Exit when all identified issues are resolved/triaged, or the user cancels.

Phase 1: Pre-check

1. Confirm target version

Ask the user for the target PHP version if not already stated.

2. Detect current PHP configuration

get_php_project_config()

This returns the configured PHP language level, interpreter details (name, path, local/remote), and runtime information (exact version, loaded extensions, debuggers). Use it to determine the current PHP version the project is targeting.

3. Check Composer project

get_composer_dependencies()

If no packages are returned, warn: "No composer.json found. Proceeding with code-only scan."

4. Confirm PHP version constraint

get_file_text_by_path(pathInProject: "composer.json")

Look for "require": { "php": "..." } and config.platform.php. Report to the user: Current: PHP >=X.Y → Target: PHP Z.W

Phase 2: Discovery (Scan)

Scan the project to build a complete issue inventory. Do not fix anything yet.

Step 1: Find PHP files

find_files_by_glob(globPattern: "**/*.php")

Exclude vendor/ from scanning. For large projects (>200 files), scan src/, app/ first, then tests/ separately.

Step 2: Run deprecation inspections on each file

get_inspections(
  filePath: "<relative-path>",
  minSeverity: "WEAK_WARNING"
)

Common deprecation-related problems will have descriptions mentioning:

  • Deprecated function/method usage
  • PHP version-specific language level issues
  • Deprecated string interpolation syntax (${})
  • Deprecated partially-supported callables
  • Deprecated implode() argument order
  • Deprecated serializable usage
  • Deprecated cast expressions

Step 3: Supplementary structural search (optional)

For patterns inspections may miss, use structural search:

# Dynamic properties (deprecated in PHP 8.2)
search_structural(
  pattern: "$obj$->$prop$ = $val$",
  fileType: "PHP",
  maxResults: 50
)

Pattern syntax: Use $name$ for template variables (e.g., $a$->$b$() matches any method call on any object). Use $a${2,5} for count constraints, $a$+ for one-or-more, $a$* for zero-or-more.

Step 4: Build and present inventory

Categorize all discovered issues:

PriorityCategoryCountAuto-fixable
P0Errors (breaking in target version)NY/N
P1Deprecations (removed in target)NY/N
P2Deprecations (warned in target)NY/N

Present this table to the user. Wait for explicit confirmation before proceeding to fixes.

Phase 3: Fix

Apply fixes only after user confirmation. Process in priority order: P0 → P1 → P2.

Auto-fixes (quick fix available)

For each problem where quickFixes is non-empty:

apply_quick_fix(
  filePath: "<path>",
  line: <line>,
  column: <column>,
  quickFixName: "<quickFixes[0].name>"
)

Strategy:

  1. Process one file at a time — apply all fixes for that file before moving on.
  2. After all fixes in a file, re-scan it to verify fixes took effect:
    get_inspections(filePath: "<path>", minSeverity: "WEAK_WARNING")
  3. If re-scan shows new issues, attempt to fix (max 3 iterations per file).

Manual fixes (no quick fix available)

When quickFixes is empty:

  1. Read the problem description — it usually names the replacement.
  2. Read the file context with get_file_text_by_path.
  3. Apply the fix with replace_text_in_file.

Common manual fix patterns:

DeprecationBeforeAfter
Implicitly nullable params (8.4)function f(Type $p = null)function f(?Type $p = null)
${} interpolation (8.2)"Hello ${name}""Hello {$name}"
Partially-supported callables (8.2)$c = "self::method"$c = self::method(...)

If no replacement is documented, add a // TODO: PHP <target> - <description> comment and include in the "Remaining" report.

Update composer.json

After code fixes, update the PHP version constraint:

replace_text_in_file(
  pathInProject: "composer.json",
  oldText: "\"php\": \">=8.1\"",
  newText: "\"php\": \">=8.4\""
)

Do NOT run composer update automatically. Advise the user to run it manually.

Phase 4: Verify

1. Re-scan modified files

Re-run get_inspections on all modified files with minSeverity: "WEAK_WARNING". Confirm zero remaining deprecation issues.

2. Suggest test run

Check for available test configurations:

get_run_configurations()

Suggest the user run their test suite. Do not execute tests automatically unless the user explicitly asks.

3. Final report

PHP Upgrade Summary: X.Y → Z.W
────────────────────────────────
Files scanned:    N
Issues found:     M
Auto-fixed:       A
Manually fixed:   B
Remaining:        C (needs manual review)
composer.json:    Updated / Not updated

Next steps:
1. Run `composer update` to validate dependency compatibility
2. Run your test suite
3. Review files listed under "Remaining"

Edge cases

CaseHandling
No quick fix availableApply manual fix or add TODO comment
Breaking changes (P0)Fix these first — code will fail at runtime
Inspection timeoutRe-run with longer timeout or narrow to subdirectory
Large project (>500 files)Scan in batches of 50; offer to scope to specific directories
Multiple composer.jsonAsk user which sub-project to upgrade

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.