discord-php-extension
Skill by discord-php
Scaffolds and maintains DiscordPHP-based bots and API libraries built on DiscordPHP. It covers the client subclass, HTTP layer, Parts, repositories, JSON state store, boot guard and composer wiring. Aimed at developers creating or working across DiscordPHP extension repos.
Install discord-php-extension
Built from the published package, never by AI.
git clone --depth 1 https://github.com/discord-php/DiscordPHP /tmp/DiscordPHP && mkdir -p ~/.claude/skills && cp -r /tmp/DiscordPHP/.github/skills/discord-php-extension ~/.claude/skills/discord-php-extensionRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/discord-php/DiscordPHP /tmp/DiscordPHP && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/DiscordPHP/.github/skills/discord-php-extension ~/.gemini/antigravity-cli/skills/discord-php-extensionAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install discord-php-extension in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill guides an AI assistant through building or maintaining a DiscordPHP-based bot, or a library that wraps a third-party REST API on top of DiscordPHP. It follows the pattern used by the DiscordPHP-MTG, DiscordPHP-NHA and DiscordPHP-Sabacc extensions. It covers a MessageCommandClient subclass, a third-party HTTP layer, Parts, repositories, a JSON state store, a boot guard for the init and application-init events, and composer path-repository wiring.
It also records conventions and a known gotcha. The bot token should not be passed to third-party API clients, and in these repos git diff can show every line changed because of CRLF normalisation. The skill is aimed at developers creating a new extension repo or working across the existing ones.
Written from the project's SKILL.md and checked against it.
What it can do
- Client subclassShows how to subclass MessageCommandClient and wire a third-party HTTP client.
- Boot guardRuns setup once, after both the init and application-init events have fired.
- JSON state storeDescribes a flat JSON persistence layer with atomic writes and lazy loading.
- Repository layoutDescribes the src layout with Http, Repository and Parts folders.
- Composer wiringExplains composer path repositories for local sibling DiscordPHP checkouts.
- Part conventionsSets PHPDoc and return type rules for classes that extend DiscordPHP parts.
- CRLF diff checkExplains why git diff shows every line changed and how to inspect staged changes.
What you need
- PHP 8.3 or later
- Composer
- DiscordPHP (team-reflex/discord-php) dependency
- Sibling DiscordPHP and DiscordPHP-Http checkouts for local path repositories
Try asking
- Scaffold a new DiscordPHP bot that wraps a third-party REST API.
- Set up the init and application-init boot guard for my DiscordPHP bot.
- Show me how to inspect staged changes after running composer cs.
Good to know
- Local development relies on sibling checkouts of DiscordPHP and DiscordPHP-Http.
- Without .gitattributes, CRLF normalisation makes a raw git diff show every line changed.
- Tests are described as pure-logic tests with no live gateway.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .github/skills/discord-php-extension/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB
Alternatives to discord-php-extension
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
discord-php-extension: common questions
What is the init and application-init boot guard?
DiscordPHP fires both init and application-init, and the command tree needs the application to be ready. The guard runs setup exactly once, after both events have fired.
Why should the bot token not go to a third-party API client?
The source says the MTG extension passed the bot token into its HTTP client and leaked it on every request. It recommends passing an empty string and adding an Authorization header only when a value is set.
Why does git diff show every line changed after running composer cs?
The repos use core.autocrlf=true with no .gitattributes, so php-cs-fixer writes CRLF and Git normalises to LF on git add. Inspect the real change set with git diff --cached instead.
How do I install discord-php-extension?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is discord-php-extension free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is discord-php-extension safe to use?
It scores 76 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to discord-php-extension?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
