用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill edge-computing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | edge-computing |
| description | Edge computing architecture and implementation |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"architect, devops-engineer","category":"devops"} |
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ IoT │ │ Edge │ │ Cloud │
│ Devices │────►│ Node │────►│ Backend │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
│ ┌─────▼─────┐ │
│ │ Local │ │
└───────────►│ Storage │ │
└────────────┘ │
┌────────────┐ │
│ Analytics │ │
└────────────┘ │
// Edge computing with Cloudflare Workers
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const url = new URL(request.url)
// A/B testing at edge
const bucket = Math.random() < 0.5 ? 'a' : 'b'
// Transform response
const response = await fetch(request)
const headers = new Headers(response.headers)
headers.set('X-Edge-Bucket', bucket)
return new Response(response.body, {
status: response.status,
headers
})
}
// KV storage at edge
export async function onRequest(context) {
const cache = await context.env.CACHE.get('data')
(cache) (cache)
response = ()
text = response.()
context...(, text, { : })
(text)
}
// Lambda@Edge function
exports.handler = async (event) => {
const request = event.Records[0].cf.request
// Add security headers
request.headers['strict-transport-security'] = [{
key: 'Strict-Transport-Security',
value: 'max-age=31536000; includeSubDomains'
}]
// Redirect based on country
const country = request.headers['cloudfront-viewer-country'][0].value
if (country === 'EU') {
request.uri = '/eu' + request.uri
}
return request
}
apiVersion: v1
kind: Pod
metadata:
name: edge-node
spec:
nodeSelector:
node-type: edge
tolerations:
- key: "edge"
operator: "Equal"
value: "true"
effect: "NoSchedule"
containers:
- name: edge-app
image: edge-app:latest
resources:
limits:
cpu: "500m"
memory: "512Mi"
# Kubernetes Federation
apiVersion: core.kubefed.io/v1beta1
kind: KubeFedConfig
metadata:
name: kubefed
spec:
scope: Namespaced
controllerDuration:
availableDelay: 20s
unavailableDelay: 60s
leaderElect:
leaseDuration: 15s
renewDeadline: 10s
retryPeriod: 5s
resourceLock: configmaps
featureGates:
- name: PushReconciler
configuration: Enabled
- name: SchedulerPreferences
configuration: Enabled