Change Plugin Runtime
Agent Buildingchange-plugin-runtimeChange Plugin Runtime is an Agent Skill for agent building published in the SII-Holos/synergy repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Add, modify, or review Synergy Plugin API 3 definitions, generated manifests, plugin-kit builds, installation transactions, capability approval, process runtimes, operations/events/hooks, marketplace behavior, or trusted UI contribution lifecycle.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/SII-Holos/synergy/blob/HEAD/.synergy/skill/change-plugin-runtime/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/change-plugin-runtime, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Change the Plugin Runtime
Trace the Single Contract
- Read Plugin documentation and the focused contract for the affected area.
- Start with source types in
packages/plugin, then plugin-kit build output, host discovery/install underpackages/synergy/src/plugin, runtime generation/dispatch underplugin-runtime, server routes, and the Web host underpackages/app/src/plugin. - Trace
definePlugin()→ generated manifest/artifacts → metadata-only validation → approval → installation transaction → contribution adapter → lazy runtime generation → invocation context/Host Service → disposer or lifecycle cleanup. - Load
change-execution-boundariesfor host capability enforcement,change-server-apifor routes/SDK,change-persistencefor lock/approval/config migration, anddevelop-frontendfor the Web host.
Preserve the Architecture
definePlugin()is the only source of identity, capabilities, contributions, and handlers. Do not add a source manifest, handler map, nested permission tree, or compatibility reader.- Keep plugin ID identical across manifest, registry, lockfile, approval, runtime generation, asset URL, and UI surface namespace.
- Validate generated metadata, paths, hashes, and approval before importing executable code.
- Keep contribution kinds flat and adapter-owned. Adding a kind means adding its public type/schema, adapter, validation, lifecycle disposal, and tests—not a branch in a central registration loop.
- Treat generated tool input JSON Schema as canonical model metadata. Tool inputs must be top-level objects; AJV-backed execution validation must not round-trip the schema through Zod. Settings-gated tools are filtered for the current Scope and checked again at dispatch.
- External plugins use
process; only trusted built-ins may useinProcess. Do not restore worker mode or describe the process boundary as an OS sandbox. - One active generation is shared across enabled Scopes. Inject Scope/Session per invocation and reject stale-generation responses.
- Expose Synergy internals only through capability-gated Host Services. Do not pass a raw SDK client, server URL, token, or mutable current Scope into plugin code.
- Keep operations finite and schema-validated. Use declared events for invalidation; do not add a generic plugin Job or business-data store.
- Use host-declared observer/transform/guard hook points with deterministic ordering and contribution-level degradation.
- For trusted UI, enforce approval, UI API major, plugin-kit Solid compilation, host runtime linking, named exports, artifact hash, Scope/Session context, and one disposer per registration. Resource identity includes opaque
id/title/state; reuse the same panel/resource tab and keep distinct resources separate. Keep themes and icons as validated, namespaced data contributions; themes use the shared structured JSON schema, never arbitrary CSS. - Preserve transactional install/update/remove rollback and explicit lifecycle failure semantics. Synergy must not guess how to migrate or delete plugin-owned business data.
Verify
- Add or update behavior tests at the owning boundary: descriptor/schema, plugin-kit build/validate/pack/sign, metadata-only discovery, approval, transaction rollback, runtime generation, operation/event/hook contract, server route, or Web registration lifecycle.
- Cover duplicate IDs, undeclared capabilities, handler mismatch, invalid schemas/hashes, disabled Scope, timeout/cancel/crash, stale generation, trusted UI export/runtime mismatch, upgrade failure, and force uninstall when relevant.
- Run public package typecheck/build, inspect a packed artifact, run focused host/Web tests, regenerate OpenAPI/SDK or config schema when their sources change, and finish with
bun run quality:quick. - Update the canonical plugin docs and this Skill in the same change. Delete obsolete guidance instead of appending migration caveats to current-state docs.
Handoff
Report public contract changes, generated artifacts, capability/approval effects, runtime/generation behavior, Host Services, operation/event/hook behavior, UI lifecycle, transaction/migration effects, tests, and docs.