himiyosh-ucfitness-edge-runtime-instructions.ocm.json json Copy{
"ocm": "1",
"id": "himiyosh-ucfitness-edge-runtime-instructions",
"kind": "skill",
"name": "edge-runtime",
"description": "UCFitness は Cloudflare Pages にデプロイされるため、すべてのルートで Edge Runtime が必須。",
"publisher": "himiyosh",
"version": "1.0.0",
"capabilities": {
"domains": [
"general"
],
"tags": [
"skill-md",
"github-instructions"
],
"languages": [
"en"
]
},
"quality_prior": 0.6,
"examples": [
"UCFitness は Cloudflare Pages にデプロイされるため、すべてのルートで Edge Runtime が必須。"
],
"primary": false,
"metadata": {
"source": {
"provider": "github-instructions",
"repository": "https://github.com/himiyosh/UCFitness",
"path": ".github/instructions/edge-runtime.instructions.md",
"ref": "fa3387023c0763d224bd3b8d3619f8c19e9b5f86",
"url": "https://github.com/himiyosh/UCFitness/blob/fa3387023c0763d224bd3b8d3619f8c19e9b5f86/.github/instructions/edge-runtime.instructions.md",
"key": "himiyosh/UCFitness/.github/instructions/edge-runtime.instructions.md"
},
"applies_to": "app/**/page.tsx,app/**/route.ts"
},
"instructions": "# Edge Runtime & Cloudflare Pages 互換性\r\n\r\nUCFitness は Cloudflare Pages にデプロイされるため、すべてのルートで Edge Runtime が必須。\r\n\r\n## 必須宣言\r\n\r\nファイル先頭に必ず以下を記載(import の前):\r\n\r\n```ts\r\nexport const runtime = \"edge\";\r\n```\r\n\r\n- `layout.tsx` には不要(ページと API ルートのみ)\r\n- 新規ファイル作成時は最初の行に必ず追加\r\n\r\n## Node.js 専用 API の使用禁止\r\n\r\nEdge Runtime では以下は使用不可:\r\n\r\n- `fs`, `path`, `child_process` — 代替手段を使うこと\r\n- `Buffer.from()` → `btoa()` / `atob()` を使用\r\n- `crypto` → Web Crypto API (`crypto.subtle`) を使用\r\n- `process.env` は使用可能(ただし動的アクセスは不可)\r\n\r\n## ビルド検証\r\n\r\n- push 前に `npx tsc --noEmit` で型チェック(キャッシュ破損しない)\r\n- `npx next build` を実行した後は、必ず `.next` ディレクトリを",
"cost": {
"context_tokens": 211
}
}