Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

error-message-explainer错误信息解释器

Agent Skill

error-message-explainer 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

848

周安装

35

GitHub Stars

13

下载量

277
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:error-message-explainer(错误信息解释器)
来源仓库:https://github.com/wedsamuel1230/arduino-skills
仓库路径:skills/error-message-explainer
安装命令:
npx skills add https://github.com/wedsamuel1230/arduino-skills --skill error-message-explainer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wedsamuel1230/arduino-skills --skill error-message-explainer

简介

error-message-explainer 将 Arduino/ESP32 编译器错误转化为 actionable 修复建议。

  • 适用于嵌入式开发中快速理解 '未声明变量' 或 '类型不匹配' 等问题。
  • 内置 20+ 常见错误模式解析器,支持交互式查询或批量日志分析。
  • 安装方式:通过 npx 从 GitHub 仓库添加,需 Python 环境和 uv 包管理器。
  • 依赖 arduino-cli 编译输出格式,不同 IDE 可能需要适配正则表达式。

SKILL.md

Error Message Explainer

Translates cryptic compiler errors into actionable fixes for Arduino/ESP32/RP2040 projects.

Resources

This skill includes bundled tools:

  • scripts/parse_errors.py - Automated error analysis with 20+ error patterns

Quick Start

Analyze error from file:

uv run --no-project scripts/parse_errors.py --file error_log.txt

Analyze single error:

uv run --no-project scripts/parse_errors.py --message "error: 'LED' was not declared in this scope"

Interactive mode:

uv run --no-project scripts/parse_errors.py --interactive

Pipe from compiler:

arduino-cli compile 2>&1 | uv run --no-project scripts/parse_errors.py --stdin

How to Use This Skill

When user pastes an error message:

  1. Identify the error type from patterns below
  2. Explain what it means in simple terms
  3. Show the specific fix with code example
  4. Explain WHY this error happens (educational value)

Common Compilation Errors

1. "'xyz' was not declared in this scope"

error: 'xyz' was not declared in this scope

Meaning: Compiler doesn't recognize the name xyz.

Common Causes & Fixes:

CauseFix
Typo in variable/function nameCheck spelling, C++ is case-sensitive!
Variable used before declarationMove declaration before first use
Missing #includeAdd required library header
Function defined after it's calledAdd forward declaration or move function up

Example - Typo:

// WRONG
int ledpin = 13;      // lowercase 'p'
digitalWrite(ledPin, HIGH);  // uppercase 'P' - DIFFERENT!

// CORRECT
int ledPin = 13;
digitalWrite(ledPin, HIGH);

Example - Missing Include:

// WRONG - Servo not defined!
Servo myServo;

// CORRECT
#include <Servo.h>
Servo myServo;

2. "expected ';' before..."

error: expected ';' before 'xyz'

Meaning: Missing semicolon on the previous line.

Fix: Add ; at end of the line ABOVE the error.

// WRONG - error points to line 3
int x = 5       // ← missing ; here!
int y = 10;

// CORRECT
int x = 5;
int y = 10;

Pro Tip: The error line number is where compiler noticed the problem, not where the missing ; is!


3. "expected ')' before..." or "expected '}' before..."

error: expected ')' before ';'
error: expected '}' at end of input

Meaning: Mismatched parentheses or braces.

Common Patterns:

