code-bug-finder

Code Bug Finder: Used to analyze code to find bugs, logic errors, missing boundary conditions, security risks, and maintainability issues; used when users request bug finding, code problem analysis, defect investigation, or code review.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "code-bug-finder" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-da86458f877bb49eefdeb6107491b880d94ce7d76929cbd26f9f699322ba4d72. Verify the upstream source and version against https://skillhub.cn/skills/user_eb217ab1/code-bug-finder before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Code Bug Finder: Used to analyze code to find bugs, logic errors, missing boundary conditions, security risks, and maintainability issues; used when users request bug finding, code problem analysis, defect investigation, or code review.

0 Downloads

Introduction source: third_party · user_eb217ab1 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: code-bug-finder
description: 分析代码以发现 bug、逻辑错误、边界条件遗漏、安全风险和可维护性问题。当用户要求找 bug、分析代码问题、排查潜在缺陷或进行代码缺陷审查时使用。
triggers:
  - 找bug
  - 找 bug
  - 分析代码bug
  - 代码bug
  - bug分析
  - 排查bug
  - 代码缺陷
  - debug

代码 Bug 分析 SKILL

目标

通过静态分析、逻辑推断和上下文检查,识别代码中的实际 bug 与潜在风险,并给出可执行的修复建议。

输入

  • 代码文件路径、代码片段、或完整代码目录
  • 用户描述的问题现象(如有)
  • 相关需求 / 设计文档(如有)

输出

一份缺陷分析报告,包含:

  • 已确认 bug:会导致实际错误的代码
  • 潜在风险:在特定条件下可能触发的问题
  • 改进建议:可提升健壮性、可读性的非阻塞项

执行流程

Phase 1:理解上下文
    → Phase 2:代码读取与静态扫描
        → Phase 3:逻辑与边界分析
            → Phase 4:输出缺陷报告

Phase 1 — 理解上下文

  1. 明确用户要分析的代码范围(单个文件 / 多个文件 / 整个目录)
  2. 了解代码要实现的功能、用户描述的问题现象
  3. 确认技术栈、运行环境、关键依赖

Phase 2 — 代码读取与静态扫描

  1. 读取代码:使用 Read / Glob / Grep 读取目标文件
  2. 扫描编译/语法问题:优先使用 GetProblems 查看当前文件是否有语法或类型错误
  3. 关注高风险区域:
    • 条件分支、循环、递归
    • 异步 / 并发代码
    • 空值 / 未定义值使用
    • 数组 / 对象越界访问
    • 资源释放(定时器、事件监听、连接等)
    • 用户输入 / 外部数据使用处
    • 类型转换、数值计算
    • 权限 / 安全相关逻辑

Phase 3 — 逻辑与边界分析

对每个可疑点,至少回答:

  • 正常流程下是否成立?
  • 异常输入 / 边界值下是否成立?
  • 是否存在竞态、时序、资源泄漏?
  • 是否违反业务规则或需求?
  • 是否引入安全漏洞(如 XSS、SQL 注入、越权等)?

Phase 4 — 输出缺陷报告

按严重程度分级输出:

严重程度 含义
🔴 Critical 会导致崩溃、数据丢失、安全漏洞或功能完全失效
🟠 High 明显 bug,多数场景下会触发错误
🟡 Medium 在边界/异常条件下会触发的问题
🟢 Low 潜在风险或代码质量/可维护性问题

每条缺陷必须包含:

  • 位置:文件路径(必要时含行号)
  • 问题描述:具体是什么 bug
  • 触发条件:什么输入 / 操作会触发
  • 影响:会导致什么后果
  • 修复建议:最小改动方案,必要时给出代码示例

分析维度清单

  • [ ] 语法 / 类型 / 编译错误
  • [ ] 空指针 / 未定义值使用
  • [ ] 数组 / 集合越界
  • [ ] 条件判断遗漏或逻辑反转
  • [ ] 循环终止条件错误
  • [ ] 异步回调 / Promise / async-await 错误
  • [ ] 并发 / 竞态条件
  • [ ] 资源未释放(定时器、监听、连接、锁)
  • [ ] 数值计算溢出或精度问题
  • [ ] 字符串 / 日期 / 时区处理错误
  • [ ] 输入校验缺失
  • [ ] 安全漏洞(注入、XSS、越权、敏感信息泄露)
  • [ ] 业务规则违背
  • [ ] 错误处理缺失或不当
  • [ ] 性能隐患(死循环、重复计算、大数据量处理)

输出模板

# 代码缺陷分析报告

## 概要

- 分析范围:{文件/目录}
- 发现缺陷:Critical {N} 个,High {N} 个,Medium {N} 个,Low {N} 个

## 严重问题(Critical / High)

### 1. {一句话概括}

- **位置**:`path/to/file.ts`
- **问题描述**:...
- **触发条件**:...
- **影响**:...
- **修复建议**:...

## 中低风险(Medium / Low)

### N. {一句话概括}

...

## 总体建议

- {针对整体代码质量的建议}

约束

  • 除非用户明确要求,否则只分析不修改代码
  • 不得臆测不存在的信息;不确定时标注为「潜在风险」
  • 优先关注实际 bug,而非风格或格式化问题
  • 涉及多文件时,先定位核心文件,再扩展相关文件
  • 尽量给出具体的行号或代码片段引用

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 面向开发者高频刚需场景,直接解决代码质量与安全隐患痛点
  • 提供端到端缺陷分析闭环,显著提升开发效率
Trigger Precision95/100

Highlights

  • 触发词覆盖全面,包含常见变体与边界场景
  • 边界清晰,不易误触或漏触
Structure and Standards95/100

Highlights

  • Phase 划分清晰,执行流程完整
  • 提供标准化输出模板与分析维度清单
Execution Reliability95/100

Highlights

  • 工具使用规范,参数合理
  • 覆盖主要异常场景,分级输出机制完善
Evidence Verifiability (mean of the first four)95/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.