Before you begin
- Storybook 8 or higher
- OpenCode installed locally
Install the addon
Connect a provider
The addon uses OpenCode as its coding agent. It automatically detects your existing OpenCode configuration and authentication — no extra setup needed if OpenCode is already configured. If no provider is detected on first launch, the onboarding screen prompts you to select a provider (Anthropic or OpenAI) and enter your API key.Configure OpenCode
To pin a specific provider and model for the addon, create.storybook/opencode.json:
.storybook/opencode.json
opencode.json at your project root if it exists. The .storybook/opencode.json file takes precedence for provider and model settings.
Add system context with AGENTS.md
Create.storybook/AGENTS.md to inject persistent instructions into every AI prompt. Use it to describe your component library, import conventions, and coding guidelines.
.storybook/AGENTS.md
Use the chat panel
Navigate to any story in Storybook and open the Loracle panel. Type a prompt describing what you want — the AI edits the story file directly and Storybook hot-reloads with the result. Examples of prompts:- “Add a disabled state to this button story”
- “Create variants for small, medium, and large sizes”
- “Style this to match our brand colors”