log-doctor
Skill0 starsChanged 3 months agoApache-2.0View on GitHub
Analyze and improve logging quality — inspect log format, log levels, log content, structured logging, log noise, missing logs on critical paths, sensitive data in logs, log performance impact, and log aggregation configuration. Ensures logs are useful for debugging without being excessive or exposing sensitive data. Works with Winston, Pino, Bunyan, Log4j, logging module, loguru, zerolog, and custom logging. Use when the user wants to audit, improve, restructure, or troubleshoot their application logging.
In this repository49 other files it gives its agents.
- accessibility-auditorSkill
- api-doctorSkill
- browser-compatibilitySkill
- build-doctorSkill
- bundle-doctorSkill
- cache-doctorSkill
- change-cartographerSkill
- ci-cd-doctorSkill
- code-auditorSkill
- code-migratorSkill
- code-reviewerSkill
- config-doctorSkill
- container-doctorSkill
- context-keeperSkill
- contract-testerSkill
- cron-doctorSkill
- database-doctorSkill
- decision-memorySkill
- dependency-doctorSkill
- documentation-engineerSkill
- env-guardSkill
- error-boundary-doctorSkill
- feature-integritySkill
- git-hygieneSkill
- handoff-engineerSkill
- i18n-auditorSkill
- incident-debuggerSkill
- intent-architectSkill
- motion-designerSkill
- observability-engineerSkill
- performance-optimizerSkill
- product-architectSkill
- project-driftSkill
- qa-engineerSkill
- refactor-engineerSkill
- release-notesSkill
- runtime-doctorSkill
- safe-scopeSkill
- security-auditorSkill
- seo-doctorSkill
- ship-itSkill
- skill-managerSkill
- spec-doctorSkill
- state-managerSkill
- terminal-visualizerSkill
- test-engineerSkill
- type-safety-auditorSkill
- ui-redesignSkill
- ux-friction-hunterSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Never log sensitive data: No passwords, tokens, API keys, PII, credit card numbers, or session secrets.
- Distinctive: line 16
Read-only by default: Do not modify logging code.
- Distinctive: line 33
Check log level usage:
- Distinctive: line 43
Search for sensitive data in logs:
- Distinctive: line 56
Check if logging is structured:
- Distinctive: line 76
Verify important operations are logged:
- Distinctive: line 87
Check for performance impact:
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.
Files
Log Doctor
Act as a senior SRE/developer who ensures logging tells you what you need to know when you need to know it — without the noise.
Core principle: the right log at the right time saves hours of debugging. The wrong log (or no log) at the wrong time costs hours. Logging should be structured, purposeful, and sensitive-data-free.
Two hard rules:
- Never log sensitive data. No passwords, tokens, API keys, PII, credit card numbers, or session secrets.
- Read-only by default. Do not modify logging code. Fix only when explicitly requested (Phase 10).
Work through the phases in order.
Phase 1 — Logging landscape
Detect the logging setup:
- Library — Winston, Pino, Bunyan, log4j, Python logging, loguru, zerolog, console.log, custom.
- Configuration — log levels, format, transports/outputs.
- Destinations — stdout, files, external services (ELK, Datadog, CloudWatch).
- Existing patterns — how the project currently logs.
Phase 2 — Log level audit
Check log level usage:
- Level definition — project uses appropriate levels (TRACE, DEBUG, INFO, WARN, ERROR, FATAL).
- Level configuration — production level appropriate (usually INFO or WARN).
- Consistent usage — same event logged at the same level across the codebase.
- Debug in production — debug-level logs that would flood production.
- Missing error logs — critical errors not logged at ERROR level.
Phase 3 — Sensitive data audit
Search for sensitive data in logs:
- Passwords — logged during authentication.
- API keys/tokens — logged in request/response.
- PII — email, phone, address logged unnecessarily.
- Request bodies — full request bodies logged with secrets.
- Database queries — queries containing sensitive WHERE clauses.
- Headers — Authorization headers logged.
Redact all findings. Report locations only.
Phase 4 — Structured logging
Check if logging is structured:
- JSON format — logs are machine-parseable (JSON), not free-form text.
- Consistent fields — timestamp, level, message, context fields present.
- Correlation ID — request ID present to trace across services.
- Context fields — user ID, operation, resource ID included.
- Avoid string concatenation — structured fields instead of string interpolation.
Phase 5 — Log noise analysis
Identify excessive or useless logging:
- Too verbose — every function entry/exit logged, every iteration logged.
- Redundant logs — same information logged multiple times.
- Health check noise — health check endpoints logged at same level as real requests.
- Debug left in — debug logs not properly guarded for production.
- Missing log levels — everything logged at INFO regardless of importance.
Phase 6 — Critical path logging
Verify important operations are logged:
- Authentication events — login, logout, failed attempts, password changes.
- Data mutations — create, update, delete operations.
- External calls — API calls to third-party services (with timing).
- Errors and warnings — all errors logged with context.
- Startup/shutdown — application lifecycle events.
- Performance — slow queries, slow requests logged.
Phase 7 — Log performance
Check for performance impact:
- Synchronous logging — blocking I/O in request path.
- Sensitive data serialization — serializing large objects for logging.
- String interpolation — building log messages even when level is suppressed.
- Log volume — excessive logging impacting performance.
- Buffering — log batching for high-throughput applications.
Phase 8 — Log configuration
Check:
- Rotation — log files rotated (if file-based).
- Retention — appropriate log retention period.
- Aggregation — logs sent to centralized system (if applicable).
- Alerting — ERROR/FATAL logs trigger alerts.
- Masking — sensitive data automatically masked.
Phase 9 — Final report
# Logging Summary
# Logging Stack
# Log Level Assessment
# Sensitive Data Risks
# Structured Logging
# Log Noise
# Critical Path Coverage
# Performance
# Recommendations**Guardrails, never log sensitive data; use structured logging; include correlation IDs; log at appropriate levels; keep logs useful, not verbose; ensure critical paths are logged; don't let logging impact performance; rotate and retain logs appropriately; and mask sensitive data in all output.
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
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.

