> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # 概要 このリファレンスでは、既存の Mastra templates の使用方法と独自 template の作成方法を説明します。コミュニティエコシステムへの template のコントリビューションについても扱います。 Mastra templates は、特定のユースケースやパターンを示す構築済みのプロジェクト構成です。次のものを提供します。 - **動作するサンプル**:完全に機能する Mastra アプリケーション - **ベストプラクティス**:適切なプロジェクト構成とコーディング規約 - **学習リソース**:実際の実装を通じて Mastra のパターンを学習 - **クイックスタート**:ゼロから構築するよりも素早くプロジェクトを開始 ## 利用可能な templates 次の templates は、Gateway を中心とした Mastra アプリケーションを紹介します。 - `template-docs-expert`:Gateway の Web 検索、引用、Memory、構造化レスポンスを使用してドキュメントの質問に回答します。 - `template-browser-agent`:AgentBrowser を使用して Web ページを閲覧、調査、操作します。 - `template-meeting-notes`:Zoom の文字起こしやアップロードされた文字起こしから、決定事項とアクション項目を含む構造化ノートを作成します。 - `template-company-knowledge`:Linear と Notion のコンテンツを pgvector にインデックス化し、社内ナレッジに関する質問に回答します。 - `template-claw-assistant`:ファイルシステム、Sandbox、ブラウザー、Web 検索 Tool を備えた Workspace を操作します。 ## Templates の使用 ### インストール `create-mastra` コマンドで template をインストールします。 **npm**: ```sh npx create-mastra@latest my-project --template template-name ``` **pnpm**: ```sh pnpm dlx create-mastra@latest my-project --template template-name ``` **Yarn**: ```sh yarn dlx create-mastra@latest my-project --template template-name ``` **Bun**: ```sh bun x create-mastra@latest my-project --template template-name ``` このコマンドは完全なプロジェクトを作成し、依存関係をインストールします。モデル、Provider の依存関係、環境変数、ソースコードは template の作成者が管理します。 ### セットアップ手順 インストール後、次の手順を実行します。 1. **プロジェクトディレクトリに移動**: ```bash cd your-project-name ``` 2. **環境変数を設定**: ```bash cp .env.example .env ``` template の README に従って、必要な API キーを `.env` に設定します。 3. **開発サーバーを起動**: **npm**: ```sh npm run dev ``` **pnpm**: ```sh pnpm run dev ``` **Yarn**: ```sh yarn dev ``` **Bun**: ```sh bun run dev ``` ### Template の構成 すべての templates は、次の標準構成に従います。 ```text your-template/ ├── src/ │ └── mastra/ │ ├── agents/ # Agent definitions │ ├── tools/ # Tool definitions │ ├── workflows/ # Workflow definitions │ └── index.ts # Main Mastra config ├── .env.example # Required environment variables ├── package.json ├── tsconfig.json └── README.md ```