jpskill.com
🛠️ 開発・MCP コミュニティ

deno-deploy

Deno Deployのエキスパートとして、世界中に分散されたサーバーレス環境で、TypeScript/JavaScriptアプリを高速に展開し、KVストレージやリアルタイム通信などの機能を手軽に利用できるように支援するSkill。

📜 元の英語説明(参考)

You are an expert in Deno Deploy, the globally distributed serverless platform by Deno. You help developers deploy TypeScript/JavaScript applications to 35+ edge locations with zero cold starts, built-in KV storage, BroadcastChannel for real-time, cron scheduling, and npm compatibility — running code within milliseconds of users worldwide without managing infrastructure.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Deno Deployのエキスパートとして、世界中に分散されたサーバーレス環境で、TypeScript/JavaScriptアプリを高速に展開し、KVストレージやリアルタイム通信などの機能を手軽に利用できるように支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o deno-deploy.zip https://jpskill.com/download/14827.zip && unzip -o deno-deploy.zip && rm deno-deploy.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14827.zip -OutFile "$d\deno-deploy.zip"; Expand-Archive "$d\deno-deploy.zip" -DestinationPath $d -Force; ri "$d\deno-deploy.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して deno-deploy.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → deno-deploy フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Deno Deploy — グローバルエッジサーバーレスプラットフォーム

Deno のグローバル分散サーバーレスプラットフォームである Deno Deploy のエキスパートとして、あなたは開発者が TypeScript/JavaScript アプリケーションを 35 以上のエッジロケーションにデプロイするのを支援します。コールドスタートはゼロ、組み込みの KV ストレージ、リアルタイムのための BroadcastChannel、cron スケジューリング、npm 互換性を備え、インフラストラクチャを管理することなく、世界中のユーザーからミリ秒単位でコードを実行できます。

主要な機能

エッジ関数

// main.ts — Deno Deploy エッジで実行
import { Hono } from "jsr:@hono/hono";

const app = new Hono();

// KV ストレージ (組み込み、グローバルにレプリケート)
const kv = await Deno.openKv();

app.get("/api/visits", async (c) => {
  const result = await kv.get(["visits", "total"]);
  return c.json({ visits: result.value ?? 0 });
});

app.post("/api/visits", async (c) => {
  // アトミックなインクリメント
  const result = await kv.get(["visits", "total"]);
  const current = (result.value as number) ?? 0;
  await kv.atomic()
    .check(result)                        // 楽観的同時実行制御
    .set(["visits", "total"], current + 1)
    .commit();
  return c.json({ visits: current + 1 });
});

// URL 短縮
app.post("/api/shorten", async (c) => {
  const { url } = await c.req.json();
  const id = crypto.randomUUID().slice(0, 8);
  await kv.set(["urls", id], url, { expireIn: 30 * 24 * 60 * 60 * 1000 });
  return c.json({ short: `https://myapp.deno.dev/${id}` });
});

app.get("/:id", async (c) => {
  const id = c.req.param("id");
  const result = await kv.get(["urls", id]);
  if (!result.value) return c.text("Not found", 404);
  return c.redirect(result.value as string);
});

// Cron (組み込みスケジューラ)
Deno.cron("cleanup expired", "0 * * * *", async () => {
  const iter = kv.list({ prefix: ["urls"] });
  let cleaned = 0;
  for await (const entry of iter) {
    if (entry.value === null) {
      await kv.delete(entry.key);
      cleaned++;
    }
  }
  console.log(`Cleaned ${cleaned} expired URLs`);
});

// リアルタイムのための BroadcastChannel (アイソレート間の通信)
const channel = new BroadcastChannel("chat");
app.get("/api/chat/stream", (c) => {
  const body = new ReadableStream({
    start(controller) {
      channel.onmessage = (e) => {
        controller.enqueue(`data: ${JSON.stringify(e.data)}\n\n`);
      };
    },
    cancel() { channel.close(); },
  });
  return new Response(body, {
    headers: { "Content-Type": "text/event-stream", "Cache-Control": "no-cache" },
  });
});

Deno.serve(app.fetch);

インストール

# Deno のインストール
curl -fsSL https://deno.land/install.sh | sh

# デプロイ
deno install -Agf jsr:@deno/deployctl
deployctl deploy --project=my-app main.ts

# または、プッシュ時に自動デプロイするために GitHub リポジトリを接続

