Token导航 LogoToken导航

Agent Skill · 研究检索

health-check(健康检查)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

health-check 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 70,604。

总安装 210周安装 9GitHub Stars 1下载 73核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:health-check(健康检查)
来源仓库:https://github.com/cleanexpo/nodejs-starter-v1
仓库路径:skills/health-check
安装命令:
npx skills add https://github.com/cleanexpo/nodejs-starter-v1 --skill health-check
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cleanexpo/nodejs-starter-v1 --skill health-check

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

health-check 定义三层健康探针架构,覆盖存活、就绪与依赖深度检查,适配容器化部署。适用于 Kubernetes 或独立服务中监控系统可用性、数据库连接与外部依赖状态。集成 Docker 健康检查与 cron 定时监控,支持路由发现与自定义探针脚本。

使用前请确认网络策略允许探针访问目标端点,避免防火墙阻断导致误判。建议在部署后立即验证探针响应,确保告警机制真实反映系统状况。

来源仓库内路径:skills/health-check

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/cleanexpo/nodejs-starter-v1 --skill health-che…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

health-check 怎么安装?

在终端执行 npx skills add https://github.com/cleanexpo/nodejs-starter-v1 --skill health-check。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

health-check 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

health-check 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

health-check 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

health-check 用的人多吗?

公开数据是累计安装 210 次,近一周安装 9 次,下载 73 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

health-check 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
health-check

健康检查 · 本页

2101接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Health Check - Liveness, Readiness & Dependency Probes

Codifies the project's three-tier health probe architecture (shallow liveness, readiness, deep dependency checks), Docker container healthchecks, cron-based periodic monitoring, route discovery verification, and the comprehensive system health script. Patterns align with Kubernetes probe conventions even when running outside K8s.

Description

Codifies liveness, readiness, and deep dependency health endpoints for NodeJS-Starter-V1's Next.js and FastAPI services, covering three-tier probe architecture, Docker healthchecks, cron-based monitoring, route discovery verification, and the system health script.


When to Apply

Positive Triggers

  • Adding new health check endpoints or probes
  • Integrating new dependencies that need health verification
  • Configuring Docker healthchecks for containers
  • Setting up periodic health monitoring via cron
  • Implementing startup, liveness, or readiness probes
  • Adding service dependency checks to existing endpoints
  • User mentions: "health check", "liveness", "readiness", "probe", "heartbeat", "service health", "dependency check"

Negative Triggers

  • Collecting application metrics (use metrics-collector instead)
  • Adding structured log statements (use structured-logging instead)
  • Designing dashboard UI for health status (use dashboard-patterns instead)
  • Implementing graceful shutdown (use graceful-shutdown when available)

Core Directives

The Three Laws of Health Checks

  1. Three tiers, not one: Separate liveness (am I alive?), readiness (can I serve traffic?), and deep (are all dependencies healthy?). Never combine them.
  2. Parallel dependency checks: Check all dependencies concurrently via Promise.all or asyncio.gather. Never check sequentially — a slow database should not delay the Redis check.
  3. 503 for unhealthy: Return HTTP 200 for healthy/degraded, HTTP 503 for unhealthy. Load balancers and orchestrators use status codes, not response bodies.

Existing Project Infrastructure

Backend (FastAPI)

EndpointTypeLocation
GET /healthLivenessapps/backend/src/api/routes/health.py
GET /readyReadinessapps/backend/src/api/routes/health.py
GET /api/agents/{id}/healthAgent healthapps/backend/src/api/routes/agent_dashboard.py

Frontend (Next.js)

EndpointTypeLocation
GET /api/healthShallow livenessapps/web/app/api/health/route.ts
GET /api/health/deepDeep dependencyapps/web/app/api/health/deep/route.ts
GET /api/health/routesRoute discoveryapps/web/app/api/health/routes/route.ts
GET /api/cron/health-checkPeriodic cronapps/web/app/api/cron/health-check/route.ts

Docker

ServiceCommandIntervalTimeoutRetries
PostgreSQLpg_isready -U starter_user -d starter_db10s5s5
Redisredis-cli ping10s5s5

System Script

scripts/health-check.ps1 — 6-phase comprehensive health check (prerequisites, database, backend, frontend, integration, summary) with exit code 0 (healthy) or 1 (unhealthy).


