forumify / plugin-skeleton
A starting point for building forumify plugins.
Package info
github.com/forumify/forumify-plugin-skeleton
Type:forumify-plugin
pkg:composer/forumify/plugin-skeleton
Requires
- php: >=8.4
- forumify/forumify-platform: ^1.3
Requires (Dev)
- dama/doctrine-test-bundle: ^8.0
- dg/bypass-finals: ^1.9
- phpstan/phpstan: ^2.1
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.5
- slevomat/coding-standard: ^8.15
- squizlabs/php_codesniffer: ^3.13
- symfony/browser-kit: 7.4.*
- symfony/css-selector: 7.4.*
- zenstruck/foundry: 2.8.7
This package is auto-updated.
Last update: 2026-08-11 14:27:56 UTC
README
Generates a bare forumify plugin: registered with the platform, with quality tooling, a test suite wired up to forumify's test kit, GitHub Actions workflows and a README explaining where things go.
No example controllers, entities or templates — nothing to delete before you start.
Usage
composer create-project forumify/plugin-skeleton my-plugin
The generator asks for your package name, namespace, license and whether you want tests and CI, then rewrites the skeleton into your plugin and removes itself.
Add --no-interaction to take every default, deriving the package name from the target
directory. Useful in scripts:
composer create-project forumify/plugin-skeleton my-plugin --no-interaction
Scripting the answers
Every question can be answered up front with an environment variable, which is how this repository's own CI checks the generator:
SKELETON_PACKAGE=acme/todo-plugin \ SKELETON_NAME=Todo \ SKELETON_FEATURES=tests,ci \ composer create-project forumify/plugin-skeleton my-plugin --no-interaction
| Variable | Answers |
|---|---|
SKELETON_PACKAGE |
package name (vendor/name) |
SKELETON_NAMESPACE |
PHP namespace |
SKELETON_PLUGIN_CLASS |
plugin class name |
SKELETON_NAME |
display name |
SKELETON_DESCRIPTION |
description |
SKELETON_AUTHOR |
author |
SKELETON_HOMEPAGE |
homepage |
SKELETON_LICENSE |
license |
SKELETON_PLATFORM |
minimum forumify version |
SKELETON_FEATURES |
comma separated list of the features to include, everything else is left out |
Valid features: tests, ci.
Requirements
- PHP 8.4 or newer
- Composer 2
- A MySQL 8.4 database, if you generate a test suite
What you get
Always:
composer.jsonwith the plugin wiring (type,extra.forumify-plugin-class, autoload)- the plugin class, plus service and route configuration
phpcs.xmlandphpstan.neon(level 8), runnable withmake quality- a
Makefile,.editorconfig,.gitignoreand amigrations/directory - a README explaining where controllers, entities, templates and translations go
Optionally:
| Question | What it generates |
|---|---|
| Test suite | phpunit wired to Forumify\Testing, plus a test proving the plugin boots |
| GitHub Actions | Workflows running the tests and the quality checks |
How this repository works
The skeleton is a working forumify plugin in its own right. Its test suite runs in CI exactly as a generated plugin's would, which is what stops the templates from drifting away from the platform.
Generation is plain string replacement of the skeleton's own identity:
| Placeholder | Becomes |
|---|---|
forumify/plugin-skeleton |
your package name |
Forumify\PluginSkeleton |
your namespace |
ForumifyPluginSkeletonPlugin |
your plugin class |
Plugin Skeleton |
your plugin's display name |
plugin-skeleton / plugin_skeleton |
slugged and snake_cased forms of the display name |
Optional parts are wrapped in markers that are stripped when you decline them, and kept (without the markers) when you accept:
# skeleton:if tests tests: make setup-tests make run-tests # skeleton:endif
# skeleton:if !tests inverts the condition. The comment character is ignored, so the
same markers work in PHP, YAML, Twig, Makefiles and Markdown.
The generator lives in skeleton/Installer.php and runs from
composer's post-create-project-cmd. It deletes itself once it is done.
Contributing
Test a change by generating a plugin from your working copy:
composer create-project forumify/plugin-skeleton /tmp/test-plugin \ --repository='{"type":"path","url":"/path/to/plugin-skeleton","options":{"symlink":false}}' \ --stability=dev cd /tmp/test-plugin && make quality && make tests