feat: add openclaw-plugin-dev skill

Plugin development reference and workflows based on real development
experience (Dirigent, ContractorAgent, PrismFacet).

Docs: structure, entry-point, hooks, tools, state, config, debugging
Workflows: create-plugin, add-hook

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
zhi
2026-04-18 17:25:07 +00:00
parent 1d34768019
commit 5a8f490cc2
10 changed files with 465 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
# Plugin Project Structure
```
proj-root/
plugin/ # Installable plugin (copied to ~/.openclaw/plugins/<id>/)
index.ts # Entry: export default { id, name, register }
openclaw.plugin.json # Config schema declaration
package.json # name, version, type: module
hooks/ # Hook handlers (one file per hook)
tools/ # Tool registrations
core/ # Pure business logic (no plugin-sdk imports)
web/ # HTTP routes (optional)
services/ # Sidecar processes (optional, installed alongside plugin)
skills/ # OpenClaw skills provided by this plugin (optional)
routers/ # Drop-in modules (plugin-specific, e.g., PrismFacet routers)
scripts/
install.mjs # --install / --uninstall / --update
docs/ # Documentation
```
## Conventions
- File names: kebab-case (`before-model-resolve.ts`)
- Export names: camelCase (`registerBeforeModelResolve`)
- `plugin/core/` must not import from `openclaw/plugin-sdk` — keeps logic unit-testable
- Hook registration logic goes in `plugin/hooks/`, not in `index.ts`