Health Status Model

All health endpoints use a three-state status:

StatusHTTP CodeMeaningAction
healthy200All systems operationalNone
degraded200Functional but impairedMonitor, alert
unhealthy503Cannot serve requestsRemove from load balancer

Aggregation Rule

if any dependency is unhealthy → overall = unhealthy (503)
else if any dependency is degraded → overall = degraded (200)
else → overall = healthy (200)

Probe Patterns

Tier 1: Liveness (Shallow)

Returns immediately with minimal computation. Used by load balancers and orchestrators to confirm the process is alive.

Backend (/health):

@router.get("/health")
async def health_check() -> dict[str, str]:
    return {
        "status": "healthy",
        "timestamp": datetime.now().isoformat(),
        "version": "0.1.0",
    }

Frontend (/api/health):

interface HealthResponse {
  status: "healthy" | "degraded" | "unhealthy";
  timestamp: string;
  version: string;
  uptime: number;
  environment: string;
}

Rules: No database calls, no external service checks, no computation. Must respond in < 50ms.

Tier 2: Readiness

Confirms the service can accept and process requests. Checks that critical dependencies are reachable.

Backend (/ready):

@router.get("/ready")
async def readiness_check() -> dict[str, str]:
    # Check database connectivity
    # Check Redis connectivity
    # Check AI provider availability
    return {"status": "ready", "timestamp": datetime.now().isoformat()}

Rules: Check only fast, critical dependencies (database, cache). Timeout each check at 2–5 seconds. Do not check optional or slow services.

Tier 3: Deep Dependency Check

Checks all dependencies in parallel with latency measurement. Used for debugging and monitoring dashboards, not for load balancer probes (too slow).

Frontend (/api/health/deep):

interface DependencyCheck {
  name: string;
  status: "healthy" | "degraded" | "unhealthy" | "unchecked";
  latency_ms: number | null;
  error: string | null;
  last_checked: string;
}

Each dependency checker follows this pattern:

  1. Record start time
  2. Attempt operation with timeout (AbortSignal.timeout(5000))
  3. Measure latency (Date.now() - start)
  4. Classify: healthy (success), degraded (slow or partial), unhealthy (error/timeout)

Checks run in parallel via Promise.all:

const [database, backend, verification] = await Promise.all([
  checkDatabase(),
  checkBackend(),
  checkVerificationSystem(),
]);

The summary aggregates results:

const summary = {
  total_checks: checks.length,
  passed: checks.filter(c => c.status === "healthy").length,
  failed: checks.filter(c => c.status === "unhealthy").length,
  degraded: checks.filter(c => c.status === "degraded").length,
};

Docker Healthcheck Pattern

Docker Compose healthchecks use CMD-SHELL with service-native commands:

services:
  postgres:
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U starter_user -d starter_db"]
      interval: 10s
      timeout: 5s
      retries: 5
  redis:
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

For application containers, use curl or wget against the liveness endpoint:

backend:
  healthcheck:
    test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
    interval: 30s
    timeout: 10s
    retries: 3
    start_period: 40s

start_period gives the application time to initialise before healthchecks begin. Use depends_on with condition: service_healthy to sequence container startup.


Cron-Based Monitoring

The project's /api/cron/health-check runs every 5 minutes, pings the backend, and logs results. Secured with CRON_SECRET bearer token.

Pattern for adding new periodic checks:

export async function GET(request: Request) {
  // 1. Verify CRON_SECRET
  const authHeader = request.headers.get("authorization");
  if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
    return new NextResponse("Unauthorized", { status: 401 });
  }
  // 2. Run checks with latency measurement
  const start = Date.now();
  const response = await fetch(`${backendUrl}/health`, {
    signal: AbortSignal.timeout(5000),
  });
  const latency = Date.now() - start;
  // 3. Log results
  logger.info("Health check cron", { backend: response.ok, latency });
  // 4. Alert if unhealthy
  if (!response.ok) { logger.error("Backend unhealthy"); }
  // 5. Return results
  return NextResponse.json({ status: response.ok ? "healthy" : "unhealthy" });
}

Route Health Verification

