# Introduction

Plugin Kit is a runtime for Dart apps that have grown into platforms. Features get real
lifecycles. Services get replaceable, prioritized implementations. Sessions stay sealed.
Events flow between parts of your app that have never been formally introduced.

It has no opinion about what your app does. It does not know about Flutter, servers, agents, editors,
or any particular settings backend. You build those on top. The runtime stays the same.

For the origin story and the design decisions that follow from it, [Why Plugin Kit?](https://plugin-kit.saad-ardati.dev/why-plugin-kit/) is the short read.

## What it looks like in real work
**The screen stops knowing who won**
A Flutter screen asks the session for "the current search implementation"
  and gets the highest-priority one. No provider checks, no feature-flag
  branches, no fallback wiring at the call site.

**One send action becomes a pipeline**
The user hits send once. One plugin inspects the draft, another gathers
  context, another routes the work, and the chat UI renders progress as
  those phases happen. The button stays boring.

**Live customization stops being scary**
A settings dialog enables plugins, raises priorities, and updates config
  in the running session. The runtime detaches what lost, attaches what
  won, and keeps the session coherent across the swap.

![Plugin Kit Dialog showing the Plugins tab with toggleable enable/disable controls for each registered plugin](https://plugin-kit.saad-ardati.dev/images/dialog/plugins_tab_dark.png)

*Plugin Kit Dialog, the customization surface that ships with the library. Toggling a plugin runs the full lifecycle. The runtime is fully introspectable.*

## A small taste

Two plugins claim the same `'system_prompt'` slot at different priorities; the runtime resolves to the winner. The chat plugin ships the default; a teammate's experimental plugin wins by asking for higher priority. Disable the experiment via settings and the original wins again, no code change at the call site. The full runnable program is in [Getting Started](https://plugin-kit.saad-ardati.dev/getting-started/).

```dart
extractRegion(pluginLifecycleDart, 'system-prompt-taste')
```

That move, features owning slots and slots resolving to the current winner, is the vocabulary the rest of the library is built on.

## Where to next

[Why Plugin Kit?](https://plugin-kit.saad-ardati.dev/why-plugin-kit/)
  [Show me it running](https://plugin-kit.saad-ardati.dev/getting-started/)
  [Show me the mental model](https://plugin-kit.saad-ardati.dev/concepts/plugins/)
If you prefer reading code over docs, the [`example/`](https://github.com/SaadArdati/plugin_kit/tree/main/example) directory walks a miniature workflow built out of plugins, one concept per file. Many readers go straight there.