cleanup-cache
Clean system caches (npm, Homebrew, Yarn, browsers, Python/ML) to free disk space
Synchronize environment variables between local development and Vercel deployments
$ npx -y skills add davila7/claude-code-templates --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/vercel-env-syncContext preview
What this command does when you run it.
Synchronize environment variables between local development and Vercel deployments
allowed-tools: Read, Write, Edit, Bash argument-hint: [--pull] [--push] [--validate] [--backup] description: Synchronize environment variables between local development and Vercel deployments
**Sync Operation**: $ARGUMENTS
// Environment file structure analysis
interface EnvironmentConfig {
development: Record<string, string>;
preview: Record<string, string>;
production: Record<string, string>;
}
const environmentFiles = {
'.env.local': 'Local development overrides',
'.env.development': 'Development environment',
'.env.staging': 'Staging/preview environment',
'.env.production': 'Production environment',
'.env': 'Default environment (committed to git)',
'.env.example': 'Environment template (safe to commit)',
};# List all environment variables for all environments vercel env ls # List environment variables for specific environment vercel env ls --environment=production vercel env ls --environment=preview vercel env ls --environment=development # Pull environment variables from Vercel vercel env pull .env.vercel # Add new environment variable vercel env add [name] [environment] # Remove environment variable vercel env rm [name] [environment]
#!/bin/bash # Pull environments from Vercel echo "๐ Pulling environment variables from Vercel..." # Create backup of existing files if [ -f .env.local ]; then cp .env.local .env.local.backup.$(date +%Y%m%d_%H%M%S) echo "๐ฆ Backup created for .env.local" fi # Pull from Vercel (creates .env.local by default) vercel env pull .env.local if [ $? -eq 0 ]; then echo "โ Successfully pulled environment variables" echo "๐ Variables saved to .env.local" # Show summary echo "" echo "๐ Environment Variables Summary:" echo "================================" grep -c "=" .env.local 2>/dev/null && echo "Total variables: $(grep -c "=" .env.local)" # List variable names (hide values for security) echo "" echo "๐ Variable Names:" grep "^[A-Z]" .env.local | cut -d'=' -f1 | sort else echo "โ Failed to pull environment variables" exit 1 fi
#!/bin/bash
# Push environment variables to Vercel
echo "๐ Pushing environment variables to Vercel..."
# Check if environment files exist
ENV_FILES=(".env.production" ".env.staging" ".env.development")
FOUND_FILES=()
for file in "${ENV_FILES[@]}"; do
if [ -f "$file" ]; then
FOUND_FILES+=("$file")
fi
done
if [ ${#FOUND_FILES[@]} -eq 0 ]; then
echo "โ No environment files found to push"
echo "๐ก Expected files: ${ENV_FILES[*]}"
exit 1
fi
# Push each environment file
for file in "${FOUND_FILES[@]}"; do
echo "๐ค Processing $file..."
# Determine target environment
if [[ "$file" == *"production"* ]]; then
ENV="production"
elif [[ "$file" == *"staging"* ]]; then
ENV="preview" # Vercel uses 'preview' for staging
elif [[ "$file" == *"development"* ]]; then
ENV="development"
else
ENV="development" # Default
fi
echo "๐ฏ Pushing to $ENV environment..."
# Read variables from file and push to Vercel
while IFS='=' read -r key value; do
# Skip empty lines and comments
if [[ -z "$key" || "$key" =~ ^#.* ]]; then
continue
fi
# Remove quotes from value if present
value=$(echo "$value" | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\(.*\)'$/\1/")
echo " ๐ Setting $key..."
echo "$value" | vercel env add "$key" "$ENV" --force
done < "$file"
echo "โ
Completed $file -> $ENV"
echo ""
done
echo "๐ All environment variables pushed successfully!"// Environment validation script
interface ValidationRule {
name: string;
required: boolean;
pattern?: RegExp;
description: string;
}
const validationRules: ValidationRule[] = [
{
name: 'DATABASE_URL',
required: true,
pattern: /^(postgresql|mysql|sqlite):\/\/.+/,
description: 'Database connection string',
},
{
name: 'NEXTAUTH_SECRET',
required: true,
pattern: /.{32,}/,
description: 'NextAuth.js secret key (min 32 characters)',
},
{
name: 'NEXTAUTH_URL',
required: true,
pattern: /^https?:\/\/.+/,
description: 'NextAuth.js canonical URL',
},
{
name: 'API_KEY',
required: false,
pattern: /^[A-Za-z0-9_-]+$/,
description: 'API key for external services',
},
];
function validateEnvironment(envFile: string): ValidationResult {
const errors: string[] = [];
const warnings: string[] = [];
const env = readEnvironmentFile(envFile);
// Check required variables
validationRules.forEach(rule => {
const value = env[rule.name];
if (rule.required && !value) {
errors.push(`Missing required variable: ${rule.name}`);
return;
}
if (value && rule.pattern && !rule.pattern.test(value)) {
errors.push(`Invalid format for ${rule.name}: ${rule.description}`);
}
});
// Check for common issues
Object.entries(env).forEach(([key, value]) => {
// Check for placeholder values
if (value === 'your-secret-here' || value === 'change-me') {
warnings.push(`Placeholder value detected for ${key}`);
}
//Ready-to-use configurations for Anthropic's Claude Code. A comprehensive collection of AI agents, custom commands, settings, hooks, external integrations (MCPs), and project templates to enhance your development workflow.
Repo: davila7/claude-code-templates
Clean system caches (npm, Homebrew, Yarn, browsers, Python/ML) to free disk space
Create an SEO-optimized blog article for a Claude Code component with AI-generated cover image