/godmode:loggingfrom godmode
Implements structured JSON logging with log levels, correlation IDs, PII redaction, and aggregation pipeline setup for ELK/Loki/CloudWatch.
Ships in godmode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
/godmode:logging# Detect current logging state
grep -rn "console\.log\|console\.error" src/ \
--include="*.ts" 2>/dev/null | wc -l
grep -rn "log\.Println\|fmt\.Println" . \
--include="*.go" 2>/dev/null | wc -l
grep -rn "print(\|logging\." . \
--include="*.py" 2>/dev/null | wc -l
# Check for structured loggers
grep -r "pino\|winston\|structlog\|zerolog\|slog" \
package.json go.mod pyproject.toml 2>/dev/null
LOGGING ASSESSMENT:
| Aspect | Status |
|-------------|---------------------------|
| Format | Unstructured / JSON |
| Levels | info/error only / full |
| Context | requestId, userId present?|
| Correlation | traceId propagated? |
| PII | Redacted / exposed |
| Aggregation | stdout / ELK / Loki |
| Retention | Configured / none |
IF unstructured: migrate to JSON logger
IF no correlation IDs: add middleware
IF PII in logs: add redaction layer
IF no retention policy: configure rotation
| Level | When to Use |
|-------|------------------------------|
| FATAL | Process cannot continue |
| ERROR | Operation failed, process OK |
| WARN | Degraded but functional |
| INFO | Business events, milestones |
| DEBUG | Diagnostic detail |
THRESHOLDS:
Production default: INFO
DEBUG in prod: only when explicitly enabled
IF 404/validation fail logged as ERROR: fix to WARN
IF > 100 ERROR/min sustained: investigate
IF DEBUG enabled in prod > 1 hour: auto-disable
STRUCTURED LOG FORMAT (JSON):
{
"timestamp": "ISO 8601 with timezone",
"level": "info",
"service": "<name>",
"environment": "<env>",
"version": "<semver>",
"requestId": "<uuid>",
"traceId": "<uuid>",
"message": "<event description>",
"data": { <structured fields> }
}
LIBRARIES:
Node.js: pino (async, fast, JSON native)
Go: slog (stdlib) or zerolog (zero-alloc)
Python: structlog (processor pipeline)
RULES:
Always structured fields, never string interpolation
Always ISO 8601 timestamps with timezone
Always include service, environment, version
IF log line > 10KB: truncate request/response
IDs:
requestId — unique per HTTP request (edge-generated)
traceId — spans entire distributed transaction
spanId — unique per operation within a trace
PROPAGATION:
Incoming: read X-Request-Id, X-Trace-Id headers
IF missing: generate UUIDv4
Outgoing: forward in headers to downstream
Logging: include in every log line via context
OPENTELEMETRY:
Auto-instrument with @opentelemetry/sdk-node
Export traces to Jaeger/Zipkin/OTLP collector
Correlate logs with traces via traceId
PII REDACTION POLICY:
| Data Type | Action | Technique |
|---------------|-----------|--------------------|
| Email | MASK | j***@example.com |
| Phone | MASK | +1-***-***-5678 |
| Credit card | REDACT | [REDACTED] |
| CVV/password | NEVER LOG | — |
| SSN | REDACT | [REDACTED] |
| IP address | ANONYMIZE | 192.168.1.0/24 |
THRESHOLDS:
IF any NEVER LOG field found in logs: P0 fix
IF PII regex match rate > 0 in prod: alert
Redaction must happen at logger level,
not at call site (prevents human error)
PIPELINES:
ELK: App → stdout → Filebeat → Logstash → ES → Kibana
Loki: App → stdout → Promtail → Loki → Grafana
CloudWatch: App → stdout → CW Agent → Insights
IF high volume (> 10K events/s): use Loki (cheaper)
IF need full-text search: use ELK
IF AWS-native: use CloudWatch
RETENTION POLICY:
| Env | Level | Retention | Tier |
|------------|-------|-----------|---------------|
| Production | ERROR | 365 days | Hot→Warm→Cold |
| Production | WARN | 90 days | Hot→Warm |
| Production | INFO | 30 days | Hot |
| Production | DEBUG | 7 days | On-demand only|
| Staging | All | 14 days | Hot |
| Dev | All | 3 days | Hot |
| Compliance | Audit | 7 years | Hot→Archive |
PERFORMANCE:
Use async loggers (pino, slog, structlog)
Buffer and flush periodically
Sample DEBUG logs (1 in 100) at high volume
Max message size: 10KB
IF synchronous logging in hot path: refactor
| Check | Pass? |
|------------------------------------|-------|
| All logs structured JSON in prod | |
| ISO 8601 timestamps with timezone | |
| Consistent field names across svcs | |
| Log level strategy documented | |
| No ERROR for expected conditions | |
| DEBUG disabled in prod by default | |
| Correlation IDs on every line | |
| PII redacted at logger level | |
| Retention policy configured | |
| Async logging in hot paths | |
Commit: "logging: <service> — structured JSON with correlation IDs and PII redaction"
Never ask to continue. Loop autonomously until done.
1. Unstructured: console.log, log.Println, print()
2. Structured: pino/winston, slog/zerolog, structlog
3. Libraries: package.json, go.mod, pyproject.toml
Print: Logging: {N} services. Format: JSON. Correlation: {status}. PII: {status}. Retention: {policy}. Verdict: {verdict}.
iteration task services_configured format correlation_ids pii_redacted retention_days status
KEEP if: valid JSON AND required fields present
AND PII redacted AND no performance regression
DISCARD if: malformed output OR missing fields
OR PII leaked OR blocks event loop
STOP when ANY of:
- All services produce structured JSON with IDs
- PII redaction verified with test data
- Log aggregation pipeline receiving logs
- User requests stop
What SKILL.md sets; muted values are Claude Code's defaults
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
135 skills in this plugin
/a11yAccessibility. WCAG 2.1 AA/AAA, a11y audit, color contrast, keyboard navigation, screen reader, Axe, Pa11y, Lighthouse./agentAI agent development. ReAct/plan-and-execute/multi-agent architectures, tool design, memory systems, guardrails, orchestration (LangChain, LlamaIndex, CrewAI, AutoGen)./analyticsProduct analytics implementation — event tracking, funnel analysis, A/B testing, Segment/Amplitude/Mixpanel/PostHog, privacy-compliant instrumentation./angularAngular architecture. NgRx, Signals, RxJS, standalone components, lazy loading, dependency injection, Jasmine, Jest.Other plugins' skills for the same job