Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

Add /flare-ai-app skill for AI business intelligence apps

Jeremy Dawes3cdcbcdf805e
diff --git a/plugins/cloudflare/skills/flare-ai-app/SKILL.md b/plugins/cloudflare/skills/flare-ai-app/SKILL.md
new file mode 100644
index 00000000..22c143a9
--- /dev/null
+++ b/plugins/cloudflare/skills/flare-ai-app/SKILL.md
@@ -0,0 +1,347 @@
+---
+name: flare-ai-app
+description: "Scaffold an AI-powered business intelligence app from vite-flare-ai-starter. Includes AI tool-calling agent with SSE streaming, knowledge base with FTS5, inline charts, user memories, conversation sharing, and lead capture. Clone, configure domain tools + schema, seed KB, deploy to Cloudflare."
+compatibility: claude-code-only
+---
+
+# Flare AI App
+
+Clone and configure the AI business intelligence starter into a standalone client app. Produces a fully branded, deployable AI analyst platform with domain-specific tools, knowledge base, and dashboards.
+
+## What You Get
+
+| Layer | Technology |
+|-------|-----------|
+| Frontend | React 19, Vite, Tailwind v4, shadcn/ui colour schemes |
+| Backend | Hono (on Cloudflare Workers) |
+| Database | D1 (SQLite at edge) with FTS5 knowledge base search |
+| AI | Anthropic Claude API (direct, with prompt caching + SSE streaming) |
+| Charts | Recharts (bar, line, pie, scatter, control) inline in chat |
+| Features | AI analyst, KB, memories, sharing, artifacts, lead gate, Ctrl+K search |
+| Deployment | Cloudflare Workers with Static Assets |
+
+See [references/tech-stack.md](references/tech-stack.md) for the full dependency list.
+
+## Architecture
+
+Everything in `src/` is shared infrastructure — never needs modification. Everything in `config/` is domain-specific — this is what you customise per client.
+
+```
+config/ ← CUSTOMISE per client
+ app.ts — app identity, feature toggles, defaults
+ schema.ts — AI system prompt (domain knowledge, table schemas)
+ tools.ts — domain-specific AI tools (definitions + executors)
+ nav.ts — sidebar navigation sections
+ seed.sql — initial KB articles
+
+src/server/ ← STABLE: shared AI agent infrastructure
+src/client/ ← STABLE: shared UI components
+```
+
+## Workflow
+
+### Step 1: Gather Project Info
+
+Ask for:
+
+| Required | Optional |
+|----------|----------|
+| Project name (kebab-case, e.g. `acme-ai`) | Custom domain |
+| Client/business name (display name) | Logo character/emoji |
+| Business domain (what data? what industry?) | Colour scheme preference |
+| One-line description | Lead capture (demo mode)? |
+
+Also ask about the data source:
+- **D1 only** (default): Domain tables in D1, populated via import/seed
+- **Hyperdrive**: Existing PostgreSQL/MySQL database to connect to
+
+### Step 2: Clone and Configure
+
+See [references/setup-pattern.md](references/setup-pattern.md) for exact operations.
+
+1. **Clone** the starter repo and remove `.git`, init fresh repo
+ ```bash
+ git clone https://github.com/jezweb/vite-flare-ai-starter.git PROJECT_DIR --depth 1
+ cd PROJECT_DIR
+ rm -rf .git
+ git init
+ ```
+
+2. **Rebrand** — find-replace in these files:
+
+ | File | What Changes |
+ |------|-------------|
+ | `wrangler.jsonc` | Worker name (`"name"`), database name |
+ | `package.json` | Package name, version to `0.1.0` |
+ | `index.html` | `<title>`, favicon emoji |
+ | `config/app.ts` | `name`, `description`, `logoChar`, `version`, `defaultModel`, `kbCategories` |
+
+3. **Create** `.dev.vars` from template with `ANTHROPIC_API_KEY`
+
+4. **Create** Cloudflare D1 database and update `wrangler.jsonc` with `database_id`
+
+5. **Install** and migrate:
+ ```bash
+ npm install
+ npm run db:migrate
+ npm run db:seed
+ ```
+
+### Step 3: Configure Domain (THE KEY STEP)
+
+This is where the app becomes specific to the client's business. Configure these 5 files:
+
+#### 3a. Domain Schema (`config/schema.ts`)
+
+Write the `DOMAIN_SYSTEM_PROMPT` that makes the AI smart about THIS client's data:
+
+```typescript
+export const DOMAIN_SYSTEM_PROMPT = `
+## Domain: [Client's Business]
+
+You are an AI analyst for [Client Name], a [business description].
+
+### Database Tables
+
+**orders** — Customer orders
+| Column | Type | Description |
+|--------|------|-------------|
+| id | INTEGER | Primary key |
+| customer_name | TEXT | Customer name |
+| total | REAL | Order total in AUD |
+| status | TEXT | pending/confirmed/shipped/delivered |
+| created_at | TEXT | ISO timestamp |
+
+### Domain Knowledge
+- [Key business rules, terminology, seasonal patterns]
+- [How metrics are calculated]
+- [Important relationships between tables]
+
+### Common Queries
+- "How are sales this month?" → Query orders table, group by date
+- "Who are our top customers?" → Aggregate by customer_name
+`;
+```
+
+**Tips**: Include table schemas with column descriptions, domain terminology, join paths between tables, and example query patterns. This is the single most important customisation.
+
+#### 3b. Domain Tools (`config/tools.ts`)
+
+Define AI tools beyond the built-in ones (run_sql, search_kb, create_chart, etc.):
+
+```typescript
+import type { ToolDefinition } from "@shared/types";
+
+export const DOMAIN_TOOL_DEFINITIONS: ToolDefinition[] = [
+ {
+ name: "get_summary_stats",
+ description: "Get summary statistics for a date range",
+ input_schema: {
+ type: "object" as const,
+ properties: {
+ from_date: { type: "string", description: "Start date (YYYY-MM-DD)" },
+ to_date: { type: "string", description: "End date (YYYY-MM-DD)" },
+ },
+ required: ["from_date", "to_date"],
+ },
+ },
+];
+
+export async function executeDomainTool(
+ name: string,
+ input: Record<string, unknown>,
+ db: D1Database,
+): Promise<unknown> {
+ switch (name) {
+ case "get_summary_stats": {
+ // Execute domain-specific queries
+ const result = await db.prepare(
+ "SELECT COUNT(*) as count, SUM(total) as revenue FROM orders WHERE created_at >= ?1 AND created_at <= ?2"
+ ).bind(input.from_date, input.to_date).first();
+ return result;
+ }
+ default:
+ return { error: `Unknown tool: ${name}` };
+ }
+}
+
+export function domainToolInputSummary(
+ name: string,
+ input: Record<string, unknown>,
+): string | null {
+ if (name === "get_summary_stats") return `${input.from_date} to ${input.to_date}`;
+ return null;
+}
+```
+
+#### 3c. Navigation (`config/nav.ts`)
+
+Add sidebar sections for domain-specific pages:
+
+```typescript
+import { LayoutDashboard, Sparkles, BookOpen, Settings } from "lucide-react";
+import type { LucideIcon } from "lucide-react";
+
+export interface NavItem { to: string; label: string; icon?: LucideIcon; }
+export interface NavSection { label: string; items: NavItem[]; }
+
+export const NAV_SECTIONS: NavSection[] = [
+ {
+ label: "Analytics",
+ items: [
+ { to: "/app", label: "Overview", icon: LayoutDashboard },
+ { to: "/app/analyst", label: "AI Analyst", icon: Sparkles },
+ ],
+ },
+ {
+ label: "Resources",
+ items: [
+ { to: "/app/kb", label: "Knowledge Base", icon: BookOpen },
+ { to: "/app/settings", label: "Settings", icon: Settings },
+ ],
+ },
+];
+```
+
+#### 3d. Seed Data (`config/seed.sql`)
+
+Insert KB articles with domain-specific knowledge the AI can search:
+
+```sql
+INSERT INTO kb_articles (slug, category, title, content) VALUES
+('business-overview', 'general', 'Business Overview',
+ 'Description of the business, its products/services, key metrics...'),
+('data-dictionary', 'technical', 'Data Dictionary',
+ 'Explanation of database tables, column meanings, data quality notes...');
+```
+
+#### 3e. App Identity (`config/app.ts`)
+
+Update the APP_CONFIG with client branding:
+
+```typescript
+export const APP_CONFIG = {
+ name: "Acme AI",
+ description: "AI-powered analytics for Acme Corp",
+ logoChar: "A",
+ version: "1.0.0",
+ defaultModel: "claude-sonnet",
+ // ...
+};
+```
+
+### Step 4: Create Domain Migration (if needed)
+
+If the client has domain-specific tables beyond the built-in ones:
+
+```bash
+# Create migration file
+cat > migrations/0002_domain.sql << 'EOF'
+-- Domain tables for [Client]
+CREATE TABLE IF NOT EXISTS orders (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ customer_name TEXT NOT NULL,
+ total REAL NOT NULL DEFAULT 0,
+ status TEXT NOT NULL DEFAULT 'pending',
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
+ updated_at TEXT NOT NULL DEFAULT (datetime('now'))
+);
+EOF
+
+# Apply
+npm run db:migrate
+```
+
+### Step 5: Create Domain Dashboard (optional)
+
+Edit `src/client/pages/domain/Overview.tsx` to show KPI cards and charts specific to the client's business. Use the included components:
+
+```tsx
+import { KPICard } from "@/components/dashboard/KPICard";
+import { FilterBar } from "@/components/dashboard/FilterBar";
+import { SkeletonCard } from "@/components/ui/Skeleton";
+```
+
+### Step 6: Verify Locally
+
+```bash
+npm run dev
+```
+
+Check:
+- [ ] App loads with correct branding at http://localhost:5173 (or next available port)
+- [ ] AI analyst responds (requires ANTHROPIC_API_KEY in .dev.vars)
+- [ ] Knowledge base shows seeded articles
+- [ ] Ctrl+K command palette works
+- [ ] Theme switching works in Settings
+
+### Step 7: Deploy to Production
+
+```bash
+# Set secrets
+echo "sk-ant-api03-your-key" | npx wrangler secret put ANTHROPIC_API_KEY
+
+# Migrate remote database
+npm run db:migrate:remote
+npm run db:seed:remote
+
+# Build and deploy
+npm run deploy
+```
+
+After first deploy:
+- [ ] Verify at `https://PROJECT_NAME.workers.dev`
+- [ ] Test AI analyst with a real question
+- [ ] Optionally add custom domain via `wrangler.jsonc` routes
+
+## Common Issues
+
+| Symptom | Cause | Fix |
+|---------|-------|-----|
+| AI returns errors | Missing ANTHROPIC_API_KEY | Add key to `.dev.vars` (local) or `wrangler secret put` (production) |
+| KB search returns nothing | Seed data not loaded | Run `npm run db:seed` |
+| D1 "table not found" | Migrations not applied | Run `npm run db:migrate` (local) or `npm run db:migrate:remote` (production) |
+| 500 on API endpoints | Dev server started before migrations | Restart dev server after applying migrations |
+| Charts not rendering | Missing data in tool response | Check `create_chart` tool returns valid `data`, `x_key`, `y_keys` |
+| Model selector shows "unavailable" | No API key configured | Expected without key — set ANTHROPIC_API_KEY |
+| Lead gate blocks access | `features.leadCapture` is true | Set to `false` in config/app.ts, or register via the gate |
+| Build > 500KB warning | Recharts is large (~600KB) | Expected — use React.lazy() for code splitting if needed |
+
+## What Gets Customised
+
+| File | What Changes | When |
+|------|-------------|------|
+| `config/app.ts` | App name, description, logo, features | Always |
+| `config/schema.ts` | AI system prompt with domain knowledge | Always |
+| `config/tools.ts` | Domain-specific AI tool definitions | Usually |
+| `config/nav.ts` | Sidebar navigation items | Usually |
+| `config/seed.sql` | KB articles for the domain | Always |
+| `wrangler.jsonc` | Worker name, database_id, custom domain | Always |
+| `package.json` | Package name | Always |
+| `index.html` | Title, favicon | Always |
+| `migrations/0002_domain.sql` | Domain-specific tables | If D1 data |
+| `src/client/pages/domain/Overview.tsx` | Domain dashboard | Optional |
+
+## Built-in AI Tools (always available)
+
+| Tool | Purpose |
+|------|---------|
+| `list_tables` | Show available tables + row counts |
+| `get_table_schema` | Column names, types, sample data |
+| `run_sql` | Read-only SQL (up to 500 rows) |
+| `calculate` | Arithmetic expressions |
+| `search_kb` | FTS5 knowledge base search |
+| `create_chart` | Inline chart (bar/line/pie/scatter/control) |
+| `calculate_process_stats` | Mean, stddev, Cp, Cpk |
+
+## Domain Tool Libraries (copy from previous projects)
+
+For common verticals, reuse tool definitions from existing projects:
+
+| Vertical | Source | Tools included |
+|----------|--------|---------------|
+| Manufacturing | Crosbe AI / Plastiq AI | SPC, Nelson Rules, Cpk, spec limits, batch tracking |
+| SEO | WhisperingWombat | Rank tracking, crawl analysis, competitor comparison |
+| General analytics | This starter | Summary stats, date range queries |
+
+See [references/customisation-guide.md](references/customisation-guide.md) for the full guide.
diff --git a/plugins/cloudflare/skills/flare-ai-app/assets/dev-vars-template.txt b/plugins/cloudflare/skills/flare-ai-app/assets/dev-vars-template.txt
new file mode 100644
index 00000000..27f355fc
--- /dev/null
+++ b/plugins/cloudflare/skills/flare-ai-app/assets/dev-vars-template.txt
@@ -0,0 +1,2 @@
+# Anthropic API Key (required for AI features)
+ANTHROPIC_API_KEY={{ANTHROPIC_API_KEY}}
diff --git a/plugins/cloudflare/skills/flare-ai-app/assets/wrangler-template.jsonc b/plugins/cloudflare/skills/flare-ai-app/assets/wrangler-template.jsonc
new file mode 100644
index 00000000..67c42440
--- /dev/null
+++ b/plugins/cloudflare/skills/flare-ai-app/assets/wrangler-template.jsonc
@@ -0,0 +1,43 @@
+{
+ "$schema": "node_modules/wrangler/config-schema.json",
+ "name": "{{PROJECT_NAME}}",
+ "compatibility_date": "2025-04-01",
+ "compatibility_flags": ["nodejs_compat"],
+ "account_id": "{{ACCOUNT_ID}}",
+ "main": "src/server/index.ts",
+ "assets": {
+ "directory": "dist/client",
+ "binding": "ASSETS",
+ "not_found_handling": "single-page-application",
+ "run_worker_first": ["/api/*"]
+ },
+ "observability": {
+ "enabled": true,
+ "logs": {
+ "invocation_logs": true,
+ "head_sampling_rate": 1
+ }
+ },
+ "d1_databases": [
+ {
+ "binding": "DB",
+ "database_name": "{{PROJECT_NAME}}-db",
+ "database_id": "{{DATABASE_ID}}"
+ }
+ ],
+ "ai": {
+ "binding": "AI"
+ },
+ // Optional: Hyperdrive for external PostgreSQL/MySQL
+ // "hyperdrive": [
+ // {
+ // "binding": "HYPERDRIVE",
+ // "id": "{{HYPERDRIVE_ID}}"
+ // }
+ // ],
+ "workers_dev": true
+ // Custom domain when ready:
+ // "routes": [
+ // { "pattern": "{{CUSTOM_DOMAIN}}", "custom_domain": true }
+ // ]
+}
diff --git a/plugins/cloudflare/skills/flare-ai-app/references/customisation-guide.md b/plugins/cloudflare/skills/flare-ai-app/references/customisation-guide.md
new file mode 100644
index 00000000..0cd8e19e
--- /dev/null
+++ b/plugins/cloudflare/skills/flare-ai-app/references/customisation-guide.md
@@ -0,0 +1,149 @@
+# Flare AI App — Customisation Guide
+
+Complete checklist for turning the starter into a client-specific app.
+
+## Automated (Step 2 in setup)
+
+| Item | File | Default Value |
+|------|------|--------------|
+| Worker name | `wrangler.jsonc` | `my-ai-app` |
+| Database name | `wrangler.jsonc` | `my-ai-app-db` |
+| Database ID | `wrangler.jsonc` | `REPLACE_WITH_YOUR_DATABASE_ID` |
+| Package name | `package.json` | `vite-flare-ai-starter` |
+| Page title | `index.html` | Emoji favicon |
+
+## Domain Configuration (Step 3 — THE KEY STEP)
+
+### config/app.ts — App Identity
+
+| Field | Purpose | Example |
+|-------|---------|---------|
+| `name` | Display name in sidebar + header | `"Acme Analytics"` |
+| `description` | Subtitle / tagline | `"AI-powered business intelligence"` |
+| `logoChar` | Single character for sidebar logo | `"A"` |
+| `version` | Shown in sidebar footer | `"1.0.0"` |
+| `defaultModel` | Initial AI model selection | `"claude-sonnet"` |
+| `timezone` | Date/time display | `"Australia/Sydney"` |
+| `kbCategories` | KB article category list | `["general", "technical", "faq"]` |
+| `features.leadCapture` | Enable demo access gate | `false` |
+
+### config/schema.ts — AI System Prompt
+
+This is the **most important** customisation. The quality of the AI's responses depends entirely on this file.
+
+**Must include:**
+- Business context (what the company does, key metrics)
+- Table schemas with column descriptions
+- Domain terminology and definitions
+- Common query patterns (what users typically ask)
+- Data quality notes and caveats
+
+**Pattern for table documentation:**
+```
+### Table: orders
+| Column | Type | Description |
+|--------|------|-------------|
+| id | INTEGER | Auto-increment primary key |
+| customer_name | TEXT | Full customer name |
+| total | REAL | Order total in AUD (GST-inclusive) |
+| status | TEXT | One of: pending, confirmed, shipped, delivered |
+| region | TEXT | State abbreviation (NSW, VIC, QLD, etc.) |
+| created_at | TEXT | ISO 8601 timestamp |
+
+**Joins**: orders.customer_id → customers.id
+**Note**: Historical orders before 2024 may have NULL region values.
+```
+
+### config/tools.ts — Domain Tools
+
+Three exports required:
+
+| Export | Type | Purpose |
+|--------|------|---------|
+| `DOMAIN_TOOL_DEFINITIONS` | `ToolDefinition[]` | Tool definitions for the AI |
+| `executeDomainTool` | `async function` | Server-side tool executor |
+| `domainToolInputSummary` | `function` | Human-readable input for streaming UI |
+
+**When to add domain tools:**
+- Calculations that are too complex for SQL alone
+- Aggregations that span multiple queries
+- Domain-specific metrics (e.g., Cpk, conversion rate, retention)
+- Lookups from external sources
+
+**When NOT to add domain tools:**
+- Simple SELECT queries — the built-in `run_sql` handles these
+- Basic calculations — the built-in `calculate` tool handles these
+- Chart rendering — the built-in `create_chart` tool handles this
+
+### config/nav.ts — Sidebar Navigation
+
+Each section has a label and items array. Items need `to` (route path), `label`, and optional `icon` (Lucide icon component).
+
+The CommandPalette (Ctrl+K) automatically reads `NAV_SECTIONS` — no separate configuration needed.
+
+### config/seed.sql — KB Seed Data
+
+Categories should match `APP_CONFIG.kbCategories`. Each article needs:
+- `slug` — URL-friendly identifier (unique)
+- `category` — one of the configured categories
+- `title` — article title
+- `content` — full markdown content
+
+**Good KB articles to seed:**
+- Business overview and key metrics
+- Data dictionary (table/column explanations)
+- FAQs about common data questions
+- Methodology notes (how metrics are calculated)
+- Getting started guide for end users
+
+## Domain-Specific Code
+
+### migrations/0002_domain.sql
+
+Create domain tables. Follow D1/SQLite patterns:
+- Use `TEXT` for dates (ISO 8601)
+- Use `REAL` for decimals
+- Use `INTEGER PRIMARY KEY AUTOINCREMENT` for IDs
+- Add `created_at` and `updated_at` with `DEFAULT (datetime('now'))`
+- **Never use** PostgreSQL functions (STDDEV, DATE_TRUNC, INTERVAL, etc.)
+
+### src/client/pages/domain/Overview.tsx
+
+Customise the landing dashboard. Available components:
+
+| Component | Import | Purpose |
+|-----------|--------|---------|
+| `KPICard` | `@/components/dashboard/KPICard` | Metric card with trend |
+| `FilterBar` | `@/components/dashboard/FilterBar` | Date range picker |
+| `SkeletonCard` | `@/components/ui/Skeleton` | Loading placeholder |
+| `SkeletonChart` | `@/components/ui/Skeleton` | Chart loading state |
+| `SkeletonTable` | `@/components/ui/Skeleton` | Table loading state |
+
+### src/server/routes/domain/example.ts
+
+Add domain-specific API routes (dashboards, exports, etc.). These are mounted at `/api/domain/`.
+
+## Deployment Checklist
+
+- [ ] `ANTHROPIC_API_KEY` set via `wrangler secret put`
+- [ ] D1 database created and ID in `wrangler.jsonc`
+- [ ] Remote migrations applied (`npm run db:migrate:remote`)
+- [ ] Remote seed data loaded (`npm run db:seed:remote`)
+- [ ] Custom domain configured (optional)
+- [ ] Lead capture toggled appropriately
+- [ ] AI analyst tested with a real domain question
+
+## Colour Schemes
+
+Six built-in colour schemes (each with light/dark variants):
+
+| Scheme | Primary colour | Best for |
+|--------|---------------|----------|
+| `default` (zinc) | Neutral grey | Professional, conservative |
+| `blue` | Blue | Tech, corporate |
+| `green` | Emerald | Health, environment, finance |
+| `orange` | Orange | Energy, construction, trades |
+| `violet` | Purple | Creative, premium |
+| `rose` | Pink/rose | Beauty, wellness, lifestyle |
+
+Users choose in Settings. The scheme is stored in localStorage and applied via CSS custom properties.
diff --git a/plugins/cloudflare/skills/flare-ai-app/references/setup-pattern.md b/plugins/cloudflare/skills/flare-ai-app/references/setup-pattern.md
new file mode 100644
index 00000000..0b4d82e3
--- /dev/null
+++ b/plugins/cloudflare/skills/flare-ai-app/references/setup-pattern.md
@@ -0,0 +1,120 @@
+# Flare AI App — Setup Pattern
+
+Reference for the operations Claude performs when scaffolding a new AI app from
+vite-flare-ai-starter. Adapt to the user's environment.
+
+## Step 1: Clone and Clean
+
+```bash
+git clone https://github.com/jezweb/vite-flare-ai-starter.git PROJECT_DIR --depth 1
+cd PROJECT_DIR
+rm -rf .git
+git init
+```
+
+## Step 2: Find-Replace Targets
+
+Replace default values with the project-specific names:
+
+| File | Target | Replace with | Notes |
+|------|--------|-------------|-------|
+| `wrangler.jsonc` | `"my-ai-app"` (name field) | `"PROJECT_NAME"` | Worker name |
+| `wrangler.jsonc` | `"my-ai-app-db"` (database_name) | `"PROJECT_NAME-db"` | |
+| `wrangler.jsonc` | `REPLACE_WITH_YOUR_DATABASE_ID` | Actual database_id | After creating D1 |
+| `wrangler.jsonc` | Existing `account_id` value | Verify or remove | Let wrangler prompt |
+| `package.json` | `"vite-flare-ai-starter"` | `"PROJECT_NAME"` | Package name |
+| `package.json` | Version | `"0.1.0"` | Reset version |
+| `index.html` | Favicon emoji and `<title>` content | Client's branding | |
+
+## Step 3: Configure App Identity
+
+Edit `config/app.ts`:
+
+```typescript
+export const APP_CONFIG = {
+ name: "Client AI", // Display name
+ description: "AI analytics", // One-liner
+ logoChar: "C", // Sidebar logo character
+ version: "1.0.0",
+ defaultModel: "claude-sonnet" as const,
+ timezone: "Australia/Sydney",
+ allowedOrigins: [],
+ kbCategories: ["general", "technical", "faq"],
+ features: {
+ leadCapture: false, // Set true for demo mode
+ },
+};
+```
+
+## Step 4: Create .dev.vars
+
+```
+# Anthropic API Key (required for AI features)
+ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
+```
+
+## Step 5: Create Cloudflare D1 Database
+
+```bash
+npx wrangler d1 create PROJECT_NAME-db
+# Extract database_id from output, update wrangler.jsonc
+```
+
+## Step 6: Install, Migrate, Seed
+
+```bash
+npm install
+npm run db:migrate
+npm run db:seed
+```
+
+## Step 7: Configure Domain
+
+This is the critical customisation step. Edit these files:
+
+### config/schema.ts — AI System Prompt
+
+The `DOMAIN_SYSTEM_PROMPT` string is injected into the AI's system prompt. Include:
+- Business description and terminology
+- Database table schemas with column descriptions
+- Join paths between tables
+- Common query patterns
+- Data quality caveats
+
+### config/tools.ts — Domain AI Tools
+
+Export `DOMAIN_TOOL_DEFINITIONS` (array of tool definitions for the AI), `executeDomainTool` (server-side executor), and `domainToolInputSummary` (human-readable input display).
+
+### config/nav.ts — Sidebar Navigation
+
+Define `NAV_SECTIONS` with items pointing to routes. The CommandPalette reads these automatically.
+
+### config/seed.sql — KB Articles
+
+Insert domain-specific knowledge base articles. Categories should match `APP_CONFIG.kbCategories`.
+
+## Step 8: Domain Migration (if needed)
+
+Create `migrations/0002_domain.sql` with domain-specific tables, then:
+
+```bash
+npm run db:migrate
+```
+
+## Step 9: Initial Commit
+
+```bash
+git add -A
+git commit -m "Initial commit: PROJECT_NAME from vite-flare-ai-starter"
+```
+
+## Step 10: Push to GitHub
+
+```bash
+gh repo create jezweb/PROJECT_NAME --private --source=. --push --description "AI-powered analytics for CLIENT_NAME"
+```
+
+## macOS sed Note
+
+macOS `sed -i` requires an extension argument: `sed -i '' 's/old/new/g' file`.
+Use the Edit tool directly (preferred — avoids sed entirely).
diff --git a/plugins/cloudflare/skills/flare-ai-app/references/tech-stack.md b/plugins/cloudflare/skills/flare-ai-app/references/tech-stack.md
new file mode 100644
index 00000000..a940a899
--- /dev/null
+++ b/plugins/cloudflare/skills/flare-ai-app/references/tech-stack.md
@@ -0,0 +1,59 @@
+# Flare AI App — Tech Stack
+
+## Runtime & Server
+
+| Package | Purpose |
+|---------|---------|
+| `hono` | HTTP framework (Cloudflare Workers) |
+| `@cloudflare/vite-plugin` | Dev server + build integration |
+| `wrangler` | Cloudflare CLI (deploy, D1, secrets) |
+
+## Frontend
+
+| Package | Purpose |
+|---------|---------|
+| `react` + `react-dom` | UI framework (v19) |
+| `react-router-dom` | Client-side routing (v7) |
+| `@tanstack/react-query` | Server state management |
+| `tailwindcss` + `@tailwindcss/vite` | Utility CSS (v4) |
+| `class-variance-authority` | Component variant utility |
+| `clsx` + `tailwind-merge` | Class name merging |
+| `lucide-react` | Icons |
+
+## AI & Data Visualisation
+
+| Package | Purpose |
+|---------|---------|
+| Anthropic Claude API | AI agent (direct HTTP, not SDK) |
+| `recharts` | Charts (bar, line, pie, scatter, control) |
+| `react-markdown` + `remark-gfm` | Markdown rendering in chat |
+
+## Date Handling
+
+| Package | Purpose |
+|---------|---------|
+| `date-fns` | Date formatting utilities |
+
+## Build & Dev
+
+| Package | Purpose |
+|---------|---------|
+| `vite` | Build tool (v6) |
+| `@vitejs/plugin-react` | React Fast Refresh |
+| `typescript` | Type checking |
+| `@cloudflare/workers-types` | Worker type definitions |
+
+## Cloudflare Services Used
+
+| Service | Binding | Purpose |
+|---------|---------|---------|
+| D1 | `DB` | SQLite database (structured data + FTS5 KB) |
+| Workers AI | `AI` | Office doc preprocessing (toMarkdown) |
+| Static Assets | `ASSETS` | SPA hosting |
+
+## Optional (uncomment in wrangler.jsonc)
+
+| Service | Binding | Purpose |
+|---------|---------|---------|
+| Hyperdrive | `HYPERDRIVE` | External PostgreSQL/MySQL connection pooling |
+| R2 | — | File/object storage |