重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
error-recovery by mgd34msu/goodvibes-plugin
npx skills add https://github.com/mgd34msu/goodvibes-plugin --skill error-recoveryscripts/
validate-error-recovery.sh
references/
common-errors.md
当任务失败时,智能体必须遵循一个系统性的恢复流程,在效率和彻底性之间取得平衡。本技能定义了如何对错误进行分类、利用机构记忆、应用多源恢复策略,以及知道何时需要上报。
当任务执行过程中发生错误时:
切勿盲目重试。完整阅读错误信息、堆栈跟踪以及任何诊断输出。
将错误归类为以下六种类型之一:
检查 .goodvibes/memory/failures.json,使用 precision_read 匹配关键词:
resolution广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
常见原因:
恢复步骤:
sandbox.enabled)记忆中的常见模式:
output.format,处理程序读取 output.mode。始终使用 ?? 检查两者。src/**/*.ts 这样的模式在使用 ripgrep 时会静默失败。使用正则表达式检测字面前缀并强制使用 fast-glob。path.resolve() 之前始终使用 path.isAbsolute()。sandbox === true || sandbox === 'true' 时启用。切勿使用 === false 检查。常见原因:
恢复步骤:
npm install常见原因:
恢复步骤:
await、不当使用 done() 或存在竞态条件常见原因:
obj.prop,其中 obj 可能为 null/undefined)string 赋值给 number)any 使用逃逸类型系统恢复步骤:
explain_type_error 分析引擎工具?.)或空值检查any 逃逸:用正确的类型替换 any常见模式:
if (obj && 'prop' in obj)obj?.prop?.nestedProp常见原因:
恢复步骤:
.catch() 处理程序或在 await 周围使用 try/catch.env 文件,确认它们已加载常见模式:
await 表达式周围使用 try/catchif (!value) throw new Error('...')常见原因:
恢复步骤:
.goodvibes/secrets/ 中的凭据,验证令牌是否未过期常见模式:
在对错误进行分类并检查 failures.json 后,使用一次性策略,即同时(而非顺序)咨询所有知识源,并应用最佳解决方案:
咨询所有来源后:
评估解决方案,依据:
完整应用解决方案:
验证修复:
成功解决错误后:
.goodvibes/memory/failures.json使用 precision_edit 追加一个新条目:
{
"id": "fail_YYYYMMDD_HHMMSS",
"date": "ISO-8601 timestamp",
"error": "Brief description of the error",
"context": "What was being attempted when error occurred",
"root_cause": "Why it happened (technical explanation)",
"resolution": "How it was fixed (specific steps taken)",
"prevention": "How to avoid this in the future",
"keywords": ["relevant", "search", "terms"]
}
示例:
{
"id": "fail_20260215_143000",
"date": "2026-02-15T14:30:00Z",
"error": "precision_read returns 'file not found' for valid path",
"context": "Reading component file at src/components/Button.tsx",
"root_cause": "Path was relative, but precision tools require absolute paths. Sandbox was enabled, blocking CWD resolution.",
"resolution": "RESOLVED - Used absolute path with process.cwd() to create absolute path before calling precision_read.",
"prevention": "Always use absolute paths with precision tools. Use path.resolve() to convert relative to absolute.",
"keywords": ["precision_read", "path", "absolute", "relative", "sandbox", "file-not-found"]
}
.goodvibes/logs/errors.md使用 precision_edit 追加一个 Markdown 条目:
## [YYYY-MM-DD HH:MM] ERROR_CATEGORY: Brief Description
**Error**: Full error message
**Context**: What was being done
**Resolution**: How it was fixed
**Time to resolve**: X minutes
---
记录完成后,返回原始任务。无需等待确认。
如果你已尝试修复错误 3 次但仍然失败:
添加到 failures.json,并设置 "resolution": "UNRESOLVED - <what was tried>":
{
"id": "fail_20260215_143500",
"date": "2026-02-15T14:35:00Z",
"error": "Vitest tests hang indefinitely on CI",
"context": "Running npm run test in CI pipeline",
"root_cause": "Unknown - tests pass locally but hang in CI environment",
"resolution": "UNRESOLVED - Tried: 1) Added --no-watch flag, 2) Increased timeout to 60s, 3) Disabled coverage collection. Tests still hang.",
"prevention": "Need deeper investigation into CI environment differences",
"keywords": ["vitest", "ci", "hang", "timeout", "unresolved"]
}
在你的响应中使用结构化格式:
## Task Status: BLOCKED
### Error
[ERROR_CATEGORY] Brief description
### Attempts Made
1. **Attempt 1**: What was tried -> Result
2. **Attempt 2**: What was tried -> Result
3. **Attempt 3**: What was tried -> Result
### Root Cause Analysis
Best guess at why this is failing based on investigation.
### Suggested Next Steps
- Option 1: [Describe approach that requires different permissions/access]
- Option 2: [Describe alternative architecture/design decision]
- Option 3: [Describe manual intervention needed]
### Files Changed
- `path/to/file.ts` - [what was changed during troubleshooting]
将任务保持在 BLOCKED 状态。协调器将决定是否:
对于某些错误类型,请勿尝试恢复。立即上报给协调器:
EACCES: permission denied
EPERM: operation not permitted
原因:这些需要用户干预来授予权限。智能体无法解决此问题。
上报时附带:"遇到权限错误。需要用户:[授予文件访问权限 / 以 sudo 运行 / 更改所有权]。 "
Error: OPENAI_API_KEY is not defined
Error: Database connection failed: authentication error
401 Unauthorized
原因:智能体无法创建或修改密钥。只有用户才能提供凭据。
上报时附带:"缺少凭据:[ENV_VAR_NAME 或服务名称]。用户需要通过 .env 或密钥管理来提供。"
Context clues indicate multiple valid approaches:
- Use REST API vs GraphQL
- Use Prisma vs Drizzle
- Component composition pattern unclear
原因:这些是影响整个系统的设计决策。智能体不应单方面做出架构选择。
上报时附带:"需要架构决策:[描述选择]。选项:[列出 2-3 个选项及其权衡]。 "
Original task: "Add user profile page"
Discovered: Requires new database schema, auth changes, API endpoints
原因:任务范围比最初定义的要大。协调器需要重新规划。
上报时附带:"发现范围扩大。原始任务:[任务]。所需:[新的依赖项/更改]。建议:[分解为子任务 / 获取用户批准]。 "
当发生错误时:
3 次尝试后:
立即上报以下情况:
请记住:
每周安装量
71
代码仓库
GitHub Stars
6
首次出现
2026年2月17日
安全审计
安装于
codex70
opencode70
github-copilot69
kimi-cli69
gemini-cli69
amp69
scripts/
validate-error-recovery.sh
references/
common-errors.md
When tasks fail, agents must follow a systematic recovery process that balances efficiency with thoroughness. This skill defines how to categorize errors, leverage institutional memory, apply multi-source recovery strategies, and know when to escalate.
When an error occurs during task execution:
DO NOT retry blindly. Read the full error message, stack trace, and any diagnostic output.
Categorize the error into one of six types:
Check.goodvibes/memory/failures.json for matching keywords using precision_read:
resolutionCommon Causes:
Recovery Steps:
sandbox.enabled)Common Patterns from Memory:
output.format, handlers read output.mode. Always check both with ??.src/**/*.ts fail silently with ripgrep. Use regex to detect literal prefixes and force fast-glob.path.isAbsolute() before path.resolve().sandbox === true || sandbox === 'true'. Never use === false checks.Common Causes:
Recovery Steps:
npm installCommon Causes:
Recovery Steps:
await, improper use of done(), or race conditionsCommon Causes:
obj.prop where obj could be null/undefined)string assigned to number)any usage escaping type systemRecovery Steps:
explain_type_error analysis-engine tool if available?.) or null checkany escapes: Replace any with proper typesCommon Patterns:
if (obj && 'prop' in obj)obj?.prop?.nestedPropCommon Causes:
Recovery Steps:
.catch() handlers or try/catch around await.env files, verify they're loadedCommon Patterns:
try/catch around all await expressionsif (!value) throw new Error('...')Common Causes:
Recovery Steps:
.goodvibes/secrets/, verify token hasn't expiredCommon Patterns:
After categorizing the error and checking failures.json, use a one-shot strategy where you consult ALL knowledge sources simultaneously (not sequentially) and apply the best solution:
Once you've consulted all sources:
Evaluate solutions based on:
Apply the solution completely:
Validate the fix :
Once you've successfully resolved the error:
.goodvibes/memory/failures.jsonUse precision_edit to append a new entry with:
{
"id": "fail_YYYYMMDD_HHMMSS",
"date": "ISO-8601 timestamp",
"error": "Brief description of the error",
"context": "What was being attempted when error occurred",
"root_cause": "Why it happened (technical explanation)",
"resolution": "How it was fixed (specific steps taken)",
"prevention": "How to avoid this in the future",
"keywords": ["relevant", "search", "terms"]
}
Example:
{
"id": "fail_20260215_143000",
"date": "2026-02-15T14:30:00Z",
"error": "precision_read returns 'file not found' for valid path",
"context": "Reading component file at src/components/Button.tsx",
"root_cause": "Path was relative, but precision tools require absolute paths. Sandbox was enabled, blocking CWD resolution.",
"resolution": "RESOLVED - Used absolute path with process.cwd() to create absolute path before calling precision_read.",
"prevention": "Always use absolute paths with precision tools. Use path.resolve() to convert relative to absolute.",
"keywords": ["precision_read", "path", "absolute", "relative", "sandbox", "file-not-found"]
}
.goodvibes/logs/errors.mdAppend a markdown entry using precision_edit:
## [YYYY-MM-DD HH:MM] ERROR_CATEGORY: Brief Description
**Error**: Full error message
**Context**: What was being done
**Resolution**: How it was fixed
**Time to resolve**: X minutes
---
Once logged, return to the original task. Don't wait for confirmation.
If you've tried to fix the error 3 times and it's still failing:
Add to failures.json with "resolution": "UNRESOLVED - <what was tried>":
{
"id": "fail_20260215_143500",
"date": "2026-02-15T14:35:00Z",
"error": "Vitest tests hang indefinitely on CI",
"context": "Running npm run test in CI pipeline",
"root_cause": "Unknown - tests pass locally but hang in CI environment",
"resolution": "UNRESOLVED - Tried: 1) Added --no-watch flag, 2) Increased timeout to 60s, 3) Disabled coverage collection. Tests still hang.",
"prevention": "Need deeper investigation into CI environment differences",
"keywords": ["vitest", "ci", "hang", "timeout", "unresolved"]
}
Use structured format in your response:
## Task Status: BLOCKED
### Error
[ERROR_CATEGORY] Brief description
### Attempts Made
1. **Attempt 1**: What was tried -> Result
2. **Attempt 2**: What was tried -> Result
3. **Attempt 3**: What was tried -> Result
### Root Cause Analysis
Best guess at why this is failing based on investigation.
### Suggested Next Steps
- Option 1: [Describe approach that requires different permissions/access]
- Option 2: [Describe alternative architecture/design decision]
- Option 3: [Describe manual intervention needed]
### Files Changed
- `path/to/file.ts` - [what was changed during troubleshooting]
Leave the task in BLOCKED state. The orchestrator will decide whether to:
For certain error types, do NOT attempt recovery. Escalate immediately to the orchestrator:
EACCES: permission denied
EPERM: operation not permitted
Why : These require user intervention to grant permissions. Agents can't fix this.
Escalate with : "Permission error encountered. Need user to: [grant file access / run as sudo / change ownership]."
Error: OPENAI_API_KEY is not defined
Error: Database connection failed: authentication error
401 Unauthorized
Why : Agents can't create or modify secrets. Only users can provide credentials.
Escalate with : "Missing credential: [ENV_VAR_NAME or service name]. User needs to provide via .env or secrets management."
Context clues indicate multiple valid approaches:
- Use REST API vs GraphQL
- Use Prisma vs Drizzle
- Component composition pattern unclear
Why : These are design decisions that affect the broader system. Agents shouldn't make architectural choices unilaterally.
Escalate with : "Architectural decision required: [describe the choice]. Options: [list 2-3 options with tradeoffs]."
Original task: "Add user profile page"
Discovered: Requires new database schema, auth changes, API endpoints
Why : The task is larger than originally scoped. Orchestrator needs to re-plan.
Escalate with : "Scope expansion discovered. Original: [task]. Required: [new dependencies/changes]. Recommend: [break into subtasks / get user approval]."
When errors occur:
After 3 attempts:
Escalate immediately for:
Remember:
Weekly Installs
71
Repository
GitHub Stars
6
First Seen
Feb 17, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex70
opencode70
github-copilot69
kimi-cli69
gemini-cli69
amp69
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
48,700 周安装
AI旅行规划器 - 个性化行程、预算、打包清单与文化指南一键生成
1,100 周安装
Burp Suite 项目解析器 - 安全审计数据提取与 HTTP 流量分析工具
1,200 周安装
gmgn-market:查询代币K线数据和热门代币的CLI工具 | 支持Solana/BSC/Base链
1,200 周安装
Claude Chrome MCP 故障排除指南:解决浏览器扩展连接失败与原生主机冲突问题
1,200 周安装
内容相似度检查器 - 使用余弦、杰卡德、莱文斯坦算法比较文档和文本相似度
62 周安装
mcporter - MCP 服务器命令行工具,快速调用、管理和生成代码
1,300 周安装