@agent-scaffolder:health-checkfrom scaffolder
This document provides essential context about the health check system for AI agents working on this codebase.
Ships in scaffolder. Installing the plugin adds it to Claude Code.
This document provides essential context about the health check system for AI agents working on this codebase.
The health check system provides enterprise-grade monitoring endpoints that validate environment variable configuration and system operational state. All checks are executed atomically (in parallel, independently) with no shared state or side effects, ensuring accurate and fast health status reporting.
src/app/routes/health.ts: Main health check router
/api/health, /api/health/live, /api/health/readyPromise.all()/api/health in the main router (src/app/routes/index.ts)Each environment variable has its own atomic check function:
checkViteAuth0Domain(): Validates VITE_AUTH0_DOMAIN (critical)checkViteAuth0ClientId(): Validates VITE_AUTH0_CLIENT_ID (critical)checkViteAuth0Audience(): Validates VITE_AUTH0_AUDIENCE (critical)checkEncryptionKey(): Validates ENCRYPTION_KEY with hex format validation (warning)checkAuth0ManagementApiClientId(): Validates AUTH0_MANAGEMENT_API_CLIENT_ID (warning)checkAuth0ManagementApiClientSecret(): Validates AUTH0_MANAGEMENT_API_CLIENT_SECRET (warning)checkLiveness(): Process liveness check (critical)checkEnvironmentVariable(varName, options): Generic function that:
process.env[varName]ENCRYPTION_KEY)IHealthCheck object with name, status, duration, severity, and messageinterface IHealthCheck {
name: string; // Lowercase variable name (e.g., "vite_auth0_domain")
status: 'pass' | 'fail';
duration: number; // Milliseconds
severity?: 'critical' | 'warning' | 'info';
message?: string; // Human-readable description
}
interface IHealthResponse {
status: 'healthy' | 'degraded' | 'unhealthy';
timestamp: string; // ISO 8601 format
version?: string;
checks: IHealthCheck[];
}
The overall status is determined by:
HTTP status codes:
200: Healthy or degraded (can still serve requests)503: Unhealthy (should not receive traffic)/api/healthFull health check with all individual environment variable checks.
Execution Flow:
Promise.all()checks arrayPerformance: < 5ms total (all checks in parallel)
/api/health/liveLiveness probe for orchestration systems (Kubernetes, Docker).
Returns: Simple JSON indicating process is alive Always: HTTP 200 (if endpoint is reachable, process is alive)
/api/health/readyReadiness probe for load balancers.
Checks: Only critical variables (VITE_AUTH0_DOMAIN, VITE_AUTH0_CLIENT_ID, VITE_AUTH0_AUDIENCE)
Returns: Status and individual variable configuration state
HTTP Codes: 200 (ready) or 503 (not ready)
All variables check for:
undefined value'')trim())ENCRYPTION_KEY includes additional validation:
/^[0-9a-fA-F]{64}$/)All checks follow atomic operation principles:
process.env, no side effectsHealth check router is registered in src/app/routes/index.ts:
router.route('/health', healthRouter);
The system checks these environment variables:
Critical (Required for core functionality):
VITE_AUTH0_DOMAINVITE_AUTH0_CLIENT_IDVITE_AUTH0_AUDIENCEWarning (Optional features):
ENCRYPTION_KEY (with format validation)AUTH0_MANAGEMENT_API_CLIENT_IDAUTH0_MANAGEMENT_API_CLIENT_SECRETsrc/app/services/auth0Service.ts: Contains isAuth0ManagementApiConfigured() and getAuth0ManagementApiConfigStatus() functionssrc/utils/serverEncryption.ts: Contains isEncryptionAvailable() functionIf the health check endpoint itself fails (e.g., exception during execution):
process.env read)Example liveness/readiness probe configuration:
livenessProbe:
httpGet:
path: /api/health/live
port: 5000
periodSeconds: 10
readinessProbe:
httpGet:
path: /api/health/ready
port: 5000
periodSeconds: 5
Example healthcheck configuration:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health/live"]
interval: 10s
src/app/routes/health.ts: Main health check implementationsrc/app/routes/index.ts: Router registrationsrc/app/services/auth0Service.ts: Auth0 configuration status helperssrc/utils/serverEncryption.ts: Encryption key validationENCRYPTION_KEY (64-character hex format)What the agent file sets; muted values are Claude Code's defaults
7-day visitors to each agent page
Other plugins' agents for the same job
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: agents: Invalid string: must end with ".md"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
16 agents in this plugin
agent-templateAgent Name[System prompt content - describe what this agent does and how it should behave]ai-chat-schema-builderAgent AI Chat Schema Builder - Context GuideThis document provides essential context about the AI chat-based schema builder system for AI agents working on this codebase.database-introspectorAgent Database Introspector - Context GuideThis document provides essential context about the database introspection system for AI agents working on this codebase.design-systemDesign System Maintenance AgentYou are a design system specialist responsible for maintaining the enterprise-grade design system architecture in this project.docker-environmentAgent Docker Environment - Context GuideThis document provides essential context about the Docker development environment setup for AI agents working on this codebase.error-handlingAgent Error Handling and Server Configuration - Context GuideThis document provides essential context about the error handling system and server configuration management for AI agents working on this codebase.