/validate-config
Validate wrangler.jsonc configuration, verify Cloudflare Images bindings, check environment variables, and test Workers integration. Ensures correct setup for using Cloudflare Images with Cloudflare Workers.
$ npx -y skills add secondsky/claude-skills --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/validate-config
Context preview
What this command does when you run it.
Validate wrangler.jsonc configuration, verify Cloudflare Images bindings, check environment variables, and test Workers integration. Ensures correct setup for using Cloudflare Images with Cloudflare Workers.
Command definition
validate-config.mdname: cloudflare-images:validate-config
description: Validate wrangler.jsonc configuration, verify Cloudflare Images bindings, check environment variables, and test Workers integration. Ensures correct setup for using Cloudflare Images with Cloudflare Workers.
Validate Cloudflare Images Configuration
Comprehensive validation of `wrangler.jsonc`, environment variables, and Cloudflare Images bindings for Workers integration.
What This Command Does
When you run `/validate-config`, Claude will: 1. Check if `wrangler.jsonc` exists and has valid JSON 2. Verify images binding configuration 3. Validate environment variables (`.env`, `.dev.vars`) 4. Test API token permissions 5. Check account ID matches binding 6. Verify Worker can access IMAGES binding 7. Validate transformation endpoints 8. Check for common configuration issues
Usage
/validate-config
Run from your Cloudflare Worker project root (where `wrangler.jsonc` is located).
Implementation
Run the following validation checks:
1. Check wrangler.jsonc Exists
echo "๐ Checking project structure..."
if [ ! -f "wrangler.jsonc" ]; then
echo "โ wrangler.jsonc not found"
echo " Run: wrangler init"
exit 1
else
echo "โ
wrangler.jsonc found"
fi
echo ""
2. Validate wrangler.jsonc Syntax
echo "๐ Validating wrangler.jsonc syntax..."
# Check if valid JSON (with comments allowed for JSONC)
if jq empty wrangler.jsonc 2>/dev/null; then
echo "โ
Valid JSON syntax"
else
# Try stripping comments and validating
if grep -v '^\s*//' wrangler.jsonc | jq empty 2>/dev/null; then
echo "โ
Valid JSONC syntax (with comments)"
else
echo "โ Invalid JSON syntax in wrangler.jsonc"
echo " Check for trailing commas, missing quotes, etc."
exit 1
fi
fi
echo ""3. Verify Images Binding Configuration
echo "๐ Checking images binding..."
BINDING_EXISTS=$(jq -r 'has("images")' wrangler.jsonc 2>/dev/null)
if [ "$BINDING_EXISTS" = "true" ]; then
echo "โ
images binding configured"
# Validate binding structure
BINDING_COUNT=$(jq -r '.images | length' wrangler.jsonc)
echo " Bindings configured: $BINDING_COUNT"
# Check each binding
for i in $(seq 0 $(($BINDING_COUNT - 1))); do
BINDING_NAME=$(jq -r ".images[$i].binding" wrangler.jsonc)
BINDING_ACCOUNT=$(jq -r ".images[$i].account_id" wrangler.jsonc)
if [ "$BINDING_NAME" != "null" ]; then
echo " โข Binding: $BINDING_NAME"
else
echo " โ ๏ธ Binding $i missing 'binding' field (default: IMAGES)"
fi
if [ "$BINDING_ACCOUNT" != "null" ]; then
echo " Account: ${BINDING_ACCOUNT:0:8}..."
else
echo " โ ๏ธ No account_id specified (will use account from wrangler auth)"
fi
done
else
echo "โ No images binding configured"
echo ""
echo " Add to wrangler.jsonc:"
echo ' {
"images": [
{
"binding": "IMAGES",
"account_id": "your_account_id"
}
]
}'
exit 1
fi
echo ""4. Validate Environment Variables
echo "๐ Checking environment variables..."
# Check .env file
if [ -f ".env" ]; then
echo "โ
.env file found"
if grep -q "CF_ACCOUNT_ID" .env; then
ACCOUNT_ID=$(grep "CF_ACCOUNT_ID" .env | cut -d '=' -f2)
echo " CF_ACCOUNT_ID: ${ACCOUNT_ID:0:8}..."
else
echo " โ ๏ธ CF_ACCOUNT_ID not set in .env"
fi
if grep -q "CF_API_TOKEN" .env; then
API_TOKEN=$(grep "CF_API_TOKEN" .env | cut -d '=' -f2)
echo " CF_API_TOKEN: ${API_TOKEN:0:10}..."
else
echo " โ ๏ธ CF_API_TOKEN not set in .env"
fi
if grep -q "CF_ACCOUNT_HASH" .env; then
ACCOUNT_HASH=$(grep "CF_ACCOUNT_HASH" .env | cut -d '=' -f2)
echo " CF_ACCOUNT_HASH: $ACCOUNT_HASH"
else
echo " โน๏ธ CF_ACCOUNT_HASH not set (optional for delivery URLs)"
fi
else
echo "โ ๏ธ .env file not found"
echo " Create .env with:"
echo " CF_ACCOUNT_ID=your_account_id"
echo " CF_API_TOKEN=your_api_token"
fi
# Check .dev.vars file (for wrangler dev)
echo ""
if [ -f ".dev.vars" ]; then
echo "โ
.dev.vars file found (for local development)"
else
echo "โน๏ธ .dev.vars not found (optional - for wrangler dev)"
echo " Create .dev.vars for local secrets"
fi
echo ""5. Verify Account ID Matches
echo "๐ Verifying account ID consistency..."
# Get account ID from wrangler.jsonc
WRANGLER_ACCOUNT=$(jq -r '.images[0].account_id // empty' wrangler.jsonc)
# Get account ID from .env
if [ -f ".env" ]; then
ENV_ACCOUNT=$(grep "CF_ACCOUNT_ID" .env | cut -d '=' -f2 | tr -d '"' | tr -d "'")
fi
if [ ! -z "$WRANGLER_ACCOUNT" ] && [ ! -z "$ENV_ACCOUNT" ]; then
if [ "$WRANGLER_ACCOUNT" = "$ENV_ACCOUNT" ]; then
echo "โ
Account IDs match"
echo " wrangler.jsonc: ${WRANGLER_ACCOUNT:0:8}..."
echo " .env: ${ENV_ACCOUNT:0:8}..."
else
echo "โ Account ID mismatch!"
echo " wrangler.jsonc: ${WRANGLER_ACCOUNT:0:8}..."
echo " .env: ${ENV_ACCOUNT:0:8}..."
echo " These should match for consistent behavior"
fi
elif [ -z "$WRANGLER_ACCOUNT" ]; then
echo "โน๏ธ No account_id in wrangler.jsonc (using default account)"
elif [ -z "$ENV_ACCOUNT" ]; then
echo "โน๏ธ CF_ACCOUNT_ID not set in .env"
fi
echo ""6. Test API Token Permissions
echo "๐ Testing API token permissions..."
if [ -f ".env" ] && grep -q "CF_API_TOKEN" .env && grep -q "CF_ACCOUNT_ID" .env; then
source .env
# Test Images API access
IMAGES_TEST=$(curl -s \
"https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/images/v1?per_page=1" \
-H "Authorization: Bearer ${CF_API_TOKEN}")
IMAGES_SUCCESS=$(echo "$IMAGES_TEST" | jq -r '.success')
if [ "$IMAGES_SUCCESS" = "true" ]; then
echo "โ
API token has Images:Read permission"
# Test if can list variants (requires Edit permission)
VARIANTS_TEST=$(curl -s \
"https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/images/v1/variants" \
-H "Authorization: Bearer ${CF_APRead more
name: cloudflare-images:validate-config description: Validate wrangler.jsonc configuration, verify Cloudflare Images bindings, check environment variables, and test Workers integration. Ensures correct setup for using Cloudflare Images with Cloudflare Workers.
Validate Cloudflare Images Configuration
Comprehensive validation of `wrangler.jsonc`, environment variables, and Cloudflare Images bindings for Workers integration.
What This Command Does
When you run `/validate-config`, Claude will: 1. Check if `wrangler.jsonc` exists and has valid JSON 2. Verify images binding configuration 3. Validate environment variables (`.env`, `.dev.vars`) 4. Test API token permissions 5. Check account ID matches binding 6. Verify Worker can access IMAGES binding 7. Validate transformation endpoints 8. Check for common configuration issues
Usage
/validate-config
Run from your Cloudflare Worker project root (where `wrangler.jsonc` is located).
Implementation
Run the following validation checks:
1. Check wrangler.jsonc Exists
echo "๐ Checking project structure..." if [ ! -f "wrangler.jsonc" ]; then echo "โ wrangler.jsonc not found" echo " Run: wrangler init" exit 1 else echo "โ wrangler.jsonc found" fi echo ""
2. Validate wrangler.jsonc Syntax
echo "๐ Validating wrangler.jsonc syntax..."
# Check if valid JSON (with comments allowed for JSONC)
if jq empty wrangler.jsonc 2>/dev/null; then
echo "โ
Valid JSON syntax"
else
# Try stripping comments and validating
if grep -v '^\s*//' wrangler.jsonc | jq empty 2>/dev/null; then
echo "โ
Valid JSONC syntax (with comments)"
else
echo "โ Invalid JSON syntax in wrangler.jsonc"
echo " Check for trailing commas, missing quotes, etc."
exit 1
fi
fi
echo ""3. Verify Images Binding Configuration
echo "๐ Checking images binding..."
BINDING_EXISTS=$(jq -r 'has("images")' wrangler.jsonc 2>/dev/null)
if [ "$BINDING_EXISTS" = "true" ]; then
echo "โ
images binding configured"
# Validate binding structure
BINDING_COUNT=$(jq -r '.images | length' wrangler.jsonc)
echo " Bindings configured: $BINDING_COUNT"
# Check each binding
for i in $(seq 0 $(($BINDING_COUNT - 1))); do
BINDING_NAME=$(jq -r ".images[$i].binding" wrangler.jsonc)
BINDING_ACCOUNT=$(jq -r ".images[$i].account_id" wrangler.jsonc)
if [ "$BINDING_NAME" != "null" ]; then
echo " โข Binding: $BINDING_NAME"
else
echo " โ ๏ธ Binding $i missing 'binding' field (default: IMAGES)"
fi
if [ "$BINDING_ACCOUNT" != "null" ]; then
echo " Account: ${BINDING_ACCOUNT:0:8}..."
else
echo " โ ๏ธ No account_id specified (will use account from wrangler auth)"
fi
done
else
echo "โ No images binding configured"
echo ""
echo " Add to wrangler.jsonc:"
echo ' {
"images": [
{
"binding": "IMAGES",
"account_id": "your_account_id"
}
]
}'
exit 1
fi
echo ""4. Validate Environment Variables
echo "๐ Checking environment variables..."
# Check .env file
if [ -f ".env" ]; then
echo "โ
.env file found"
if grep -q "CF_ACCOUNT_ID" .env; then
ACCOUNT_ID=$(grep "CF_ACCOUNT_ID" .env | cut -d '=' -f2)
echo " CF_ACCOUNT_ID: ${ACCOUNT_ID:0:8}..."
else
echo " โ ๏ธ CF_ACCOUNT_ID not set in .env"
fi
if grep -q "CF_API_TOKEN" .env; then
API_TOKEN=$(grep "CF_API_TOKEN" .env | cut -d '=' -f2)
echo " CF_API_TOKEN: ${API_TOKEN:0:10}..."
else
echo " โ ๏ธ CF_API_TOKEN not set in .env"
fi
if grep -q "CF_ACCOUNT_HASH" .env; then
ACCOUNT_HASH=$(grep "CF_ACCOUNT_HASH" .env | cut -d '=' -f2)
echo " CF_ACCOUNT_HASH: $ACCOUNT_HASH"
else
echo " โน๏ธ CF_ACCOUNT_HASH not set (optional for delivery URLs)"
fi
else
echo "โ ๏ธ .env file not found"
echo " Create .env with:"
echo " CF_ACCOUNT_ID=your_account_id"
echo " CF_API_TOKEN=your_api_token"
fi
# Check .dev.vars file (for wrangler dev)
echo ""
if [ -f ".dev.vars" ]; then
echo "โ
.dev.vars file found (for local development)"
else
echo "โน๏ธ .dev.vars not found (optional - for wrangler dev)"
echo " Create .dev.vars for local secrets"
fi
echo ""5. Verify Account ID Matches
echo "๐ Verifying account ID consistency..."
# Get account ID from wrangler.jsonc
WRANGLER_ACCOUNT=$(jq -r '.images[0].account_id // empty' wrangler.jsonc)
# Get account ID from .env
if [ -f ".env" ]; then
ENV_ACCOUNT=$(grep "CF_ACCOUNT_ID" .env | cut -d '=' -f2 | tr -d '"' | tr -d "'")
fi
if [ ! -z "$WRANGLER_ACCOUNT" ] && [ ! -z "$ENV_ACCOUNT" ]; then
if [ "$WRANGLER_ACCOUNT" = "$ENV_ACCOUNT" ]; then
echo "โ
Account IDs match"
echo " wrangler.jsonc: ${WRANGLER_ACCOUNT:0:8}..."
echo " .env: ${ENV_ACCOUNT:0:8}..."
else
echo "โ Account ID mismatch!"
echo " wrangler.jsonc: ${WRANGLER_ACCOUNT:0:8}..."
echo " .env: ${ENV_ACCOUNT:0:8}..."
echo " These should match for consistent behavior"
fi
elif [ -z "$WRANGLER_ACCOUNT" ]; then
echo "โน๏ธ No account_id in wrangler.jsonc (using default account)"
elif [ -z "$ENV_ACCOUNT" ]; then
echo "โน๏ธ CF_ACCOUNT_ID not set in .env"
fi
echo ""6. Test API Token Permissions
echo "๐ Testing API token permissions..."
if [ -f ".env" ] && grep -q "CF_API_TOKEN" .env && grep -q "CF_ACCOUNT_ID" .env; then
source .env
# Test Images API access
IMAGES_TEST=$(curl -s \
"https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/images/v1?per_page=1" \
-H "Authorization: Bearer ${CF_API_TOKEN}")
IMAGES_SUCCESS=$(echo "$IMAGES_TEST" | jq -r '.success')
if [ "$IMAGES_SUCCESS" = "true" ]; then
echo "โ
API token has Images:Read permission"
# Test if can list variants (requires Edit permission)
VARIANTS_TEST=$(curl -s \
"https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/images/v1/variants" \
-H "Authorization: Bearer ${CF_AP142 production-ready skills for Claude Code CLI ๐ Platform / Harness Support These plugins ship as Claude Code marketplace plugins (.claude-plugin/ manifests) and Codex CLI plugins (.codex-plugin/ manifests).
Repo: secondsky/claude-skills
Other commands on secondsky-claude-skills.
- /better-auth-add-plugin
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
Open command - /better-auth-setup
Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin configuration.
Open command - /explain-error
Explain Better Auth error codes and provide solutions with code examples
Open command - /providers
Display Better Auth available authentication providers and their configuration
Open command - /bun-debug
Type of issue to debug (runtime, test, build, memory, performance)
Open command - /bun-deploy
Target platform (docker, cloudflare, vercel, fly, railway)
Open command

