dangjin/bi-builder-skills/bi-builder

Claude Code and agent skill by dangjin/bi-builder-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Build BI dashboards from databases. Use when creating dashboards, charts, or analytics pages with Next.js + shadcn/ui + Recharts + Prisma.

Install

npx vskill@latest install dangjin/bi-builder-skills/bi-builder

SKILL.md

BI Builder

Build BI dashboards from existing databases, from data exploration to full implementation.

Tech Stack

LayerTechnology
Frontend FrameworkNext.js 16 (App Router)
UI Componentsshadcn/ui + Tailwind CSS
ChartsRecharts
ORMPrisma
DatabaseMySQL / PostgreSQL / Supabase / SQLite

Core Workflow

Database Connection → Schema Exploration → Requirements Dialog → Metrics Design → Chart Planning → Page Implementation
Workflow Flexibility

Skip phases based on project state and user needs:

ScenarioSkip PhasesStarting Point
Project has prisma/schema.prismaPhase 1Go directly to Phase 2 schema analysis
User has clear requirements and metricsPhase 3Go directly to Phase 4 metrics design
Only need a single chart componentPhases 1-5Read recharts-guide.md and implement
Only need data query logicPhases 5-6End after metrics design

Decision criteria:

  • Check if prisma/schema.prisma exists in project
  • Ask user "Do you have specific metrics requirements?"
  • Ask user "Do you need a full dashboard or just a single chart?"

Phase 1: Database Connection

1.1 Check and Install Prisma

First, check if Prisma is already installed in the project:

bash
# Check if prisma is in package.json dependencies
grep -q '"prisma"' package.json && echo "Prisma installed" || echo "Prisma not installed"

If Prisma is not installed, install it:

bash
# Install Prisma as dev dependency
npm install prisma --save-dev
# Install Prisma Client
npm install @prisma/client
1.2 Initialize Prisma
bash
# Initialize Prisma (creates prisma/schema.prisma and .env)
npx prisma init

Note: If prisma/schema.prisma already exists, skip this step.

1.3 Create .env with Placeholders

⚠️ Security Note: Never ask users to share database credentials directly.

First, ask user which database type they use, then create .env file with placeholders:

Which database are you using?
1. MySQL
2. PostgreSQL
3. Supabase
4. SQLite

For MySQL:

env
# Database Connection
# Please fill in your database credentials below
DATABASE_URL="mysql://YOUR_USERNAME:YOUR_PASSWORD@YOUR_HOST:3306/YOUR_DATABASE"
# Example:
# DATABASE_URL="mysql://root:password123@localhost:3306/myapp_db"

For PostgreSQL:

env
# Database Connection
# Please fill in your database credentials below
DATABASE_URL="postgresql://YOUR_USERNAME:YOUR_PASSWORD@YOUR_HOST:5432/YOUR_DATABASE"
# Example:
# DATABASE_URL="postgresql://postgres:password123@localhost:5432/myapp_db"

For Supabase:

env
# Supabase Database Connection
# Find your connection string in: Supabase Dashboard → Project Settings → Database → Connection string → URI
DATABASE_URL="postgresql://postgres.YOUR_PROJECT_REF:YOUR_PASSWORD@aws-0-YOUR_REGION.pooler.supabase.com:6543/postgres?pgbouncer=true"
# Direct connection (for migrations)
DIRECT_URL="postgresql://postgres.YOUR_PROJECT_REF:YOUR_PASSWORD@aws-0-YOUR_REGION.pooler.supabase.com:5432/postgres"
# Example:
# DATABASE_URL="postgresql://postgres.abcdefghijkl:MyPassword123@aws-0-us-east-1.pooler.supabase.com:6543/postgres?pgbouncer=true"

For SQLite:

env
# Database Connection
DATABASE_URL="file:./dev.db"

After creating the file, tell the user:

For MySQL/PostgreSQL:

I've created .env file with placeholders. Please fill in your actual database credentials:
- YOUR_USERNAME → your database username
- YOUR_PASSWORD → your database password
- YOUR_HOST → database host (e.g., localhost or IP address)
- YOUR_DATABASE → database name
Tip: Use a read-only account for safety.
Let me know when you've filled in the credentials.

For Supabase:

I've created .env file with Supabase placeholders. To get your connection string:
1. Go to Supabase Dashboard → Your Project
2. Click "Project Settings" (gear icon)
3. Go to "Database" section
4. Copy the "Connection string" → "URI" format
5. Replace [YOUR-PASSWORD] with your database password
Let me know when you've filled in the credentials.
1.4 Configure Prisma Schema

After user confirms .env is configured, update prisma/schema.prisma:

For MySQL/PostgreSQL/SQLite:

prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql" // or postgresql, sqlite
url = env("DATABASE_URL")
}

For Supabase (requires directUrl for migrations):

prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}
1.5 Pull Database Schema
bash
# Pull schema from existing database
npx prisma db pull
# Generate Prisma Client
npx prisma generate
1.6 Error Handling

When connection fails:

Error MessagePossible CauseSolution
Can't reach database serverNetwork/FirewallCheck host address and port accessibility
Access deniedInsufficient permissionsVerify username, password, and user privileges
Unknown databaseDatabase doesn't existConfirm database name spelling
SSL connection errorSSL configurationAdd ?sslmode=require to DATABASE_URL

Post-schema pull checks:

  • If few tables (< 3) → Confirm connection to correct database
  • If no relationships → May be legacy database, need manual relationship analysis

Phase 2: Schema Exploration & Analysis

2.1 Read Generated Schema

