# Custom Instructions

> Personalisation settings for an assistant: what to call you, what you do and how replies should read, with trait chips that write sentences into the instructions, segmented warmth, length and formatting controls, character counters and an on switch. A live preview answers a sample question in the chosen style, and a footer tracks unsaved changes with Discard and Save.

- Slug: `custom-instructions`
- Category: [AI chat](https://www.assembli.design/category/ai-chat.md)
- Type: block
- Tags: settings, personalization, instructions, preferences, chat
- npm dependencies: motion, lucide-react
- shadcn/ui dependencies: button, input, textarea, @assembli/segmented-control, @assembli/switch
- Live preview: https://www.assembli.design/preview/custom-instructions
- Page: https://www.assembli.design/components/custom-instructions

![Custom Instructions preview](https://www.assembli.design/thumbnails/custom-instructions-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `Partial<CustomInstructionsValue>` |  | The saved settings. Edits are compared against these to show the unsaved bar. |
| `onSave` | `(value: CustomInstructionsValue) => void \| Promise<void>` |  | Persist the settings. Return a promise to show a saving state. |
| `traits` | `InstructionTrait[]` | `DEFAULT_TRAITS` | Chips that add a sentence to the instructions. |
| `assistantName` | `string` | `"Assistant"` | Name shown on the preview reply. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/custom-instructions/custom-instructions.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/custom-instructions
```

Registry item JSON: https://www.assembli.design/r/custom-instructions.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
