home / skills / duc01226 / easyplatform / fix-logs
This skill analyzes application logs to identify root causes and suggests targeted fixes to improve reliability and debuggability.
npx playbooks add skill duc01226/easyplatform --skill fix-logsReview the files below or copy the command above to add this skill to your agents.
---
name: fix-logs
description: "[Fix & Debug] ⚡ Analyze logs and fix issues"
argument-hint: [issue]
infer: true
---
**IMPORTANT:** Analyze the skills catalog and activate the skills that are needed for the task during the process.
## ⚠️ Anti-Hallucination Reminder
**Before modifying ANY code:** Verify assumptions with actual code evidence. Search for usages, read implementations, trace dependencies. If confidence < 90% on any change, investigate first or ask user. See `.claude/skills/shared/anti-hallucination-protocol.md` for full protocol.
## Mission
<issue>$ARGUMENTS</issue>
## Workflow
1. Check if `./logs.txt` exists:
- If missing, set up permanent log piping in project's script config (`package.json`, `Makefile`, `pyproject.toml`, etc.):
- **Bash/Unix**: append `2>&1 | tee logs.txt`
- **PowerShell**: append `*>&1 | Tee-Object logs.txt`
- Run the command to generate logs
2. Use `debugger` subagent to analyze `./logs.txt` and find root causes:
- Use `Grep` with `head_limit: 30` to read only last 30 lines (avoid loading entire file)
- If insufficient context, increase `head_limit` as needed
3. Use `scout` subagent to analyze the codebase and find the exact location of the issues, then report back to main agent.
4. Use `planner` subagent to create an implementation plan based on the reports, then report back to main agent.
5. Start implementing the fix based the reports and solutions.
6. Use `tester` agent to test the fix and make sure it works, then report back to main agent.
7. Use `code-reviewer` subagent to quickly review the code changes and make sure it meets requirements, then report back to main agent.
8. If there are issues or failed tests, repeat from step 3.
9. After finishing, respond back to user with a summary of the changes and explain everything briefly, guide user to get started and suggest the next steps.
## IMPORTANT Task Planning Notes
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed
This skill automates log-driven debugging: it inspects runtime logs, identifies root causes, locates offending code, and implements fixes with iterative testing and review. It orchestrates specialized subagents to grep logs, scout the codebase, plan changes, apply fixes, run tests, and perform a code review. The process is conservative: verify assumptions against real code and logs before changing anything.
First the skill ensures a local logs.txt exists or sets up persistent log piping in the project scripts, then collects recent log lines to avoid loading huge files. A debugger subagent reads and summarizes the last lines, the scout locates relevant files and call sites, and the planner breaks the work into small actionable tasks. Implementation is applied incrementally, tested, and code-reviewed; failed tests or new errors trigger a new investigative cycle.
What if logs.txt is missing or truncated?
The skill will modify the project's run scripts to append tee-style piping and then reproduce the failure to capture fresh logs.
How does the skill avoid changing code blindly?
It follows an anti-hallucination principle: every proposed change is backed by log evidence and code references, and confidence must be high before modifying code.
Can I control how much log context is read?
Yes. The default reads the last ~30 lines; the head_limit can be increased when more context is necessary.