Configure Clay across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific Clay configurations. Trigger with phrases like "clay environments", "clay staging", "clay dev prod", "clay environment setup", "clay config by env".
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
skills listSkill Instructions
name: clay-multi-env-setup description: | Configure Clay across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific Clay configurations. Trigger with phrases like "clay environments", "clay staging", "clay dev prod", "clay environment setup", "clay config by env". allowed-tools: Read, Write, Edit, Bash(aws:), Bash(gcloud:), Bash(vault:*) version: 1.0.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io
Clay Multi-Environment Setup
Overview
Configure Clay across development, staging, and production environments.
Prerequisites
- Separate Clay accounts or API keys per environment
- Secret management solution (Vault, AWS Secrets Manager, etc.)
- CI/CD pipeline with environment variables
- Environment detection in application
Environment Strategy
| Environment | Purpose | API Keys | Data |
|---|---|---|---|
| Development | Local dev | Test keys | Sandbox |
| Staging | Pre-prod validation | Staging keys | Test data |
| Production | Live traffic | Production keys | Real data |
Configuration Structure
config/
├── clay/
│ ├── base.json # Shared config
│ ├── development.json # Dev overrides
│ ├── staging.json # Staging overrides
│ └── production.json # Prod overrides
base.json
{
"timeout": 30000,
"retries": 3,
"cache": {
"enabled": true,
"ttlSeconds": 60
}
}
development.json
{
"apiKey": "${CLAY_API_KEY}",
"baseUrl": "https://api-sandbox.clay.com",
"debug": true,
"cache": {
"enabled": false
}
}
staging.json
{
"apiKey": "${CLAY_API_KEY_STAGING}",
"baseUrl": "https://api-staging.clay.com",
"debug": false
}
production.json
{
"apiKey": "${CLAY_API_KEY_PROD}",
"baseUrl": "https://api.clay.com",
"debug": false,
"retries": 5
}
Environment Detection
// src/clay/config.ts
import baseConfig from '../../config/clay/base.json';
type Environment = 'development' | 'staging' | 'production';
function detectEnvironment(): Environment {
const env = process.env.NODE_ENV || 'development';
const validEnvs: Environment[] = ['development', 'staging', 'production'];
return validEnvs.includes(env as Environment)
? (env as Environment)
: 'development';
}
export function getClayConfig() {
const env = detectEnvironment();
const envConfig = require(`../../config/clay/${env}.json`);
return {
...baseConfig,
...envConfig,
environment: env,
};
}
Secret Management by Environment
Local Development
# .env.local (git-ignored)
CLAY_API_KEY=sk_test_dev_***
CI/CD (GitHub Actions)
env:
CLAY_API_KEY: ${{ secrets.CLAY_API_KEY_${{ matrix.environment }} }}
Production (Vault/Secrets Manager)
# AWS Secrets Manager
aws secretsmanager get-secret-value --secret-id clay/production/api-key
# GCP Secret Manager
gcloud secrets versions access latest --secret=clay-api-key
# HashiCorp Vault
vault kv get -field=api_key secret/clay/production
Environment Isolation
// Prevent production operations in non-prod
function guardProductionOperation(operation: string): void {
const config = getClayConfig();
if (config.environment !== 'production') {
console.warn(`[clay] ${operation} blocked in ${config.environment}`);
throw new Error(`${operation} only allowed in production`);
}
}
// Usage
async function deleteAllData() {
guardProductionOperation('deleteAllData');
// Dangerous operation here
}
Feature Flags by Environment
const featureFlags: Record<Environment, Record<string, boolean>> = {
development: {
newFeature: true,
betaApi: true,
},
staging: {
newFeature: true,
betaApi: false,
},
production: {
newFeature: false,
betaApi: false,
},
};
Instructions
Step 1: Create Config Structure
Set up the base and per-environment configuration files.
Step 2: Implement Environment Detection
Add logic to detect and load environment-specific config.
Step 3: Configure Secrets
Store API keys securely using your secret management solution.
Step 4: Add Environment Guards
Implement safeguards for production-only operations.
Output
- Multi-environment config structure
- Environment detection logic
- Secure secret management
- Production safeguards enabled
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| Wrong environment | Missing NODE_ENV | Set environment variable |
| Secret not found | Wrong secret path | Verify secret manager config |
| Config merge fails | Invalid JSON | Validate config files |
| Production guard triggered | Wrong environment | Check NODE_ENV value |
Examples
Quick Environment Check
const env = getClayConfig();
console.log(`Running in ${env.environment} with ${env.baseUrl}`);
Resources
Next Steps
For observability setup, see clay-observability.
More by jeremylongshore
View allRabbitmq Queue Setup - Auto-activating skill for Backend Development. Triggers on: rabbitmq queue setup, rabbitmq queue setup Part of the Backend Development skill category.
evaluating-machine-learning-models: This skill allows Claude to evaluate machine learning models using a comprehensive suite of metrics. It should be used when the user requests model performance analysis, validation, or testing. Claude can use this skill to assess model accuracy, precision, recall, F1-score, and other relevant metrics. Trigger this skill when the user mentions "evaluate model", "model performance", "testing metrics", "validation results", or requests a comprehensive "model evaluation".
building-neural-networks: This skill allows Claude to construct and configure neural network architectures using the neural-network-builder plugin. It should be used when the user requests the creation of a new neural network, modification of an existing one, or assistance with defining the layers, parameters, and training process. The skill is triggered by requests involving terms like "build a neural network," "define network architecture," "configure layers," or specific mentions of neural network types (e.g., "CNN," "RNN," "transformer").
Oauth Callback Handler - Auto-activating skill for API Integration. Triggers on: oauth callback handler, oauth callback handler Part of the API Integration skill category.
