yun520-1/mark-heartflow-skill

code-error-fixer

Systematic code error diagnosis and fix skill. Handles compilation errors, runtime exceptions, type errors, logic bugs, crash analysis, dependency conflicts, and unexpected behavior. TRIGGER when: user reports an error/exception/bug/crash, build or test failures, unexpected behavior in code, type errors, runtime stack traces, dependency resolution failures, or asks "why is this not working" / "fix this error" / "debug this". DO NOT TRIGGER when: user asks for code review without errors, general

67CollectingRuns scripts
See how to use itView GitHub source
npx skills add https://github.com/yun520-1/mark-heartflow-skill --skill "skills/code-fix"

Quick start

Start using it in three steps

Install it or open the source, trigger it with a clear task, then follow the source workflow.

1

Install the Skill

npx skills add https://github.com/yun520-1/mark-heartflow-skill --skill "skills/code-fix"
2

Describe the task

Use code-error-fixer to help me with: [describe your task]. Before you begin, tell me what input you need, the steps you will follow, and the expected output.

3

Follow the workflow

No structured workflow was detected; follow the original SKILL.md below.

Continue to the workflow

Direct answers

Answers to review before you install

What is code-error-fixer?

Systematic code error diagnosis and fix skill. Handles compilation errors, runtime exceptions, type errors, logic bugs, crash analysis, dependency conflicts, and unexpected behavior.

Who should use code-error-fixer?

It is relevant to workflows involving Code review, Testing, Engineering, Research.

How do you install code-error-fixer?

SkillSignal detected this source-specific command: npx skills add https://github.com/yun520-1/mark-heartflow-skill --skill "skills/code-fix". Inspect the repository and command before running it.

Which Agent platforms does it support?

The upstream source does not declare a dedicated Agent platform.

What permissions or risks should you review?

Static analysis detected exec-script signals. Review the cited source lines before installing; these signals are not a security audit.

What are the current evidence limits?

This page combines upstream documentation with deterministic repository, quality, and static-risk signals. It is not described as a manual test or security review.

SkillSignal brief

Decide whether it fits your work first

Systematic code error diagnosis and fix skill. Handles compilation errors, runtime exceptions, type errors, logic bugs, crash analysis, dependency conflicts, and unexpected behavior.

Useful in these contexts

Not yet included in a workflow collection

Core capabilities

Code reviewTestingEngineeringResearchPython
Repository stars
36
Repository forks
7
Quality
67/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

67/100
Documentation28/30
Specificity16/25
Maintenance20/20
Trust signals3/25

Compare before choosing

Related Agent Skills and source variants

These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.

pr-reviewer by yun520-1

Automated GitHub PR code review with diff analysis, lint integration, and structured reports. Use when reviewing pull requests, checking for security issues, error handling gaps, test coverage, or code style problems. Supports Go, Python, and JavaScript/TypeScript. Requires `gh` CLI authenticated with repo access.

code-reviewer by jeffallan

Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quali

dmux-workflows by affaan-m

Multi-agent orchestration using dmux (tmux pane manager for AI agents). Patterns for parallel agent workflows across Claude Code, Codex, OpenCode, and other harnesses. Use when running multiple agent sessions in parallel or coordinating multi-agent development workflows.

dmux-workflows by affaan-m

Multi-agent orchestration using dmux (tmux pane manager for AI agents). Patterns for parallel agent workflows across Claude Code, Codex, OpenCode, and other harnesses. Use when running multiple agent sessions in parallel or coordinating multi-agent development workflows.

sql-code-review by github

Universal SQL code review assistant that performs comprehensive security, maintainability, and code quality analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Focuses on SQL injection prevention, access control, code standards, and anti-pattern detection. Complements SQL optimization prompt for complete development coverage.

View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 2 min

Code Error Fixer — 代码报错自动修复技能

系统化诊断和修复各类代码错误的工作流。遵循 复现 → 定位 → 理解 → 修复 → 验证 五步法,避免凭直觉猜测式改代码。

