Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ln-514-test-log-analyzer

БесплатноЗапускает вложенные скриптыНе проверен

Analyzes application logs: classifies errors, checks log quality/format, maps stack traces to source, recommends fixes.

tensologyот tensology★ 17 звёзд на GitHub

Об этом скилле

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

Test Log Analyzer

Two-layer analysis of application logs. Python script handles collection and quantitative analysis; AI handles classification, quality assessment, and fix recommendations.

Inputs

No required inputs. Runs in current project directory, auto-detects log sources.

Optional args — caller instructions (natural language): time window, expected errors, test context. Example: "review logs for last 30min, auth 401 errors expected from negative tests".

Purpose & Scope

  • Analyze application logs (after test runs, during development, or on demand)
  • Classify errors into 4 categories: Real Bug, Test Artifact, Expected Behavior, Operational Warning
  • Assess log quality: noisiness, completeness, level correctness, format, structured logging
  • Map stack traces to source files; provide fix recommendations
  • Report findings for quality verdict (only Real Bugs block)
  • No status changes or task creation — report only

When to Use

  • Analyze application logs in any project (default: last 1h)
  • After test runs to classify errors and assess log quality
  • Can be invoked with context instructions: Skill(skill: "ln-514-test-log-analyzer", args: "review last 30min, 401 errors expected")

Workflow

Phase 0: Parse Instructions

If args provided — extract: time window (default: 1h), expected errors list, test context. If no args — use defaults (last 1h, no expected errors).

Phase 1: Log Source Detection and Script Execution

MANDATORY READ: Load docs/project/infrastructure.md, docs/project/runbook.md

  1. Check if scripts/analyze_test_logs.py exists in target project. If missing, copy from references/analyze_test_logs.py.
  2. Detect log source mode (auto-detection priority: docker → file → loki):
Mode Detection Source
docker docker compose ps returns running containers docker compose logs --since {window}
file .log files exist, or tests/manual/results/ has output File paths from infrastructure.md or *.log glob
loki LOKI_URL env var or tools_config.md observability section Loki HTTP query_range API
  1. Run script: python scripts/analyze_test_logs.py --mode {detected} [options]
  2. If no log sources found → return NO_LOG_SOURCES status, skip to Phase 5.

Phase 2: 4-Category Error Classification

Classify each error group from script JSON output:

Category Action Criteria
Real Bug Fix Unexpected crash, data loss, broken pipeline
Test Artifact Skip From test scripts, deliberate error-path validation
Expected Behavior Skip Rate limiting, input validation, auth failures from invalid tokens
Operational Warning Monitor Clock drift, resource pressure, temporary unavailability

Test artifact detection heuristics:

  • Test name contains: invalid, error, fail, reject, unauthorized, forbidden, not_found, bad_request, timeout
  • Test asserts non-2xx status codes (4xx, 5xx)
  • Test uses pytest.raises, expect(...).rejects, assertThrows, should.throw
  • Errors correlate with test execution timestamps from regression test output
  • Patterns matching tests/manual/ scripts

Error taxonomy per references/error_taxonomy.md (9 categories: CRASH, TIMEOUT, AUTH, DB, NETWORK, VALIDATION, CONFIG, RESOURCE, DEPRECATION).

Phase 3: Log Quality Assessment

MANDATORY READ: Load references/error_taxonomy.md (per-level criteria table + level correctness reference)

Step 1: Detect configured log level. Check in order:

  1. LOG_LEVEL / LOGLEVEL env var (.env, docker-compose.yml, infrastructure.md)
  2. Framework config: Python logging.conf / Django LOGGING / Node LOG_LEVEL
  3. Default: assume INFO if not detected

Configured level determines WHICH levels appear in logs, but each level has its own noise threshold regardless.

Step 2: Assess 6 quality dimensions:

Dimension What to Check Signal
Noisiness Per-level noise thresholds from error_taxonomy.md section 4: TRACE (zero in prod), DEBUG (>50% monopoly), INFO (>30%), WARNING (>1% of total), ERROR (>0.1% of total) NOISY: {level} template "{msg}" at {ratio}%
Completeness & Traceability Critical operations missing log entries + traceability gaps (see table below) MISSING: No log for {operation} / TRACEABILITY_GAP: {type} in {file}:{line}
Level correctness Per-level criteria from error_taxonomy.md section 4: content, anti-patterns, library rule WRONG_LEVEL: should be {level}
Structured logging Missing trace_id/request_id/user context; unstructured plaintext UNSTRUCTURED: lacks {field}
Sensitivity PII/secrets/tokens/pass
Полный SKILL.md на GitHub

Установить ln-514-test-log-analyzer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/analyze_test_logs.pyreferences/error_taxonomy.mdreferences/log_analysis_output_format.md

FAQ

Что делает скилл ln-514-test-log-analyzer?

Analyzes application logs: classifies errors, checks log quality/format, maps stack traces to source, recommends fixes.

Как установить скилл ln-514-test-log-analyzer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ln-514-test-log-analyzer запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ln-514-test-log-analyzer с