// WRONG - unmatched parenthesis
if (x > 5 {  // missing )
}

// WRONG - unmatched brace
void setup() {
    Serial.begin(115200);
// missing closing }

// CORRECT
if (x > 5) {
}

void setup() {
    Serial.begin(115200);
}

Debugging Tip: Use IDE auto-format (Ctrl+T) to reveal mismatches.


4. "invalid conversion from 'const char*' to 'char*'"

error: invalid conversion from 'const char*' to 'char*'

Meaning: Trying to modify a string literal (which is read-only).

// WRONG
char* message = "Hello";  // string literals are const!
message[0] = 'h';         // can't modify!

// CORRECT (if you need to modify)
char message[] = "Hello"; // creates modifiable copy
message[0] = 'h';         // OK!

// CORRECT (if read-only is fine)
const char* message = "Hello";

5. "no matching function for call to..."

error: no matching function for call to 'SomeClass::method(int, int, int)'
note: candidate: void SomeClass::method(int, int)

Meaning: Function called with wrong number or type of arguments.

// WRONG - too many arguments
myServo.write(90, 100);  // write() takes only 1 argument!

// CORRECT
myServo.write(90);

Read the "note:" lines - they show what arguments ARE accepted.


6. "multiple definition of 'xyz'"

error: multiple definition of 'xyz'

Meaning: Same variable/function defined in multiple files.

Fixes:

// In header file (.h), use 'extern':
extern int globalVar;  // declaration only

// In ONE .cpp file, define it:
int globalVar = 0;     // actual definition

Or for functions in header:

// WRONG - defined in header, included multiple times
int add(int a, int b) { return a + b; }

// CORRECT - use 'inline'
inline int add(int a, int b) { return a + b; }

7. "'xyz' does not name a type"

error: 'WiFiClient' does not name a type

Meaning: Class/type not recognized.

Fixes:

BoardLibraryInclude
ESP32WiFi#include <WiFi.h>
ESP8266WiFi#include <ESP8266WiFi.h>
Arduino + WiFi ShieldWiFi#include <WiFi.h>
// WRONG
WiFiClient client;  // WiFiClient unknown!

// CORRECT for ESP32
#include <WiFi.h>
WiFiClient client;

8. "redefinition of 'xyz'"

error: redefinition of 'int x'

Meaning: Variable declared twice in same scope.

// WRONG
int count = 0;
int count = 0;  // redefinition!

// WRONG in loops
for (int i = 0; i < 10; i++) {
    int i = 5;  // shadows loop variable!
}

// CORRECT
int count = 0;  // declare once
count = 5;      // assign without 'int'

Upload Errors

9. "avrdude: stk500_recv(): programmer is not responding"

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt X of 10: not in sync

Meaning: Arduino IDE can't communicate with the board.

Fixes (try in order):

  1. ✅ Correct board selected? (Tools → Board)
  2. ✅ Correct port selected? (Tools → Port)
  3. ✅ USB cable is data cable (not charge-only)?
  4. ✅ Try different USB port
  5. ✅ Nothing connected to pins 0/1 (TX/RX)?
  6. ✅ Press reset button during upload
  7. ✅ Install/reinstall USB drivers

10. "A fatal error occurred: Failed to connect to ESP32"

A fatal error occurred: Failed to connect to ESP32:
Timed out waiting for packet header

Meaning: ESP32 not entering bootloader mode.

Fix: Hold BOOT button while uploading:

  1. Click Upload in IDE
  2. When "Connecting..." appears, hold BOOT button
  3. Release when upload starts
  4. Some boards: hold BOOT, press EN/RST, release BOOT

11. "Sketch too big"

Sketch too big; see https://support.arduino.cc/...
Sketch uses 34816 bytes (107%) of program storage space.
Maximum is 32256 bytes.

Meaning: Program doesn't fit in flash memory.

Fixes:

// 1. Use F() macro for strings (saves RAM + sometimes Flash)
Serial.println(F("This string in flash"));  // instead of RAM

// 2. Remove unused libraries
// Each #include adds code even if not used

// 3. Use smaller data types
uint8_t x = 5;  // instead of int (2 bytes saved)

// 4. Choose board with more flash (ESP32 has 4MB vs Arduino's 32KB)

Library Errors

12. "fatal error: xyz.h: No such file or directory"

fatal error: Adafruit_BME280.h: No such file or directory

Meaning: Library not installed.

Fix:

  1. Sketch → Include Library → Manage Libraries
  2. Search for library name
  3. Click Install
  4. If not in Library Manager: download ZIP, Sketch → Include Library → Add.ZIP Library

13. "exit status 1 / Error compiling for board..."

exit status 1
Error compiling for board Arduino Uno.

Meaning: Generic error - scroll UP to find the real error message.

The actual error is ABOVE this line! Look for lines containing error:.


Type Errors

14. "cannot convert 'String' to 'const char*'"

error: cannot convert 'String' to 'const char*'

Meaning: Function expects C-string but got Arduino String.

// WRONG
String myString = "hello";
someFunction(myString);  // if someFunction expects const char*

// CORRECT
String myString = "hello";
someFunction(myString.c_str());  // convert to C-string

15. "invalid operands to binary expression"

error: invalid operands of types 'const char*' and 'const char*' to binary 'operator+'

Meaning: Can't use + with C-strings.

// WRONG
const char* a = "hello";
const char* b = " world";
const char* c = a + b;  // doesn't work!

// CORRECT - use String
String a = "hello";
String b = " world";
String c = a + b;  // works!

// Or use snprintf
char c[20];
snprintf(c, sizeof(c), "%s%s", a, b);

Quick Reference Table

Error ContainsLikely ProblemQuick Fix
"not declared"Typo or missing includeCheck spelling, add #include
"expected ';'"Missing semicolonAdd; to line ABOVE error
"expected ')'"Unmatched parenthesisCount (and)
"expected '}'"Unmatched braceCount {and}
"no matching function"Wrong argumentsCheck function signature
"does not name a type"Missing libraryAdd #include
"multiple definition"Defined in multiple filesUse extern
"stk500"Upload failedCheck board/port/cable
"No such file"Library not installedInstall via Library Manager
"too big"Out of flashUse F(), remove unused code

Debugging Strategy

1. Read the FIRST error (later ones often cascade)
2. Note the FILE and LINE NUMBER
3. Look at that line AND the line above
4. Check for common patterns above
5. Fix ONE error at a time, recompile
6. Repeat until clean

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.11%
按下载量换算100

Claude

29.89%
按下载量换算83

Cursor

20.03%
按下载量换算55

Gemini CLI

10.07%
按下载量换算28

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills