dev-specialisms:hashbrown-core
Building LLM-powered React applications with the Hashbrown library. Use when the user asks to (1) Build generative UI where LLMs render React components, (2) Add client-side tool calling for LLM-app interaction, (3) Stream LLM responses in React applications, (4) Execute LLM-generated JavaScript safely in a sandbox, (5) Build browser agents or AI-powered UIs with hashbrown, (6) Control React UI from LLM output, (7) Integrate with LLM providers like OpenAI, Anthropic, Google, Azure, Bedrock, or Ollama in React apps, (8) Create chatbots, form builders, predictive text inputs, or multi-threaded conversations with LLMs, (9) Transform natural language to structured data in TypeScript React applications.
What this skill does
# Hashbrown Development Skill
## Overview
Hashbrown is a React library for building LLM-powered applications with generative UI, client-side tool calling, streaming, and sandboxed JavaScript execution. It provides React hooks (`useChat`, `useUiChat`, etc.) that connect to a Node.js backend adapter, which securely communicates with LLM providers (OpenAI, Anthropic, Google, Azure, Bedrock, Ollama).
**Architecture**: React frontend (using Hashbrown hooks) + Node.js backend adapter (proxies LLM API requests)
## Quick Start Workflow
### 1. Choose the Right Hook
| Hook | Multi-turn Chat | Single Input | Structured Output | Tool Calling | Generate UI |
| ------------------------- | :-------------: | :----------: | :---------------: | :----------: | :---------: |
| `useChat` | ✅ | ❌ | ❌ | ✅ | ❌ |
| `useStructuredChat` | ✅ | ❌ | ✅ | ✅ | ❌ |
| `useCompletion` | ❌ | ✅ | ❌ | ✅ | ❌ |
| `useStructuredCompletion` | ❌ | ✅ | ✅ | ✅ | ❌ |
| `useUiChat` | ✅ | ❌ | ✅ | ✅ | ✅ |
### 2. Generate Boilerplate
Use the scripts to scaffold components and servers:
```bash
# List available templates
python scripts/list-templates.py
# Generate a component
python scripts/generate-component.py simple-chat ./src/components
# Generate a backend server
python scripts/generate-server.py basic-chat-server ./backend
```
**Available component templates:**
- `simple-chat` - Basic text-only chat with `useChat`
- `ui-chat-with-components` - Generative UI with `useUiChat` and `exposeComponent`
- `client-side-tool-calling` - Tool calling with `useTool`
- `js-runtime-chart-generator` - Sandboxed JS execution for data visualization
- `structured-data-form` - Form generation from natural language with Skillet schemas
- `streaming-chat-ui` - Streaming responses with loading states
- `multi-threaded-chat-ui` - Multi-conversation management with threads
- `predictive-text-input` - Autocomplete/suggestions powered by LLM
- `chat-with-voice-input` - Voice input with speech recognition
**Available server templates:**
- `basic-chat-server` - Simple Express server with OpenAI adapter
- `streaming-chat-server` - Streaming support for real-time responses
- `chat-server-with-data` - Server with database/context injection
- `chat-server-with-threads` - Persistent conversation threads
- `server-with-authentication` - Auth-protected endpoints
### 3. Consult References for Details
Load reference documentation as needed for deep implementation details:
- **[getting-started.md](references/getting-started.md)** - Installation, setup, hook overview
- **[core-concepts.md](references/core-concepts.md)** - Generative UI, tool calling, JS runtime, streaming
- **[structured-data.md](references/structured-data.md)** - Skillet schema language for type-safe JSON output
- **[platform-integration.md](references/platform-integration.md)** - LLM provider adapters (OpenAI, Anthropic, Google, etc.)
- **[advanced-guides.md](references/advanced-guides.md)** - Chatbots, threads, MCP, predictive actions
- **[best-practices.md](references/best-practices.md)** - Prompt engineering, model selection, ethics
- **[INDEX.md](references/INDEX.md)** - Navigation map of all documentation
## Core Capabilities
### 1. Generative UI
Expose React components to the LLM so it can render your UI dynamically.
```tsx
import { useUiChat, exposeComponent } from '@hashbrownai/react'
import { s } from '@hashbrownai/core'
import { MyCard } from './MyCard'
const exposedCard = exposeComponent(MyCard, {
name: 'MyCard',
description: 'A card to display information',
props: { title: s.string('The title'), content: s.string('The body') },
})
const { messages } = useUiChat({
components: [exposedCard],
model: 'gpt-4',
system: 'Render cards to show information to the user.',
})
// messages[1].ui will contain <MyCard title="..." content="..." />
```
**When to use**: Build browser agents, dynamic dashboards, form builders, or any UI that should adapt based on LLM decisions.
**Reference**: See [core-concepts.md](references/core-concepts.md) for detailed component exposure patterns.
### 2. Client-Side Tool Calling
Allow the LLM to call client-side functions to access app state or perform actions.
```tsx
import { useChat, useTool } from '@hashbrownai/react'
const getUserTool = useTool({
name: 'getUser',
description: 'Get current user information',
handler: async () => ({ name: 'Jane Doe' }),
deps: [],
})
const { messages } = useChat({
tools: [getUserTool],
model: 'gpt-4',
})
```
**When to use**: Let the LLM access application state, trigger actions, or interact with external APIs.
**Reference**: See [core-concepts.md](references/core-concepts.md) for tool definition patterns.
### 3. Structured Data Output
Use Skillet schemas to get type-safe, validated JSON from the LLM.
```tsx
import { useStructuredCompletion } from '@hashbrownai/react'
import { s } from '@hashbrownai/core'
const schema = s.object('Response', {
name: s.string('User name'),
age: s.number('User age'),
interests: s.array('List of interests', s.string('An interest')),
})
const { data } = useStructuredCompletion({
schema,
model: 'gpt-4',
prompt: 'Extract user info: John is 30 and likes hiking and reading.',
})
// data will be typed as { name: string; age: number; interests: string[] }
```
**When to use**: Extract structured information, build forms from natural language, parse documents, or transform unstructured text to JSON.
**Reference**: See [structured-data.md](references/structured-data.md) for Skillet schema language details.
### 4. Sandboxed JavaScript Execution
Execute LLM-generated JavaScript safely in a WASM-based QuickJS sandbox.
```tsx
import { useRuntime, useToolJavaScript, useChat } from '@hashbrownai/react'
const runtime = useRuntime({ functions: [] })
const jsTool = useToolJavaScript({ runtime })
const chat = useChat({ tools: [jsTool], model: 'gpt-4' })
```
**When to use**: Let the LLM perform complex calculations, data transformations, or generate visualizations using code.
**Reference**: See [core-concepts.md](references/core-concepts.md) for runtime configuration.
### 5. Platform Integration
Connect to any LLM provider via backend adapters:
```typescript
// Backend server (Node.js)
import { HashbrownOpenAI } from '@hashbrownai/openai'
const stream = HashbrownOpenAI.stream.text({
apiKey: process.env.OPENAI_API_KEY,
request,
})
```
**Supported platforms**: OpenAI, Anthropic, Google, Azure, Bedrock, Ollama, Writer, and custom adapters.
**Reference**: See [platform-integration.md](references/platform-integration.md) for all adapter configurations.
## Common Patterns
### Building a Chat Interface
1. Generate component: `python scripts/generate-component.py simple-chat ./src`
2. Generate server: `python scripts/generate-server.py basic-chat-server ./backend`
3. Wrap app in `<HashbrownProvider url="/api/chat">`
4. Customize system prompt and model in component
### Adding Generative UI
1. Generate: `python scripts/generate-component.py ui-chat-with-components ./src`
2. Create presentational React components
3. Expose with `exposeComponent(Component, { name, description, props })`
4. Pass to `useUiChat({ components: [...] })`
5. Write system prompt instructing when to use components
### Implementing Tool Calling
1. Define tools with `useTool({ name, description, handler })`
2. Pass to chat hook: `useChat({ tools: [...] })`
3. Tools are automatically called by the LLM when needed
4. Tool results are sent back to LLM in the conversation
### Streaming Structured Data
1. Use `s.streaming` modifier in Skillet schema:
```tsx
const schema = s.object('ReRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.