Service health check

From vladkesler/initrunner · View interactive version

Service health check is an AI agent skill from the GitHub repository vladkesler/initrunner. Health endpoint verification and dependency status checks. Probes standard health paths, validates dependency connectivity, and reports overall service readiness.

How to use this skill

Skill file

Service health check skill using curl and standard system tools.

When to activate

Use this skill when tests fail and the underlying service might be down,

when running pre-test health validation to confirm infrastructure is ready,

when a deployment just completed and needs smoke-test verification, or when

intermittent failures suggest an unstable dependency.

Health endpoints

Probe these common health paths in order until one responds:

  1. /health
  2. /healthz
  3. /readiness
  4. /api/health
  5. /status
  6. /ping
  7. / (root, as a last resort)

For each endpoint:

curl -s -o /dev/null -w '%{http_code}' --max-time 5 http://host:port/health

A 200 response means healthy. A non-200 or timeout means the service or

that specific check is failing.

If the health endpoint returns a JSON body, parse it to extract per-dependency

status:

curl -s --max-time 5 http://host:port/health | python -c "
import sys, json
data = json.load(sys.stdin)
for dep, status in data.get('dependencies', {}).items():
    mark = 'OK' if status.get('healthy') else 'FAIL'
    print(f'  {dep}: {mark}')
"

Dependency checks

For each service, verify that its dependencies are reachable:

availability

known stable URL with a short timeout

Build a dependency map from the service's configuration (docker-compose.yaml,

environment variables, config files) and check each dependency individually.

Docker service health

When services run in Docker:

docker-compose ps                     # all services and their status
docker logs --tail 30 <service>       # recent log output for errors
docker inspect --format='{{.State.Health.Status}}' <container>

Check for:

Process checks

When services run directly on the host:

pgrep -f <process-name>              # check if process is running
ss -tlnp | grep :<port>             # check if port is listening

If a process is not running, check recent system logs for crash information.

Port checks

Verify expected ports are listening and responsive:

curl -s -o /dev/null -w '%{http_code}' --max-time 3 http://host:port/

For non-HTTP services, check port availability:

timeout 3 bash -c '</dev/tcp/host/port' && echo "open" || echo "closed"

Report which ports responded and which timed out.

MUST

downstream dependency failure often looks like the upstream service is

broken

other commands) to avoid hanging

"service-a is failing because database-b is unreachable")

MUST NOT

diagnostic only

or environment variables

down, report the mixed state clearly

status

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.