[AI] Add compilation and debugging skills for PHP.wasm#3445
Open
[AI] Add compilation and debugging skills for PHP.wasm#3445
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds dedicated AI “skills” documentation for compiling and debugging PHP.wasm (main module + side modules), and trims the root agent docs to reference these skills instead of duplicating detailed instructions.
Changes:
- Added three new skill docs under
.agents/skills/for PHP.wasm compilation and debugging workflows. - Moved (and consolidated) PHP recompilation/debugging guidance out of
AGENTS.mdinto the new skills. - Updated
AGENTS.mdto point contributors/agents to the relevant skill names.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| AGENTS.md | Removes detailed PHP recompilation/debug snippets and replaces them with pointers to the new skills. |
| .agents/skills/compile-php-wasm/SKILL.md | New reference covering PHP.wasm compilation pipeline, flags, cache busting, and inspection tooling. |
| .agents/skills/debug-php-wasm-main-module/SKILL.md | New reference for interpreting/diagnosing main-module Asyncify/JSPI/memory issues and test gotchas. |
| .agents/skills/debug-php-wasm-side-modules/SKILL.md | New reference for diagnosing dynamic extension (SIDE_MODULE) loading and JSPI/Asyncify pitfalls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bgrgicak
reviewed
Apr 7, 2026
Comment on lines
+24
to
+28
| # Debug build (DWARF info) | ||
| npx nx recompile-php:all php-wasm-node -- --WITH_DEBUG=yes | ||
|
|
||
| # Source maps | ||
| npx nx recompile-php:all php-wasm-node -- --WITH_SOURCEMAPS=yes |
Collaborator
There was a problem hiding this comment.
Should we mention when to use these?
Collaborator
Author
There was a problem hiding this comment.
Yes! You're, right I added comments, thank you for your review @bgrgicak
bgrgicak
reviewed
Apr 7, 2026
Co-authored-by: Bero <berislav.grgicak@gmail.com>
576cfa9 to
1acc4ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for the change, related issues
Working with PHP.wasm compilation and debugging requires deep knowledge of Emscripten flags, Asyncify/JSPI mechanics, dynamic linking, and WASM-specific error patterns. This knowledge was previously scattered or undocumented, making it difficult for AI agents to efficiently diagnose and fix PHP.wasm issues.
These three skills codify the patterns discovered through extensive debugging work across dynamic extension loading , Emscripten upgrades, WASM memory growth bugs, and Asyncify crash resolution.
Implementation details
Adds three new Claude Code skills in .agents/skills/:
compile-php-wasm: Reference for compiling PHP.wasm main modules and side modules. Covers the build pipeline, Emscripten flags,MAIN_MODULElinking gotchas, side module compilation withlibtoolworkarounds, Emscriptenversion upgrade checklist, cache busting, and WASM binary inspection.
debug-php-wasm-main-module: Reference for debugging crashes in the main PHP.wasm binary. Covers Asyncify error interpretation, step-by-step Asyncify crash debugging strategy, JSPI suspension errors, WASM memory growth bugs, PHP startup lifecycle, WASM-JS boundary tracing, and test infrastructure gotchas.debug-php-wasm-side-modules: Reference for debugging dynamic PHP extensions (WASM side modules). Covers_dlopen_jssynchronous override, JSPI suspension patterns for side modules, extension loading lifecycle,ASYNCIFY_IMPORTSrequirements, Asyncify shared globals, C++ weak symbol crashes, web platform loading, and version coupling.Also trims the root
AGENTS.mdto remove PHP recompilation details now covered by the skills, replacing them with pointers to the relevant skill names.