# Agent presets

An Agent preset is a ready Agent Definition with defaults, instructions, and behavior. You pick a preset and add your model, credentials, and project settings.

Import ready presets from `vite-hub/presets/<name>` (package `@vite-hub/presets`). They use ViteHub primitives such as Channels, Capabilities, and process hosts.

## Choose a preset

| Preset | Use it for | Host requirements |
| --- | --- | --- |
| [Babysitter](https://vitehub.dev/docs/agents/babysitter) | Fix pull requests, answer reviews, wait for checks, and optionally merge. | A persistent Node process, SQL Agent State, Git, a GitHub App, and Codex or Claude Code. |
| [Workspace](https://vitehub.dev/docs/agents/workspace-preset) | Read mounted Sources and cite files at their resolved GitHub revision. | A configured Workspace and the Codex Driver. |

The deployment `preset` in `vitehub({ preset: 'node' })` is different. It picks the server host, not an Agent workflow.

## Select and configure

Import a preset, name it in the Agent's `presets` map, and select that name with `preset`.

```ts [server/agents/babysitter/agent.ts]
import { defineAgent } from 'vite-hub/agent'
import { babysitter } from 'vite-hub/presets/babysitter'

export default defineAgent({
  preset: 'babysitter',
  presets: { babysitter },
  workspace: {},
  options: {
    filter: { repository: { allow: ['acme/app'] } },
    lifecycle: {
      labels: { require: ['agent:repair'], deny: ['agent:paused'] },
    },
    merge: false,
  },
  driver: { model: 'your-codex-model' },
})
```

An Agent file alone is not enough. Babysitter also needs [GitHub setup](https://vitehub.dev/docs/agents/babysitter#configure-github), [deployment](https://vitehub.dev/docs/agents/babysitter#deploy), and [label controls](https://vitehub.dev/docs/agents/babysitter#control-work-with-labels).

You can also pick one parent with `extends: babysitter`. Use `extends` or `preset`, not both. Preset names are local to the definition. ViteHub does not load packages by name and has no global preset registry.

## Customize the Agent

Put workflow settings in `options` and provider settings in `driver`. For example, Babysitter's `options.driver` picks Codex or Claude Code, and `driver.model` picks the model.

If a preset has an instruction slot, put `instructions.md` next to `agent.ts`. Your guidance fills the slot, and the preset keeps its workflow instructions. Read [Instructions](https://vitehub.dev/docs/agents/instructions) before you replace a whole instruction template.

When you extend a preset:

- The extension gets a fresh runtime.
- Capabilities and Channels with the same key replace inherited ones.
- A hook with the same name runs after the inherited hook.
- Other arrays and option callbacks replace inherited ones.

See [Agent presets and inheritance](https://vitehub.dev/docs/agents/agent-presets#extend-an-agent) for the full rules.

## Share your own preset

Export a `defineAgent()` definition. If users need workflow settings, add typed `options` and a synchronous `configure` callback. Keep credentials and network calls out of that callback.

Declare `@vite-hub/agent` as a peer dependency. Include instructions and assets explicitly, because selecting a preset does not find files inside its package. See [Named presets](https://vitehub.dev/docs/agents/agent-presets#named-presets) for the API.

A preset that needs a long-running Node host attaches one with `withAgentProcessHost()` from `vite-hub/agent/process-host`. In package.json:

- List the subpath in `vitehub.agent.processHost`. ViteHub then starts the host and rejects hosts that cannot run it.
- List subpaths that pick the Codex or Claude Code Driver in `vitehub.agent.providerDriver`. Worker builds then fail early.

```json [package.json]
{
  "vitehub": {
    "agent": {
      "processHost": ["./babysitter"],
      "providerDriver": ["./babysitter", "./workspace"]
    }
  }
}
```

<!-- vitehub-docs:section-links -->
## In this section

- [Start](https://vitehub.dev/raw/docs/agents.md)
- [Define and run](https://vitehub.dev/raw/docs/agents/agent-definitions.md)
- [Instructions and tools](https://vitehub.dev/raw/docs/agents/instructions.md)
- [History and context](https://vitehub.dev/raw/docs/agents/chat-history-sessions.md)
- [Channels](https://vitehub.dev/raw/docs/agents/channels.md)
- [Inspect and evaluate](https://vitehub.dev/raw/docs/agents/observability.md)
- [Advanced](https://vitehub.dev/raw/docs/agents/agent-presets.md)
- [Recipes](https://vitehub.dev/raw/docs/agents/support-agent.md)
- Presets
  - [Overview](https://vitehub.dev/raw/docs/agents/presets.md) (this page)
  - [Babysitter](https://vitehub.dev/raw/docs/agents/babysitter.md)
  - [Workspace preset](https://vitehub.dev/raw/docs/agents/workspace-preset.md)
- [Capabilities](https://vitehub.dev/raw/docs/agents/capabilities/access.md)

Next: [Babysitter](https://vitehub.dev/raw/docs/agents/babysitter.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
