pocketbase
PocketBaseというSQLite内蔵の単一バイナリBackendを活用し、MVP開発やAPI試作、コレクション設定、認証フロー構築などを手軽に行えるように支援するSkill。
📜 元の英語説明(参考)
Assists with building backends using PocketBase, a single-binary backend with embedded SQLite, real-time subscriptions, file storage, and authentication. Use when creating MVPs, prototyping APIs, configuring collections, or setting up auth flows. Trigger words: pocketbase, backend, sqlite, real-time, single binary, collections, pb.
🇯🇵 日本人クリエイター向け解説
PocketBaseというSQLite内蔵の単一バイナリBackendを活用し、MVP開発やAPI試作、コレクション設定、認証フロー構築などを手軽に行えるように支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o pocketbase.zip https://jpskill.com/download/15266.zip && unzip -o pocketbase.zip && rm pocketbase.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15266.zip -OutFile "$d\pocketbase.zip"; Expand-Archive "$d\pocketbase.zip" -DestinationPath $d -Force; ri "$d\pocketbase.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
pocketbase.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
pocketbaseフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
PocketBase
概要
PocketBase は、単一のバイナリとしてパッケージ化されたオープンソースのバックエンドであり、組み込みの SQLite データベース、リアルタイムサブスクリプション、ファイルストレージ、および組み込みの認証機能を提供します。コレクションに対して REST API を自動生成し、最小限のインフラストラクチャの複雑さでフルスタックアプリケーションを構築するのに最適です。
手順
- コレクションを定義する際は、適切なタイプを選択してください。標準的な CRUD には base コレクション、メール/パスワードと OAuth2 によるユーザー管理には auth コレクション、読み取り専用の SQL バックアップクエリには view コレクションを使用します。
- クライアント統合を構築する際は、JavaScript/TypeScript SDK を使用し、クエリには
pb.collection("name").getList()、リアルタイム更新には.subscribe()、単一のリクエストで関連データを取得するにはexpandパラメータを使用します。 - 権限を構成する際は、行レベルのセキュリティのために
@request.auth.id = user.idのようなフィルタ構文を使用して、すべてのコレクション (listRule、viewRule、createRule、updateRule、deleteRule) に API ルールを設定します。 - 機能を拡張する際は、ビジネスロジックには JavaScript フック (
onBeforeCreateRecord、onAfterUpdateRecord)、カスタムルートにはrouterAdd()、cron ジョブにはcronAdd()を追加します。 - デプロイする際は、
./pocketbase serveで単一のバイナリを実行し、pb_data/を Docker ボリュームとしてマウントし、HTTPS 終端には Caddy または Nginx を使用します。 - バックアップする際は、移行を実行する前に
pb_data/ディレクトリをコピーするか、組み込みのバックアップ API を使用します。 - スケーリングする際は、SQLite は約 50,000 の同時読み取りを処理することに注意してください。1 日あたり 10 万を超えるアクティブユーザーの書き込み負荷の高いワークロードの場合は、PostgreSQL の代替手段を検討してください。
例
例 1: 認証付きの MVP バックエンドを構築する
ユーザーリクエスト: "ユーザー認証と投稿コレクションを備えた PocketBase バックエンドをセットアップする"
アクション:
- メール/パスワードと Google OAuth2 を使用して、ユーザー用の auth コレクションを作成する
- タイトル、本文、およびユーザーへのリレーションを持つ投稿コレクションを作成する
- API ルールを設定する: 誰でもリスト/表示でき、認証された作成者のみが自分の投稿を作成/更新/削除できる
- クライアント側の CRUD および認証フロー用に JS SDK を構成する
出力: 認証、権限、および自動生成された REST API を備えた完全に機能するバックエンド。
例 2: リアルタイム機能を追加する
ユーザーリクエスト: "PocketBase を使用してチャットアプリケーションのライブアップデートを有効にする"
アクション:
- テキスト、送信者のリレーション、およびルームフィールドを持つメッセージコレクションを作成する
pb.collection("messages").subscribe("*", callback)で SSE サブスクリプションを設定する- ルームベースのアクセス制御用に API ルールを構成する
- 指数バックオフでクライアントの自動再接続を処理する
出力: Server-Sent Events を介したライブメッセージ配信を備えたリアルタイムチャットバックエンド。
ガイドライン
- 常にすべてのコレクションに API ルールを設定してください。デフォルトは管理者専用 (
null) であり、クライアントアクセスを中断します。 - 関連データには、複数の API 呼び出しの代わりに
expandパラメータを使用してください。 - スキーマ検証を超えたビジネスロジックについては、フック (
onBeforeCreateRecord) で入力を検証します。 - SQLite の移行は不可逆的であるため、移行前に
pb_data/をバックアップしてください。 - クライアント側の結合の代わりに、複雑なクエリには view コレクションを使用してください。
- フックは軽量に保ちます。負荷の高い処理は、非同期または cron ジョブで実行する必要があります。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
PocketBase
Overview
PocketBase is an open-source backend packaged as a single binary, providing an embedded SQLite database, real-time subscriptions, file storage, and built-in authentication. It auto-generates REST APIs for collections and is ideal for shipping full-stack applications with minimal infrastructure complexity.
Instructions
- When defining collections, choose the appropriate type: base collections for standard CRUD, auth collections for user management with email/password and OAuth2, and view collections for read-only SQL-backed queries.
- When building client integrations, use the JavaScript/TypeScript SDK with
pb.collection("name").getList()for queries,.subscribe()for real-time updates, andexpandparameter for fetching related data in a single request. - When configuring permissions, set API rules on every collection (
listRule,viewRule,createRule,updateRule,deleteRule) using filter syntax like@request.auth.id = user.idfor row-level security. - When extending functionality, add JavaScript hooks (
onBeforeCreateRecord,onAfterUpdateRecord) for business logic, custom routes withrouterAdd(), and cron jobs withcronAdd(). - When deploying, run the single binary with
./pocketbase serve, mountpb_data/as a Docker volume, and use Caddy or Nginx for HTTPS termination. - When backing up, copy the
pb_data/directory or use the built-in backup API before running migrations. - When scaling, note that SQLite handles approximately 50,000 concurrent reads; for write-heavy workloads exceeding 100K daily active users, consider PostgreSQL alternatives.
Examples
Example 1: Build an MVP backend with authentication
User request: "Set up a PocketBase backend with user auth and a posts collection"
Actions:
- Create an auth collection for users with email/password and Google OAuth2
- Create a posts collection with title, body, and relation to users
- Set API rules: anyone can list/view, only authenticated authors can create/update/delete their own posts
- Configure the JS SDK for client-side CRUD and auth flows
Output: A fully functional backend with auth, permissions, and auto-generated REST API.
Example 2: Add real-time features
User request: "Enable live updates for a chat application using PocketBase"
Actions:
- Create a messages collection with text, sender relation, and room field
- Set up SSE subscription with
pb.collection("messages").subscribe("*", callback) - Configure API rules for room-based access control
- Handle client auto-reconnect with exponential backoff
Output: A real-time chat backend with live message delivery via Server-Sent Events.
Guidelines
- Always set API rules on every collection; default is admin-only (
null), which breaks client access. - Use
expandparameter instead of multiple API calls for related data. - Validate inputs in hooks (
onBeforeCreateRecord) for business logic beyond schema validation. - Back up
pb_data/before migrations since SQLite migrations are irreversible. - Use view collections for complex queries instead of client-side joins.
- Keep hooks lightweight; heavy processing should run async or in cron jobs.