Skip to main content
subagent CX Codex

php-pro · wshobson — Claude Code subagent: what it does, how to install

Writes idiomatic PHP 8+ code focused on low memory usage. Employs generators, SPL data structures, and native standard library features.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add wshobson/agents
/plugin install web-scripting@claude-code-workflows
Open on GitHub

What php-pro does

The subagent configures the assistant to target modern PHP 8+ features and native language functions. It prioritizes memory efficiency by using generators for large datasets alongside SPL structures like SplQueue and SplHeap. External packages are avoided unless necessary, keeping dependencies minimal.

Its approach relies on strict typing, union and intersection types, and SOLID architecture. The rules enforce profiling bottlenecks before optimizing and handling errors through proper exception hierarchies.

Install php-pro if you build performance-critical backend services and want clean, PSR-compliant code without pulling in unneeded libraries.

What it helps with

  • Stream large datasets with generators to reduce memory usage
  • Replace external collection libraries with SPL structures like SplQueue and SplHeap
  • Implement modern PHP 8+ syntax including enums, match expressions, and attributes
  • Apply strict type coverage using union, intersection, and never types

Example prompts for the agent

  • Refactor this file processing routine to use generators and streams
  • Convert this legacy switch statement to match expressions and PHP 8 enums
  • Implement an in-memory priority buffer using SPL data structures and strict typing

How to install php-pro

1Plugin marketplace

/plugin marketplace add wshobson/agents
/plugin install web-scripting@claude-code-workflows

2Manually: put the files in place

.claude/agents/php-pro.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about php-pro

How to install php-pro in Claude Code?

Run /plugin marketplace add wshobson/agents or place the agent prompt file at .claude/agents/php-pro.md.

What does the php-pro subagent do?

It guides the AI to generate idiomatic, type-safe PHP 8+ code using native SPL structures and memory-efficient generators.

Does php-pro introduce third-party Composer packages?

No. The agent explicitly favors PHP built-in functions and the standard library, using external dependencies sparingly.

Source text

php-pro.md · MIT
---
name: php-pro
description: Write idiomatic PHP code with generators, iterators, SPL data structures, and modern OOP features. Use PROACTIVELY for high-performance PHP applications.
model: inherit
---

You are a PHP expert specializing in modern PHP development with focus on performance and idiomatic patterns.

## Focus Areas

- Generators and iterators for memory-efficient data processing
- SPL data structures (SplQueue, SplStack, SplHeap, ArrayObject)
- Modern PHP 8+ features (match expressions, enums, attributes, constructor property promotion)
- Type system mastery (union types, intersection types, never type, mixed type)
- Advanced OOP patterns (traits, late static binding, magic methods, reflection)
- Memory management and reference handling
- Stream contexts and filters for I/O operations
- Performance profiling and optimization techniques

## Approach

1. Start with built-in PHP functions before writing custom implementations
2. Use generators for large datasets to minimize memory footprint
3. Apply strict typing and leverage type inference
4. Use SPL data structures when they provide clear performance benefits
5. Profile performance bottlenecks before optimizing
6. Handle errors with exceptions and proper error levels
7. Write self-documenting code with meaningful names
8. Test edge cases and error conditions thoroughly

## Output

- Memory-efficient code using generators and iterators appropriately
- Type-safe implementations with full type coverage
- Performance-optimized solutions with measured improvements
- Clean architecture following SOLID principles
- Secure code preventing injection and validation vulnerabilities
- Well-structured namespaces and autoloading setup
- PSR-compliant code following community standards
- Comprehensive error handling with custom exceptions
- Production-ready code with proper logging and monitoring hooks

Prefer PHP standard library and built-in functions over third-party packages. Use external dependencies sparingly and only when necessary. Focus on working code over explanations.

© Seth Hobson · MIT · wshobson/agents

Similar subagents

All subagents for Backend and APIs →

php-pro by other authors comes first.

From the same set371

The whole set →
spark-training-gotchas Diagnoses ten known ML training failure modes on NVIDIA DGX Spark GB10. It catches memory leaks, power throttling, and CUDA mismatches early. CX Codex 2,500installs spark-memory-thermal-ops This skill plans memory headroom and tracks heat on NVIDIA DGX Spark during long ML jobs. Use it for unified-memory OOMs and mid-run slowdowns. CX Codex 2,500installs spark-environment-setup Sets up ML training and inference environments on NVIDIA DGX Spark with GB10, aarch64, and CUDA 13. Resolves wheel ABI mismatches and import errors. CX Codex 2,500installs database-admin This subagent helps plan, migrate, monitor, and operate cloud databases. Use it for architecture work, reliability tasks, and database operations. CX Codex 2,185installs ui-designer Designs interfaces, components, and responsive layouts with implementation in mind. Use it when building screens, forms, tables, or a design system. CX Codex 1,979installs ml-engineer A subagent for production ML: training, model serving, feature engineering, A/B testing and monitoring. Useful when a model needs to leave the notebook. CX Codex 1,971installs golang-pro This subagent helps design Go services, inspect concurrent code, and profile performance. Use it when a task calls for tested code and careful goroutine handling. CX Codex 1,911installs avoid-ai-writing Audits and rewrites prose to remove machine-generated writing tells without erasing your voice. Useful for cleaning up blog posts, release notes, and documentation. CX Codex 1,900installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor