Skip to content

secondsky/claude-skills / plugins/cloudflare-hyperdrive/skills/cloudflare-hyperdrive

cloudflare-hyperdrive

Verified

Cloudflare Hyperdrive for Workers-to-database connections with pooling and caching. Use for PostgreSQL/MySQL, Drizzle/Prisma, or encountering pool errors, TLS issues, connection refused.

scripts/check-versions.sh

View on GitHub
#!/bin/bash
#
# Hyperdrive Package Version Checker
#
# Checks installed package versions against minimum requirements.
# Run this script to verify your dependencies are up to date.
#
# Usage:
#   ./scripts/check-versions.sh
#

set -e

echo "πŸ” Checking Hyperdrive Package Versions"
echo ""

# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

# Check if package.json exists
if [ ! -f "package.json" ]; then
  echo "❌ package.json not found in current directory"
  echo "   Run this script from your project root"
  exit 1
fi

# Function to check package version
check_package() {
  local package=$1
  local min_version=$2
  local installed_version

  if npm list "$package" &> /dev/null; then
    installed_version=$(npm list "$package" --depth=0 2>/dev/null | grep "$package@" | sed 's/.*@//' | cut -d' ' -f1)

    echo -n "  $package: "

    if [ -n "$installed_version" ]; then
      # Simple version comparison (works for most cases)
      if [[ "$installed_version" == "$min_version"* ]] || [[ "$installed_version" > "$min_version" ]]; then
        echo -e "${GREEN}βœ“${NC} $installed_version (>= $min_version required)"
      else
        echo -e "${RED}βœ—${NC} $installed_version (>= $min_version required)"
        echo -e "     ${YELLOW}Run: npm install $package@latest${NC}"
      fi
    else
      echo -e "${RED}βœ—${NC} Not found"
    fi
  else
    echo "  $package: ${YELLOW}Not installed${NC}"
  fi
}

# Check Wrangler
echo "Wrangler CLI:"
if command -v wrangler &> /dev/null; then
  wrangler_version=$(wrangler --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
  if [ -n "$wrangler_version" ]; then
    echo -e "  wrangler: ${GREEN}βœ“${NC} $wrangler_version (>= 4.81.0 required)"
  else
    echo -e "  wrangler: ${YELLOW}Unknown version${NC}"
  fi
else
  echo -e "  wrangler: ${RED}βœ—${NC} Not installed"
  echo -e "     ${YELLOW}Run: npm install -g wrangler${NC}"
fi

echo ""

# Check PostgreSQL drivers (if applicable)
echo "PostgreSQL Drivers (optional):"
check_package "pg" "8.13.0"
check_package "postgres" "3.4.5"

echo ""

# Check MySQL drivers (if applicable)
echo "MySQL Drivers (optional):"
check_package "mysql2" "3.13.0"

echo ""

# Check ORMs (if applicable)
echo "ORMs (optional):"
check_package "drizzle-orm" "0.0.0"  # Any version (always latest)
check_package "prisma" "0.0.0"        # Any version (always latest)
check_package "@prisma/client" "0.0.0"  # Any version (always latest)

echo ""

# Check required Workers packages
echo "Required Packages:"
check_package "@cloudflare/workers-types" "0.0.0"  # Any version

echo ""

# Check if nodejs_compat flag is set
echo "Configuration:"
if [ -f "wrangler.jsonc" ]; then
  if grep -q "nodejs_compat" wrangler.jsonc; then
    echo -e "  nodejs_compat flag: ${GREEN}βœ“${NC} Enabled"
  else
    echo -e "  nodejs_compat flag: ${RED}βœ—${NC} Not found"
    echo -e "     ${YELLOW}Add to wrangler.jsonc: \"compatibility_flags\": [\"nodejs_compat\"]${NC}"
  fi
else
  echo "  wrangler.jsonc: ${YELLOW}Not found${NC}"
fi

echo ""

# Summary
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Summary:"
echo ""
echo "βœ… = Installed and meets minimum version"
echo "❌ = Needs update or not installed"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "For latest versions, run:"
echo "  npm update"
echo ""
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall