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

encore

Encoreは、クラウドバックエンドアプリケーションを構築するためのフレームワークで、API定義、データベース、メッセージング、自動インフラ構築などの機能を備え、安全な型付けで開発効率を高めるSkill。

📜 元の英語説明(参考)

Build cloud backend applications with Encore — type-safe backend framework with built-in infrastructure. Use when someone asks to "build a backend", "Encore", "type-safe API framework", "backend with built-in infra", "auto-provision cloud resources", or "backend framework with databases built-in". Covers API definition, databases, pub/sub, cron, and auto-provisioned infrastructure.

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

一言でいうと

Encoreは、クラウドバックエンドアプリケーションを構築するためのフレームワークで、API定義、データベース、メッセージング、自動インフラ構築などの機能を備え、安全な型付けで開発効率を高めるSkill。

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して encore.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → encore フォルダができる
  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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Encore

概要

Encore は、インフラストラクチャがコードの一部となるバックエンドフレームワークです。API エンドポイントを定義すると、Encore がクラウドのリソースを自動的にプロビジョニングします。データベース、pub/sub、cron ジョブ、およびキャッシュは、Terraform ファイルではなく、TypeScript/Go コードで宣言されます。Encore はアプリケーションのアーキテクチャを理解し、コードからインフラストラクチャ、API ドキュメント、およびアーキテクチャ図を生成します。ローカル開発は、本番環境を正確に反映します。

どのような時に使うか

  • インフラストラクチャを手動で管理せずにクラウドバックエンドを構築したい場合
  • 自動ドキュメントを備えたタイプセーフな API が必要な場合
  • データベース、pub/sub、および cron を設定なしで利用したい場合
  • 本番環境にスケールする迅速なプロトタイピングが必要な場合
  • DevOps ではなくビジネスロジックに集中したいチーム

手順

セットアップ

# Encore CLI のインストール (macOS/Linux)
brew install encoredev/tap/encore

# 新しいアプリの作成
encore app create my-app --lang=ts
cd my-app
encore run  # ホットリロードによるローカル開発サーバー

API エンドポイントの定義

// backend/user/user.ts — API エンドポイントはエクスポートされた関数です
import { api } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";

// コードで宣言されたデータベース — Encore が自動的にプロビジョニングします
const db = new SQLDatabase("users", {
  migrations: "./migrations",
});

interface User {
  id: number;
  email: string;
  name: string;
}

// POST /user.create — タイプセーフなリクエスト/レスポンス
export const create = api(
  { method: "POST", path: "/user", expose: true },
  async (params: { email: string; name: string }): Promise<User> => {
    const row = await db.queryRow`
      INSERT INTO users (email, name)
      VALUES (${params.email}, ${params.name})
      RETURNING id, email, name
    `;
    return row!;
  }
);

// GET /user/:id — パスパラメータは型付けされています
export const get = api(
  { method: "GET", path: "/user/:id", expose: true },
  async (params: { id: number }): Promise<User> => {
    const row = await db.queryRow`
      SELECT id, email, name FROM users WHERE id = ${params.id}
    `;
    if (!row) throw new Error("User not found");
    return row;
  }
);

// GET /user — クエリパラメータ付きのリスト
export const list = api(
  { method: "GET", path: "/user", expose: true },
  async (params: { limit?: number; offset?: number }): Promise<{ users: User[] }> => {
    const rows = await db.query`
      SELECT id, email, name FROM users
      ORDER BY id DESC
      LIMIT ${params.limit ?? 20} OFFSET ${params.offset ?? 0}
    `;
    return { users: rows };
  }
);

Pub/Sub

// backend/notifications/notifications.ts — pub/sub によるイベント駆動
import { Topic, Subscription } from "encore.dev/pubsub";

// トピックの宣言 — Encore がメッセージブローカーをプロビジョニングします
export const userCreated = new Topic<{ userId: number; email: string }>("user-created");

// イベントの発行
export async function notifyUserCreated(userId: number, email: string) {
  await userCreated.publish({ userId, email });
}

// イベントのサブスクライブ
const _ = new Subscription(userCreated, "send-welcome-email", {
  handler: async (event) => {
    await sendEmail(event.email, {
      subject: "Welcome!",
      body: "Thanks for signing up.",
    });
  },
});

Cron ジョブ

// backend/reports/cron.ts — スケジュールされたタスク
import { CronJob } from "encore.dev/cron";

// 毎日午前 9 時 (UTC) に実行 — Encore がスケジュールを処理します
const dailyReport = new CronJob("daily-report", {
  title: "Generate Daily Report",
  schedule: "0 9 * * *",
  endpoint: generateReport,
});

export const generateReport = api(
  { method: "POST", path: "/reports/daily" },
  async (): Promise<{ generated: boolean }> => {
    const stats = await db.query`SELECT ...`;
    await sendSlackReport(stats);
    return { generated: true };
  }
);

デプロイ

# Encore Cloud へのデプロイ (すべてのインフラストラクチャを自動プロビジョニング)
git push encore main

# または Docker でセルフホスト
encore build docker my-app:latest
docker run my-app:latest

例 1: SaaS バックエンドの構築

ユーザープロンプト: 「ユーザー、プロジェクト、およびリアルタイム更新を備えたプロジェクト管理ツールのバックエンドを構築してください。」

エージェントは、データベース、リアルタイムイベント用の pub/sub、および通知用の cron を備えた Encore サービスを定義します。すべてのインフラストラクチャは自動的にプロビジョニングされます。

例 2: サービス間呼び出しによるマイクロサービス

ユーザープロンプト: 「モノリスをタイプセーフな内部通信を備えたマイクロサービスに分割してください。」

