Teach AI agents to write correct non-blocking async PHP using AMPHP v3
Skill that teaches AI coding assistants (Claude, Codex, OpenClaw, Cursor agents) to generate production-ready async PHP using AMPHP v3.
Prevents common mistakes like:
- blocking I/O inside event loops
- outdated AMPHP v2 patterns
- incorrect async patterns
- unsafe JSON handling
- broken connection reuse
✅ Generates correct async PHP code ✅ Enforces AMPHP v3 architecture ✅ Prevents blocking operations in event loop ✅ Rewrites AMPHP v2 → v3 patterns ✅ Safe JSON handling with exceptions ✅ Proper HTTP body consumption ✅ Correct async concurrency patterns
Supports ecosystem:
amphp/ampamphp/http-serveramphp/http-clientamphp/websocketamphp/mysqlamphp/redisamphp/socketamphp/fileamphp/cacheamphp/syncamphp/processamphp/parallelrevolt/event-loop
AI often generates blocking code:
$response = file_get_contents($url);
sleep(1);AI generates correct async code:
use Amp\Http\Client\HttpClientBuilder;
use function Amp\delay;
$client = HttpClientBuilder::buildDefault();
$response = $client->request($request);
await delay(1);git clone https://github.com/opencck/skill-amphp ~/.claude/skills/amphpRestart Claude Code.
mkdir -p .claude/skills
git clone https://github.com/opencck/skill-amphp .claude/skills/amphpCursor loads skills from the project folder.
mkdir -p .cursor/skills
git clone https://github.com/opencck/skill-amphp .cursor/skills/amphpRestart Cursor.
Place the skill file manually:
skills/amphp/SKILL.md
Example:
skills/
└ amphp/
└ SKILL.md
└ ...
The skill activates automatically when Claude detects:
Amp\Future
Amp\async
Amp\delay
Revolt\EventLoop
amphp/*
or async server patterns.
Convert this PHP code to AMPHP v3 async style
Create an async HTTP server using amphp/http-server
Write async MySQL queries using amphp/mysql
More prompt examples
Build a WebSocket server using amphp/websocket
Create an async queue worker
Convert this blocking script to non-blocking AMPHP
| Requirement | Version |
|---|---|
| PHP | 8.1+ |
| AMPHP | v3 |
| Revolt Event Loop | 1+ |
Composer example:
composer require amphp/amp revolt/event-loop| Model | Result |
|---|---|
| Claude Sonnet 3.5 | ✅ Excellent |
| Claude Sonnet 4 | ✅ Excellent |
| Claude Opus | ✅ Excellent |
| Cursor Agents | ✅ Works |
| MCP Agents | ✅ Works |
Good prompt:
Write async AMPHP v3 code for this API client
Bad prompt:
Write PHP HTTP client
Use amphp/http-server
Use Revolt event loop
Use async concurrency
Works great with:
- PHP refactor skills
- async architecture skills
- performance optimization skills
- Not designed for AMPHP v2
- Assumes PHP 8.1+
- Works best when prompts mention async or AMPHP
MIT License
If this skill helped you:
⭐ Star the repository
https://github.com/opencck/skill-amphp
It helps other developers discover it.
Открыть описание на русском
Помогает AI-ассистентам писать асинхронный PHP код с AMPHP v3 без типичных ошибок.
Исправляет:
- блокирующий I/O
- устаревший AMPHP v2 код
- неправильные async-паттерны
git clone https://github.com/opencck/skill-amphp ~/.claude/skills/amphp
Просто пишите:
Convert this code to AMPHP async
или
Create async HTTP server using amphp
Skill активируется автоматически.
⭐ If you like this project — give it a star!