agentleFS
Lethe044Lethe044/agentskill-kit/skills/log-analyzer/SKILL.md

log-analyzer

Skill48 starsChanged 17 days agoMITView on GitHub

Summarizes application log files by severity, time range and the most frequent error messages. Use when the user shares a log file or pasted log output and asks what went wrong, which errors repeat, or how noisy the log is.

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use test-generator and security-audit.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • u9401066Skill

    test-generator

    Generate comprehensive test suites including static analysis, unit tests, integration tests, E2E tests, and coverage reports. Triggers: TG, test, 測試, 寫測試, coverage, 覆蓋率, pytest, unittest, 驗證.

    Also in 3 projects that use this

  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Start with levels. A high ratio of ERROR to INFO points to a sustained failure, not a one-off.

    line 42

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “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

Log analyzer

Reads plain text logs and produces a structured summary so the agent can reason about the incident instead of scrolling through thousands of lines.

When to use

  • The user pastes a stack trace or log excerpt and asks for the root cause.
  • The user asks which errors happen most often, or when problems started.
  • A deploy or test run failed and a log file is available.

How to run

python scripts/analyze_log.py --top 5 app.log
cat app.log | python scripts/analyze_log.py

The script reads the file given as the last argument, or standard input when no file is given.

Output

A JSON object:

  • total_lines and levels: a count per severity (CRITICAL, ERROR, WARN, INFO, DEBUG).
  • first_timestamp and last_timestamp: the earliest and latest ISO style timestamps found, or null.
  • top_errors: the most frequent error messages as {"message", "count"}. Numbers, hex ids and quoted values are replaced with placeholders so that similar errors group together.

Reading the result

  1. Start with levels. A high ratio of ERROR to INFO points to a sustained failure, not a one-off.
  2. Compare first_timestamp with the time the user reports the problem.
  3. Take the first entry of top_errors and search the original log for its raw form to get the stack trace.
  4. Report the cause, the evidence (counts and timestamps), and one concrete next step.

Example

Input line: 2024-05-01 10:00:02 ERROR db timeout after 30s on host 10.0.0.5

The message is grouped as db timeout after <n>s on host <n>.<n>.<n>.<n>.

Errors

A missing file exits with code 2 and file not found on stderr. Empty input returns zero counts.

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.