agentleFS
r3bl-orgr3bl-org/r3bl-open-core/.agents/skills/analyze-log-files/SKILL.md

analyze-log-files

Skill486 starsChanged 15 days agoApache-2.0View on GitHub

Analyze log files by stripping ANSI escape sequences first. Use when asked to process, handle, read, or analyze log files that may contain terminal escape codes.

  • Installs packages

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When user asks to "analyze /tmp/r3bl_tui/log.txt", "read the log file", "process logs", "check the logs"

    line 10
  2. Very specific:

    When dealing with any .log or log-related files that may contain ANSI escape sequences

    line 11
  3. Distinctive:

    When terminal output has been captured to a file and needs analysis

    line 12
  4. Distinctive:

    When log files appear garbled or contain escape sequence artifacts

    line 13
  5. Distinctive:

    Read in plain text editors

    line 24
  6. Distinctive:

    Search with grep/ripgrep

    line 25
  7. Very specific:

    Before analyzing any log file, first strip the ANSI sequences using ansifilter:

    line 33
  8. Very specific:

    Read and analyze /tmp/clean_log.txt instead of the original file:

    line 46
  9. Distinctive:

    When reporting findings to the user:

    line 54
  10. Very specific:

    If ansifilter is not installed:

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Analyze Log Files

When to Use

  • When user asks to "analyze /tmp/r3bl_tui/log.txt", "read the log file", "process logs", "check the logs"
  • When dealing with any .log or log-related files that may contain ANSI escape sequences
  • When terminal output has been captured to a file and needs analysis
  • When log files appear garbled or contain escape sequence artifacts

Why This Matters

Log files captured from terminal sessions often contain ANSI escape sequences for:

  • Colors (e.g., \x1b[31m for red)
  • Cursor movements
  • Text formatting (bold, underline)
  • Screen clearing commands

These sequences make logs difficult to:

  1. Read in plain text editors
  2. Search with grep/ripgrep
  3. Process with text analysis tools
  4. Analyze accurately by LLMs

Instructions

Step 1: Strip ANSI Escape Sequences

Before analyzing any log file, first strip the ANSI sequences using ansifilter:

ansifilter -i /tmp/r3bl_tui/log.txt -o /tmp/clean_log.txt

For other log file names, adjust accordingly:

ansifilter -i <input_file> -o /tmp/clean_log.txt

Step 2: Analyze the Clean Log

Read and analyze /tmp/clean_log.txt instead of the original file:

# Use the Read tool on /tmp/clean_log.txt

Step 3: Report Findings

When reporting findings to the user:

  • Reference line numbers from the clean log
  • Quote relevant sections
  • Summarize errors, warnings, or patterns found

Common Log File Locations

  • /tmp/r3bl_tui/log.txt - General purpose log in project root
  • target/ - Cargo build logs
  • /tmp/*.log - Temporary logs

Example Workflow

User: "Can you analyze /tmp/r3bl_tui/log.txt and tell me what's wrong?"

  1. Run: ansifilter -i /tmp/r3bl_tui/log.txt -o /tmp/clean_log.txt
  2. Read: /tmp/clean_log.txt
  3. Analyze the content for errors, warnings, patterns
  4. Report findings to user

Troubleshooting

If ansifilter is not installed:

# Ubuntu/Debian
sudo apt-get install ansifilter

# macOS
brew install ansifilter

# Or run bootstrap.sh to install all dependencies
./bootstrap.sh

Related Skills

  • check-code-quality - For checking Rust code quality (may generate logs)
  • analyze-performance - For performance analysis (generates flamegraph data)

Related Commands

  • /analyze-logs - Explicitly invokes this skill

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.