observability-baseline — Claude Code skill
Bakes error capture in Sentry, request-id structured logs and /healthz plus /readyz endpoints into a freshly generated service. Useful when the app is still being scaffolded and you don't want the first prod failure to go unseen.
npx skills add avelikiy/great_cto --skill observability-baseline -a claude-codeWhat observability-baseline does
The skill runs while an app is being generated. It puts three pieces in place: Sentry initialization with the DSN read from SENTRY_DSN rather than written into code, a logger that emits JSON carrying a request_id per request, and two endpoints — GET /healthz for liveness and GET /readyz for readiness, which checks that dependencies such as the database and cache answer. Diagnostics go to stderr so they stay out of user-facing output.
Wiring is the part that matters. app-scaffolder drops instrumentation.ts, the logger and the endpoints into the generated app and adds SENTRY_DSN to .env.example. infra-provisioner sets the variable in the prod environment and points the platform health probe at /readyz. l3-support reads Sentry and the request-id logs during triage, and devops fails the deploy gate when /readyz doesn't return 200 after a release.
Skip it for a plain library, a CLI with no running service, or a static site with no backend — there is nothing to probe or log. The Sentry project and endpoints get recorded in docs/infra/PROVISION-{slug}.md. Done means the three pieces are wired into the prod environment, not merely present in the code.
What it helps with
- catch the first production error instead of hearing about it from users
- tie every log line from one request together by request_id
- give the load balancer an endpoint to check liveness against
- verify the database and cache are reachable before taking traffic
- fail a deploy when the service stops answering after release
Example prompts for the agent
- Scaffold a new service and bake in Sentry, JSON logs with request_id, and /healthz and /readyz endpoints
- Set SENTRY_DSN in the prod environment and point the platform health probe at /readyz
- Check that /readyz returns 200 after deploy, otherwise stop the rollout
How to install observability-baseline
1Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill observability-baseline -a claude-code2Manually: put the files in place
~/.claude/skills/observability-baseline/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/observability-baseline/
1Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill observability-baseline -a codex2Manually: put the files in place
.agents/skills/observability-baseline/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill observability-baseline -a cursor2Manually: put the files in place
.cursor/skills/observability-baseline/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install avelikiy/great_cto observability-baseline2Manually: put the files in place
.github/skills/observability-baseline/SKILL.md1Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill observability-baseline -a gemini-cli2Platform CLI
gemini skills install https://github.com/avelikiy/great_cto --path skills/observability-baselineManually: put the files in place
.devin/skills/observability-baseline/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add avelikiy/great_cto --skill observability-baseline -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about observability-baseline
How do I install observability-baseline in Claude Code?
Run npx skills add avelikiy/great_cto --skill observability-baseline -a claude-code. The skill file lands at ~/.claude/skills/observability-baseline/SKILL.md.
What does observability-baseline do?
At scaffold time it adds Sentry error capture, structured logs with a request_id, and /healthz and /readyz endpoints. Without it the first prod incident stays invisible.
Which projects should not use this skill?
A plain library, a CLI with no running service, or a static site with no backend. There is no live service to probe or log.
Source text
SKILL.md · MIT
---
name: observability-baseline
description: Scaffold-time observability so a shipped product is not blind in prod from day one — error capture (Sentry), request-id structured logging, and /healthz + /readyz endpoints. stack-baseline pins Sentry but nothing wires it; this is the wiring. Loaded by app-scaffolder (bake into the scaffold), infra-provisioner (prod env + probes), and consumed by l3-support (traces) and devops (deploy gate).
when_to_use: |
Apply when:
- app-scaffolder is generating a new product (any archetype that runs as a service)
- infra-provisioner is setting prod env vars + health probes
- l3-support needs traces/logs to triage an incident
Do NOT apply to:
- pure library / cli archetypes with no running service
- static marketing sites with no backend
effort: medium
allowed-tools: Read, Write, Edit, Grep, Glob
paths:
- "src/**"
- "app/**"
- "docs/infra/**"
---
# observability-baseline
stack-baseline names Sentry and wires it nowhere — so every shipped product's first
prod incident is invisible, and l3-support triages blind. This skill makes three
things exist at scaffold time. Defaults baked in; no founder question.
## 1. Error capture (Sentry)
- `instrumentation.ts` (Next.js) / SDK init at process start; DSN from `SENTRY_DSN`
env (never hardcoded).
- CI uploads source maps on release so stack traces are readable (release = git sha).
- Capture unhandled rejections + a global error boundary on the client.
## 2. Request-id structured logging
- A logger that emits **JSON** (not `console.log` prose) with a per-request
`request_id` (generate at the edge, propagate via header/async-local-storage).
- Levels: error / warn / info / debug — diagnostics go to **stderr**, never mixed
into user-facing stdout. (Same discipline as the CLI logging gap, DEEPEN d94.)
- One log line per request with: request_id, method, path, status, latency_ms.
## 3. Health endpoints
- `GET /healthz` — liveness (process up). `GET /readyz` — readiness (deps reachable:
db, cache). Cheap, unauthenticated, no PII.
- These are what infra-provisioner probes and what a load balancer checks.
## Wiring (a skill is shelfware unless a consumer loads it)
| Consumer | What it does with this skill |
|----------|------------------------------|
| **app-scaffolder** | bakes `instrumentation.ts` + the JSON logger + `/healthz`+`/readyz` into the generated app; adds `SENTRY_DSN` to `.env.example` |
| **infra-provisioner** | sets `SENTRY_DSN` in the prod env list; points the platform health probe at `/readyz`; records the Sentry project in PROVISION |
| **l3-support** | first triage step reads Sentry + the request-id logs (a trace now exists to read) |
| **devops** | deploy gate fails if `/readyz` doesn't return 200 post-deploy |
## Output
A scaffolded app where the first prod error is captured, every request is traceable
by id, and the platform can health-check it. Record the Sentry project + endpoints
in `docs/infra/PROVISION-{slug}.md`. Done = the three pieces exist AND are wired
into the prod env, not just present in code.
© avelikiy · MIT · avelikiy/great_cto