mioku-developer
mioku-lab/mioku-skillBuild, review, refactor, or explain Mioku plugins, services, framework integrations, and plugin AI skills against the real Mioku repository layout. Use when working on Mioku architecture, `plugins/*`, `src/services/*`, `skills.ts`, `runtime.ts`, plugin `package.json -> mioku.*`, WebUI `config.md`, or system services such as `60s`, `ai`, `config`, `help`, `screenshot`, and `webui`. Exclude legacy Minecraft plugin/service work unless the user explicitly asks for it.
SKILL.md
name: mioku-developer
description: Build, review, refactor, or explain Mioku plugins, services, framework integrations, and plugin AI skills against the real Mioku repository layout. Use when working on Mioku architecture, plugins/*, src/services/*, skills.ts, runtime.ts, plugin package.json -> mioku.*, WebUI config.md, or system services such as 60s, ai, config, help, screenshot, and webui. Exclude legacy Minecraft plugin/service work unless the user explicitly asks for it.
Mioku Developer
Use this skill to make repository-accurate changes for Mioku. Treat the checked-out source as the source of truth and use the bundled references to avoid drifting back to older plugin contracts.
Start Here
Follow this order:
- Confirm whether the task is framework-level, plugin-level, service-level, AI-skill-level, or WebUI config-page work.
- Inspect the target files in the repository before proposing changes.
- Read only the relevant reference files:
references/architecture.mdfor startup flow, discovery, auto-registration, and layer boundariesreferences/plugin-development.mdfor plugin package shape,skills.ts,runtime.ts,config.md, and help conventionsreferences/service-development.mdfor service contract, discovery, lifecycle, and plugin consumptionreferences/system-services.mdfor built-in non-Minecraft service APIs and caveats
- Implement changes in the repository's established style.
- Validate with
bun run buildfor edits undersrc/,plugins/, orsrc/services/.
Core Rules
- Prefer repository source over prose docs when they disagree.
- Treat Mioku as a layer on top of
mioki:miokihandles bot/events/plugin execution, Mioku adds service discovery, plugin metadata discovery, auto help registration, and AI skill loading. - Keep normal plugin
index.tsfocused on runtime behavior only. - Declare required services only in
package.json -> mioku.services. - Declare help only in
package.json -> mioku.help. - Export global plugin AI skills only from
skills.ts. - Do not add
helporskillfields onto the plugin object for normal plugins. - Do not call
helpService.registerHelp(...)oraiService.registerSkill(...)from normal plugins unless the task is explicitly changing Mioku framework internals. - Simple plugins/services can stay in one focused file.
- As complexity grows, split by responsibility into small files instead of growing one large
index.tsor one large shared helper file. - Use
runtime.tsonly as a bridge whenskills.tsneeds mutable state created duringsetup(). - Do not rely on module-local singletons inside
runtime.ts; prefersrc/core/plugin-runtime-state.ts. - Ignore legacy Minecraft plugin/service code unless the user explicitly asks for it.
Plugin Workflow
When creating or editing a plugin:
- Read
package.json,index.ts, andskills.tsif present. - Ensure the plugin directory name, plugin name, and package naming stay aligned.
- Put declarative metadata in
package.json. - Put event handlers, config registration, service wiring, and cleanup in
index.ts. - Keep small plugins simple. As the plugin grows, move pure reusable logic into
shared.ts,utils.ts, or other focused modules instead of one oversized file. - Add
runtime.tsonly whenskills.tsmust access setup-created state, and back it with the shared runtime registry. - If the plugin needs WebUI editing, define
config.mdwith<configName>.<jsonPath>keys.
Service Workflow
When creating or editing a service:
- Keep the service under
src/services/<name>/. - Export a
MiokuServiceobject fromindex.ts. - Keep small services simple; split larger services into focused modules such as
types.ts,client.ts,utils.ts, or domain-specific files. - Expose a typed API on
service.api. - Initialize resources in
init()and release them in optionaldispose(). - Remember that Mioku injects service APIs into plugins through
ctx.services.<name>. - Check whether plugin docs, examples, or imports need updates when service API shape changes.
AI Skill Workflow
When the task involves plugin AI tools:
- Read
references/plugin-development.mdandreferences/system-services.md. - Prefer plugin-scoped skills exported from
skills.tsasAISkill[]. - Keep tool handlers small and predictable.
- Pass runtime state through
runtime.tsinstead of closing oversetup()locals, using the shared runtime registry rather than plain module-level state. - Use
aiservice runtime features only when the plugin truly needs model calls or chat runtime integration.
Validation
- Run
bun run buildafter meaningful code changes in Mioku. - If behavior changed, verify the affected startup path, message command, or service usage locally.
- Call out repository quirks that affect generated code, such as the current
src/services/config/tpyes.tsfilename typo.