The /api/health/routes endpoint discovers all API routes by scanning the filesystem and optionally verifies each GET endpoint:

  1. Discovery: Recursively scan app/api/ for route.ts files
  2. Method detection: Parse file content for exported HTTP methods (GET, POST, PUT, PATCH, DELETE)
  3. Verification (optional ?verify=true): Send GET request to each endpoint with 5-second timeout
  4. Status: verified (200 OK), error (non-200 or timeout), unverified (not tested)

Adding a New Dependency Check

When integrating a new service, add a checker following this template:

async function checkNewService(): Promise<DependencyCheck> {
  const start = Date.now();
  const result: DependencyCheck = {
    name: "service_name",
    status: "unchecked",
    latency_ms: null,
    error: null,
    last_checked: new Date().toISOString(),
  };
  try {
    // Service-specific check (e.g., ping, SELECT 1, PING)
    const response = await fetch(serviceUrl, {
      signal: AbortSignal.timeout(5000),
    });
    result.latency_ms = Date.now() - start;
    result.status = response.ok ? "healthy" : "degraded";
    if (!response.ok) result.error = `HTTP ${response.status}`;
  } catch (e) {
    result.latency_ms = Date.now() - start;
    result.status = "unhealthy";
    result.error = e instanceof Error ? e.message : "Unknown error";
  }
  return result;
}

Then add it to the Promise.all array in the deep health endpoint.


Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Database query in liveness probeProbe fails when DB is slow, kills healthy processLiveness = process alive only; DB check in readiness
Sequential dependency checksTotal latency = sum of all checksPromise.all / asyncio.gather for parallel
200 OK when unhealthyLoad balancer keeps routing traffic to broken instance503 for unhealthy, 200 for healthy/degraded
No timeout on dependency checksSingle hung dependency blocks entire health responseAbortSignal.timeout(5000) on every check
Exposing sensitive details in health responseInternal errors, stack traces leaked to publicReturn status + latency only; log details server-side
No start_period in Docker healthcheckContainer marked unhealthy during bootSet start_period to cover startup time
Hardcoded service URLs in health checksBreaks across environmentsUse environment variables (BACKEND_URL, etc.)

Checklist for New Health Endpoints

Structure

  • Three-tier separation (liveness, readiness, deep)
  • healthy / degraded / unhealthy status values
  • HTTP 200 for healthy/degraded, 503 for unhealthy
  • Response includes timestamp and version

Dependencies

  • Parallel checking via Promise.all or asyncio.gather
  • 5-second timeout per dependency check
  • Latency measurement per dependency
  • Graceful handling of missing environment variables

Docker

  • Container healthcheck using service-native command
  • interval, timeout, retries configured
  • start_period covers application boot time
  • condition: service_healthy for dependent services

Monitoring

  • Cron-based periodic checks for production
  • CRON_SECRET authentication on cron endpoints
  • Health check latency instrumented via metrics-collector
  • Failures logged via structured-logging

Response Format

[AGENT_ACTIVATED]: Health Check
[PHASE]: {Design | Implementation | Review}
[STATUS]: {in_progress | complete}

{health check analysis or implementation guidance}

[NEXT_ACTION]: {what to do next}

Integration Points

Metrics Collector

  • health_check_duration_ms histogram per dependency
  • health_check_status gauge (1=healthy, 0.5=degraded, 0=unhealthy)

Structured Logging

  • Info-level health check results (dependency, status, latency)
  • Error-level alerts when dependencies become unhealthy

Error Taxonomy

  • SYS_HEALTH_DEPENDENCY_UNAVAILABLE (503) — critical dependency unreachable
  • SYS_HEALTH_TIMEOUT (504) — dependency check exceeded timeout

Cron Scheduler

  • /api/cron/health-check runs every 5 minutes with CRON_SECRET auth
  • Results can trigger alerting via notification system

Dashboard Patterns

  • StatusPulse component for live dependency status indicators
  • DataStrip for health check latency metrics
  • Connection status mapped to spectral colours (emerald=healthy, amber=degraded, red=unhealthy)

Australian Localisation (en-AU)

  • Spelling: initialise, serialise, analyse, optimise, colour, behaviour
  • Date: ISO 8601 in responses; DD/MM/YYYY in dashboard display
  • Timezone: AEST/AEDT — timestamps stored as UTC

平台分布

Codex

36.61%
按下载量换算27

Claude

31.1%
按下载量换算23

Cursor

19.84%
按下载量换算14

Gemini CLI

8.76%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills