AgentSkillsCN

verify

验证生产环境或预发布环境的部署健康状况。当您需要检查部署是否成功、在真实环境中运行冒烟测试,或在继续开发前确认某项功能是否正常运行时,可调用此技能。支持 Cloudflare Workers、GitHub Actions 以及通用 HTTP 端点的部署验证。

SKILL.md
--- frontmatter
name: verify
description: Verify deployment health for production or staging. Use when checking if a deployment succeeded, running smoke tests against live environments, or confirming a feature works before continuing development. Works with Cloudflare Workers, GitHub Actions, and generic HTTP endpoints.
license: Apache-2.0

Verify Deployment

Confirm deployments are healthy before proceeding with development.

Quick Checks

1. Health Endpoint

bash
# Check /healthz (common pattern)
curl -sf https://app.example.com/healthz | jq .

# With timeout
curl -sf --max-time 10 https://app.example.com/healthz

Expected response:

json
{"status": "ok", "env": "production"}

2. GitHub Actions Status

bash
# List recent runs (auto-detects workflows)
gh run list --limit=5

# Find deployment-related workflows
ls .github/workflows/ | grep -iE '(deploy|release|publish|ci)'

# Check latest run for a specific workflow
gh run list --workflow=<workflow-file> --limit=1

# Watch a specific run
gh run watch <run-id>

# Check if deployment succeeded
gh run view --json conclusion -q '.conclusion' <run-id>

Workflow detection priority:

  1. Look in .github/workflows/ for files matching: deploy*, release*, publish*, cd*
  2. Fall back to ci.yml or main.yml if no deploy-specific workflow exists
  3. Use gh run list --limit=5 to see recent runs across all workflows

3. Smoke Tests

Check package.json for smoke test scripts:

bash
# Common patterns (use detected package manager from lockfiles - see CLAUDE.md)
npm run test:smoke
npm run test:prod
BASE_URL=https://app.example.com npm test -- --grep=@smoke

Verification Workflow

code
Deploy completes
      ↓
Check /healthz → ❌ → Investigate logs
      ↓ ✅
Run smoke tests → ❌ → Debug failing tests
      ↓ ✅
Verify feature works → ❌ → Check implementation
      ↓ ✅
Continue development

Environment Detection

Detect environment from wrangler.jsonc:

bash
# Get production URL
grep -A5 '"production"' wrangler.jsonc | grep 'name'

# Common patterns:
# - Production: app-name (https://app-name.workers.dev or custom domain)
# - Preview: app-name-preview
# - Staging: app-name-staging

Cloudflare Workers Specifics

Check Worker Status

bash
# Via wrangler (requires auth)
bunx wrangler deployments list

# Check recent deployment
bunx wrangler deployments view

Tail Logs

bash
# Production logs
bunx wrangler tail --env production

# Filter errors
bunx wrangler tail --env production --status error

Common Issues

SymptomCheck
502/503 errorsWorker crashed - check wrangler tail
Old version deployedGitHub Actions cache - re-run workflow
Environment vars missingwrangler secret list --env production
Durable Objects errorsCheck DO migrations in wrangler.jsonc

Background Verification (Subagent)

For verification that shouldn't block the main conversation, spawn a background subagent:

code
Task(
  subagent_type: "general-purpose",
  prompt: "Read ~/.claude/skills/verify/SKILL.md and follow the verification workflow.
    Project: {project}
    Environment: {production|staging}
    URL: {url if known}
    Previous work: {what was deployed}
    Return a concise pass/fail verification report."
)

Integration with Development Loop

Before starting new work:

bash
# 1. Confirm last deploy succeeded (check recent runs across all workflows)
gh run list --limit=3

# Or target a specific workflow if known
gh run list --workflow=<workflow-file> --limit=1

# 2. Hit health endpoint
curl -sf https://app.example.com/healthz

# 3. Run quick smoke test (use detected package manager)
npm run test:smoke

# All green? → Continue development

Script Template

bash
#!/bin/bash
set -e

URL="${1:-https://app.example.com}"

echo "Checking $URL..."

# Health check
if curl -f "$URL/healthz" > /dev/null; then
  echo "✅ Health check passed"
else
  echo "❌ Health check failed"
  exit 1
fi

# Smoke tests (if available)
if grep -q '"test:smoke"' package.json 2>/dev/null; then
  echo "Running smoke tests..."
  # Detect package manager from lockfiles (see CLAUDE.md)
  BASE_URL="$URL" npm run test:smoke
fi

echo "✅ Verification complete"