← スキル一覧に戻る

cloudflare-workers
by jonit-dev
⭐ 0🍴 0📅 2026年1月21日
SKILL.md
name: cloudflare-workers description: Optimize code for Cloudflare Workers free plan with 10ms CPU limit. Use when writing API routes, server code, middleware, or discussing performance optimization.
Cloudflare Workers Optimization
Constraints
- 10ms CPU limit on free plan (not wall-clock time)
- No heavy computation in request handlers
- No blocking operations
Patterns
Prefer Streaming
// Good: Stream response
return new Response(readableStream, {
headers: { 'Content-Type': 'application/octet-stream' },
});
// Bad: Buffer entire response
const data = await fetchAllData();
return new Response(JSON.stringify(data));
Delegate to Client
Move these to browser when safe:
- Image manipulation (canvas API)
- Complex calculations
- Data transformations
- Sorting/filtering large datasets
Efficient Algorithms
- Use early returns
- Avoid nested loops on large datasets
- Use Map/Set for O(1) lookups
- Paginate database queries
Async Patterns
// Good: Parallel fetches
const [user, settings] = await Promise.all([getUser(id), getSettings(id)]);
// Bad: Sequential fetches
const user = await getUser(id);
const settings = await getSettings(id);
Response Caching
return new Response(body, {
headers: {
'Cache-Control': 'public, max-age=3600',
'CDN-Cache-Control': 'max-age=86400',
},
});
Anti-patterns
- Synchronous crypto operations
- Large JSON parsing in hot paths
- Regex on untrusted input without limits
- Deep object cloning
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です