Skip to content
Development
Command

/integrate

Intelligent integration orchestrator for services, APIs, databases, and tools with error handling and monitoring

From plugin
claude-cmd
313180 skills180 commands

How 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/integrate

Context preview

What this command does when you run it.

Intelligent integration orchestrator for services, APIs, databases, and tools with error handling and monitoring

Command definition

integrate.md
allowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(fd:*), Bash(rg:*), Bash(eza:*), Bash(bat:*), Bash(jq:*), Bash(gdate:*), Bash(docker:*), Bash(kubectl:*), Bash(curl:*), Bash(git:*)
name: "Integrate"
description: "Intelligent integration orchestrator for services, APIs, databases, and tools with error handling and monitoring"
author: "wcygan"
tags: ["workflow","manage"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N 2>/dev/null || echo "$(date +%s)$(jot -r 1 100000 999999 2>/dev/null || shuf -i 100000-999999 -n 1 2>/dev/null || echo $RANDOM$RANDOM)"`
  • Integration target: $ARGUMENTS
  • Current directory: !`pwd`
  • Project structure: !`eza -la --tree --level=2 2>/dev/null | head -10 || fd . -t d -d 2 | head -5`
  • Existing integrations: !`fd "(client|connector|adapter|integration|api)" --type f -d 3 | head -10 || echo "No integration files detected"`
  • Configuration files: !`fd "(.env|config|settings)" --type f -d 2 | head -5 || echo "No config files found"`
  • Running services: !`docker ps --format "table {{.Names}}\t{{.Status}}" 2>/dev/null | head -5 || echo "No Docker services running"`
  • Git status: !`git status --porcelain 2>/dev/null | head -5 || echo "Not a git repository"`

Your Task

STEP 1: Initialize integration session and analyze existing architecture

  • CREATE session state file: `/tmp/integration-session-$SESSION_ID.json`
  • ANALYZE project structure and technology stack from Context section
  • DETECT existing integrations, APIs, and service connections
  • IDENTIFY integration complexity and requirements
# Initialize integration session state
echo '{
  "sessionId": "'$SESSION_ID'",
  "integrationTarget": "'$ARGUMENTS'",
  "existingIntegrations": [],
  "integrationPattern": "auto-detect",
  "securityProfile": "production"
}' > /tmp/integration-session-$SESSION_ID.json

STEP 2: Comprehensive integration analysis with parallel sub-agent coordination

TRY:

IF integration_complexity == "multi-service" OR target_includes_multiple_systems:

LAUNCH parallel sub-agents for comprehensive integration analysis:

  • **Agent 1: API Discovery & Analysis**: Identify existing API endpoints, schemas, and authentication
  • Focus: REST APIs, GraphQL endpoints, RPC services, authentication mechanisms
  • Tools: rg for API patterns, fd for OpenAPI specs, curl for endpoint testing
  • Output: API inventory with capabilities and integration requirements
  • **Agent 2: Database Integration Assessment**: Analyze database connections and data flows
  • Focus: Connection strings, ORM configurations, migration patterns, data schemas
  • Tools: rg for database patterns, analysis of config files and models
  • Output: Database integration strategy and data flow requirements
  • **Agent 3: Service Discovery & Orchestration**: Map microservices and container architecture
  • Focus: Docker services, Kubernetes deployments, service mesh configuration
  • Tools: docker commands, kubectl queries, service discovery analysis
  • Output: Service topology and orchestration requirements
  • **Agent 4: Security & Compliance Analysis**: Evaluate security requirements and patterns
  • Focus: Authentication, authorization, secrets management, encryption
  • Tools: rg for credential patterns, security configuration analysis
  • Output: Security integration requirements and compliance considerations
  • **Agent 5: Monitoring & Observability Setup**: Design integration monitoring strategy
  • Focus: Logging, metrics, tracing, health checks, error handling
  • Tools: Analysis of existing monitoring patterns, log configurations
  • Output: Observability integration plan and alerting strategy

ELSE:

EXECUTE streamlined single-service integration analysis:

# Single-service integration analysis
echo "๐Ÿ” Analyzing single-service integration requirements for: $ARGUMENTS"

# Identify existing patterns
rg "(http|https|api|client|sdk)" --type-add 'config:*.{json,yaml,toml}' --type config
fd "(client|connector|adapter|integration)" --type f

# Check for credentials and configuration
rg "(API_KEY|CLIENT_ID|SECRET|TOKEN)" .env* --no-ignore 2>/dev/null || echo "No credential files found"
rg "(endpoint|baseUrl|host|url)" --type-add 'config:*.{json,yaml,toml}' --type config

# Find current integration patterns
rg "(fetch|axios|request|WebClient|http\.)" -A 2 -B 1

STEP 3: Intelligent integration pattern selection and implementation

CASE integration_type: WHEN "api_integration":

**REST API Integration (TypeScript/Deno optimized):**

// api-integration.ts
interface APIConfig {
  baseUrl: string;
  apiKey?: string;
  timeout?: number;
  retryAttempts?: number;
}

class APIIntegration {
  constructor(private config: APIConfig) {}

  async request<T>(endpoint: string, options: RequestInit = {}): Promise<T> {
    const url = `${this.config.baseUrl}${endpoint}`;
    const headers = {
      "Content-Type": "application/json",
      ...(this.config.apiKey && { "Authorization": `Bearer ${this.config.apiKey}` }),
      ...options.headers,
    };

    let lastError: Error | null = null;

    for (let attempt = 0; attempt < (this.config.retryAttempts || 3); attempt++) {
      try {
        const response = await fetch(url, {
          ...options,
          headers,
          signal: AbortSignal.timeout(this.config.timeout || 30000),
        });

        if (!response.ok) {
          throw new Error(`HTTP ${response.status}: ${response.statusText}`);
        }

        return await response.json();
      } catch (error) {
        lastError = error as Error;
        if (attempt < (this.config.retryAttempts || 3) - 1) {
          await new Promise((resolve) => setTimeout(resolve, Math.pow(2, attempt) * 1000));
        }
      }
    }

    throw lastError;
  }
}

WHEN "database_integration":

**Database Integration (Multi-database support):**

// database-integration.ts
import { Clie
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin