Xspoonai official log triage

From jiayaoqijia/cryptoskill · View interactive version

Xspoonai official log triage is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. CI/build/runtime error log analysis with root-cause detection, prioritized fix plans, and verification checklists

How to use this skill

Skill file

Skill: Log Triage & Fix Plan (Enterprise Debugging)

Source: ETHPanda

Track: Enterprise & Team Skills → Debugging

Goal: Turn raw error logs into (1) root-cause hypotheses, (2) reproducible steps, (3) prioritized fix plan, (4) verification checklist.

When to use

Use this skill when you have:

Required inputs (ask user to provide)

  1. The error log (full text preferred)
  2. What command was running (e.g. pnpm test, hardhat test, pytest, cargo test)
  3. Environment (OS, Node/Python/Rust versions, CI provider if any)
  4. Recent changes (commit, dependency bumps, config edits) if known

Output format (must follow)

  1. 1-paragraph summary of what failed and where
  2. Error signature(s) (key lines you matched)
  3. Root-cause candidates (ranked, with confidence and reasoning)
  4. Fix plan (ranked, each step includes exact commands or code areas to check)
  5. Verification checklist (how to confirm the fix)
  6. If blocked: minimal questions to unblock (max 3)

Triage procedure

  1. Extract the first fatal error (often earlier than the last line)
  2. Classify into categories:
  1. Match known patterns (e.g. "Cannot find module", "TypeError", "revert", "out of gas", "403/429", etc.)
  2. Propose minimal reproduction locally
  3. Provide safest fix first (pin version / clean install / config correction) before invasive refactors

Constraints

Available Scripts

log_triage.py

Analyzes error logs using pattern matching and generates a structured Markdown report.

Usage:

python scripts/log_triage.py --file <log_file> --format md

Input:

Output:

Supported Error Patterns

| Category | Pattern | Fix Strategy |

|----------|---------|--------------|

| Node Missing Module | Cannot find module 'X' | Clean install, check lockfile |

| TypeScript Errors | TS\d+: | Fix types, check TS version |

| Python Module Not Found | ModuleNotFoundError: No module named 'X' | Check requirements, reinstall venv |

| Hardhat Errors | HardhatError\|HH\d+: | Check compiler version, clear cache |

| Revert Reasons | reverted with reason string 'X' | Trace contract logic, check inputs |

| Rate Limits | 429\|rate limit | Add retries, reduce concurrency |

Example Usage

Scenario 1: CI Build Failed

User Query:

"My GitHub Actions workflow failed with this log: [paste log]"

Agent Response:

## Log Triage Report

### Summary
Node.js build failed due to missing module 'viem'. The dependency exists in 
package.json but wasn't installed in CI environment.

### Matched Error Signatures
1. **node_missing_module**: `Cannot find module 'viem'`

### Fix Plan (Prioritized)
1. Run clean install: `rm -rf node_modules && pnpm install`
2. Check lockfile changes and Node version consistency (CI vs local)
3. If monorepo, ensure package is listed in the right package.json

### Verification Checklist
- [ ] Re-run the exact failing command locally
- [ ] Re-run CI workflow and confirm green
- [ ] Add a regression test if applicable

Scenario 2: Hardhat Test Failure

User Query:

"My hardhat test is failing with HH600 error"

Agent Response:

## Log Triage Report

### Summary
Hardhat compilation failed due to compiler version mismatch between 
hardhat.config and contract pragma.

### Matched Error Signatures
1. **hardhat_compile**: `HH600: Compilation failed`

### Fix Plan (Prioritized)
1. Run `pnpm hardhat compile --show-stack-traces` locally
2. Check Solidity compiler version in hardhat config matches pragma
3. If error about artifacts/cache: remove `artifacts/ cache/` and recompile

### Verification Checklist
- [ ] Contracts compile successfully
- [ ] Tests pass locally
- [ ] CI passes

Best Practices

  1. Extract First Error: Often the first error causes cascading failures
  2. Minimal Reproduction: Simplify to smallest failing case
  3. Reversible Fixes: Try safe fixes (clean install, version pin) before refactoring
  4. Verify Thoroughly: Re-run exact command + CI workflow
  5. Document Root Cause: Add regression test or config comment

Integration with SpoonReactSkill

from spoon_ai.agents import SpoonReactSkill

agent = SpoonReactSkill(
    name="debug_assistant",
    skill_paths=["./enterprise-skills/debugging/log-triage"],
    scripts_enabled=True
)

await agent.activate_skill("log-triage")

result = await agent.run(
    "My CI failed with this error: [paste log]. What's wrong and how do I fix it?"
)
print(result)

Context Variables

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.