用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill site-reliability命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | site-reliability |
| description | Practices and principles for designing, building, and operating reliable systems at scale |
| category | devops |
I bridge the gap between development and operations by applying software engineering principles to operations problems. I focus on reliability, scalability, and efficiency through automation, measurement, and continuous improvement.
SLO Definition (YAML):
apiVersion: reliability/v1
kind: ServiceLevelObjective
metadata:
name: api-slo
namespace: production
spec:
service: payment-api
description: "Payment processing API reliability"
indicators:
- name: availability
description: "API responds successfully"
threshold: 99.9
window: 30d
- name: latency_p99
description: "99th percentile response time"
threshold: "500ms"
window: 7d
- name: error_rate
description: "Rate of 5xx errors"
threshold: 0.1
window: 1d
- name: throughput
description: "Successful requests per second"
threshold: 1000
window: 5m
type: minimum
compliance:
Incident Response Runbook:
# Payment API Incident Runbook
## Severity Levels
- **SEV1**: Complete outage, >50% users affected
- **SEV2**: Degraded performance, >20% users affected
- **SEV3**: Minor impact, <5% users affected
- **SEV4**: Potential issue, no user impact
## Initial Response Checklist
- [ ] Acknowledge alert within 15 minutes
- [ ] Determine severity level
- [ ] Declare incident in status page
- [ ] Create incident channel in Slack
- [ ] Notify on-call engineers
## Common Issues
### Database Connection Pool Exhaustion
**Symptoms**: 503 errors, connection timeouts
**Diagnosis**:
```bash
kubectl exec -it postgres-0 -- psql -c "SELECT count(*) FROM pg_stat_activity;"
Remediation:
kubectl rollout restart deployment/payment-apiSymptoms: P99 > 2s, increased error rates Diagnosis:
# Check recent traces
jaeger-query --service=payment-api --operation=processPayment --lookback=1h
Remediation:
# Rollback to previous version
kubectl rollout undo deployment/payment-api
# Or rollback to specific image
kubectl set image deployment/payment-api payment-api=registry.io/payment:v1.2.3
**Toil Reduction Automation (Python):**
```python
#!/usr/bin/env python3
"""
Automated operational tasks to reduce toil
"""
import boto3
import subprocess
from datetime import datetime, timedelta
class OperationalAutomation:
def __init__(self):
self.ec2 = boto3.client('ec2')
self.s3 = boto3.client('s3')
self.k8s = subprocess.run(
['kubectl', 'config', 'view', '-o', 'json'],
capture_output=True, text=True
)
def cleanup_old_log_files(self):
"""Delete log files older than 30 days"""
cutoff = datetime.now() - timedelta(days=30)
result = subprocess.run(
['find', '/var/log', '-name', '*.log', '-mtime', '+30', '-delete'],
capture_output=True
)
return f"Cleaned logs older than {cutoff}"
def rotate_kubernetes_secrets(self):
"""Rotate service account tokens that are expiring"""
result = subprocess.run(
['kubectl', 'get', 'secrets', '-A', '-o', 'json'],
capture_output=True, text=True
)
# Check for secrets older than 90 days and rotate
return "Secret rotation complete"
def scale_down_non_production(self):
"""Scale non-production workloads during off-hours"""
clusters = self.ec2.describe_instances(
Filters=[
{'Name': 'tag:Environment', 'Values': ['staging', 'development']},
{'Name': 'instance-state-name', 'Values': ['running']}
]
)
for instance in clusters['Reservations']:
# Implement scale-down logic
pass
return "Non-production environments scaled down"
def generate_capacity_report(self):
"""Generate weekly capacity utilization report"""
metrics = {
'cpu_utilization': [],
'memory_utilization': [],
'storage_iops': [],
'network_throughput': []
}
# Collect metrics across all services
return metrics
def detect_anomalies(self):
"""Detect operational anomalies using statistical analysis"""
# Implement anomaly detection
return {
'anomalies_detected': 0,
'requires_attention': []
}
def run_automated_remediation(self):
"""Run scheduled automated remediation tasks"""
tasks = [
self.cleanup_old_log_files,
self.rotate_kubernetes_secrets,
self.scale_down_non_production,
self.detect_anomalies
]
results = []
for task in tasks:
try:
result = task()
results.append({'task': task.__name__, 'status': 'success', 'result': result})
except Exception as e:
results.append({'task': task.__name__, 'status': 'failed', 'error': str(e)})
return results
if __name__ == "__main__":
automation = OperationalAutomation()
automation.run_automated_remediation()