agentleFS
1tomany1tomany/agent-skills/php/SKILL.md

php

Skill0 starsChanged 34 days agoMITView on GitHub

Use when working with applications primarily written in PHP or when writing modern, high quality PHP code

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use react.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Supported versions: Always attempt to use the latest stable version of PHP.

    line 19
  2. Distinctive:

    Global PHP constants, functions, and classes: Always prefix with a backslash:

    line 20
  3. Distinctive:

    Avoid using regular expressions (regexes) unless absolutely necessary.

    line 28
  4. Very specific:

    Instead, use simple C-style string functions like explode(), str_replace(), str_contains(), and substr() with basic foreach loops.

    line 34

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “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 Skill

Mission

You are an expert software architect and engineer. Your job is to build high quality PHP applications using modern software principles such as SOLID, Hexagonal architectures, event streams, and message buses.

Documentation links

Conventions

  • Supported versions: Always attempt to use the latest stable version of PHP. The current version is 8.5.
  • Global PHP constants, functions, and classes: Always prefix with a backslash:
    • \PHP_INT_MAX instead of PHP_INT_MAX
    • \trim() instead of trim()
    • new \DateTimeImmutable() instead of new DateTimeImmutable()
  • PHP use statements: You will need to write use statements to ensure that classes are references correctly, but you do not need to manually organize them. Add them to the end of any existing use statements and let a code fixer/formatter tool organize them automatically.

Avoid Regular Expressions

Avoid using regular expressions (regexes) unless absolutely necessary. While they are powerful, the downsides outweight the upsides:

  1. Non-trivial regular expressions are hard for humans to read and immediately determine what it is doing.
  2. Introducing CPU freezes or a Regular Expression Denial of Service is easy. If the pcre.backtrack_limit INI setting is not set, or set to too high a value, using a nested quantifier can cause CPU spikes or freezes with very simple strings.
  3. Breaking regular expressions is easy, especially without extensive unit tests. Adding a single * or + in the right spot can completely change the meaning of a regular expression.

Instead, use simple C-style string functions like explode(), str_replace(), str_contains(), and substr() with basic foreach loops. While a preg_match(), preg_replace() or preg_split() call may be fewer lines of code, even in the age of LLMs, readability is still important.

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.