Plugin skeleton
About 280 wordsLess than 1 minute
Skeleton for a Spora plugin.
Use this repository as a template for any new spora-plugin:
- Click Use this template → Create a new repository on GitHub.
- Rename the package in
composer.json(e.g.spora-ai/spora-plugin-tavily). - Rename the namespace (
Spora\Plugins\Skeleton→Spora\Plugins\<YourPlugin>) in every PHP file. - Update
plugin.json’sslug,description,class, andicon. - Replace
src/Tools/EchoTool.phpwith your real tool(s); add more files undersrc/Tools/and list them insrc/Plugin.php::tools(). - If your plugin needs database tables, add Laravel migrations under
database/migrations/and bumpSkeletonPlugin::schemaVersion().
Layout
.
├── composer.json # name=spora-ai/spora-plugin-<x>, type=spora-plugin
├── plugin.json # manifest the PluginLoader reads at boot
├── src/
│ ├── Plugin.php # PluginInterface implementation
│ └── Tools/
│ └── EchoTool.php # one tool per file (replace this one)
├── tests/ # Pest unit tests
│ ├── Pest.php
│ └── Unit/
└── .github/workflows/
└── ci.yml # pest + phpstan + cs-fixerLocal development
Clone the repo, install dependencies, and run the tests:
composer install
./vendor/bin/pestPublishing
- Bump
versionincomposer.json. - Tag the release:
git tag v0.1.0 && git push --tags. - (Optional) Configure Packagist to auto-pull from the GitHub repo.
CI
Three parallel jobs run on every push to main, on v* tags, and on pull requests:
test— Pest on PHP 8.4 + 8.5static-analysis— PHPStan level 5code-style— php-cs-fixer dry-run (same ruleset as Spora core)
External actions are pinned to full commit SHAs per the project’s supply-chain policy.
Repo: spora-ai/spora-plugin-skeleton · MIT