observability-by-default
Skill6 starsChanged 8 months agoMITView on GitHub
Structured logging, request tracing, health checks, error tracking, and key metrics. Every service should be observable from day one.
- Installs packages
In this repository64 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- api-backward-compatibilitySkill
- api-design-standardsSkill
- api-versioningSkill
- database-designSkill
- distributed-systemsSkill
- performance-budgetsSkill
- resilience-patternsSkill
- twelve-factor-appSkill
- codex-cross-reviewSkill
- dispatching-parallel-agentsSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- architecture-awarenessSkill
- intent-to-specSkill
- project-diagnosisSkill
- using-shipworthySkill
- systematic-debuggingSkill
- documentation-as-codeSkill
- accessibilitySkill
- frontend-standardsSkill
- retrospectiveSkill
- writing-skillsSkill
- ci-cd-awarenessSkill
- context-managerSkill
- environment-setupSkill
- feature-flag-disciplineSkill
- finishing-a-development-branchSkill
- guardrail-audit-logSkill
- incident-responseSkill
- mcp-integrationSkill
- migration-strategiesSkill
- production-readinessSkill
- scope-creep-detectionSkill
- session-memorySkill
- slo-sli-definitionSkill
- tech-debt-trackingSkill
- using-git-worktreesSkill
- zero-downtime-migrationsSkill
- brainstormingSkill
- decision-frameworksSkill
- design-documentsSkill
- executing-plansSkill
- writing-plansSkill
- code-complexitySkill
- confidence-based-strictnessSkill
- error-handling-patternsSkill
- feedback-driven-adaptationSkill
- quality-gatesSkill
- response-schema-validationSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- adaptive-securitySkill
- bias-detectionSkill
- compliance-awarenessSkill
- container-securitySkill
- dependency-managementSkill
- pii-detectionSkill
- secrets-managementSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
If you can't see it, you can't fix it.
- Distinctive: line 16
Before writing any code that logs anything, install a structured logger:
- Very specific: line 18
Python: use stdlib logging with JSON formatter, or structlog
- Very specific: line 19
Go: use slog (stdlib) or zerolog
- Distinctive: line 55
Every service MUST expose:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Observability by Default
Principle
If you can't see it, you can't fix it. Every service should be observable from the first commit, not bolted on after the first outage.
Structured Logging
First Step: Install a Logger
Before writing any code that logs anything, install a structured logger:
- Node.js:
npm install pino(orpino-httpfor Express/Fastify) - Python: use stdlib
loggingwith JSON formatter, orstructlog - Go: use
slog(stdlib) orzerolog
NEVER use console.log for any purpose — not even "Server running on port 3000." Replace every console.log with logger.info(). This is non-negotiable because console.log is unstructured, has no levels, and cannot be collected by log aggregation tools.
// WRONG — even for startup
console.log(`Server running on port ${PORT}`);
// RIGHT
import pino from 'pino';
const logger = pino();
logger.info({ port: PORT }, 'Server started');Rules
- JSON format — not free-text strings
- Correlation IDs — every request gets a unique ID, propagated through all log entries
- Log levels used correctly:
error: something failed that shouldn't have (action needed)warn: something unexpected but handled (investigate if frequent)info: significant business events (user created, order placed)debug: detailed diagnostic info (disabled in production)
- Never log: passwords, tokens, PII, credit card numbers, full request bodies with sensitive fields
Pattern
logger.info('User created', {
correlationId: req.id,
userId: user.id,
email: user.email, // only if non-sensitive
duration: Date.now() - start
});Health Check Endpoints
Every service MUST expose:
GET /health— returns 200 if service is runningGET /health/ready— returns 200 if service can handle traffic (DB connected, dependencies available)
Key Metrics (The Four Golden Signals)
- Latency — how long requests take (p50, p95, p99)
- Traffic — requests per second
- Errors — error rate (5xx responses / total responses)
- Saturation — how full your resources are (CPU, memory, connections)
Error Tracking
- Capture unhandled exceptions with context (request, user, stack trace)
- Group errors by type to identify patterns
- Alert on new error types and error rate spikes
Request Tracing
- Assign a unique ID to every inbound request
- Pass it through all internal service calls
- Include it in all log entries and error reports
- Return it in response headers for client-side debugging:
X-Request-Id
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.

