Skip to main content
ClaudeWave
EN, English
Skill5.1k repo starsupdated 2mo ago

develop-data-analysis-dashboard

This Claude Code skill enables end-to-end data analysis dashboard development, from project creation through data cleaning, card management, and validation. Use it when users need to build interactive dashboards with metric cards, ECharts visualizations, tables, and data processing, ensuring compliance with mandatory card count requirements (at least 6 metrics, 26-30 ECharts, 2-3 tables) before delivery.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/dtyq/magic /tmp/develop-data-analysis-dashboard && cp -r /tmp/develop-data-analysis-dashboard/backend/super-magic/agents/skills/develop-data-analysis-dashboard ~/.claude/skills/develop-data-analysis-dashboard
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Data Analysis Dashboard Development Skill

Provides full data analysis dashboard (instrument panel) development capabilities—project creation, card plan, data cleaning, dashboard development, validation, and delivery—as one end-to-end workflow. Data cleaning is an important part of dashboard development.

---

## Code Execution Method

All tool calls via `from sdk.tool import tool` in this skill must be executed by passing code to `run_sdk_snippet`'s `python_code` parameter.

When a skill snippet calls tools through the SDK, always use `result.ok` to determine success and read failure details from `result.content`. Do not read or call `result.error`, because SDK `Result` stores failure text in `content`.

---

## Quick Start

**Important**: Detailed rules are inlined later in this document; while executing steps, consult Workflow Summary, Project Setup, Dashboard Development, and Dashboard Data Cleaning Guide.

**Runtime base files**: Do not modify, overwrite, or delete `index.html`, `dashboard.js`, or `index.css`; violations make the data dashboard unusable.

**Default card counts for new dashboards — MANDATORY unless the user explicitly requests a reduced scope:**

| Card type | Required count | Notes                                                                        |
| --------- | -------------- | ---------------------------------------------------------------------------- |
| metric    | **≥ 6**        | Key KPI overview cards                                                       |
| echarts   | **26 – 30**    | Core of the dashboard; pad with same-type charts across different dimensions |
| table     | **2 – 3**      | At least 1 must be a detail-level table                                      |
| markdown  | 0              | Omit unless the user asks for notes/commentary                               |
| **Total** | **34 – 39**    | Self-check before delivery                                                   |

**Enforcement rules (non-negotiable):**

- You **must** list every card in `cards_plan` before calling `create_dashboard_project`; do not defer cards to later.
- `card_id` in `cards_plan` must exactly match the `id` used in subsequent `create_dashboard_cards` calls.
- If echarts count falls short, add same-type charts covering different dimensions or time ranges — do **not** lower the floor.
- Before delivery, call `query_dashboard_cards` and count by `type`; if any type is below the required count, create the missing cards before proceeding.
- These counts are overridden **only** when the user explicitly states they want a smaller dashboard.

---

## Workflow Summary

**Path overview**

- **New dashboard**: Planning prep (brainstorm + read sources) → Create dashboard project → Data cleaning → Dashboard development → Validate → Complete delivery
- **Edit dashboard**: Project identification → Data cleaning (as needed) → Dashboard editing and card-tool maintenance → Validate → Complete delivery

**Step details**

- **Project identification**: Understand user needs and identify the target project (edit scenarios)
- **Planning prep (new dashboards)**: Before `create_dashboard_project`, brainstorm questions and angles; **read sources in depth** (fields, grain, definitions, time, distributions, missingness, comparable dimensions), then author `cards_plan` strictly following the **mandatory counts in Quick Start** (metric ≥6, echarts 26–30, table 2–3, total 34–39)—**every card must be listed before project creation**; a handful of representative charts is not acceptable
- **Create project**: Must call `create_dashboard_project` with the required `cards_plan` in the same call; the tool writes `cards_plan.md` from it; plan card identifiers must match `id` in later `create_dashboard_cards`
- **Data cleaning**: From `cards_plan.md` and data goals, create and run `data_cleaning.py` in the project to supply data for the dashboard
- **Dashboard editing**: Change allowed files as needed (e.g. data_cleaning.py, cleaned_data/, config.js; never modify or delete index.html, dashboard.js, index.css) (edit scenarios)
- **Dashboard development**: Per `cards_plan.md`, use card tools (create_dashboard_cards, update_dashboard_cards, delete_dashboard_cards, query_dashboard_cards) to create or maintain cards
- **Validate dashboard**: Call `validate_dashboard(project_path="PROJECT_NAME")`; fix errors and re-run until passing (do not delete cards to pass validation)
- **Complete delivery**: Summarize the project and analysis results, then close the task

