Skip to content
Development
Command

/deploy

Intelligent Kubernetes deployment orchestrator with manifest generation and CI/CD integration

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/deploy

Context preview

What this command does when you run it.

Intelligent Kubernetes deployment orchestrator with manifest generation and CI/CD integration

Command definition

deploy.md
allowed-tools: Task, Read, Write, Edit, MultiEdit, Bash(kubectl:*), Bash(helm:*), Bash(git:*), Bash(fd:*), Bash(rg:*), Bash(jq:*), Bash(yq:*), Bash(gdate:*), Bash(docker:*), Bash(gh:*)
name: "Deploy"
description: "Intelligent Kubernetes deployment orchestrator with manifest generation and CI/CD integration"
author: "wcygan"
tags: ["ops","deploy"]
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)"`
  • Target application: $ARGUMENTS
  • Current directory: !`pwd`
  • Git status: !`git status --porcelain | head -5 || echo "No git repository"`
  • Current branch: !`git branch --show-current 2>/dev/null || echo "unknown"`
  • Latest commit: !`git rev-parse --short HEAD 2>/dev/null || echo "no-git"`
  • Existing k8s directory: !`fd "^(k8s|kubernetes|deploy|infra)$" . -t d -d 2 | head -1 || echo "none"`
  • Kubernetes context: !`kubectl config current-context 2>/dev/null || echo "not-configured"`
  • Available clusters: !`kubectl config get-contexts -o name 2>/dev/null | head -3 || echo "none"`
  • Helm charts detected: !`fd "Chart.yaml" . -d 3 | head -3 || echo "none"`
  • Docker images in registry: !`docker images --format "table {{.Repository}}:{{.Tag}}" | grep -v "<none>" | head -3 2>/dev/null || echo "none"`
  • Deployment tools status: !`echo "kubectl: $(which kubectl >/dev/null && echo ✓ || echo ✗) | helm: $(which helm >/dev/null && echo ✓ || echo ✗) | docker: $(which docker >/dev/null && echo ✓ || echo ✗)"`

Your Task

STEP 1: Initialize intelligent deployment session with comprehensive project analysis

  • CREATE session state file: `/tmp/deploy-session-$SESSION_ID.json`
  • ANALYZE project structure and existing deployment patterns from Context
  • DETERMINE deployment strategy based on discovered patterns
  • VALIDATE prerequisites (kubectl access, docker images, cluster connectivity)
# Initialize deployment session state
echo '{
  "sessionId": "'$SESSION_ID'",
  "targetApp": "'$ARGUMENTS'",
  "deploymentStrategy": "auto-detect",
  "environment": "staging",
  "manifestsGenerated": [],
  "deploymentStatus": "initialized"
}' > /tmp/deploy-session-$SESSION_ID.json

STEP 2: Adaptive deployment strategy selection with intelligent pattern detection

TRY:

CASE deployment_pattern: WHEN "existing_kustomize":

  • DETECT existing Kustomize structure in k8s/ directory
  • UPDATE existing manifests with new image tags and configurations
  • APPLY environment-specific overlays (staging/production)
  • VALIDATE manifest syntax with `kubectl dry-run`

WHEN "existing_helm":

  • ANALYZE existing Helm chart structure (Chart.yaml, values.yaml)
  • UPDATE values files with new image tags and environment configuration
  • VALIDATE Helm templates with `helm template` and `helm lint`
  • PREPARE for environment-specific deployments

WHEN "generate_new_manifests":

  • LAUNCH parallel sub-agents for comprehensive manifest generation
  • CREATE production-ready Kubernetes manifests with best practices
  • IMPLEMENT security hardening and observability features
  • SETUP CI/CD integration with GitHub Actions

STEP 3: Parallel manifest generation using sub-agent architecture

IF no_existing_deployment_config OR generate_new_requested:

LAUNCH parallel sub-agents for comprehensive Kubernetes deployment setup:

  • **Agent 1: Core Manifests Generation**: Create Deployment, Service, and Ingress manifests
  • Focus: Production-ready configurations with security best practices
  • Tools: kubectl, yq for YAML manipulation, template generation
  • Output: Core k8s manifests with proper resource management and health checks
  • **Agent 2: Kustomize Structure Setup**: Create Kustomize base and overlay structure
  • Focus: Environment-specific configurations (staging, production, development)
  • Tools: Kustomize CLI, directory structure creation, overlay management
  • Output: Complete Kustomize setup with environment overlays
  • **Agent 3: Secret Management**: Generate secure secret templates and management scripts
  • Focus: Kubernetes secrets, ConfigMaps, environment-specific configurations
  • Tools: kubectl, secure secret generation, template creation
  • Output: Secret templates and secure population commands
  • **Agent 4: Monitoring & Observability**: Setup Prometheus metrics and logging configurations
  • Focus: Service monitors, alerts, dashboards, health check endpoints
  • Tools: Prometheus operator configs, Grafana dashboards, logging setup
  • Output: Complete observability stack configuration
  • **Agent 5: CI/CD Integration**: Generate GitHub Actions workflows for automated deployment
  • Focus: Build, test, deploy pipelines with rollback capabilities
  • Tools: GitHub Actions, workflow generation, deployment automation
  • Output: Complete CI/CD pipeline with staging and production deployments
  • **Agent 6: Security Hardening**: Implement Pod Security Standards and network policies
  • Focus: Security contexts, network policies, RBAC configurations
  • Tools: Pod Security Standards, network policy generation, RBAC setup
  • Output: Hardened deployment configuration with security best practices

**Sub-Agent Coordination:**

# Each agent reports findings to session state
echo "Parallel manifest generation agents launched..."
echo "Coordinating deployment artifact creation across security, observability, and automation"

STEP 4: Environment-specific configuration and deployment execution

**Environment Detection and Configuration:**

# Parse deployment target from arguments
target_env=$(echo "$ARGUMENTS" | rg "--to (\w+)" -o -r '$1' || echo "staging")
tag=$(echo "$ARGUMENTS" | rg "--tag ([\w\.-]+)" -o -r '$1' || git rev-parse --short HEAD)

echo "🎯 Deployment Target: $target_env"
echo "🏷️ Image Tag: $tag"

# Environment-specific resource configuration
case $target_env in
  "produc
Read more
Ships withclaude-cmd

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

Get the whole plugin