Skip to main content
skill CX Codex

health-check-endpoints — Claude Code skill: liveness and readiness

A coding-agent skill for wiring up liveness, readiness and startup probes, plus dependency checks against your database and Redis.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add secondsky/claude-skills --skill health-check-endpoints -a claude-code
Open on GitHub

What health-check-endpoints does

The skill walks through four probe types. Liveness asks whether the process is alive, readiness asks whether it can take traffic, startup covers the boot window, and a deep check looks at every dependency at once. The Express example ships a HealthChecker class with checkDatabase and checkRedis methods, plus /health/live and /health/ready routes. Healthy responses return 200, broken ones 503.

For Kubernetes there is a manifest snippet with livenessProbe and readinessProbe: paths, port, initialDelaySeconds, periodSeconds, failureThreshold. A separate references/implementations.md file adds Python Flask and Java Spring Boot Actuator versions along with a full deployment config. If your liveness probe touches the database, that is worth a second look: when the database goes down the container restarts in a loop even though the process itself is fine.

The rules are short. Keep liveness free of external dependencies, check only critical systems in readiness, and set timeouts so one failing dependency does not drag the rest down. Response-time metrics belong in the payload too.

What it helps with

  • write a liveness probe that does not restart the container on a database outage
  • split liveness and readiness into separate endpoints
  • add Redis and database checks to the readiness route
  • stop cascading restarts caused by overly strict probes
  • pick initialDelaySeconds and failureThreshold values for Kubernetes

Example prompts for the agent

  • add /health/live and /health/ready endpoints to my Express app with database and Redis checks
  • set up livenessProbe and readinessProbe in the Kubernetes manifest for this service
  • why does my pod keep restarting — review my health check endpoints

How to install health-check-endpoints

1Skills CLI (Vercel)

npx skills add secondsky/claude-skills --skill health-check-endpoints -a claude-code

2Manually: put the files in place

~/.claude/skills/health-check-endpoints/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/health-check-endpoints/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about health-check-endpoints

How do I install health-check-endpoints in Claude?

Run npx skills add secondsky/claude-skills --skill health-check-endpoints -a claude-code. The skill then lands at ~/.claude/skills/health-check-endpoints/SKILL.md.

What does health-check-endpoints do?

It helps you define liveness, readiness, startup and deep probes along with dependency checks. The skill includes an Express example and a Kubernetes config.

What is the difference between liveness and readiness?

Liveness reports whether the process is alive, and a failure restarts the container. Readiness reports whether the service can take traffic, and a failure pulls it from the load balancer.

Source text

SKILL.md · MIT
---
name: health-check-endpoints
description: Health check endpoints for liveness, readiness, dependency monitoring. Use for Kubernetes, load balancers, auto-scaling, or encountering probe failures, startup delays, dependency checks, timeout configuration errors.
license: MIT
---

# Health Check Endpoints

Implement health checks for monitoring service availability and readiness.

## Probe Types

| Probe | Purpose | Failure Action |
|-------|---------|----------------|
| Liveness | Is process alive? | Restart container |
| Readiness | Can handle traffic? | Remove from LB |
| Startup | Has app started? | Delay other probes |
| Deep | All deps healthy? | Trigger alerts |

## Implementation (Express)

```javascript
class HealthChecker {
  async checkDatabase() {
    const start = Date.now();
    try {
      await db.query('SELECT 1');
      return { status: 'healthy', latency: Date.now() - start };
    } catch (err) {
      return { status: 'unhealthy', error: String(err?.message || err) };
    }
  }

  async checkRedis() {
    try {
      await redis.ping();
      return { status: 'healthy' };
    } catch (err) {
      return { status: 'unhealthy', error: err.message };
    }
  }

  async getReadiness() {
    const checks = await Promise.all([
      this.checkDatabase(),
      this.checkRedis()
    ]);
    const healthy = checks.every(c => c.status === 'healthy');
    return { healthy, checks };
  }
}

// Liveness - lightweight
app.get('/health/live', (req, res) => {
  res.json({ status: 'ok', timestamp: new Date().toISOString() });
});

// Readiness - check dependencies
app.get('/health/ready', async (req, res) => {
  const health = await healthChecker.getReadiness();
  res.status(health.healthy ? 200 : 503).json(health);
});
```

## Kubernetes Configuration

```yaml
livenessProbe:
  httpGet:
    path: /health/live
    port: 3000
  initialDelaySeconds: 15
  periodSeconds: 10
  failureThreshold: 3

readinessProbe:
  httpGet:
    path: /health/ready
    port: 3000
  initialDelaySeconds: 5
  periodSeconds: 10
```

## Best Practices

- Keep liveness checks minimal (no external deps)
- Check only critical systems in readiness
- Return 200 for healthy, 503 for unhealthy
- Set reasonable timeouts to prevent cascading failures
- Include response time metrics

## Additional Implementations

See [references/implementations.md](references/implementations.md) for:
- Python Flask complete health checker
- Java Spring Boot Actuator
- Full Kubernetes deployment config

## Never Do

- Make liveness depend on external services
- Return 200 when dependencies are down
- Skip dependency checks in readiness

© secondsky · MIT · secondsky/claude-skills

Similar skills

Everything for DevOps and infrastructure →

From the same set89

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor