jeremylongshore

lindy-multi-env-setup

@jeremylongshore/lindy-multi-env-setup
jeremylongshore
1,004
123 forks
Updated 1/18/2026
View on GitHub

Configure Lindy AI across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific Lindy configurations. Trigger with phrases like "lindy environments", "lindy staging", "lindy dev prod", "lindy environment setup", "lindy config by env".

Installation

$skills install @jeremylongshore/lindy-multi-env-setup
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Pathplugins/saas-packs/lindy-pack/skills/lindy-multi-env-setup/SKILL.md
Branchmain
Scoped Name@jeremylongshore/lindy-multi-env-setup

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

skills list

Skill Instructions


name: lindy-multi-env-setup description: | Configure Lindy AI across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific Lindy configurations. Trigger with phrases like "lindy environments", "lindy staging", "lindy dev prod", "lindy environment setup", "lindy 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

Lindy Multi Env Setup

Overview

Configure Lindy AI across development, staging, and production environments.

Prerequisites

  • Separate Lindy API keys per environment
  • Secret management solution (Vault, AWS Secrets Manager, etc.)
  • CI/CD pipeline with environment variables
  • Environment detection in application

Instructions

Step 1: Create Environment Configuration

// config/lindy.ts
interface LindyConfig {
  apiKey: string;
  environment: 'development' | 'staging' | 'production';
  baseUrl?: string;
  timeout: number;
  retries: number;
}

const configs: Record<string, LindyConfig> = {
  development: {
    apiKey: process.env.LINDY_DEV_API_KEY!,
    environment: 'development',
    timeout: 60000,
    retries: 1,
  },
  staging: {
    apiKey: process.env.LINDY_STAGING_API_KEY!,
    environment: 'staging',
    timeout: 45000,
    retries: 2,
  },
  production: {
    apiKey: process.env.LINDY_PROD_API_KEY!,
    environment: 'production',
    timeout: 30000,
    retries: 3,
  },
};

export function getLindyConfig(): LindyConfig {
  const env = process.env.NODE_ENV || 'development';
  return configs[env] || configs.development;
}

Step 2: Implement Environment Detection

// lib/lindy-client.ts
import { Lindy } from '@lindy-ai/sdk';
import { getLindyConfig } from '../config/lindy';

let client: Lindy | null = null;

export function getLindyClient(): Lindy {
  if (!client) {
    const config = getLindyConfig();

    // Validate environment
    if (config.environment === 'production') {
      if (!config.apiKey.startsWith('lnd_prod_')) {
        throw new Error('Production requires production API key');
      }
    }

    client = new Lindy({
      apiKey: config.apiKey,
      timeout: config.timeout,
      retries: config.retries,
    });
  }

  return client;
}

Step 3: Configure Secrets by Environment

# AWS Secrets Manager structure
secrets/
├── lindy/development
   └── api_key: lnd_dev_xxx
├── lindy/staging
   └── api_key: lnd_stg_xxx
└── lindy/production
    └── api_key: lnd_prod_xxx
// secrets/lindy.ts
import { SecretsManager } from '@aws-sdk/client-secrets-manager';

export async function getLindyApiKey(env: string): Promise<string> {
  const client = new SecretsManager({ region: 'us-east-1' });

  const response = await client.getSecretValue({
    SecretId: `lindy/${env}`,
  });

  const secret = JSON.parse(response.SecretString!);
  return secret.api_key;
}

Step 4: Environment-Specific Agents

// agents/config.ts
interface AgentMapping {
  development: string;
  staging: string;
  production: string;
}

const agentMappings: Record<string, AgentMapping> = {
  support: {
    development: 'agt_dev_support',
    staging: 'agt_stg_support',
    production: 'agt_prod_support',
  },
  sales: {
    development: 'agt_dev_sales',
    staging: 'agt_stg_sales',
    production: 'agt_prod_sales',
  },
};

export function getAgentId(agentName: string): string {
  const env = process.env.NODE_ENV || 'development';
  const mapping = agentMappings[agentName];

  if (!mapping) {
    throw new Error(`Unknown agent: ${agentName}`);
  }

  return mapping[env as keyof AgentMapping];
}

Step 5: Add Environment Guards

// guards/production.ts
export function requireProduction(): void {
  if (process.env.NODE_ENV !== 'production') {
    throw new Error('This operation requires production environment');
  }
}

export function preventProduction(): void {
  if (process.env.NODE_ENV === 'production') {
    throw new Error('This operation is not allowed in production');
  }
}

// Usage
async function dangerousOperation() {
  preventProduction();
  // ... destructive test operation
}

async function productionOnlyOperation() {
  requireProduction();
  // ... production-only logic
}

Output

  • Multi-environment configuration
  • Environment detection logic
  • Secure secret management
  • Environment-specific agents
  • Production safeguards

Error Handling

IssueCauseSolution
Wrong key for envConfig errorValidate key prefix
Secret not foundNot provisionedCreate in secrets manager
Agent not foundWrong environmentCheck agent mapping

Examples

Complete Environment Setup

// index.ts
import { getLindyClient } from './lib/lindy-client';
import { getAgentId } from './agents/config';

async function main() {
  const lindy = getLindyClient();
  const agentId = getAgentId('support');

  console.log(`Environment: ${process.env.NODE_ENV}`);
  console.log(`Agent: ${agentId}`);

  const result = await lindy.agents.run(agentId, {
    input: 'Test message',
  });

  console.log('Response:', result.output);
}

main().catch(console.error);

Resources

Next Steps

Proceed to lindy-observability for monitoring setup.

More by jeremylongshore

View all
rabbitmq-queue-setup
1,004

Rabbitmq Queue Setup - Auto-activating skill for Backend Development. Triggers on: rabbitmq queue setup, rabbitmq queue setup Part of the Backend Development skill category.

model-evaluation-suite
1,004

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".

neural-network-builder
1,004

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
1,004

Oauth Callback Handler - Auto-activating skill for API Integration. Triggers on: oauth callback handler, oauth callback handler Part of the API Integration skill category.