Token导航 LogoToken导航

Agent Skill · 前端设计

health-checks(健康检查)

health-checks 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

health-checks 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有提醒项,按安装量在前端设计类的 10,216 个 Skill 里排第 6,501。

总安装 494周安装 21GitHub Stars 777下载 173核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/dadbodgeoff/drift --skill health-checks

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

health-checks 用于基础设施监控与负载均衡,适合在 Codex、Claude、Cursor、Gemini CLI 中需要实现 liveness 与 readiness 探针时使用。它区分进程存活与就绪状态,支持详细依赖检查与自动恢复,适用于 Kubernetes 部署。

使用时需避免阻塞性检查,控制响应时间;建议聚合数据库、缓存等关键依赖状态。安装前请确认端点暴露方式,注意是否会增加额外负载,确保不影响正常请求处理。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

health-checks 怎么安装?

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

health-checks 支持哪些 AI 工具?

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

health-checks 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

health-checks 是免费的吗?

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

health-checks 用的人多吗?

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

health-checks 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

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

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
health-checks

健康检查 · 本页

494777调用外部服务未明确有提醒

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

SKILL.md 原文

Health Checks

Let your infrastructure know when your app is healthy.

When to Use This Skill

  • Kubernetes deployments (liveness/readiness probes)
  • Load balancer health checks
  • Monitoring and alerting
  • Zero-downtime deployments
  • Auto-scaling decisions

Health Check Types

Liveness Check

"Is the process alive?" - Restart if failing

GET /health/live → 200 OK

Readiness Check

"Can it handle traffic?" - Remove from load balancer if failing

GET /health/ready → 200 OK or 503 Service Unavailable

Detailed Health Check

"What's the status of each dependency?"

{
  "status": "healthy",
  "checks": {
    "database": { "status": "healthy", "latency": 5 },
    "redis": { "status": "healthy", "latency": 2 },
    "stripe": { "status": "degraded", "latency": 500 }
  }
}

TypeScript Implementation

// health/health-service.ts
interface HealthCheck {
  name: string;
  check: () => Promise<HealthCheckResult>;
  critical?: boolean; // If critical, failure = not ready
}

interface HealthCheckResult {
  status: 'healthy' | 'degraded' | 'unhealthy';
  latency?: number;
  message?: string;
}

interface HealthStatus {
  status: 'healthy' | 'degraded' | 'unhealthy';
  checks: Record<string, HealthCheckResult>;
  timestamp: string;
  version?: string;
}

class HealthService {
  private checks: HealthCheck[] = [];

  register(check: HealthCheck): void {
    this.checks.push(check);
  }

  async checkLiveness(): Promise<boolean> {
    // Simple check - is the process responsive?
    return true;
  }

  async checkReadiness(): Promise<{ ready: boolean; status: HealthStatus }> {
    const status = await this.getDetailedStatus();

    // Ready if all critical checks pass
    const criticalFailed = this.checks
      .filter(c => c.critical)
      .some(c => status.checks[c.name]?.status === 'unhealthy');

    return {
      ready: !criticalFailed && status.status !== 'unhealthy',
      status,
    };
  }

  async getDetailedStatus(): Promise<HealthStatus> {
    const results: Record<string, HealthCheckResult> = {};

    await Promise.all(
      this.checks.map(async (check) => {
        const start = Date.now();
        try {
          const result = await Promise.race([
            check.check(),
            new Promise<HealthCheckResult>((_, reject) =>
              setTimeout(() => reject(new Error('Timeout')), 5000)
            ),
          ]);
          results[check.name] = {
            ...result,
            latency: Date.now() - start,
          };
        } catch (error) {
          results[check.name] = {
            status: 'unhealthy',
            latency: Date.now() - start,
            message: (error as Error).message,
          };
        }
      })
    );

    // Overall status
    const statuses = Object.values(results).map(r => r.status);
    let overallStatus: HealthStatus['status'] = 'healthy';
    if (statuses.includes('unhealthy')) {
      overallStatus = 'unhealthy';
    } else if (statuses.includes('degraded')) {
      overallStatus = 'degraded';
    }

    return {
      status: overallStatus,
      checks: results,
      timestamp: new Date().toISOString(),
      version: process.env.APP_VERSION,
    };
  }
}

export const healthService = new HealthService();

Register Health Checks

// health/checks.ts
import { healthService } from './health-service';
import { db } from '../db';
import { redis } from '../redis';

// Database check (critical)
healthService.register({
  name: 'database',
  critical: true,
  check: async () => {
    await db.$queryRaw`SELECT 1`;
    return { status: 'healthy' };
  },
});

// Redis check (critical for sessions)
healthService.register({
  name: 'redis',
  critical: true,
  check: async () => {
    await redis.ping();
    return { status: 'healthy' };
  },
});