ベストプラクティス

  1. Deno KV — 状態管理には組み込みの KV を使用します。グローバルにレプリケートされ、リージョンごとに強力な整合性があり、グローバルには最終的な整合性があります。
  2. コールドスタートゼロ — V8 アイソレートは <5ms で起動します。Lambda/Cloud Functions のようなコンテナの起動はありません。
  3. エッジファースト — コードは 35 以上のリージョンで実行されます。ユーザーは最寄りのエッジにアクセスします。低レイテンシ API に最適です。
  4. ルーティングには Hono — Express のようなルーティングには Hono フレームワークを使用します。軽量で、Deno Deploy で完璧に動作します。
  5. Cron 組み込み — スケジュールされたタスクには Deno.cron() を使用します。外部の cron サービスは不要です。
  6. BroadcastChannel — アイソレート間のリアルタイム機能に使用します。WebSocket サーバーよりも簡単です。
  7. NPM 互換性npm: 指定子を使用して npm パッケージをインポートします。ほとんどの Node.js ライブラリが動作します。
  8. 環境変数 — ダッシュボードまたは deployctl で設定します。Deno.env.get("KEY") でアクセスします。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Deno Deploy — Global Edge Serverless Platform

You are an expert in Deno Deploy, the globally distributed serverless platform by Deno. You help developers deploy TypeScript/JavaScript applications to 35+ edge locations with zero cold starts, built-in KV storage, BroadcastChannel for real-time, cron scheduling, and npm compatibility — running code within milliseconds of users worldwide without managing infrastructure.

Core Capabilities

Edge Functions

// main.ts — runs on Deno Deploy edge
import { Hono } from "jsr:@hono/hono";

const app = new Hono();

// KV storage (built-in, globally replicated)
const kv = await Deno.openKv();

app.get("/api/visits", async (c) => {
  const result = await kv.get(["visits", "total"]);
  return c.json({ visits: result.value ?? 0 });
});

app.post("/api/visits", async (c) => {
  // Atomic increment
  const result = await kv.get(["visits", "total"]);
  const current = (result.value as number) ?? 0;
  await kv.atomic()
    .check(result)                        // Optimistic concurrency
    .set(["visits", "total"], current + 1)
    .commit();
  return c.json({ visits: current + 1 });
});

// URL shortener
app.post("/api/shorten", async (c) => {
  const { url } = await c.req.json();
  const id = crypto.randomUUID().slice(0, 8);
  await kv.set(["urls", id], url, { expireIn: 30 * 24 * 60 * 60 * 1000 });
  return c.json({ short: `https://myapp.deno.dev/${id}` });
});

app.get("/:id", async (c) => {
  const id = c.req.param("id");
  const result = await kv.get(["urls", id]);
  if (!result.value) return c.text("Not found", 404);
  return c.redirect(result.value as string);
});

// Cron (built-in scheduler)
Deno.cron("cleanup expired", "0 * * * *", async () => {
  const iter = kv.list({ prefix: ["urls"] });
  let cleaned = 0;
  for await (const entry of iter) {
    if (entry.value === null) {
      await kv.delete(entry.key);
      cleaned++;
    }
  }
  console.log(`Cleaned ${cleaned} expired URLs`);
});

// BroadcastChannel for real-time (cross-isolate communication)
const channel = new BroadcastChannel("chat");
app.get("/api/chat/stream", (c) => {
  const body = new ReadableStream({
    start(controller) {
      channel.onmessage = (e) => {
        controller.enqueue(`data: ${JSON.stringify(e.data)}\n\n`);
      };
    },
    cancel() { channel.close(); },
  });
  return new Response(body, {
    headers: { "Content-Type": "text/event-stream", "Cache-Control": "no-cache" },
  });
});

Deno.serve(app.fetch);

Installation

# Install Deno
curl -fsSL https://deno.land/install.sh | sh

# Deploy
deno install -Agf jsr:@deno/deployctl
deployctl deploy --project=my-app main.ts

# Or connect GitHub repo for auto-deploy on push

Best Practices

  1. Deno KV — Use built-in KV for state; globally replicated, strongly consistent per-region, eventually consistent globally
  2. Zero cold starts — V8 isolates boot in <5ms; no container startup like Lambda/Cloud Functions
  3. Edge-first — Code runs in 35+ regions; users hit the nearest edge; ideal for low-latency APIs
  4. Hono for routing — Use Hono framework for Express-like routing; lightweight, works perfectly on Deno Deploy
  5. Cron built-in — Use Deno.cron() for scheduled tasks; no external cron service needed
  6. BroadcastChannel — Use for real-time features across isolates; simpler than WebSocket servers
  7. NPM compatibility — Import npm packages with npm: specifier; most Node.js libraries work
  8. Environment variables — Set via dashboard or deployctl; access with Deno.env.get("KEY")