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
TypeScript refactoring and modernization guidelines from a principal specialist perspective. This skill should be used when refactoring, reviewing, or modernizing TypeScript code to ensure type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving TypeScript type architecture, narrowing, generics, error handling, or migration to modern TypeScript features.
tools
Resolves TypeScript and JavaScript problems across type-level programming, performance, monorepo management, migration, and modern tooling. Invoke when diagnosing "type instantiation excessively deep" errors, migrating JS to TS, configuring strict tsconfig, debugging module resolution, or choosing between Biome/ESLint/Turborepo/Nx.
tools
Turborepo monorepo build system guidance. Triggers on: `turbo.json`, task pipelines, `dependsOn`, caching, remote cache, the `turbo` CLI, `--filter`, `--affected`, CI optimization, environment variables, internal packages, monorepo structure, and package boundaries. Use when the user configures tasks or workflows, creates packages, sets up a monorepo, shares code between apps, runs changed packages, debugs cache behavior, or works in an `apps/` plus `packages/` workspace.
tools
Provides Tailwind CSS v4 performance optimization and best practices guidelines. Triggers when writing, reviewing, or refactoring Tailwind CSS v4 code; when working with Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.