After prisma db pull, read prisma/schema.prisma and analyze:

  • Table structure: What tables exist, what fields each has
  • Data types: Numeric, datetime, categorical fields
  • Relationships: Table associations (one-to-many, many-to-many)
  • Indexes: Which fields are indexed, indicating common query dimensions
2.2 Identify Metric Potential

Identify buildable metrics by field type:

Field TypeMetric Potential
Decimal/Float/Int (amounts, quantities)Sum, average, max/min
DateTimeTime series analysis, YoY/MoM comparisons
Enum/String (status, category)Group statistics, distribution analysis
@relationJoin aggregations, multi-dimensional analysis
BooleanConversion rates, completion rates
2.3 Generate Data Overview Report

Present database overview to user:

markdown
## Database Overview
### Core Tables
-**orders** (Orders table): 12 fields, related to users, products
-**users** (Users table): 8 fields
-**products** (Products table): 10 fields, related to categories
### Available Metrics
**Transaction Metrics**
-Total revenue (orders.total)
-Order count (orders.count)
-Average order value (orders.total / orders.count)
**User Metrics**
-Total users (users.count)
-New users (users.created_at)
**Product Metrics**
-Sales ranking (order_items.quantity)
-Category distribution (categories)
### Time Dimensions
-orders.created_at → Supports daily/weekly/monthly analysis
-users.created_at → Supports user growth analysis

Phase 3: Requirements Dialog

3.1 Questioning Strategy

Principle: Ask one question at a time, prefer multiple choice, ask in rounds.

Round 1: Industry Identification (Highest Priority)
Question 0: What industry is your business in?
Options: E-commerce/Retail / SaaS Software / Financial Services / Content/Media / Education / Healthcare / Logistics/Supply Chain / Other

Industry determines metric direction:

IndustryCore FocusTypical Metrics
E-commerce/RetailTransaction conversionGMV, AOV, Repeat purchase rate, Return rate, Inventory turnover
SaaS SoftwareUser retentionMRR/ARR, Churn Rate, LTV, CAC, DAU/MAU
Financial ServicesRisk & returnAUM, Bad debt rate, Delinquency rate, Approval rate
Content/MediaTraffic monetizationPV/UV, Session duration, Bounce rate, Ad revenue, Paid conversion
EducationLearning outcomesCourse completion rate, Renewal rate, Referral rate, Study time
HealthcareService efficiencyVisit volume, Bed turnover, Return visit rate, Satisfaction
Logistics/Supply ChainOperational efficiencyOrder fulfillment rate, Delivery time, Warehouse cost, Turnover rate
Round 2: Core Metrics Confirmation (Use AskUserQuestion tool)

Based on industry + schema analysis, generate metric options:

Question 1: Based on [industry] context and database analysis, which core metrics matter most to you? (Multiple select)
Options: [Combine industry typical metrics + schema-supported metrics]
Question 2: What's your primary time granularity for analysis?
Options: Daily / Weekly / Monthly / Quarterly
Round 3: Conditional Follow-ups

Only ask when conditions are met:

ConditionFollow-up
Schema has category tables"Do you need category filtering?"
User selected multiple metrics"Do you need metric comparisons (YoY/MoM)?"
Data volume may be large"Do you need export functionality?"
Round 4: Confirmation

Show requirements confirmation template, ask "Is the above understanding correct?"

3.2 Data Structure Limitation Handling

When user requirements don't match data, clearly inform:

User RequestMissing DataResponse
Regional distribution analysisNo region field"Database has no region information, cannot implement. Should we analyze by [available dimension] instead?"
Trend analysisNo datetime field"Missing datetime field, can only do static statistics, cannot show trends."
User profilingLimited user fields"User data is limited, can only track basic metrics (count, new users)."
3.3 Requirements Confirmation Template

Organize user requirements:

markdown
## Requirements Confirmation
### Dashboard Name
Sales Analytics Dashboard
### Core Metrics (KPI Cards)
1.Total Revenue - orders.total sum
2.Order Count - orders count
3.AOV - Total Revenue / Order Count
4.New Users - users count (this month)
### Chart Requirements
| Chart | Type | Data Source | Dimension |
|-------|------|-------------|-----------|
| Revenue Trend | Line Chart | orders.total | By day/month |
| Category Sales | Pie Chart | categories | Category distribution |
| Top 10 Products | Bar Chart | products | Sales ranking |
| Order Status | Pie Chart | orders.status | Status distribution |
### Filters
-Date range picker
-Product category dropdown
-Order status multi-select
### Other Requirements
-CSV export support
-Responsive layout

Phase 4: Metrics Design

4.1 Define Metric Calculation Logic

Based on confirmed requirements, define calculation for each metric:

typescript
// lib/metrics.ts
// KPI Metrics
export async function getKPIs(startDate: Date, endDate: Date) {
const [revenue, orders, users] = await Promise.all([
// Total revenue
prisma.order.aggregate({
where: { createdAt: { gte: startDate, lte: endDate }, status: { not: 'CANCELLED' } },
_sum: { total: true },
}),
// Order count
prisma.order.count({
where: { createdAt: { gte: startDate, lte: endDate }, status: { not: 'CANCELLED' } },
}),
// New users
prisma.user.count({
where: { createdAt: { gte: startDate, lte: endDate } },
}),
]);
return {
revenue: Number(revenue._sum.total) || 0,
orders,
avgOrderValue: orders > 0 ? Number(revenue._sum.total) / orders : 0,
newUsers: users,
};
}
4.2 Time Series Metrics

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dangjin/bi-builder-skills/bi-builder/badge)](https://verified-skill.com/skills/dangjin/bi-builder-skills/bi-builder)

Something wrong with this skill or its page? Tell us.