五步修复工作流(强制遵循)

用户报错 → [Step 1 复现] → [Step 2 定位] → [Step 3 理解] → [Step 4 修复] → [Step 5 验证] → 结案
                              ↑_____________ 证据不足时回到 Step 1 _____________↓

Step 1: 复现 (Reproduce)

目标:稳定复现问题,收集完整错误上下文。

必须收集的信息(缺一不可,逐项核对):

  • 完整错误消息 — 不要摘要,截取完整堆栈/日志
  • 触发条件 — 什么操作/输入/数据会触发?是否必现?
  • 环境信息 — 语言/运行时版本、操作系统、依赖版本、Node/Python/Go 等版本
  • 相关代码 — 出错的源文件、最近修改的文件、配置文件
  • 复现步骤 — 用户能否提供最小复现?如果不能,自己构造

执行动作:

  1. 读取报错文件内容(Read)
  2. 检查运行环境(node --version, python --version, go version 等)
  3. 尝试在本地复现(运行构建/测试/启动命令)
  4. 如果错误依赖特定输入,引导用户提供或构造最小复现用例
  5. 如果无法复现,要求用户提供更多上下文并不能继续修复

产出: 清晰的错误描述 + 可复现的步骤

Step 2: 定位 (Isolate)

目标:缩小问题范围,找到根因所在的精确位置。

定位策略(优先级从高到低):

策略适用场景方法
二分法大段代码/多文件注释掉一半代码,看错误是否消失;重复直到定位
堆栈追踪运行时异常/崩溃从栈顶往栈底读,找到第一个你自己的代码
差异对比之前能工作现在不行git diffgit blame 找到最近修改
最小化输入输入数据导致异常逐步缩小输入,找到触发异常的精确数据
断言/日志逻辑错误/静默失败在关键路径插入临时日志或断言
依赖分析编译/运行时依赖错误检查 package.json / go.mod / requirements.txt 版本约束

执行动作:

  1. 读取报错文件中涉及的文件(从堆栈/报错行号开始)
  2. 追踪变量/函数的源头和流向
  3. 用二分法注释无关代码缩小范围
  4. 必要时插入临时 console.log / print / fmt.Println
  5. 检查版本兼容性和最近变更

🔴 铁律:在没有定位到具体哪一行/哪个变量前,禁止进行修复。

Step 3: 理解 (Understand)

目标:彻底理解根因——回答"为什么会产生这个错误"。

  • 查看相关 API / 函数文档
  • 理解预期行为 vs 实际行为的差异
  • 检查边界条件、空值、类型不匹配、竞态条件等常见根因
  • 对不确定的根因,查阅 Web 搜索确认(库的已知 issue、API 变更等)

🔴 铁律:不能解释根因,就不能开始修复。

Step 4: 修复 (Fix)

目标:最小改动、精准修复。

  • 最小改动原则 — 只改导致问题的地方,不顺便重构
  • 避免"霰弹式修改" — 一次只改一个地方,验证后再改下一个
  • 先考虑修复方案对现有逻辑的影响(回归风险)
  • 处理边缘情况:空值、边界值、类型转换、异步时序
  • 添加必要的防御性检查(但不滥用)

Step 5: 验证 (Verify)

目标:确认修复有效且没有引入新问题。

  • 运行复现步骤确认错误消失
  • 运行现有测试套件
  • 检查相关功能的冒烟测试
  • 检查是否引入了新的 TypeScript / linter 错误
  • 如果影响面大,建议用户 review

如果验证失败 → 回到 Step 1。


常见错误类型与诊断策略

1. 编译/语法错误

类型快速定位技巧
类型错误 (TypeScript)从第一个错误开始修复(后续往往只是级联)
语法错误检查括号/引号/逗号配对,模板字符串中的反引号
导入错误ImportError / ModuleNotFoundError — 检查路径、大小写、__init__.py
链接错误检查库版本、ABI 兼容性、链接库路径

