skills/monitoring-setup/SKILL.md
Sets up production monitoring for NestJS and Next.js apps — Sentry error tracking, Google Analytics, and operational signals (BullMQ queue depth, Postgres slow queries, connection saturation) with alerts on each. Activates when users need error tracking, production monitoring, analytics, queue/database observability, or alerting on operational health.
npx skillsauth add shipshitdev/library monitoring-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Two layers: application health (errors, user behavior) and operational health (are the queues draining, is the database keeping up). An app with clean Sentry but a queue backing up or a table scan on every request is still failing its users — cover both.
bun add @sentry/node @sentry/profiling-nodemain.ts before app creationSENTRY_DSN environment variablebun add @sentry/nextjsbunx @sentry/wizard@latest -i nextjsNEXT_PUBLIC_SENTRY_DSN for client-sideNEXT_PUBLIC_GA_MEASUREMENT_ID (format: G-XXXXXXXXXX)Application errors tell you what threw; operational signals tell you what is quietly degrading. Instrument the three that take a product down under load.
A queue that fills faster than it drains is an outage in slow motion — no error fires until jobs time out.
Queue.getJobCounts() exposes these; scrape them on an interval or via
bullmq-prometheus.pg_stat_statements; surface the top queries by total time and by mean time.
A query that is individually fast but runs 10k×/min is the real cost.log_min_duration_statement) and alert on new
entrants — a slow query usually means a missing index or an N+1.active / max_connections). Near the ceiling on
serverless means the pooler is undersized — see postgres-ops.maxmemory, eviction rate, and command latency. Evictions mean the
cache is too small and hit-rate is silently dropping.Instrumentation no one looks at is not monitoring. For each signal above, define a threshold and route it somewhere a human sees at 3am (PagerDuty, Opsgenie, a Slack channel that pages). Alert on the leading indicator (queue waiting climbing, connections near max) not just the lagging one (jobs already timing out, 500s already served). Every alert names the runbook step to take, or it is just noise.
This skill integrates with /monitoring-setup command for automated setup workflows.
Pairs with postgres-ops (pooling, DR) and nestjs-queue-architect (queue design).
development
Coordinates a weekly engineering review of board accuracy, recent code changes, operational health, and scoped cleanup. Use for a recurring repository health review or a review of the last several days.
testing
Audits project board configuration and prepares explicitly requested setup, copy, or normalization changes while preserving the existing workflow and provider boundaries. Use when inspecting a board's fields, columns, scope, or configuration.
testing
Reconciles a project board with current work and delivery evidence, reports incomplete coverage and metadata gaps, and applies only approved provider-supported field changes. Use when auditing board drift, reviewing blocked work, or assessing upcoming delivery.
development
Walk through how a subsystem works. Use for "how does X work", code walkthroughs before changing something, and placement or ownership questions. Explains architecture, runtime flow, and onboarding mental models. Can critique architecture. Use why for motivation.