用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/personamanagmentlayer/pcl --skill devops-expert命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | devops-expert |
| version | 1.0.0 |
| description | Expert-level DevOps practices, culture, automation, and continuous delivery |
| category | devops |
| tags | ["devops","ci-cd","automation","infrastructure","culture"] |
| allowed-tools | ["Read","Write","Edit","Bash(*)"] |
Expert guidance for DevOps practices, culture, CI/CD pipelines, infrastructure automation, and operational excellence.
# GitHub Actions Example
name: CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Run tests
# Pulumi Infrastructure as Code
import pulumi
import pulumi_aws as aws
# VPC
vpc = aws.ec2.Vpc("main-vpc",
cidr_block="10.0.0.0/16",
enable_dns_hostnames=True,
enable_dns_support=True,
tags={"Name": "main-vpc"})
# Subnets
public_subnet = aws.ec2.Subnet("public-subnet",
vpc_id=vpc.id,
cidr_block="10.0.1.0/24",
availability_zone="us-east-1a",
map_public_ip_on_launch=True,
tags={"Name": "public-subnet"})
private_subnet = aws.ec2.Subnet("private-subnet",
vpc_id=vpc.id,
cidr_block="10.0.2.0/24",
availability_zone="us-east-1b",
tags={"Name": "private-subnet"})
# Internet Gateway
igw = aws.ec2.InternetGateway("igw",
vpc_id=vpc.id,
tags={"Name": "main-igw"})
# Route Table
route_table = aws.ec2.RouteTable("public-rt",
vpc_id=vpc.id,
routes=[
aws.ec2.RouteTableRouteArgs(
cidr_block="0.0.0.0/0",
gateway_id=igw.id,
)
],
tags={"Name": "public-rt"})
# Security Group
security_group = aws.ec2.SecurityGroup("web-sg",
vpc_id=vpc.id,
description="Allow HTTP and HTTPS traffic",
ingress=[
aws.ec2.SecurityGroupIngressArgs(
protocol="tcp",
from_port=,
to_port=,
cidr_blocks=[],
),
aws.ec2.SecurityGroupIngressArgs(
protocol=,
from_port=,
to_port=,
cidr_blocks=[],
),
],
egress=[
aws.ec2.SecurityGroupEgressArgs(
protocol=,
from_port=,
to_port=,
cidr_blocks=[],
)
])
cluster = aws.eks.Cluster(,
role_arn=cluster_role.arn,
vpc_config=aws.eks.ClusterVpcConfigArgs(
subnet_ids=[public_subnet., private_subnet.],
security_group_ids=[security_group.],
))
pulumi.export(, vpc.)
pulumi.export(, cluster.name)
pulumi.export(, cluster.endpoint)
from typing import List, Dict
import time
class DeploymentStrategy:
"""Implement various deployment strategies"""
def __init__(self, service_name: str):
self.service_name = service_name
def blue_green_deployment(self, blue_version: str, green_version: str):
"""Blue-Green deployment"""
# Deploy green environment
self.deploy_environment("green", green_version)
# Run tests on green
if self.run_tests("green"):
# Switch traffic to green
self.switch_traffic("green")
# Keep blue for rollback
print(f"Deployment successful. Blue ({blue_version}) kept for rollback.")
else:
# Rollback - keep blue active
print("Tests failed on green. Keeping blue active.")
def canary_deployment(self, current_version: str, new_version: str,
canary_percentage: int = 10):
"""Canary deployment"""
.deploy_canary(new_version, canary_percentage)
metrics = .monitor_canary_metrics(duration_minutes=)
metrics[] < metrics[] < :
percentage [, , , ]:
.update_canary_traffic(percentage)
time.sleep()
.check_health():
.rollback(current_version)
()
:
.rollback(current_version)
()
():
instances = .get_instances()
i (, (instances), batch_size):
batch = instances[i:i + batch_size]
instance batch:
.update_instance(instance, version)
.wait_for_healthy(instance)
.check_health():
()
()
():
{
: feature_name,
: enabled,
: rollout_percentage,
: {
: [] rollout_percentage < []
}
}
from typing import Dict, Any
import yaml
import json
class ConfigurationManager:
"""Manage application configuration"""
def __init__(self, environment: str):
self.environment = environment
self.config = {}
def load_config(self, config_file: str):
"""Load configuration from file"""
with open(config_file, 'r') as f:
if config_file.endswith('.yaml') or config_file.endswith('.yml'):
self.config = yaml.safe_load(f)
elif config_file.endswith('.json'):
self.config = json.load(f)
def get(self, key: str, default: Any = None) -> Any:
"""Get configuration value"""
keys = key.split('.')
value = self.config
for k in keys:
if isinstance(value, dict):
value = value.get(k)
:
default
value :
default
value
():
.config = ._deep_merge(.config, env_config)
() -> :
result = base.copy()
key, value override.items():
key result (result[key], ) (value, ):
result[key] = ._deep_merge(result[key], value)
:
result[key] = value
result
() -> []:
missing = []
key required_keys:
.get(key) :
missing.append(key)
missing
import logging
from opencensus.ext.azure import metrics_exporter
from opencensus.stats import aggregation as aggregation_module
from opencensus.stats import measure as measure_module
from opencensus.stats import stats as stats_module
from opencensus.stats import view as view_module
from opencensus.tags import tag_map as tag_map_module
class ObservabilityStack:
"""Implement observability best practices"""
def __init__(self):
self.logger = self._setup_logging()
self.stats = stats_module.stats
self.view_manager = self.stats.view_manager
def _setup_logging(self) -> logging.Logger:
"""Setup structured logging"""
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter(
'{"time": "%(asctime)s", "level": "%(levelname)s", '
'"service": "%(name)s", "message": "%(message)s"}'
)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.INFO)
return logger
def log_with_context(self, level: str, message: str, **context):
log_func = (.logger, level)
log_func(message, extra=context)
():
():
❌ Manual deployments ❌ Configuration drift ❌ No automated testing ❌ Long-lived feature branches ❌ Blame culture ❌ Siloed teams ❌ Ignoring technical debt