code-detail-error-diagnosis

Code and command detail error diagnosis. Given Java/Scala/Python code or Linux commands and their error messages, automatically identifies detail issues such as missing spaces, case errors, mismatched parentheses, and mixed symbols; outputs error localization, explanation of cause, corrected code, and a classified error report. Suited for pre-submission self-checks, runtime error troubleshooting, Linux command failure diagnosis, and Spark/PySpark debugging. Example triggers: code error check, check code detail errors, look at what’s wrong with this code, code won’t run help, Linux command error, check case/space/parentheses, code detail debugging, help diagnose code error, Scala code error, Python indentation error.

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-detail-error-diagnosis" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-6ba666c58bacad0783f268b6d76c41827296d3e6c7e83b1b9b20bcb707a6c74b. Verify the upstream source and version against https://skillhub.cn/skills/user_68eef956/code-detail-error-diagnosis 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 and command detail error diagnosis. Given Java/Scala/Python code or Linux commands and their error messages, automatically identifies detail issues such as missing spaces, case errors, mismatched parentheses, and mixed symbols; outputs error localization, explanation of cause, corrected code, and a classified error report. Suited for pre-submission self-checks, runtime error troubleshooting, Linux command failure diagnosis, and Spark/PySpark debugging. Example triggers: code error check, check code detail errors, look at what’s wrong with this code, code won’t run help, Linux command error, check case/space/parentheses, code detail debugging, help diagnose code error, Scala code error, Python indentation error.

0 Downloads

Introduction source: third_party · user_68eef956 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: 代码细节错误诊断报告生成
description: 输入Java/Scala/Python代码或Linux命令及报错信息,自动识别空格缺失、大小写错误、括号不匹配、符号混用等细节问题,输出错误定位、原因解释、修正代码及分类错误报告;适用于学生写完代码后提交前自查、代码运行报错后排查定位、Linux命令执行失败后诊断修复、Spark/PySpark代码调试的场景;触发词:代码报错排查、检查代码细节错误、帮我看看这段代码哪里错了、代码运行不了帮我看看、Linux命令报错了、检查大小写空格括号、代码细节排错、帮我诊断代码错误、Scala代码报错、Python缩进报错

代码细节错误诊断报告生成

概述

本 Skill 专门针对 Java、Scala、Python 代码和 Linux 命令中的细节错误(空格缺失、大小写错误、括号不匹配、符号混用、缩进错误等)进行智能诊断,生成结构化的错误分析报告。核心价值在于帮助大数据/计算机专业学生和初中级开发者快速定位"代码看起来没错但就是跑不通"的细节问题。覆盖大数据技术栈主流语言(Java、Scala/Spark、Python/PySpark)和 Linux 运维命令。

适用场景

  • 学生写完 Java / Scala / Python 代码后,提交前自查细节错误
  • 代码运行报错后,排查定位具体原因
  • Linux 命令执行失败后,诊断并修复
  • Spark / PySpark 代码调试时排查细节问题
  • 批量检查代码中的常见细节问题,生成可复用的错误分析报告

触发条件

当用户提到以下内容时加载本 Skill:

  • 代码报错排查
  • 检查代码细节错误
  • 帮我看看这段代码哪里错了
  • 代码运行不了帮我看看
  • Linux 命令报错了
  • 检查大小写空格括号
  • 代码细节排错
  • 帮我诊断代码错误
  • Scala 代码报错
  • Python 缩进报错

输入格式

用户会提供以下内容(至少一项):

  1. 代码片段:Java / Scala / Python 代码或 Linux 命令(必须)
  2. 报错信息(可选):编译错误、运行时错误、终端报错输出
  3. 检查需求(可选):指定检查类型或范围

工作流程

第一步:解析输入

  • 识别输入类型(Java 代码 / Scala 代码 / Python 代码 / Linux 命令 / 混合)
  • 提取报错信息(如有)
  • 确定检查范围

第二步:细节错误扫描

按以下五大分类逐项检查,加载 references/error_patterns.md 获取完整错误模式库:

2.1 空格类 (SP)

检查运算符两侧、数组声明后、命令与参数间、逗号/分号后、管道符两侧是否缺少空格。

典型示例:

  • int[]data -> int[] data
  • chmod755 file -> chmod 755 file
  • i<data.length -> i < data.length

2.2 大小写类 (CC)

检查 Java 系统类名是否首字母大写、方法名大小写是否正确、变量名是否大小写一致、Linux 命令是否小写。Scala 检查 val/var 小写、集合类首字母大写(List/Map/Array)。Python 检查 True/False/None 首字母大写、pandas 类名首字母大写(DataFrame)。

典型示例:

  • system.out.println -> System.out.println(Java)
  • string.valueof(x) -> String.valueOf(x)(Java)
  • Val x = 0 -> val x = 0(Scala)
  • x = true -> x = True(Python)
  • pd.dataframe() -> pd.DataFrame()(Python/pandas)

2.3 括号类 (BR)

检查圆括号 ()、方括号 []、花括号 {} 是否配对、是否缺失、类型是否混淆。

