> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AD-001 Microkernel with plugins

> Decision record: why Kcode Robot Suite uses a domain-agnostic microkernel with plugins.

| Field | Value |
| - | - |
| Status | Accepted |
| Scope | `packages/kernel`, `packages/plugin-sdk`, `plugins/*`, `apps/web` |

## Context

The suite must show several unrelated robot demos in one application. Teams should add a demo without editing the platform or the other demos.

## Decision

Use a microkernel with plugins. The kernel provides registration, lifecycle, permissions, events, and configuration. Plugins implement the `KcodePlugin` contract from `@kcode/plugin-sdk`. The host app imports concrete plugins only through `config/plugins.ts`.

## Consequences

| Type | Effect |
| - | - |
| Benefit | A standard plugin needs one package and one config entry. |
| Benefit | The kernel stays free of domain terms, so it can be tested alone. |
| Cost | The host must still import every plugin at build time. There is no dynamic loading. |
| Cost | The web app currently uses only the registry from the kernel. See [R-4](https://docs.khanhng.com/kcode-robot-suite/architecture/11-risks-and-technical-debt.md). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.