Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:19:13 +08:00
commit eca17ae5cf
10 changed files with 348 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
---
name: orchestrating-deployment-pipelines
description: |
This skill orchestrates complex, multi-stage deployment pipelines. It generates production-ready configurations and setup code based on user-specified requirements and infrastructure. Use this skill when the user asks to create a deployment pipeline, generate CI/CD configurations, or needs help with automating software deployments. Trigger terms include "deployment pipeline", "CI/CD", "automate deployment", "pipeline configuration", and "deployment orchestration".
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
version: 1.0.0
---
## Overview
This skill allows Claude to create and manage deployment pipelines, ensuring efficient and reliable software releases. It simplifies the process of configuring and automating deployments across various platforms.
## How It Works
1. **Requirement Gathering**: Claude identifies the user's specific deployment requirements, including target environment, deployment stages, and security considerations.
2. **Configuration Generation**: Based on the gathered requirements, Claude generates production-ready configuration files for the deployment pipeline.
3. **Code Generation**: Claude creates necessary setup code to automate the deployment process, integrating best practices and security measures.
## When to Use This Skill
This skill activates when you need to:
- Create a new deployment pipeline from scratch.
- Generate CI/CD configurations for automating software deployments.
- Automate the deployment process across multiple environments.
## Examples
### Example 1: Setting up a Production Deployment Pipeline
User request: "Set up a production deployment pipeline for a web application using Docker and Kubernetes."
The skill will:
1. Generate a Kubernetes deployment configuration file.
2. Create a Dockerfile for containerizing the web application.
### Example 2: Automating CI/CD with GitLab
User request: "Automate CI/CD for a Python microservice using GitLab."
The skill will:
1. Generate a `.gitlab-ci.yml` file defining the CI/CD pipeline stages (build, test, deploy).
2. Create scripts for automated testing and deployment to a staging environment.
## Best Practices
- **Security**: Always prioritize security by incorporating vulnerability scanning and secure coding practices into the pipeline.
- **Automation**: Automate as many steps as possible to reduce manual errors and increase efficiency.
- **Testing**: Implement comprehensive testing at each stage of the pipeline to ensure code quality and stability.
## Integration
This skill can integrate with other Claude Code plugins related to infrastructure provisioning, security analysis, and code quality checks to create a fully automated DevOps workflow.

View File

@@ -0,0 +1,7 @@
# Assets
Bundled resources for deployment-pipeline-orchestrator skill
- [ ] pipeline_template.yaml: A template for creating new deployment pipelines, providing a starting point for users to customize.
- [ ] example_config.yaml: An example deployment pipeline configuration file, demonstrating how to configure the pipeline for a specific application.
- [ ] sample_scripts/: A directory containing sample scripts for common deployment tasks, such as database migration and service restart.

View File

@@ -0,0 +1,84 @@
# example_config.yaml
# Configuration file for the Deployment Pipeline Orchestrator plugin.
# General pipeline settings
pipeline_name: "Example Application Deployment" # Name of this deployment pipeline
application_name: "ExampleApp" # Name of the application being deployed
environment: "production" # Target environment (e.g., staging, production, development)
# Source code repository settings
repository:
type: "git" # Type of repository (e.g., git, svn)
url: "https://github.com/YOUR_GITHUB_USERNAME/ExampleApp.git" # URL of the repository
branch: "main" # Branch to deploy from
credentials:
username: "YOUR_GITHUB_USERNAME" # Username for accessing the repository (if required)
password: "YOUR_GITHUB_PASSWORD" # Password or token for accessing the repository (if required, consider using secrets management)
# Build stage configuration
build:
enabled: true # Whether to enable the build stage
builder: "docker" # Build tool to use (e.g., docker, maven, gradle)
dockerfile_path: "Dockerfile" # Path to the Dockerfile (if using Docker)
context_path: "." # Build context path
image_name: "example-app" # Name of the Docker image to build
image_tag: "latest" # Tag for the Docker image
registry: # Docker registry settings (optional)
url: "docker.io" # URL of the Docker registry
username: "YOUR_DOCKER_USERNAME" # Username for accessing the registry
password: "YOUR_DOCKER_PASSWORD" # Password or token for accessing the registry (if required, consider using secrets management)
build_args: # Additional build arguments (optional)
- "VERSION=1.0.0"
# Test stage configuration
test:
enabled: true # Whether to enable the test stage
test_runner: "pytest" # Testing framework (e.g., pytest, unittest)
test_command: "pytest tests/" # Command to run the tests
dependencies: # Dependencies required for testing (optional)
- "pytest"
- "requests"
# Deploy stage configuration
deploy:
enabled: true # Whether to enable the deploy stage
deployment_platform: "kubernetes" # Platform to deploy to (e.g., kubernetes, aws, azure)
kubernetes: # Kubernetes deployment settings (required if deployment_platform is kubernetes)
namespace: "example-app-ns" # Kubernetes namespace
deployment_file: "k8s/deployment.yaml" # Path to the Kubernetes deployment file
service_file: "k8s/service.yaml" # Path to the Kubernetes service file
ingress_file: "k8s/ingress.yaml" # Path to the Kubernetes ingress file (optional)
image_pull_secret: "docker-registry-secret" # Name of the image pull secret (optional)
aws: # AWS deployment settings (required if deployment_platform is aws)
region: "us-east-1" # AWS region
ecr_repository: "YOUR_ECR_REPOSITORY_NAME" # Name of the ECR repository
ecs_cluster: "YOUR_ECS_CLUSTER_NAME" # Name of the ECS cluster
azure: # Azure deployment settings (required if deployment_platform is azure)
resource_group: "YOUR_RESOURCE_GROUP_NAME" # Name of the Azure resource group
container_registry: "YOUR_CONTAINER_REGISTRY_NAME" # Name of the Azure container registry
# Monitoring stage configuration
monitor:
enabled: true # Whether to enable the monitor stage
monitoring_tool: "prometheus" # Monitoring tool to use (e.g., prometheus, datadog)
endpoints: # Endpoints to monitor
- "http://localhost:8080/health"
alerts: # Alerting configuration
cpu_usage: # Example alert for CPU usage
threshold: 80 # Percentage threshold
severity: "critical" # Severity of the alert
memory_usage: # Example alert for memory usage
threshold: 90 # Percentage threshold
severity: "warning" # Severity of the alert
# Notification settings
notifications:
enabled: true # Whether to enable notifications
type: "slack" # Notification type (e.g., slack, email)
slack: # Slack notification settings (required if type is slack)
webhook_url: "REPLACE_ME" # Slack webhook URL
email: # Email notification settings (required if type is email)
sender: "deployments@example.com" # Sender email address
recipients: # List of recipient email addresses
- "admin@example.com"
- "devops@example.com"

