用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kwkraus/my-dashboard --skill debug-component命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | debug-component |
| description | Debug React components and resolve common issues in Next.js 15 |
When debugging components in this Next.js 15 dashboard:
"use client" vs Server Component issues:
"use client"; at the top of the fileHydration errors:
// Use client-only rendering for dynamic content
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);
if (!mounted) return null;
CSS variable issues in charts:
globals.cssuseChartColors hook in chart componentsconst colors = useChartColors();
// Use colors.chart1, colors.chart2, etc.
TypeScript errors:
interface ComponentProps {
title: string;
value: number;
optional?: string;
}
as const for literal types:changeType: "positive" as const
Import path issues:
tsconfig.json@/components/...@/lib/...@/app/...Theme not applying:
hsl(var(--color-name)):root and .dark selectorsChart not responsive:
<ResponsiveContainer width="100%" height={250}>
<LineChart data={data}>...</LineChart>
</ResponsiveContainer>
Development debugging tools:
// Console logging (remove in production)
console.log("Debug:", { props, state });
// React DevTools
// Install React Developer Tools browser extension
// Type checking
npm run lint
Common linting errors:
useEffect(() => {
doSomething(value);
}, [value]); // Add value to dependencies
Performance issues:
"use client";
import { useState, useEffect } from "react";
export default function DynamicComponent() {
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return <div>Loading...</div>;
}
return <div>{new Date().toLocaleString()}</div>;
}
// Define clear interfaces
interface StatCardProps {
title: string;
value: string;
change: string;
changeType: "positive" | "negative"; // Union type
icon: React.ComponentType<{ className?: string }>;
}
export function StatCard({ title, value, change, changeType, icon }: StatCardProps) {
// Component implementation
}
"use client";
import { useEffect } from "react";
function ChartComponent() {
const colors = useChartColors();
// Debug colors
useEffect(() => {
console.log("Chart colors:", colors);
}, [colors]);
return (
<LineChart data={data}>
<Line stroke={colors.chart1} />
</LineChart>
);
}
src/app/layout.tsxsrc/app/globals.csstsconfig.jsonnext.config.tsoptimize-react-componentadd-chartadd-theme-colors