- name
SKILL.md
技能檔案保留在發布者的儲存庫中。
在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add JackyST0/awesome-agent-skills --skill debug-helper -a cursor -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add JackyST0/awesome-agent-skills --skill debug-helper -a claude-code -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add JackyST0/awesome-agent-skills --skill debug-helper -a codex -y在終端機中貼上複製的指令。它會將這個 SKILL.md 安裝到對應的代理中。
npx skills add JackyST0/awesome-agent-skills --skill debug-helper -a grok -y在 Grok Bot 聊天中傳送複製的訊息。Bot 會從 GitHub 取得這個 SKILL.md,並加入你所有 Bot 共用的技能中。
Install this skill: https://github.com/JackyST0/awesome-agent-skills/tree/HEAD/examples/debug-helper來自發布者
帮助调试代码,分析错误信息,定位问题根源,提供修复建议。
Help debug code by analyzing error messages, identifying root causes, and providing fix suggestions.
当用户请求以下操作时使用此 skill:
对于每个错误,需要分析:
使用 templates/debug-report.md 模板格式化输出。
Use the templates/debug-report.md template to format output.
## 调试分析报告 / Debug Analysis Report
### 错误概述 / Error Summary
[错误类型和简要描述]
### 根本原因 / Root Cause
[详细分析]
### 修复方案 / Fix
[具体代码修改]
### 预防建议 / Prevention
[如何避免类似问题]
错误信息:
TypeError: Cannot read properties of undefined (reading 'map')
at UserList (UserList.jsx:15:23)
at renderWithHooks (react-dom.development.js:14985:18)
相关代码:
function UserList({ users }) {
return (
<ul>
{users.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
}
TypeError: Cannot read properties of undefined (reading 'map')
在 UserList 组件第 15 行调用 .map() 时,users 变量为 undefined。
undefined 上调用 .map() 方法users prop方案 1: 添加默认值(推荐)
function UserList({ users = [] }) {
return (
<ul>
{users.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
}
方案 2: 条件渲染
function UserList({ users }) {
if (!users || users.length === 0) {
return <p>No users found</p>;
}
return (
<ul>
{users.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
}
方案 3: 可选链操作符
function UserList({ users }) {
return (
<ul>
{users?.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
);
}
使用 TypeScript - 添加类型检查
interface Props {
users: User[];
}
添加 PropTypes - 运行时类型检查
UserList.propTypes = {
users: PropTypes.array.isRequired
};
检查数据源 - 确保父组件正确传递数据
处理加载状态 - 在数据获取期间显示加载指示器
Help debug code by analyzing error messages, identifying root causes, and providing fix suggestions.
---name: debug-helperdescription: Help debug code by analyzing error messages, identifying root causes, and providing fix suggestions.---# examples/debug-helper/SKILL.md常見問題
從發布者下載 examples/debug-helper/SKILL.md,或複製路徑後開啟儲存庫。PlugMCP 只收錄這項技能,不代管檔案。
發布者將它存放在 https://github.com/JackyST0/awesome-agent-skills。
Claude、Cursor、Codex 和 Grok Build 可以讀取你從發布者儲存庫加入的 SKILL.md。在聊天中傳送技能的 GitHub 資料夾連結,Grok Bot 就會安裝它。