php-core-developer
A Claude Code plugin for working on the PHP language core (php/php-src).
Three workflows: bug fixing, idea prototyping, and code review. Every task is captured in a living document (SPEC.md for bugs and ideas, REVIEW.md for reviews) under .claude/php-core-dev/<slug>/ inside your php-src checkout, so work is stoppable mid-flow and resumable from exactly where the last invocation left off.
Quickstart
# 1. One-time install in Claude Code:
/plugin marketplace add /path/to/php-src-developer
/plugin install php-core-developer
# 2. In a terminal, go to your php-src checkout and cut a branch:
cd ~/projects/php-src
git checkout -b fix/gh-12345 master # name the branch after the task
# 3. Launch Claude Code from there:
claude
Then drive the workflow with prompts:
| You want to… | First prompt |
|---|
| Fix a bug | Fix php-src issue GH-12345 |
| Prototype an idea | /idea-prototype "caching common zend_string parameter names could speed up function calls" |
| Review your local diff | /review-local |
| Review a GitHub PR | /review-pr 12345 |
Prerequisites: the plugin runs inside a php-src checkout (any subdirectory works — the plugin walks up to find the root). Recommended before first use:
cd ~/projects/php-src
./buildconf && ./configure --enable-debug && make -j$(nproc)
gh auth login # for /bug-context, /research, /review-pr
Workflows
Bug fix — /bug-context → /research → /bug-reproduce-test → /bug-fix → /bug-verify
cd ~/projects/php-src
git checkout -b fix/gh-12345 master
claude
In Claude Code:
| Step | Slash command | What it does |
|---|
| 1 | /bug-context 12345 | Fetches the GH issue with gh issue view, writes Context phase of SPEC.md, stubs out the remaining phases. |
| 2 | /research | Sweeps prior discussion across four sources: php.internals (via externals.io Algolia), gh issue list, gh pr list, git log --grep. Populates Research phase with synthesised findings. Soft-gated — downstream steps warn if skipped, never block. |
| 3 | /bug-reproduce-test | Writes a minimal repro.php, converts it into a .phpt test under tests/..., runs run-tests.php, asserts FAIL (post-guardrail). Stages the test (git add) — does not commit yet. |
| 4 | /bug-fix | Pins the root cause in C code (consulting Research findings), plans the change, implements it, rebuilds, asserts the .phpt now PASSES. Commits test + fix as one commit (Fix GH-NNNNN: <subject>) on the current branch. |
| 5 | /bug-verify | Runs the related test directory + checks for new compiler warnings. Marks the task done. |
Close the terminal at any point. Re-open it, cd back to the checkout, and run the next prompt (or re-run the last) — the skill reads SPEC.md from .claude/php-core-dev/gh-12345/, finds the first non-done phase, and continues.
Idea prototype — /idea-prototype "<one-line hypothesis>"
cd ~/projects/php-src
git checkout -b idea/zstring-cache master
claude
/idea-prototype "caching common zend_string parameter names could speed up function calls"
One skill that walks the hypothesis through six phases: Context → Hypothesis & Metric → Research → Survey & Plan → Prototype → Measurement & Verdict. Re-run /idea-prototype (no argument) to advance to the next phase. When the next phase is Research, run /research instead (it owns that phase across both bug and idea flows). The metric must be falsifiable — the skill refuses fuzzy hypotheses ("it'll be faster") at the Hypothesis & Metric guardrail.
End state: SPEC.md with a verdict of pursue-as-rfc / reframe / kill, plus the prototype patch and the benchmark or example evidence. Commits land at the end of Prototype and Measurement phases.
Code review (local) — /review-local [base-ref]
cd ~/projects/php-src
git checkout my-fix-branch
claude
/review-local
Defaults to git merge-base HEAD origin/master. Override with /review-local PHP-8.3 or a SHA. Writes REVIEW.md with severity-graded findings (Blocker / Major / Minor / Nit) anchored to path:line. Read-only against the source tree.
Code review (GitHub PR) — /review-pr <pr-number>
/review-pr 12345