local-link/skills/debug-by-commits/SKILL.md
通过 Git Commit 二分法调试前端白屏/卡死问题。 当用户报告页面白屏、无响应、卡死,且怀疑是代码问题时使用。 特别适用于: 1. 开发服务器能启动但页面显示白屏 2. 页面无响应或卡死(可能是死循环) 3. 需要快速定位引入问题的具体 commit 4. 需要排除缓存、配置等干扰因素
npx skillsauth add lionad-morotar/local-tools debug-by-commitsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
当页面出现白屏或卡死时,通过 Git 回退到之前的 commit,逐个验证,快速定位问题引入点。
# 查看当前状态
git status --short
git log --oneline -10
# 保存当前工作(包括未跟踪文件)
git stash push -m "stash: debug 问题" --include-untracked
# 查看最近提交历史
git log --oneline -10
选择要回退的目标 commit(通常是已知正常的版本)。
# 回退到指定 commit
git checkout <commit-hash>
# 清理依赖(关键!排除缓存干扰)
rm -rf node_modules .nuxt
# 杀掉残留进程
pkill -f "nuxt" || true
pnpm install && pnpm dev
让用户验证页面是否正常:
重复步骤 3-4,使用二分法快速缩小范围:
正常 ←——————————————————→ 白屏
↑
检查中间点
找到第一个出现问题的 commit 后:
# 查看该 commit 的具体改动
git show <commit-hash>
# 查看改动的文件列表
git show <commit-hash> --stat
# 查看具体改动内容
git show <commit-hash> --no-patch
根据改动内容分析可能的问题。重点检查该 commit 引入的新代码:
分析思路:
不要预设立场 - 白屏可能由多种原因导致,需要根据具体改动分析,而不是套用固定模式。
修复完成后,恢复之前 stash 的工作:
# 回到原分支
git checkout <branch-name>
# 恢复 stash
git stash pop
node_modules 和 .nuxt,排除缓存干扰定位到问题后,记录:
问题 commit: <hash>
问题文件: <file-path>
问题类型: <死循环/异步/生命周期/响应式/其他>
根本原因: <具体解释>
修复方案: <如何修复>
tools
分批提交 Git 变更的完整工作流。当用户说"提交这个文件"、"帮我 commit"、"分批提交"、"整理提交计划"、"staged 的文件"、"git 提交"时触发
tools
从用户给出的文档片段中,提取"进阶必知"的深层知识,当用户提到"太简单了,给我几条秘密","面试必备的那种","八股文进阶"时触发
data-ai
批量给技能目录添加 disable-model-invocation,节省 token 开销。只保留需要 LLM 生成/分析/决策的技能有模型调用能力。
tools
open understand dashboard for user