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:
- CI failure logs (GitHub Actions, GitLab CI, Jenkins, etc.)
- Runtime crashes, stack traces, uncaught exceptions
- Build failures (TypeScript, Python, Rust, Go, Java, Solidity/Hardhat)
- Dependency / environment / permission / network issues
Required inputs (ask user to provide)
- The error log (full text preferred)
- What command was running (e.g.
pnpm test, hardhat test, pytest, cargo test)
- Environment (OS, Node/Python/Rust versions, CI provider if any)
- Recent changes (commit, dependency bumps, config edits) if known
Output format (must follow)
- 1-paragraph summary of what failed and where
- Error signature(s) (key lines you matched)
- Root-cause candidates (ranked, with confidence and reasoning)
- Fix plan (ranked, each step includes exact commands or code areas to check)
- Verification checklist (how to confirm the fix)
- If blocked: minimal questions to unblock (max 3)
Triage procedure
- Extract the first fatal error (often earlier than the last line)
- Classify into categories:
- Syntax/type errors
- Missing dependency / wrong version
- Build toolchain mismatch
- Env var / secret missing
- Permission / path / file system
- Network / rate limit / RPC issues
- Test flakiness / timing
- Match known patterns (e.g. "Cannot find module", "TypeError", "revert", "out of gas", "403/429", etc.)
- Propose minimal reproduction locally
- Provide safest fix first (pin version / clean install / config correction) before invasive refactors
Constraints
- Don't hallucinate files that don't exist; when unsure, say "check whether X exists".
- Prefer reversible changes (lockfile pin, config tweak) over broad refactors.
- Always include a verification step (rerun exact command / CI workflow).
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:
--file: Path to log file
--format: Output format (md or txt)
Output:
- Matched error signatures
- Prioritized fix plan
- Verification checklist
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
- Extract First Error: Often the first error causes cascading failures
- Minimal Reproduction: Simplify to smallest failing case
- Reversible Fixes: Try safe fixes (clean install, version pin) before refactoring
- Verify Thoroughly: Re-run exact command + CI workflow
- 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
{{log_file}}: Path to log file
{{command}}: Command that failed
{{environment}}: Environment details
{{recent_changes}}: Recent commits or dependency changes
1---2name: log-triage3description: CI/build/runtime error log analysis with root-cause detection, prioritized fix plans, and verification checklists4---56# Skill: Log Triage & Fix Plan (Enterprise Debugging)78**Source:** ETHPanda 9**Track:** Enterprise & Team Skills → Debugging 10**Goal:** Turn raw error logs into (1) root-cause hypotheses, (2) reproducible steps, (3) prioritized fix plan, (4) verification checklist.1112## When to use1314Use this skill when you have:15- CI failure logs (GitHub Actions, GitLab CI, Jenkins, etc.)16- Runtime crashes, stack traces, uncaught exceptions17- Build failures (TypeScript, Python, Rust, Go, Java, Solidity/Hardhat)18- Dependency / environment / permission / network issues1920## Required inputs (ask user to provide)21221. The error log (full text preferred)232. What command was running (e.g. `pnpm test`, `hardhat test`, `pytest`, `cargo test`)243. Environment (OS, Node/Python/Rust versions, CI provider if any)254. Recent changes (commit, dependency bumps, config edits) if known2627## Output format (must follow)28291. **1-paragraph summary** of what failed and where302. **Error signature(s)** (key lines you matched)313. **Root-cause candidates** (ranked, with confidence and reasoning)324. **Fix plan** (ranked, each step includes exact commands or code areas to check)335. **Verification checklist** (how to confirm the fix)346. **If blocked:** minimal questions to unblock (max 3)3536## Triage procedure37381. Extract the *first* fatal error (often earlier than the last line)392. Classify into categories:40 - Syntax/type errors41 - Missing dependency / wrong version42 - Build toolchain mismatch43 - Env var / secret missing44 - Permission / path / file system45 - Network / rate limit / RPC issues46 - Test flakiness / timing473. Match known patterns (e.g. "Cannot find module", "TypeError", "revert", "out of gas", "403/429", etc.)484. Propose minimal reproduction locally495. Provide safest fix first (pin version / clean install / config correction) before invasive refactors5051## Constraints5253- Don't hallucinate files that don't exist; when unsure, say "check whether X exists".54- Prefer reversible changes (lockfile pin, config tweak) over broad refactors.55- Always include a verification step (rerun exact command / CI workflow).5657## Available Scripts5859### log_triage.py6061Analyzes error logs using pattern matching and generates a structured Markdown report.6263**Usage:**64```bash65python scripts/log_triage.py --file <log_file> --format md66```6768**Input:**69- `--file`: Path to log file70- `--format`: Output format (md or txt)7172**Output:**73- Matched error signatures74- Prioritized fix plan75- Verification checklist7677## Supported Error Patterns7879| Category | Pattern | Fix Strategy |80|----------|---------|--------------|81| Node Missing Module | `Cannot find module 'X'` | Clean install, check lockfile |82| TypeScript Errors | `TS\d+:` | Fix types, check TS version |83| Python Module Not Found | `ModuleNotFoundError: No module named 'X'` | Check requirements, reinstall venv |84| Hardhat Errors | `HardhatError\|HH\d+:` | Check compiler version, clear cache |85| Revert Reasons | `reverted with reason string 'X'` | Trace contract logic, check inputs |86| Rate Limits | `429\|rate limit` | Add retries, reduce concurrency |8788## Example Usage8990### Scenario 1: CI Build Failed9192**User Query:**93```94"My GitHub Actions workflow failed with this log: [paste log]"95```9697**Agent Response:**98```markdown99## Log Triage Report100101### Summary102Node.js build failed due to missing module 'viem'. The dependency exists in 103package.json but wasn't installed in CI environment.104105### Matched Error Signatures1061. **node_missing_module**: `Cannot find module 'viem'`107108### Fix Plan (Prioritized)1091. Run clean install: `rm -rf node_modules && pnpm install`1102. Check lockfile changes and Node version consistency (CI vs local)1113. If monorepo, ensure package is listed in the right package.json112113### Verification Checklist114- [ ] Re-run the exact failing command locally115- [ ] Re-run CI workflow and confirm green116- [ ] Add a regression test if applicable117```118119### Scenario 2: Hardhat Test Failure120121**User Query:**122```123"My hardhat test is failing with HH600 error"124```125126**Agent Response:**127```markdown128## Log Triage Report129130### Summary131Hardhat compilation failed due to compiler version mismatch between 132hardhat.config and contract pragma.133134### Matched Error Signatures1351. **hardhat_compile**: `HH600: Compilation failed`136137### Fix Plan (Prioritized)1381. Run `pnpm hardhat compile --show-stack-traces` locally1392. Check Solidity compiler version in hardhat config matches pragma1403. If error about artifacts/cache: remove `artifacts/ cache/` and recompile141142### Verification Checklist143- [ ] Contracts compile successfully144- [ ] Tests pass locally145- [ ] CI passes146```147148## Best Practices1491501. **Extract First Error**: Often the first error causes cascading failures1512. **Minimal Reproduction**: Simplify to smallest failing case1523. **Reversible Fixes**: Try safe fixes (clean install, version pin) before refactoring1534. **Verify Thoroughly**: Re-run exact command + CI workflow1545. **Document Root Cause**: Add regression test or config comment155156## Integration with SpoonReactSkill157158```python159from spoon_ai.agents import SpoonReactSkill160161agent = SpoonReactSkill(162 name="debug_assistant",163 skill_paths=["./enterprise-skills/debugging/log-triage"],164 scripts_enabled=True165)166167await agent.activate_skill("log-triage")168169result = await agent.run(170 "My CI failed with this error: [paste log]. What's wrong and how do I fix it?"171)172print(result)173```174175## Context Variables176177- `{{log_file}}`: Path to log file178- `{{command}}`: Command that failed179- `{{environment}}`: Environment details180- `{{recent_changes}}`: Recent commits or dependency changes