**Core principles**

Follow the steps in order; validation must pass before delivery or the page will not work.
Never modify, overwrite, or delete `index.html`, `dashboard.js`, or `index.css`, or the data dashboard becomes unusable (maintain allowed files such as `data.js` only via card tools and other permitted paths).

**Preferences**

- New dashboards: **planning prep** first, then `cards_plan`; **strictly follow the mandatory card counts table in Quick Start** — metric ≥6, echarts 26–30, table 2–3, total 34–39; self-check with `query_dashboard_cards` before delivery
- Prefer setting `title` on cards (skip on metric cards when it would duplicate the metric `label`)
- Prefer ECharts; many charts → same-type charts across dimensions
- Card standard size examples (24-column grid): metric `{w:4,h:3}`, chart `{w:8,h:8}`, table `{w:12,h:8}`, Markdown `{w:12,h:(calculate height based on content)}`

---

## Decision Tree

New or edit dashboard?
├─ New → Planning prep (brainstorm, read sources) → Author cards_plan [metric ≥6, echarts 26–30, table 2–3, total 34–39, ALL cards listed] → create_dashboard_project → Data cleaning → Dashboard development → Validate → Complete delivery
└─ Edit → Identify existing dashboard project → Data cleaning (as needed) → Dashboard development/editing → Validate → Complete delivery

Need data cleaning?
├─ New dashboard → Must execute data_cleaning.py
├─ Edit dashboard with data/requirement changes → Execute as needed
└─
agent-infoSkill

Query the list of all agents (employees) available to the current user. Use when generating code that requires a real agentId, or when the user asks "which agents/employees do I have".

ai-card-generatorSkill

|

antd-style-to-tailwindSkill

Migrate existing antd-style CSS-in-JS (createStyles) components to Tailwind CSS utility classes with full dark mode support, following the project's style system transition strategy. Use when the user asks to migrate, convert, or rewrite antd-style components to Tailwind, or when working on new components in files that already use antd-style.

browserSkill

Open and operate webpages in a real browser: navigate, read rendered content, inspect interactive elements, click, type, submit forms, press keys, select options, check boxes, hover, scroll, upload files, wait for page changes, manage pages, take and save screenshots, analyze visual layout, and inspect page errors and network activity.

canvas-designerSkill

Core canvas design skill covering project management, multimedia principles, AI image generation, web image search, and design marker processing. Load for any canvas design task. CRITICAL - When user message contains [@design_canvas_project:...] or [@design_marker:...] mentions, or when the user wants to generate video/animation/clip on a canvas project, you MUST load this skill first before any operations.

chat-historySkill

Use when details may have been lost after context compaction, or when the Agent needs to inspect earlier compacted messages or previously created sub-agents.

cli-managerSkill

Manage persistence for user-installed third-party CLI tools in the Super Magic sandbox. Use when the user wants to install, configure, adopt, restore, inspect, or remove a CLI, or when an external skill, webpage, or installer asks to run CLI install commands such as curl|sh, npm install -g, pipx install, uv tool install, go install, cargo install, or brew install. Do not persist runtime-provided CLIs.

code-review-expertSkill

Expert code review of current git changes with a senior engineer lens. Detects SOLID violations, security risks, and proposes actionable improvements.