mcpField
S
stuck

stuck

github.com/johnlindquist开发2644 次安装45 周前更新
代码仓库

关于 stuck

面向开发者的系统化排障技能,用于处理反复出现的错误、调试僵局和难以解释的问题。它结合假设审查、最小复现与逐级排查,并可协助整理求助问题。

主要功能

  1. 01按结构梳理问题与已尝试方案
  2. 02通过橡皮鸭调试和假设审查分析
  3. 03覆盖异步、状态、类型与构建问题
  4. 04逐级检查环境、复现和 Git 历史
  5. 05协助撰写求助问题

适用场景

  1. 01多种修复尝试均无效时重新分析
  2. 02定位重复出现的错误
  3. 03创建最小复现并查找引入问题的提交
  4. 04准备包含代码和错误信息的求助帖

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/johnlindquist/claude --skill stuck

安装后在 Claude Code 中输入/stuck确认已加载。

详细介绍

卡住助手

系统化方法,帮助你在棘手问题上摆脱困境。

何时使用

  • 你已尝试多种方法但均未成功
  • 尽管进行了修复,同一错误仍反复出现
  • 你不明白为什么某些东西不起作用
  • 调试已陷入死胡同

快速脱困

gemini -m pro -o text -e "" "I'm stuck on this problem:

PROBLEM: [describe what you're trying to do]
TRIED: [what you've already attempted]
ERROR/SYMPTOM: [what's happening]
EXPECTED: [what should happen]

Help me get unstuck. Consider:
1. Am I solving the right problem?
2. What assumptions might be wrong?
3. What haven't I tried?
4. What would an expert check first?"

结构化调试

小黄鸭协议
gemini -m pro -o text -e "" "I need to rubber duck debug this issue:

I'm trying to: [goal]
The code does: [behavior]
I expected: [expected behavior]
The relevant code is:

\`\`\`
[paste code]
\`\`\`

Walk through the code step by step with me, questioning each assumption."
假设审查
gemini -m pro -o text -e "" "Audit my assumptions about this problem:

PROBLEM: [description]
MY ASSUMPTIONS:
1. [assumption 1]
2. [assumption 2]
3. [assumption 3]

For each assumption:
- Is it definitely true?
- How would I verify it?
- What if it's wrong?"
全新视角
gemini -m pro -o text -e "" "I've been stuck on this for a while. Give me a completely fresh approach:

PROBLEM: [description]
WHAT I'VE TRIED:
- [approach 1]
- [approach 2]
- [approach 3]

Suggest approaches from a different angle. What would someone with no context try?"

常见的卡住场景

异步/Promise 问题
gemini -m pro -o text -e "" "Debug this async code issue:

CODE:
\`\`\`
[paste async code]
\`\`\`

SYMPTOM: [what's happening]

Check for:
- Missing await
- Race conditions
- Unhandled rejections
- Callback timing
- Promise chain issues"
状态管理
gemini -m pro -o text -e "" "Debug this state management issue:

FRAMEWORK: [React/Vue/etc]
CODE:
\`\`\`
[paste code]
\`\`\`

SYMPTOM: State not updating / Stale state / Infinite loop

Check for:
- Mutation vs immutable update
- Dependency arrays
- Closure over stale values
- Re-render triggers"
类型错误
gemini -m pro -o text -e "" "Help me understand this TypeScript error:

ERROR:
\`\`\`
[paste error]
\`\`\`

CODE:
\`\`\`
[paste code]
\`\`\`

Explain:
1. What the error means in plain English
2. Why TypeScript is complaining
3. How to fix it properly (not just any)"
构建/配置问题
gemini -m pro -o text -e "" "Debug this build/config issue:

TOOL: [webpack/vite/esbuild/etc]
ERROR:
\`\`\`
[paste error]
\`\`\`

CONFIG:
\`\`\`
[paste config]
\`\`\`

Common causes and solutions for this type of error."

升级阶梯

当简单调试失败时,系统地升级:

第 1 级:验证环境
# Check versions
node --version
npm --version
# Check dependencies
npm ls
# Clean and reinstall
rm -rf node_modules package-lock.json && npm install
第 2 级:最小复现
# Create minimal test case
mkdir /tmp/test-issue
cd /tmp/test-issue
# Create smallest code that reproduces issue
第 3 级:Git Bisect
# Find when it broke
git bisect start
git bisect bad HEAD
git bisect good <last-known-good-commit>
# Test each commit git suggests
第 4 级:搜索类似问题
# GitHub issues
gh search issues "[error message]" --limit 10

# With specific repo
gh search issues "[error]" --repo package/repo
第 5 级:寻求帮助
# Prepare a good question
gemini -m pro -o text -e "" "Help me write a good Stack Overflow question for:

PROBLEM: [description]
CODE: [minimal reproduction]
ERROR: [full error]
TRIED: [what I've attempted]

Format as a clear, answerable question."

预防清单

脱困后,防止问题再次发生:

gemini -m pro -o text -e "" "I just solved this issue:

PROBLEM: [what was wrong]
SOLUTION: [how I fixed it]

Suggest:
1. Test to prevent regression
2. Documentation to add
3. Linting/tooling to catch this earlier
4. Pattern to follow in future"

最佳实践

  1. 清晰地陈述问题 - 写出来往往能揭示问题所在
  2. 列出你尝试过的方法 - 防止重复失败的尝试
  3. 质疑假设 - 问题往往源于错误的假设
  4. 简化 - 删除代码,直到找到最小案例
  5. 休息一下 - 新鲜的眼光能看到疲惫时忽略的东西
  6. 尽早寻求帮助 - 不要在一个 5 分钟的问题上花几个小时
  7. 记录解决方案 - 未来的你会感谢现在的你

评论

支持 Markdown