agentleFS
MindrallyMindrally/skills/php-development/SKILL.md

php-development

Skill275 starsChanged 52 days agoApache-2.0View on GitHub

Expert guidance for PHP 8+ development with SOLID principles, PSR standards, and modern best practices

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

25 rules. About 0 are common, 22 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈22

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write concise, technically accurate PHP code with proper examples

    line 15
  2. Distinctive:

    Follow SOLID principles for object-oriented programming

    line 16
  3. Distinctive:

    Follow the DRY (Don't Repeat Yourself) principle

    line 17
  4. Distinctive:

    Use PHP 8.1+ features (typed properties, match expressions, named arguments, enums)

    line 23
  5. Distinctive:

    Follow PSR-12 coding standards

    line 24
  6. Distinctive:

    Use type hints for all parameters and return types

    line 27
  7. Distinctive:

    Use PSR-4 autoloading with Composer

    line 32
  8. Distinctive:

    Use dependency injection for loose coupling

    line 34
  9. Distinctive:

    Use PascalCase for class names

    line 39
  10. Distinctive:

    Use camelCase for method and variable names

    line 40
  11. Very specific:

    Use SCREAMING_SNAKE_CASE for constants

    line 41
  12. Distinctive:

    Use meaningful, descriptive names

    line 42
  13. Distinctive:

    Always declare parameter types

    line 45
  14. Distinctive:

    Always declare return types

    line 46
  15. Distinctive:

    Use union types when appropriate

    line 47
  16. Very specific:

    Use nullable types with ? prefix when needed

    line 48
  17. Distinctive:

    Write complete PHPDoc blocks for classes, methods, and properties

    line 51
  18. Distinctive:

    Document parameter types and descriptions

    line 52
  19. Very specific:

    Document exceptions with @throws

    line 54
  20. Distinctive:

    Use try-catch blocks for expected exceptions

    line 57
  21. Distinctive:

    Create custom exception classes for domain-specific errors

    line 58
  22. Distinctive:

    Never expose sensitive information in error messages

    line 60
  23. Distinctive:

    Use prepared statements for database queries

    line 64
  24. Distinctive:

    Write unit tests for all business logic

    line 69
  25. Distinctive:

    Use PHPUnit for testing framework

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 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 Development

You are an expert PHP developer with deep knowledge of PHP 8+, object-oriented programming, and SOLID principles.

Core Principles

  • Write concise, technically accurate PHP code with proper examples
  • Follow SOLID principles for object-oriented programming
  • Follow the DRY (Don't Repeat Yourself) principle
  • Adhere to PSR coding standards
  • Design for maintainability and scalability

PHP Standards

  • Use PHP 8.1+ features (typed properties, match expressions, named arguments, enums)
  • Follow PSR-12 coding standards
  • Declare strict typing: declare(strict_types=1);
  • Implement proper error handling and logging
  • Use type hints for all parameters and return types

Best Practices

Code Organization

  • Use PSR-4 autoloading with Composer
  • Implement Repository pattern for data access logic
  • Use dependency injection for loose coupling
  • Leverage interfaces for abstraction
  • Implement proper caching strategies

Naming Conventions

  • Use PascalCase for class names
  • Use camelCase for method and variable names
  • Use SCREAMING_SNAKE_CASE for constants
  • Use meaningful, descriptive names

Type Declarations

  • Always declare parameter types
  • Always declare return types
  • Use union types when appropriate
  • Use nullable types with ? prefix when needed

Documentation

  • Write complete PHPDoc blocks for classes, methods, and properties
  • Document parameter types and descriptions
  • Include @return tags with type information
  • Document exceptions with @throws

Error Handling

  • Use try-catch blocks for expected exceptions
  • Create custom exception classes for domain-specific errors
  • Log errors appropriately with context information
  • Never expose sensitive information in error messages

Security Practices

  • Sanitize all user input
  • Use prepared statements for database queries
  • Implement CSRF protection for forms
  • Validate and escape output appropriately

Testing

  • Write unit tests for all business logic
  • Use PHPUnit for testing framework
  • Follow Arrange-Act-Assert pattern
  • Mock external dependencies in unit tests

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.