View File

@@ -0,0 +1,77 @@
# pipeline_template.yaml
# This file is a template for defining deployment pipelines.
# Use it as a starting point and customize it to your specific needs.
# Metadata about the pipeline
metadata:
name: REPLACE_ME_PIPELINE_NAME # Unique name for your pipeline
description: YOUR_VALUE_HERE # A brief description of what this pipeline does
version: 1.0 # Pipeline version (e.g., semantic versioning)
# Global configuration settings that apply to the entire pipeline
global_config:
# Environment to deploy to (e.g., development, staging, production)
environment: staging
# Region where the deployment will take place (e.g., us-east-1, eu-west-1)
region: us-east-1
# Notification settings (e.g., Slack webhook, email address)
notifications:
type: slack
webhook_url: REPLACE_ME_SLACK_WEBHOOK_URL
# Define the stages of the deployment pipeline
stages:
- name: build
description: Build the application artifact
type: build
# Configuration specific to the build stage
config:
# Build tool to use (e.g., docker, maven, npm)
build_tool: docker
# Path to the Dockerfile
dockerfile_path: ./Dockerfile
# Image name for the built artifact
image_name: REPLACE_ME_DOCKER_IMAGE_NAME
# Tag for the image
image_tag: latest
- name: test
description: Run automated tests against the built artifact
type: test
# Configuration specific to the test stage
config:
# Test framework to use (e.g., pytest, jest, junit)
test_framework: pytest
# Path to the test scripts
test_path: ./tests
# Command to execute the tests
test_command: pytest
- name: deploy
description: Deploy the application to the target environment
type: deploy
# Configuration specific to the deploy stage
config:
# Deployment platform (e.g., aws, azure, gcp, kubernetes)
platform: kubernetes
# Namespace to deploy to
namespace: REPLACE_ME_KUBERNETES_NAMESPACE
# Path to the Kubernetes deployment manifest
manifest_path: ./deployment.yaml
# Number of replicas
replicas: 3
- name: post_deploy_test
description: Run tests after deployment to confirm success
type: test
config:
test_framework: curl
test_path: ./post_deploy_tests.sh #Example script
test_command: ./post_deploy_tests.sh #Example script
endpoint_url: REPLACE_ME_APPLICATION_ENDPOINT_URL # Example URL to test
# Rollback strategy in case of deployment failure (optional)
rollback:
enabled: true
# Strategy for rollback (e.g., redeploy previous version, manual intervention)
strategy: redeploy_previous

View File

@@ -0,0 +1,8 @@
# References
Bundled resources for deployment-pipeline-orchestrator skill
- [ ] pipeline_configuration_schema.json: Defines the schema for the deployment pipeline configuration files, ensuring consistency and validity.
- [ ] best_practices.md: Provides best practices for designing and implementing deployment pipelines, covering topics such as security, scalability, and reliability.
- [ ] supported_platforms.md: Lists the supported platforms and technologies for the deployment pipeline, including operating systems, cloud providers, and deployment tools.
- [ ] error_handling.md: Provides guidance on handling errors and exceptions during the deployment process, including logging, monitoring, and alerting.

View File

@@ -0,0 +1,8 @@
# Scripts
Bundled resources for deployment-pipeline-orchestrator skill
- [ ] init_pipeline.sh: Automates the initial setup of the deployment pipeline, including environment configuration and dependency installation.
- [ ] validate_config.py: Validates the deployment pipeline configuration files against a predefined schema to ensure correctness and prevent errors.
- [ ] deploy.sh: Executes the deployment process, handling tasks such as code deployment, database migration, and service restart.
- [ ] rollback.sh: Executes the rollback process, handling tasks such as code rollback, database migration rollback, and service restart.