エージェントは、型付き関数呼び出し(記述する HTTP クライアントは不要)で相互に呼び出す Encore サービスを作成し、自動トレースとドキュメントを提供します。

ガイドライン

  • インフラストラクチャはコード — データベース、pub/sub、cron は TypeScript で宣言
  • api() はエンドポイント用 — 自動検証によるタイプセーフなリクエスト/レスポンス
  • SQLDatabase はデータベース用 — Encore が Postgres を自動的にプロビジョニング
  • Topic / Subscription はイベント用 — メッセージブローカーの設定なしで pub/sub
  • CronJob はスケジュール用 — コードで宣言すると、Encore が実行を処理
  • encore run はローカル開発用 — 本番環境を正確に反映
  • 自動生成ドキュメント — 型定義からの API ドキュメント
  • アーキテクチャ図 — Encore がサービスグラフを理解
  • 組み込みのトレース — 設定なしでサービス全体の分散トレース
  • expose: true はパブリック API 用 — 内部サービスはデフォルトでプライベート
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Encore

Overview

Encore is a backend framework where infrastructure is part of the code — define an API endpoint and Encore provisions the cloud resources automatically. Databases, pub/sub, cron jobs, and caching are declared in your TypeScript/Go code, not in Terraform files. Encore understands your application architecture and generates infrastructure, API documentation, and architecture diagrams from the code. Local development mirrors production exactly.

When to Use

  • Building cloud backends without managing infrastructure manually
  • Want type-safe APIs with automatic documentation
  • Need databases, pub/sub, and cron without configuring them
  • Rapid prototyping that scales to production
  • Teams that want to focus on business logic, not DevOps

Instructions

Setup

# Install Encore CLI (macOS/Linux)
brew install encoredev/tap/encore

# Create a new app
encore app create my-app --lang=ts
cd my-app
encore run  # Local dev server with hot reload

Define API Endpoints

// backend/user/user.ts — API endpoints are just exported functions
import { api } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";

// Database declared in code — Encore provisions it automatically
const db = new SQLDatabase("users", {
  migrations: "./migrations",
});

interface User {
  id: number;
  email: string;
  name: string;
}

// POST /user.create — Type-safe request/response
export const create = api(
  { method: "POST", path: "/user", expose: true },
  async (params: { email: string; name: string }): Promise<User> => {
    const row = await db.queryRow`
      INSERT INTO users (email, name)
      VALUES (${params.email}, ${params.name})
      RETURNING id, email, name
    `;
    return row!;
  }
);

// GET /user/:id — Path parameters are typed
export const get = api(
  { method: "GET", path: "/user/:id", expose: true },
  async (params: { id: number }): Promise<User> => {
    const row = await db.queryRow`
      SELECT id, email, name FROM users WHERE id = ${params.id}
    `;
    if (!row) throw new Error("User not found");
    return row;
  }
);

// GET /user — List with query params
export const list = api(
  { method: "GET", path: "/user", expose: true },
  async (params: { limit?: number; offset?: number }): Promise<{ users: User[] }> => {
    const rows = await db.query`
      SELECT id, email, name FROM users
      ORDER BY id DESC
      LIMIT ${params.limit ?? 20} OFFSET ${params.offset ?? 0}
    `;
    return { users: rows };
  }
);

Pub/Sub

// backend/notifications/notifications.ts — Event-driven with pub/sub
import { Topic, Subscription } from "encore.dev/pubsub";

// Declare a topic — Encore provisions the message broker
export const userCreated = new Topic<{ userId: number; email: string }>("user-created");

// Publish events
export async function notifyUserCreated(userId: number, email: string) {
  await userCreated.publish({ userId, email });
}

// Subscribe to events
const _ = new Subscription(userCreated, "send-welcome-email", {
  handler: async (event) => {
    await sendEmail(event.email, {
      subject: "Welcome!",
      body: "Thanks for signing up.",
    });
  },
});

Cron Jobs

// backend/reports/cron.ts — Scheduled tasks
import { CronJob } from "encore.dev/cron";

// Runs daily at 9 AM UTC — Encore handles scheduling
const dailyReport = new CronJob("daily-report", {
  title: "Generate Daily Report",
  schedule: "0 9 * * *",
  endpoint: generateReport,
});

export const generateReport = api(
  { method: "POST", path: "/reports/daily" },
  async (): Promise<{ generated: boolean }> => {
    const stats = await db.query`SELECT ...`;
    await sendSlackReport(stats);
    return { generated: true };
  }
);

Deploy

# Deploy to Encore Cloud (auto-provisions all infrastructure)
git push encore main

# Or self-host with Docker
encore build docker my-app:latest
docker run my-app:latest

Examples

Example 1: Build a SaaS backend

User prompt: "Build a backend for a project management tool with users, projects, and real-time updates."

The agent will define Encore services with databases, pub/sub for real-time events, and cron for notifications — all infrastructure auto-provisioned.

Example 2: Microservices with service-to-service calls

User prompt: "Split our monolith into microservices with type-safe internal communication."

The agent will create Encore services that call each other with typed function calls (no HTTP clients to write), with automatic tracing and documentation.

Guidelines

  • Infrastructure is code — databases, pub/sub, cron declared in TypeScript
  • api() for endpoints — type-safe request/response with automatic validation
  • SQLDatabase for databases — Encore provisions Postgres automatically
  • Topic / Subscription for events — pub/sub without message broker setup
  • CronJob for schedules — declare in code, Encore handles execution
  • encore run for local dev — mirrors production environment exactly
  • Auto-generated docs — API documentation from your type definitions
  • Architecture diagrams — Encore understands your service graph
  • Tracing built-in — distributed tracing across services without config
  • expose: true for public APIs — internal services are private by default