AgentSkillsCN

failure-analyzer

分析失败任务的输出,对错误进行分类并提出重试策略。适用于 TaskPlex 实施尝试失败时使用。

SKILL.md
--- frontmatter
name: failure-analyzer
description: "Analyzes failed task output to categorize the error and suggest a retry strategy. Use when a TaskPlex implementation attempt fails."

Failure Analyzer

Analyzes failed task output to determine the error category and recommend a retry strategy.

Error Categories

CategoryDetection PatternsStrategyMax Retries
env_missing"API key", "token", "credentials", "ECONNREFUSED", "connection refused"Skip immediately, log for user0
test_failureTests ran but assertions failedRetry with test output as context2
timeoutExit code 124, "timed out"Retry with 1.5x timeout1
code_errorLinter, typecheck, build errorsRetry with error output as context2
dependency_missing"Cannot find module", "ModuleNotFoundError", "package not found"Skip, log for user0
unknownUnclassifiableRetry once, then skip1

Input

Provide the failed task output (stdout + stderr) and the story details.

Output

json
{
  "error_category": "test_failure",
  "confidence": 0.95,
  "evidence": "pytest output shows 2 assertion failures in test_priority.py",
  "retry_recommended": true,
  "retry_context": "Previous attempt failed because: ...",
  "user_action_needed": false,
  "user_action": null
}

Analysis Steps

  1. Scan output for category-specific patterns
  2. Determine confidence level
  3. Extract relevant error context for retry prompt
  4. Recommend: retry with context, skip, or request user action