Prompt file imported from academic-moodle-cooperation/management-ui (
.claude/commands/new-plugin.md). Fill in{{arguments}}before use. Copyright stays with the author.
Scaffold a new plugin ({{arguments}}) and finish wiring it per AGENTS.md.
-
Pick the location (confirm with me if it's ambiguous):
pnpm create-plugin <name>→.local-plugins/<name>/(gitignored; for org / community plugins; ships a Mavenbackend/POM by default — pass--no-pomto skip).pnpm create-plugin <name> --in-tree→plugins/<name>/(a built-in plugin shipped with the OSS repo; no Maven layout). Only for core contributors.- Add
--template appfor a visible screen + sidebar entry; the defaultminimaltemplate is a placeholderapp:header-logoregistration with no visible effect.
-
Run the scaffolder. It writes the canonical layout (
package.json,plugin.json,tsconfig.json,vitest.config.ts,src/index.ts,src/plugin.contract.test.ts) and runspnpm installto link the package into the workspace. -
Confirm the contract test is green out of the box:
pnpm --filter @oc-mui/plugin-<name> test:contract. -
Replace the placeholder. Update
src/index.ts'sinitialize()registrations and keepplugin.json'sextensionPointsarray in sync — the contract test fails if a declared extension point isn't populated (or vice-versa). Keep allmanager.registerObject(...)calls ininitialize(), notactivate(). -
Respect the boundaries (AGENTS.md → Boundaries). The plugin may import only
@oc-mui/*,plugins/core, itself, and already-wrapped third-party libs. Never import fromapps/*, another plugin, or a wrapped library directly (use@oc-mui/router, not@tanstack/react-router;@oc-mui/query,@oc-mui/i18n,@oc-mui/storelikewise).
A .local-plugins/ plugin is never added to plugins/index.ts. When the plugin
work is done, run the pre-flight-check skill (or /verify) before declaring it complete.