// External API check (non-critical)
healthService.register({
  name: 'stripe',
  critical: false,
  check: async () => {
    try {
      await stripe.balance.retrieve();
      return { status: 'healthy' };
    } catch {
      return { status: 'degraded', message: 'Stripe API slow or unavailable' };
    }
  },
});

// Disk space check
healthService.register({
  name: 'disk',
  critical: false,
  check: async () => {
    const { available, total } = await checkDiskSpace('/');
    const percentFree = (available / total) * 100;

    if (percentFree < 5) {
      return { status: 'unhealthy', message: `Only ${percentFree.toFixed(1)}% disk free` };
    }
    if (percentFree < 20) {
      return { status: 'degraded', message: `${percentFree.toFixed(1)}% disk free` };
    }
    return { status: 'healthy' };
  },
});

Express Routes

// routes/health.ts
import { Router } from 'express';
import { healthService } from '../health/health-service';

const router = Router();

// Liveness probe - is the process alive?
router.get('/health/live', (req, res) => {
  res.status(200).json({ status: 'ok' });
});

// Readiness probe - can it handle traffic?
router.get('/health/ready', async (req, res) => {
  const { ready, status } = await healthService.checkReadiness();
  res.status(ready ? 200 : 503).json(status);
});

// Detailed health - for monitoring dashboards
router.get('/health', async (req, res) => {
  const status = await healthService.getDetailedStatus();
  const httpStatus = status.status === 'unhealthy' ? 503 : 200;
  res.status(httpStatus).json(status);
});

export { router as healthRoutes };

Python Implementation

# health/health_service.py
from dataclasses import dataclass
from typing import Callable, Awaitable, Optional
from datetime import datetime
import asyncio

@dataclass
class HealthCheckResult:
    status: str  # healthy, degraded, unhealthy
    latency: Optional[float] = None
    message: Optional[str] = None

@dataclass
class HealthCheck:
    name: str
    check: Callable[[], Awaitable[HealthCheckResult]]
    critical: bool = False

class HealthService:
    def __init__(self):
        self.checks: list[HealthCheck] = []

    def register(self, check: HealthCheck):
        self.checks.append(check)

    async def check_readiness(self) -> tuple[bool, dict]:
        status = await self.get_detailed_status()

        critical_failed = any(
            status["checks"].get(c.name, {}).get("status") == "unhealthy"
            for c in self.checks if c.critical
        )

        return not critical_failed, status

    async def get_detailed_status(self) -> dict:
        results = {}

        async def run_check(check: HealthCheck):
            start = datetime.now()
            try:
                result = await asyncio.wait_for(check.check(), timeout=5.0)
                results[check.name] = {
                    "status": result.status,
                    "latency": (datetime.now() - start).total_seconds() * 1000,
                    "message": result.message,
                }
            except Exception as e:
                results[check.name] = {
                    "status": "unhealthy",
                    "latency": (datetime.now() - start).total_seconds() * 1000,
                    "message": str(e),
                }

        await asyncio.gather(*[run_check(c) for c in self.checks])

        statuses = [r["status"] for r in results.values()]
        if "unhealthy" in statuses:
            overall = "unhealthy"
        elif "degraded" in statuses:
            overall = "degraded"
        else:
            overall = "healthy"

        return {
            "status": overall,
            "checks": results,
            "timestamp": datetime.utcnow().isoformat(),
        }

health_service = HealthService()

FastAPI Routes

from fastapi import APIRouter, Response

router = APIRouter()

@router.get("/health/live")
async def liveness():
    return {"status": "ok"}

@router.get("/health/ready")
async def readiness(response: Response):
    ready, status = await health_service.check_readiness()
    if not ready:
        response.status_code = 503
    return status

@router.get("/health")
async def detailed_health(response: Response):
    status = await health_service.get_detailed_status()
    if status["status"] == "unhealthy":
        response.status_code = 503
    return status

Kubernetes Configuration

apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      containers:
        - name: app
          livenessProbe:
            httpGet:
              path: /health/live
              port: 3000
            initialDelaySeconds: 10
            periodSeconds: 10
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /health/ready
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 5
            failureThreshold: 3
          startupProbe:
            httpGet:
              path: /health/live
              port: 3000
            initialDelaySeconds: 0
            periodSeconds: 5
            failureThreshold: 30

Best Practices

  1. Separate liveness from readiness - Different purposes
  2. Keep liveness simple - Don't check dependencies
  3. Timeout health checks - Don't hang forever
  4. Mark critical dependencies - Database yes, analytics no
  5. Include version info - Helps debugging

Common Mistakes

  • Checking external services in liveness probe
  • No timeout on health checks
  • All dependencies marked as critical
  • Health endpoint requires authentication
  • Not caching expensive checks

平台分布

Codex

33.52%
按下载量换算58

Claude

29.26%
按下载量换算51

Cursor

18.7%
按下载量换算32

Gemini CLI

9.34%
按下载量换算16

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

继续浏览同类 Skills