Halo Plugin Development
Work from the target plugin and fetch current Halo documentation only when the
task needs a Halo-specific contract. Do not rely on API details embedded in the
skill or recalled from training data.
Establish the Target
- Inspect the existing Gradle files,
src/main/resources/plugin.yaml, UI package
manifest and build configuration, and nearby implementations before editing.
- Determine both the Halo platform dependency and
plugin.yaml spec.requires.
Do not silently raise the requirement or switch the UI build format.
- Preserve an existing plugin's structure and tooling. For a new plugin, prefer
the official
pnpm create halo-plugin scaffold unless the user chose another
starting point.
Fetch Documentation on Demand
- Start with the plugin documentation index
when the task involves Halo plugin APIs, configuration, lifecycle, UI, DevTools,
security, or integration contracts.
- Use the complete Halo documentation index
only when the route is unclear or the task crosses documentation sections.
- Fetch only the Markdown pages relevant to the current task. Do not load
llms-full.txt by default.
- For version-sensitive work, also read the plugin API changelog,
then verify exact signatures and behavior against the target dependency,
source, or existing callers. The target version wins over current-site docs.
If online docs are unavailable, continue from the target checkout and dependency
sources when possible, and disclose what could not be verified instead of guessing.
Halo-Specific Boundaries
- Keep blocking work off reactive WebFlux paths; follow the current
reactive development guide.
- Reuse Halo-provided UI components, FormKit inputs, shared utilities, and the
project's installed build tooling before adding dependencies or custom equivalents.
- Use Setting YAML for ordinary plugin settings instead of creating a duplicate
settings route. Use FormKit for page and modal forms, and reuse Halo list,
search, modal, feedback, and permission components before native replacements;
follow the current forms and page components guide.
- Use the project's
generateApiClient task to generate TypeScript models and API
methods from custom models and documented SpringdocRouteBuilder endpoints.
Reuse Halo's axiosInstance; do not handwrite generated resource types or create
a separate Axios client for /api or /apis. Follow the current
API request guide.
- Treat generated API clients and built UI assets as generated files: change their
inputs and use the project's generator or build task rather than editing output.
- Store passwords, tokens, API keys, and private keys in Halo
Secret, never in a
ConfigMap or custom-model spec. Validate user-controlled outbound destinations
against SSRF and redirect risks before attaching credentials, and keep public
APIs or security switches closed when configuration loading fails. Follow the
current outbound HTTP guide.
- Add RoleTemplates only when non-super-admin or anonymous access is required;
grant the narrowest permissions needed.
Verify
Use the project's existing Gradle and UI scripts. Run the narrowest relevant tests
and checks, and verify packaging when manifest, UI output, or generated resources
affect the plugin JAR. When a runnable Halo instance is available, smoke-test the
changed Console, User Center, API, lifecycle, or theme integration path.
1---2name: halo-plugin-dev3description: Create or modify Halo CMS plugins, including Java backend code, plugin.yaml and extension resources, Gradle and DevTools configuration, plugin APIs and lifecycle, and Vue-based Console or User Center UI. Use for Halo plugin implementation, migration, debugging, or integration work; do not use for theme-only changes.4---56# Halo Plugin Development78Work from the target plugin and fetch current Halo documentation only when the9task needs a Halo-specific contract. Do not rely on API details embedded in the10skill or recalled from training data.1112## Establish the Target1314- Inspect the existing Gradle files, `src/main/resources/plugin.yaml`, UI package15 manifest and build configuration, and nearby implementations before editing.16- Determine both the Halo platform dependency and `plugin.yaml` `spec.requires`.17 Do not silently raise the requirement or switch the UI build format.18- Preserve an existing plugin's structure and tooling. For a new plugin, prefer19 the official `pnpm create halo-plugin` scaffold unless the user chose another20 starting point.2122## Fetch Documentation on Demand23241. Start with the [plugin documentation index](https://docs.halo.run/developer-guide/plugin/index.md)25 when the task involves Halo plugin APIs, configuration, lifecycle, UI, DevTools,26 security, or integration contracts.272. Use the complete [Halo documentation index](https://docs.halo.run/llms.txt)28 only when the route is unclear or the task crosses documentation sections.293. Fetch only the Markdown pages relevant to the current task. Do not load30 `llms-full.txt` by default.314. For version-sensitive work, also read the [plugin API changelog](https://docs.halo.run/developer-guide/plugin/api-changelog.md),32 then verify exact signatures and behavior against the target dependency,33 source, or existing callers. The target version wins over current-site docs.3435If online docs are unavailable, continue from the target checkout and dependency36sources when possible, and disclose what could not be verified instead of guessing.3738## Halo-Specific Boundaries3940- Keep blocking work off reactive WebFlux paths; follow the current41 [reactive development guide](https://docs.halo.run/developer-guide/plugin/basics/server/reactive-development.md).42- Reuse Halo-provided UI components, FormKit inputs, shared utilities, and the43 project's installed build tooling before adding dependencies or custom equivalents.44- Use Setting YAML for ordinary plugin settings instead of creating a duplicate45 settings route. Use FormKit for page and modal forms, and reuse Halo list,46 search, modal, feedback, and permission components before native replacements;47 follow the current [forms and page components guide](https://docs.halo.run/developer-guide/plugin/basics/ui/forms.md).48- Use the project's `generateApiClient` task to generate TypeScript models and API49 methods from custom models and documented `SpringdocRouteBuilder` endpoints.50 Reuse Halo's `axiosInstance`; do not handwrite generated resource types or create51 a separate Axios client for `/api` or `/apis`. Follow the current52 [API request guide](https://docs.halo.run/developer-guide/plugin/api-reference/ui/api-request.md).53- Treat generated API clients and built UI assets as generated files: change their54 inputs and use the project's generator or build task rather than editing output.55- Store passwords, tokens, API keys, and private keys in Halo `Secret`, never in a56 ConfigMap or custom-model spec. Validate user-controlled outbound destinations57 against SSRF and redirect risks before attaching credentials, and keep public58 APIs or security switches closed when configuration loading fails. Follow the59 current [outbound HTTP guide](https://docs.halo.run/developer-guide/plugin/security/outbound-http.md).60- Add RoleTemplates only when non-super-admin or anonymous access is required;61 grant the narrowest permissions needed.6263## Verify6465Use the project's existing Gradle and UI scripts. Run the narrowest relevant tests66and checks, and verify packaging when manifest, UI output, or generated resources67affect the plugin JAR. When a runnable Halo instance is available, smoke-test the68changed Console, User Center, API, lifecycle, or theme integration path.