典型示例:

  • System.out.println(x; -> System.out.println(x);(缺少右括号)
  • data[0 -> data[0](缺少右方括号)

2.4 符号类 (SY)

检查分号是否缺失、中英文标点是否混用、引号是否配对、赋值与比较符号是否混淆。Python 额外检查控制结构末尾冒号(if/for/def/while/class 行末 :)和 Tab/空格混用问题。

典型示例:

  • int x = 5 -> int x = 5;(Java 缺少分号)
  • int x = 5; -> int x = 5;(中文分号)
  • if (x = 5) -> if (x == 5)(赋值与比较混淆)
  • if x > 0 -> if x > 0:(Python 缺少冒号)
  • if x > 0: -> if x > 0:(Python 中文冒号)

2.5 混淆类 (CF)

检查常见命令混淆、语法结构混淆、参数顺序错误、类型不匹配。Scala 检查 val/var 混淆、==/eq 混淆、Spark === 比较。Python 检查 is/== 混淆、print 语句/函数混淆、列表/元组可变性混淆、pandas loc/iloc 混淆。

典型示例:

  • grep pattern file -r -> grep -r pattern file(Linux 选项顺序)
  • String s = 5; -> String s = "5";(Java 类型不匹配)
  • val x = 5; x = 10 -> var x = 5(Scala val 不可变)
  • if x is 5: -> if x == 5:(Python is/== 混淆)
  • print "hello" -> print("hello")(Python 3 需括号)

第三步:交叉验证

  • 如有报错信息,将扫描结果与报错信息交叉验证
  • 确认每个错误都有实际依据,不编造错误原因
  • 如扫描结果与报错信息不一致,优先以报错信息为准并标注差异

第四步:生成修正代码

  • 仅修正细节错误,不改变业务逻辑
  • 确保修正后的代码不引入新的语法错误
  • 标注每处修改的位置和内容

第五步:生成错误分类报告

按以下格式输出结构化报告:

## 代码细节错误诊断报告

### 错误概览
- 检查类型:[Java 代码 / Scala 代码 / Python 代码 / Linux 命令 / 混合]
- 发现错误数:X 处
- 错误类型分布:空格类 X 处、大小写类 X 处、括号类 X 处、符号类 X 处、混淆类 X 处

### 错误明细

#### 错误 1
- 类型:[空格类 SP / 大小写类 CC / 括号类 BR / 符号类 SY / 混淆类 CF]
- 位置:第 X 行,第 X 列
- 原代码:`xxx`
- 修正后:`xxx`
- 原因:[具体解释为什么这是错误,以及会导致什么后果]

#### 错误 2
...(依次列出所有错误)

### 修正后完整代码
[语言标识]
[修正后的完整代码]

### 防错建议
- [针对本次发现的错误类型,给出具体的预防建议]
- [推荐 IDE 配置或工具辅助]

约束规则

必须遵守

  1. 基于实际分析:所有错误判断必须基于代码实际内容,不能编造错误原因
  2. 仅改细节:只修正空格、大小写、括号、符号等细节错误,不改变代码的业务逻辑
  3. 不引入新错误:修正后的代码不能引入新的语法错误或逻辑问题
  4. 完整报告:必须输出完整的错误分类报告,包括错误概览、明细、修正代码和防错建议
  5. 精确定位:每个错误必须标注行号和位置

禁止行为

  1. 编造不存在的错误
  2. 修改代码的业务逻辑或算法
  3. 省略错误定位信息(必须给出行号和位置)
  4. 给出未经验证的修正方案
  5. 修改与细节错误无关的代码风格(如变量命名偏好、注释风格等)

错误分类体系

类别 代号 典型示例 严重程度
空格类 SP int[]data -> int[] data 中-高
大小写类 CC system.out -> System.out 高
括号类 BR if(x{ -> if(x){ 高
符号类 SY println(x) -> println(x); 高
混淆类 CF = vs == 高

详见 references/error_taxonomy.md。

参考文档

  • references/error_patterns.md — Java / Linux / Scala / Python 常见细节错误模式库(含错误示例与正确写法对照)
  • references/error_taxonomy.md — 错误分类体系详解(含识别规则与严重程度)

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 针对代码细节错误(空格、大小写、括号、符号等)进行智能诊断,解决用户常见痛点
  • 覆盖大数据技术栈主流语言(Java、Scala/Spark、Python/PySpark)和 Linux 运维命令
  • 适用场景明确且高频,包括学生代码自查、运行报错排查、Linux 命令诊断等
Trigger Precision95/100

Highlights

  • 触发词列表完整,覆盖多种变体(如“代码报错排查”、“帮我看看这段代码哪里错了”等)
  • 边界清晰,能有效区分于其他通用代码辅助工具
Structure and Standards98/100

Highlights

  • Phase/步骤清晰(解析输入、细节错误扫描、交叉验证、生成修正代码、生成错误分类报告)
  • 有明确的出口条件和端到端示例,frontmatter 完整
Execution Reliability96/100

Areas to improve

  • 引用文件缺失 Reported severity: Minor

    SKILL.md 引用了 references/error_patterns.md 和 references/error_taxonomy.md,但传入内容中未提供这两个文件

    Recommendation: 请补充 references/error_patterns.md 和 references/error_taxonomy.md 文件,或调整文档引用以避免缺失

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.

Not specified in the source documentation.

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