P

Pro Production Workspace

Boost productivity using this autonomously, deep, scan, entire. Includes structured workflows, validation checks, and reusable patterns for development.

SkillClipticsdevelopmentv1.0.0MIT
0 views0 copies

Production Workspace Skill

A Claude Code skill for preparing and maintaining production-ready development workspaces — covering environment parity, configuration management, monitoring setup, and production readiness checklists.

When to Use This Skill

Choose this skill when:

  • Preparing an application for production deployment
  • Setting up staging environments that mirror production
  • Creating production readiness checklists
  • Configuring logging, monitoring, and alerting for production
  • Implementing health checks and graceful shutdown
  • Reviewing security and performance for production launch

Consider alternatives when:

  • You need deployment automation (use a deployment skill)
  • You need infrastructure provisioning (use a Terraform/IaC skill)
  • You need CI/CD pipeline setup (use a GitHub Actions skill)

Quick Start

# Add to your Claude Code project claude mcp add production-workspace # Run production readiness check claude "check if this project is production-ready" # Set up production configuration claude "configure this app for production deployment"
// Production-ready server configuration const server = app.listen(PORT, () => { logger.info({ port: PORT, env: NODE_ENV }, 'Server started'); }); // Graceful shutdown const shutdown = async (signal: string) => { logger.info({ signal }, 'Shutdown signal received'); server.close(async () => { await db.disconnect(); await cache.quit(); logger.info('Server shut down gracefully'); process.exit(0); }); setTimeout(() => { process.exit(1); }, 10000); }; process.on('SIGTERM', () => shutdown('SIGTERM')); process.on('SIGINT', () => shutdown('SIGINT'));

Core Concepts

Production Readiness Checklist

CategoryCheckStatus
SecurityHTTPS enforced, CORS configured, secrets in env varsRequired
Error HandlingGlobal error handler, structured logging, error trackingRequired
PerformanceResponse compression, caching headers, connection poolingRequired
MonitoringHealth check endpoint, metrics, alertingRequired
ReliabilityGraceful shutdown, retry logic, circuit breakersRequired
DataBackups configured, migration strategy, seed data removedRequired
DevOpsCI/CD pipeline, rollback procedure, runbooksRecommended
DocumentationAPI docs, deployment guide, architecture diagramRecommended

Health Check Endpoint

app.get('/health', async (req, res) => { const checks = { status: 'healthy', uptime: process.uptime(), timestamp: new Date().toISOString(), checks: { database: await checkDb(), cache: await checkRedis(), memory: { used: process.memoryUsage().heapUsed, total: process.memoryUsage().heapTotal, }, }, }; const isHealthy = checks.checks.database.ok && checks.checks.cache.ok; res.status(isHealthy ? 200 : 503).json(checks); });

Configuration

ParameterTypeDefaultDescription
NODE_ENVstring"production"Environment identifier
LOG_LEVELstring"info"Logging level in production
CORS_ORIGINstringAllowed CORS origins
RATE_LIMITnumber100Requests per minute per IP
HEALTH_CHECK_PATHstring"/health"Health check endpoint path
SHUTDOWN_TIMEOUTnumber10000Graceful shutdown timeout (ms)
COMPRESSIONbooleantrueEnable response compression

Best Practices

  1. Never use console.log in production — use a structured logger (pino, winston) that outputs JSON, includes timestamps, and supports log levels for filtering.

  2. Implement health checks with dependency verification — the /health endpoint should check database, cache, and external service connectivity, not just return 200.

  3. Set NODE_ENV=production — this enables Express optimizations, disables verbose error messages, and triggers production behavior in many libraries.

  4. Remove all test and seed data before launch — verify the database contains only production data and remove any test accounts, sample content, or development fixtures.

  5. Document the rollback procedure — before deploying to production, ensure there's a tested, documented process for reverting to the previous version within minutes.

Common Issues

Application crashes silently in production — Missing global error handler or unhandled promise rejection. Add process.on('uncaughtException') and process.on('unhandledRejection') with logging.

Memory usage grows over time — Memory leak from event listeners, growing caches, or unreleased database connections. Monitor process.memoryUsage() and set up alerts when heap usage exceeds 80%.

Environment variables missing in production — Validate all required env vars at startup with a library like envalid. Fail fast with a clear error listing missing variables.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates