用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kwkraus/my-dashboard --skill add-chart命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | add-chart |
| description | Add a new Recharts visualization with theme-aware styling to the dashboard |
When adding a new chart to this dashboard application using Recharts:
Use the useChartColors hook for theme-aware colors:
const colors = useChartColors();
This hook automatically updates chart colors when theme changes between light/dark modes.
Choose the appropriate chart type:
MiniLineChart or MiniBarChart from @/lib/charts for compact displaysApply consistent theming to all chart elements:
stroke="hsl(var(--border))" opacity={0.5}fill="hsl(var(--muted-foreground))" for tick labelscontentStyle={{
backgroundColor: "hsl(var(--popover))",
border: "1px solid hsl(var(--border))",
borderRadius: "8px",
fontSize: "12px",
color: "hsl(var(--popover-foreground))",
}}
colors.chart1, colors.chart2, etc.Make charts responsive:
<ResponsiveContainer width="100%" height={250} className="sm:h-[300px]">fontSize: 10 for axis labelsComponent structure for full-size charts:
function ChartComponent() {
const colors = useChartColors();
return (
<ResponsiveContainer width="100%" height={250}>
{/* Chart implementation */}
</ResponsiveContainer>
);
}
Add to the charts array in DashboardCharts.tsx:
{
title: "Chart Title",
description: "Chart description",
component: YourChartComponent,
}
Mark component as client-side if it's in its own file:
"use client";
function SalesLineChart() {
const colors = useChartColors();
return (
<ResponsiveContainer width="100%" height={250}>
<LineChart data={salesData}>
<CartesianGrid
strokeDasharray="3 3"
stroke="hsl(var(--border))"
opacity={0.5}
/>
<XAxis
dataKey="month"
tick={{ fontSize: 10, fill: "hsl(var(--muted-foreground))" }}
/>
<YAxis
tick={{ fontSize: 10, fill: "hsl(var(--muted-foreground))" }}
/>
<Tooltip contentStyle={{
backgroundColor: "hsl(var(--popover))",
border: "1px solid (())",
"",
}} />
);
}
import { MiniLineChart } from "@/lib/charts";
const trendData = [
{ x: "Mon", y: 10 },
{ x: "Tue", y: 15 },
{ x: "Wed", y: 12 },
];
<DashboardCard title="Trend" value="142">
<MiniLineChart data={trendData} />
</DashboardCard>
src/components/DashboardCharts.tsxsrc/lib/charts.tsxsrc/app/globals.cssadd-dashboard-cardadd-theme-colors