2. 运行时异常

异常常见根因
NullPointerException / Cannot read property of undefined异步数据未加载、可选链缺失、初始值未设
TypeError: X is not a function导入错误、变量覆盖、调用时机过早
IndexError / IndexOutOfBoundsoff-by-one 错误、空列表、边界条件
StackOverflow无限递归、事件循环、循环依赖
OutOfMemoryError内存泄漏、大对象未释放、数据量超出预期

3. 逻辑 Bug

类型诊断方法
条件分支错误列出所有分支 + 输入组合,逐一验证
循环/遍历错误追踪循环变量变化,检查边界条件
异步/并发错误检查 race condition,添加锁或原子操作
状态管理错误追踪状态变更链路,检查不可变性
浮点精度不直接比较浮点数,使用 epsilon 或 Decimal

4. 依赖/环境问题

问题诊断方法
版本冲突npm ls <pkg>, go mod graph, pipdeptree
环境差异对比开发/测试/生产环境的 .env 和配置文件
缓存问题清除缓存:node_modules, pip cache, Go build cache
平台差异路径分隔符、换行符(CRLF vs LF)、文件权限

5. 数据/API 错误

问题诊断方法
API 返回值异常curl / 浏览器检查真实响应,验证接口文档
数据格式不对检查 JSON Schema、边界类型(空数组/null/缺失字段)
编码问题UTF-8 vs GBK、BOM、特殊字符转义

核心原则

1. 一次只改一个问题

不要同时修复多个无关问题。每个修复独立验证,否则无法确定哪个改动有效。

2. 证据驱动

每个结论必须由数据支持:堆栈、日志、变量值、测试结果。禁止脑补根因。

3. 先检查最简单的可能性

  • 拼写错误?大小写?路径分隔符?
  • 缓存需要清除?
  • 服务需要重启?
  • 配置文件生效了吗?

4. 最小复现原则

如果能构造最小复现(Minimal Reproducible Example),优先用它调试。MRE 本身往往就已经揭示了根因。

5. 回退总比乱改好

如果问题复杂且时间紧迫,回退到上次正常工作的版本好过胡乱修复引入更多问题。


技术栈快速参考

JavaScript / TypeScript / Node.js

# 检查 Node 版本和类型定义
node --version && npx tsc --version

# 检查依赖版本冲突
npm ls <package-name>          # 已安装的版本树
npm outdated                    # 可更新的包
npx synp --source-file          # yarn.lock ↔ package-lock.json 转换检查

# 清除缓存
rm -rf node_modules && npm install
# 或
npm cache clean --force

Python

# 检查 Python 版本和虚拟环境
python --version && which python
pip list | grep <package>

# 依赖树
pipdeptree -p <package>

# 重新安装
pip install --force-reinstall <package>

Go

go version
go env GOPATH GOROOT
go mod graph | grep <package>
go mod tidy

Rust

rustc --version && cargo --version
cargo tree -p <crate>
cargo clean && cargo build

对话模板

当用户报告错误时,按以下结构回复:

  1. 错误复现 — 确认收到的错误信息 + 环境信息(如已提供)
  2. 缺失信息 — 如果缺少关键信息,列出需要补充的内容
  3. 定位计划 — 简要说明打算如何排查
  4. 发现 — 定位过程中的发现/新信息
  5. 根因 — 确定根因时的明确声明
  6. 修复方案 — 具体修改内容 + 预期效果
  7. 验证结果 — 验证结论

禁止做的事

  • ❌ 不收集完整错误信息就开始猜
  • ❌ 不确认根因就改代码(霰弹式修改)
  • ❌ 一次改多个无关问题
  • ❌ 修复后不验证
  • ❌ 对不确定的问题直接建议"升级依赖"或"重装"而不分析根因
  • ❌ 复杂问题不尝试构建最小复现
Skill path
skills/code-fix/SKILL.md
Commit SHA
20bbbb4eacf5
Repository license
Data collected