mcpField
C
cms-collection-setup

cms-collection-setup

github.com/webflowデータ・データベース132337 回インストール6 日前に更新
リポジトリ

cms-collection-setup について

Webflow CMS コレクションを設定するためのワークフロースキルです。サイトやプランの確認、スキーマ設計、承認後の作成と検証をエージェントに案内します。

主な機能

  1. 01サイトとプラン上限の確認
  2. 02フィールド型と関係の設計
  3. 03スキーマを提示して承認を待機
  4. 04フィールド作成とコレクション検証

活用シーン

  1. 01カスタムフィールド付き CMS コレクションの作成
  2. 02オプション、参照、複数参照フィールドの設定

MCP 対応

Webflow の操作には、サイトやコレクションの確認、作成、検証を含め、Webflow MCP ツールを使用するよう定めています。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/webflow/webflow-skills --skill cms-collection-setup

インストール後、Claude Code で/cms-collection-setupを入力して読み込まれたか確認します。

詳細

CMS コレクションの設定

カスタムフィールド、リレーションシップ、適切な設定を備えた新しい CMS コレクションを作成します。

重要な注意事項

すべての操作には、必ず Webflow MCP ツールを使用してください。

  • 開始前にベストプラクティスを確認するには、Webflow MCP の webflow_guide_tool を使用してください
  • 利用可能なサイトを特定するには、アクション list_sites を指定して Webflow MCP の data_sites_tool を使用してください
  • サイトの詳細とプランの上限を取得するには、アクション get_site を指定して Webflow MCP の data_sites_tool を使用してください
  • 名前の競合を確認するには、アクション get_collection_list を指定して Webflow MCP の data_cms_tool を使用してください
  • コレクションを作成するには、アクション create_collection を指定して Webflow MCP の data_cms_tool を使用してください
  • 静的フィールドを作成するには、アクション create_collection_static_field を指定して Webflow MCP の data_cms_tool を使用してください
  • オプションフィールドを作成するには、アクション create_collection_option_field を指定して Webflow MCP の data_cms_tool を使用してください
  • 参照/複数参照フィールドを作成するには、アクション create_collection_reference_field を指定して Webflow MCP の data_cms_tool を使用してください
  • コレクションが正しく作成されたことを確認するには、アクション get_collection_details を指定して Webflow MCP の data_cms_tool を使用してください
  • Webflow の操作に、その他のツールや方法を使用しないでください
  • すべてのツール呼び出しには、必須の context パラメーターを含めてください(15~25 語、三人称の視点)

手順

フェーズ 1:サイトの選択と確認
  1. サイト情報を取得する:対象サイトを特定するには、アクション list_sites を指定して Webflow MCP の data_sites_tool を使用します
  2. サイトを確認する:利用可能なサイトが複数ある場合は、ユーザーに選択を求めます
  3. プランの上限を確認する:コレクションの上限を確認するには、アクション get_site を指定して Webflow MCP の data_sites_tool を使用します
  4. 既存のコレクションを一覧表示する:競合を確認するには、アクション get_collection_list を指定して Webflow MCP の data_cms_tool を使用します
  5. 名前を検証する:新しいコレクション名が既存の名前と競合しないことを確認します
フェーズ 2:要件の確認
  1. コレクションの詳細を確認する:ユーザーに次の情報を尋ねます。
    • コレクションの表示名(例:「ブログ記事」)
    • 単数形の名前(例:「ブログ記事」)
    • 任意:カスタムスラッグ(デフォルト:表示名から自動生成)
  2. フィールド定義を確認する:各フィールドについて、次の情報を集めます。
    • フィールド名(例:「著者名」「公開日」)
    • フィールドタイプ(テキスト、リッチテキスト、画像、オプション、参照など)
    • 必須か任意か
    • 検証ルールやヘルプテキスト
  3. リレーションシップを特定する:コレクションに次のフィールドが必要かどうかを判断します。
    • 参照フィールド(一対多のリレーションシップ)
    • 複数参照フィールド(多対多のリレーションシップ)
    • オプションフィールド(制御語彙)
フェーズ 3:スキーマの検証と計画
  1. フィールドタイプを検証する:すべてのフィールドタイプがサポートされていることを確認します
  2. フィールド数の上限を確認する:Webflow の上限内であることを確認します。
    • コレクションあたりの最大フィールド数:プランによって異なります
    • コレクションあたりの複数参照フィールドは最大 5 個です
  3. 作成順序を計画する:フィールドを依存関係に応じて整理します。
    • 参照がある場合は、コレクションを順番に作成します
    • 参照先のコレクションを先に作成します
    • 参照フィールドより先にオプションフィールドを作成します
  4. プレビューを生成する:すべてのフィールドを含む完全なスキーマを表示します
フェーズ 4:ユーザーの承認
  1. 完全なプレビューを表示する:次の内容を表示します。
    • コレクション名とスラッグ
    • タイプとプロパティを含むすべてのフィールド
    • 他のコレクションとのリレーションシップ
    • プランの上限の確認結果
  2. スキーマを検証する:次のような一般的な問題がないか確認します。
    • 必須フィールドの不足(名前とスラッグは常に必須です)
    • 無効なフィールドタイプ
    • 存在しないコレクションへの参照
    • プランの上限超過
  3. 確認を求める:「create」という明示的な承認を待ちます
フェーズ 5:コレクションの作成
  1. コレクションを作成する:次の内容を指定し、アクション create_collection を指定して Webflow MCP の data_cms_tool を使用します。
    • 表示名
    • 単数形の名前
    • 任意のスラッグ
  2. コレクション ID を保存する:フィールド作成に使用するため、ID を保存します
  3. 進行状況を表示する:コレクションが正常に作成されたことを報告します
フェーズ 6:フィールドの作成
  1. フィールドを順番に作成:各フィールドについて、以下を行います。
    • タイプに応じた適切な作成ツールを使用します
    • 静的フィールド:アクション create_collection_static_field を指定した data_cms_tool
    • オプションフィールド:アクション create_collection_option_field を指定した data_cms_tool
    • 参照フィールド:アクション create_collection_reference_field を指定した data_cms_tool
  2. フィールドのプロパティを設定:
    • 表示名
    • 必須フラグ
    • ヘルプテキスト(指定されている場合)
    • バリデーションルール(該当する場合)
  3. 進行状況を表示:作成した各フィールドを報告します
  4. エラーに対処:フィールドの作成に失敗した場合は、報告して続行します
フェーズ 7:検証とレポート
  1. コレクションを検証:Webflow MCP の data_cms_tool でアクション get_collection_details を使用し、スキーマ全体を取得します
  2. すべてのフィールドを確認:リクエストされたフィールドがすべて作成されていることを確認します
  3. レポートを作成:以下を表示します。
    • コレクション ID
    • コレクション名とスラッグ
    • 作成したすべてのフィールドとその ID
    • エラーまたは警告
  4. 次のステップを提示:以下を提案します。
    • bulk-cms-update を使用して初期アイテムを追加する
    • Designer でコレクションページを作成する
    • 該当する場合はリレーションを設定する

フィールドタイプのリファレンス

静的フィールドタイプ

PlainText - 短いテキスト(最大 256 文字)または長いテキスト

  • 使用例:タイトル、名前、説明、抜粋
  • プロパティ:maxLength バリデーション(短いテキストの場合は 256)
  • 例:「タイトル」、「著者名」、「抜粋」

RichText - HTML 形式のテキスト

  • 使用例:ブログコンテンツ、略歴、記事、長い説明
  • プロパティ:長さの制限なし
  • 例:「投稿コンテンツ」、「略歴」、「説明」

Email - メールアドレス

  • 使用例:問い合わせ先メールアドレス、著者のメールアドレス
  • プロパティ:メール形式のバリデーション
  • 例:「問い合わせ先メールアドレス」、「著者のメールアドレス」

Phone - 電話番号

  • 使用例:連絡先番号
  • プロパティ:E.164 形式
  • 例:「電話番号」、「携帯電話」

Link - 外部 URL または内部リンク

  • 使用例:ウェブサイトのリンク、ソーシャルメディア、外部リソース
  • プロパティ:URL バリデーション
  • 例:「ウェブサイト」、「LinkedIn プロフィール」

Number - 数値

  • 使用例:価格、評価、件数、注文番号
  • プロパティ:整数または小数
  • 例:「価格」、「評価」、「注文」

Image - 単一の画像

  • 使用例:注目画像、写真、サムネイル
  • プロパティ:画像 1 枚あたり最大 4MB
  • 例:「注目画像」、「写真」、「サムネイル」

MultiImage - 複数の画像(最大 25 枚)

  • 使用例:ギャラリー、商品写真
  • プロパティ:最大 25 枚、1 枚あたり 4MB
  • 例:「ギャラリー」、「商品写真」

File - ファイルのアップロード

  • 使用例:PDF、ドキュメント、ダウンロードファイル
  • プロパティ:ファイル 1 つあたり最大 4MB
  • 例:「履歴書 PDF」、「パンフレット」、「マニュアル」

Video - 動画の埋め込み(YouTube/Vimeo)

  • 使用例:動画コンテンツ
  • プロパティ:埋め込み URL
  • 例:「チュートリアル動画」、「デモ」

DateTime - 日付および/または時刻

  • 使用例:公開日、イベントの日付、締め切り
  • プロパティ:ISO 8601 形式
  • 例:「公開日」、「イベントの日付」

Switch - ブール値(true/false)

  • 使用例:注目フラグ、表示切り替え
  • プロパティ:ブール値
  • 例:「注目」、「公開済み」、「有効」

Color - 色の値

  • 使用例:テーマカラー、アクセントカラー、ブランドカラー
  • プロパティ:16 進数形式
  • 例:「ブランドカラー」、「アクセントカラー」
オプションフィールドタイプ

Option - 定義済みリストから選ぶ単一選択肢

  • 使用例:ステータス、カテゴリー、タイプ、優先度
  • プロパティ:オプション名のリスト
  • 例:「ステータス」(下書き、レビュー、公開済み)
  • 作成:オプション配列を指定し、アクション create_collection_option_field を指定した data_cms_tool を使用します

例:

{
  "type": "Option",
  "displayName": "Status",
  "metadata": {
    "options": [
      {"name": "Draft"},
      {"name": "In Review"},
      {"name": "Published"}
    ]
  }
}
Reference フィールドの種類

Reference - 別のコレクション内の1つのアイテムへのリンク(1対多)

  • 用途:Author → Post、Category → Post、Brand → Product
  • プロパティ:参照先コレクションのコレクション ID
  • 例:「Author」(Authors コレクションへの参照)
  • 作成:data_cms_tool を使用し、アクション create_collection_reference_field と collectionId を指定します

MultiReference - 別のコレクション内の複数のアイテムへのリンク(多対多)

  • 用途:Post → Tags、Product → Features、Project → Technologies
  • プロパティ:参照先コレクションのコレクション ID
  • 上限:コレクションごとに最大5つのマルチリファレンスフィールド
  • 例:「Tags」(Tags コレクションへの参照)
  • 作成:data_cms_tool を使用し、アクション create_collection_reference_field と collectionId を指定します

Reference フィールドの例:

{
  "type": "Reference",
  "displayName": "Author",
  "metadata": {
    "collectionId": "abc123..."
  }
}

Multi-Reference フィールドの例:

{
  "type": "MultiReference",
  "displayName": "Tags",
  "metadata": {
    "collectionId": "xyz789..."
  }
}

例

例1:シンプルなブログコレクション

ユーザーのプロンプト:

Create a Blog Posts collection with title, content, author, and publish date

ステップ1:確認

🔍 CMS Collection Setup

Available sites:
1. Company Website
2. Blog Site

Which site? (1/2)

ステップ2:ユーザーがサイトを選択した後

📊 Existing Collections on Company Website:

Currently: 0 collections
Plan limit: 20 collections (CMS Plan)

✅ You have capacity to create new collections.

---

📋 Collection Requirements

Display Name: Blog Posts
Singular Name: Blog Post
Slug: blog-posts (auto-generated)

Fields to create:
1. Title - Text (required)
2. Content - Rich Text (required)
3. Author - Text
4. Publish Date - Date/Time (required)

Is this correct? (yes/no)
If you want to add/modify fields, describe the changes.

ステップ3:プレビュー

📋 Preview: Create "Blog Posts" Collection

Collection:
├── Display Name: Blog Posts
├── Singular Name: Blog Post
├── Slug: blog-posts
└── Site: Company Website

Fields (6 total):
├── name (PlainText, required) ← Auto-created
├── slug (PlainText, required) ← Auto-created
├── title (PlainText, required)
├── content (RichText, required)
├── author (PlainText)
└── publish-date (DateTime, required)

✅ Validation Passed:
- Collection name available
- Within plan limits (0/20 collections)
- All field types valid
- No dependency issues

⚠️ Type "create" to proceed.

ステップ4:作成

🔄 Creating Collection...

✅ Collection created: Blog Posts (ID: 64f1a2b3...)

Adding fields...
├── ✅ title (PlainText)
├── ✅ content (RichText)
├── ✅ author (PlainText)
└── ✅ publish-date (DateTime)

Progress: ████████████████████ 100% (4/4 fields)

🎉 Collection Setup Complete!

Collection: Blog Posts
ID: 64f1a2b3...
Fields: 6 (2 auto-created + 4 custom)

---

💡 Next Steps:
1. Use bulk-cms-update to add initial blog posts
2. Create collection template page in Designer
3. Set up collection list page for blog index
4. Configure SEO settings for dynamic pages
例2:関連付けを含むコレクション

ユーザーのプロンプト:

Create a Products collection with name, price, description, images, brand, and tags

ステップ1:初回の情報収集後

📋 Collection Analysis

I see you want:
- Brand: This should be a reference field
- Tags: This should be a multi-reference field

This requires creating additional collections first:
1. Brands collection
2. Tags collection

Then we can create Products with references to them.

Would you like me to:
A) Create all three collections (Brands, Tags, Products)
B) Just create Products (you'll add relationships later)
C) Modify the requirements

Your choice? (A/B/C)

ステップ2:ユーザーが「A」を選択した後

📋 Preview: Create 3 Collections

---

### 1. Brands Collection

Fields (4 total):
├── name (PlainText, required) ← Auto
├── slug (PlainText, required) ← Auto
├── logo (Image)
└── description (PlainText)

---

### 2. Tags Collection

Fields (3 total):
├── name (PlainText, required) ← Auto
├── slug (PlainText, required) ← Auto
└── color (Color)

---

### 3. Products Collection

Fields (9 total):
├── name (PlainText, required) ← Auto
├── slug (PlainText, required) ← Auto
├── price (Number, required)
├── description (RichText)
├── images (MultiImage)
├── brand (Reference → Brands)
└── tags (MultiReference → Tags)

---

Creation Order:
1. Brands (no dependencies)
2. Tags (no dependencies)
3. Products (references 1 & 2)

✅ Validation:
- All collections available
- Within plan limits (0/20 collections)
- Multi-reference limit: 1/5 ✅
- All dependencies resolvable

⚠️ Type "create" to proceed with all 3 collections.

ステップ3:作成

🔄 Creating Collections...

[1/3] Creating Brands...
✅ Brands collection created (ID: abc123...)
├── ✅ logo (Image)
└── ✅ description (PlainText)

[2/3] Creating Tags...
✅ Tags collection created (ID: def456...)
└── ✅ color (Color)

[3/3] Creating Products...
✅ Products collection created (ID: ghi789...)
├── ✅ price (Number)
├── ✅ description (RichText)
├── ✅ images (MultiImage)
├── ✅ brand (Reference → Brands)
└── ✅ tags (MultiReference → Tags)

Progress: ████████████████████ 100% (3/3 collections)

🎉 All Collections Created!

Summary:
├── Brands (ID: abc123...)
├── Tags (ID: def456...)
└── Products (ID: ghi789...)

---

💡 Next Steps:
1. Add brand items first (use bulk-cms-update)
2. Add tag items (use bulk-cms-update)
3. Then add products with brand/tag references
4. Create collection pages in Designer
例3:オプションフィールドを含むチームメンバー

ユーザーのプロンプト:

Create a Team Members collection with name, role (dropdown: Designer, Developer, Manager), bio, photo, email

ステップ1:プレビュー

📋 Preview: Create "Team Members" Collection

Collection:
├── Display Name: Team Members
├── Singular Name: Team Member
└── Slug: team-members

Fields (7 total):
├── name (PlainText, required) ← Auto
├── slug (PlainText, required) ← Auto
├── role (Option, required)
│   Options:
│   ├── Designer
│   ├── Developer
│   └── Manager
├── bio (RichText)
├── photo (Image)
└── email (Email)

✅ Validation Passed

⚠️ Type "create" to proceed.

ステップ2:作成

🔄 Creating Collection...

✅ Collection created: Team Members (ID: jkl012...)

Adding fields...
├── ✅ role (Option: 3 options)
├── ✅ bio (RichText)
├── ✅ photo (Image)
└── ✅ email (Email)

Progress: ████████████████████ 100% (4/4 fields)

🎉 Collection Setup Complete!

Collection: Team Members
Fields: 6 (2 auto + 4 custom)

Field Details:
- role: Option field with 3 choices
  • Designer
  • Developer
  • Manager

---

💡 Next Steps:
1. Add team member items
2. Create team page in Designer
3. Consider adding:
   - LinkedIn profile (Link field)
   - Years of experience (Number field)
   - Specializations (MultiReference to Skills collection)
例4:複雑な E コマース設定

ユーザーのプロンプト:

Create an e-commerce setup with Products, Categories, Brands, and Features

ステップ1:要件の確認

📋 E-commerce Collection Planning

I'll create 4 collections:

1. **Categories** - Product categories
2. **Brands** - Product brands
3. **Features** - Product features (e.g., "Waterproof", "Wireless")
4. **Products** - Main product catalog

Relationships:
- Product → Category (Reference)
- Product → Brand (Reference)
- Product → Features (MultiReference)

Fields per collection:

**Categories:**
- Name, Slug (auto)
- Description
- Parent Category (self-reference for hierarchy)
- Icon

**Brands:**
- Name, Slug (auto)
- Logo
- Description

**Features:**
- Name, Slug (auto)
- Icon
- Description

**Products:**
- Name, Slug (auto)
- Price
- Sale Price
- Description
- Images (MultiImage)
- Category (Reference → Categories)
- Brand (Reference → Brands)
- Features (MultiReference → Features)
- In Stock (Switch)
- SKU (PlainText)

Is this structure good? (yes/modify/cancel)

ステップ2:プレビュー(ユーザーが「はい」と回答)

📋 Preview: Create E-commerce Collections

---

### Collection 1: Categories

Fields (5 total):
├── name (PlainText, required)
├── slug (PlainText, required)
├── description (PlainText)
├── parent-category (Reference → Categories) ← Self-reference
└── icon (Image)

---

### Collection 2: Brands

Fields (4 total):
├── name (PlainText, required)
├── slug (PlainText, required)
├── logo (Image)
└── description (PlainText)

---

### Collection 3: Features

Fields (4 total):
├── name (PlainText, required)
├── slug (PlainText, required)
├── icon (Image)
└── description (PlainText)

---

### Collection 4: Products

Fields (12 total):
├── name (PlainText, required)
├── slug (PlainText, required)
├── price (Number, required)
├── sale-price (Number)
├── description (RichText)
├── images (MultiImage)
├── category (Reference → Categories)
├── brand (Reference → Brands)
├── features (MultiReference → Features)
├── in-stock (Switch)
└── sku (PlainText)

---

Creation Order:
1. Categories (self-reference OK)
2. Brands (no dependencies)
3. Features (no dependencies)
4. Products (references 1, 2, 3)

✅ Validation:
- Within plan limits (0/20 collections)
- Multi-reference count: 1/5 ✅
- All field types valid
- Self-reference supported

⚠️ Type "create" to proceed with all 4 collections.

ステップ3:進捗を報告しながら作成

🔄 Creating E-commerce Collections...

[1/4] Creating Categories...
✅ Categories created (ID: aaa111...)
Progress: ████████░░░░░░░░░░░░ 25%

[2/4] Creating Brands...
✅ Brands created (ID: bbb222...)
Progress: ████████████░░░░░░░░ 50%

[3/4] Creating Features...
✅ Features created (ID: ccc333...)
Progress: ████████████████░░░░ 75%

[4/4] Creating Products...
✅ Products created (ID: ddd444...)
Progress: ████████████████████ 100%

---

🎉 E-commerce Setup Complete!

Collections Created (4):
├── Categories (ID: aaa111..., 5 fields)
├── Brands (ID: bbb222..., 4 fields)
├── Features (ID: ccc333..., 4 fields)
└── Products (ID: ddd444..., 12 fields)

Relationships Configured:
- Products → Categories (one-to-many)
- Products → Brands (one-to-many)
- Products → Features (many-to-many)
- Categories → Parent Category (self-reference)

---

💡 Recommended Content Order:
1. Add categories first (including parent relationships)
2. Add brands
3. Add features
4. Finally add products (with all references)

💡 Next Steps:
1. Use bulk-cms-update for initial data
2. Create product template page
3. Create product listing page with filters
4. Set up category landing pages
5. Configure e-commerce integration

ガイドライン

フェーズ1:確認のベストプラクティス

サイトの選択:

  • 利用可能なサイトを取得するには、必ずアクション list_sites で data_sites_tool を使用します
  • サイト ID を推測しないでください
  • ユーザーが正しいサイトを選択していることを確認します

プラン上限の確認:

Check limits before creation:
- Starter: 1 collection, 50 items
- Basic: 2 collections, 200 items
- CMS: 20 collections, 2,000 items
- Business: 40 collections, 10,000 items
- Enterprise: Custom

Warn user if approaching limits.

名前の競合防止:

  • 既存のコレクション名を確認します
  • 名前が競合する場合は、別の名前を提案します
  • スラッグが使用可能か確認します
フェーズ2:要件収集のベストプラクティス

表示名と単数形の名前:

Display Name: Plural form shown in CMS
Singular Name: Singular form for individual items

Examples:
- Display: "Blog Posts" → Singular: "Blog Post"
- Display: "Team Members" → Singular: "Team Member"
- Display: "Products" → Singular: "Product"
- Display: "Categories" → Singular: "Category"

フィールドの命名規則:

✅ Good names:
- author-name (descriptive, hyphenated)
- publish-date (clear purpose)
- featured-image (specifies which)
- main-content (explains use)

❌ Bad names:
- text1 (meaningless)
- field (too generic)
- data (unclear)
- img (which image?)

関連付けの検出:

If user says:
"... with author" → Likely reference field
"... with tags" → Likely multi-reference field
"... with category" → Likely reference field
"... with related products" → Likely multi-reference field

Ask clarifying questions:
- Is [author] the same across items? → Reference
- Can items have multiple [tags]? → Multi-reference
- Do you have a [Categories] collection? → Check existence
フェーズ3:スキーマ検証のベストプラクティス

フィールドタイプの検証:

Common field type mappings:

User says... → Field type:
"title", "name" → PlainText
"description", "summary" → PlainText (long)
"content", "bio", "article" → RichText
"photo", "image", "thumbnail" → Image
"gallery", "photos" → MultiImage
"document", "PDF", "file" → File
"video" → Video
"link", "URL", "website" → Link
"email" → Email
"phone", "mobile" → Phone
"price", "cost", "amount" → Number
"date", "published", "deadline" → DateTime
"featured", "active", "published" → Switch
"status", "type", "category" → Option (if fixed choices)
"color", "theme" → Color

マルチリファレンスの上限確認:

Count multi-reference fields requested:

If > 5:
⚠️ Warning: Collection Limit Exceeded

Webflow allows max 5 multi-reference fields per collection.

You requested: 7 multi-reference fields

Options:
1. Choose 5 most important relationships
2. Convert some to reference fields (one-to-many)
3. Create bridging collections
4. Use option fields for simple categorization

Which would you prefer?

依存関係の解決:

For reference fields:
1. Check if referenced collection exists
2. If not, add to creation queue
3. Create in correct order

Example:
Products needs:
- Categories collection (create first)
- Brands collection (create first)
Then create Products
フェーズ4:プレビューのベストプラクティス

完全なプレビュー形式:

📋 Preview: Create "[Collection Name]"

Collection Details:
├── Display Name: [Name]
├── Singular Name: [Singular]
├── Slug: [slug]
└── Site: [Site Name]

Fields ([X] total):
├── name (PlainText, required) ← Auto-created
├── slug (PlainText, required) ← Auto-created
├── [field-1] ([Type], [required/optional])
├── [field-2] ([Type], [required/optional])
│   [Additional info if Option or Reference]
└── [field-n] ([Type], [required/optional])

Relationships:
├── [field] → [Collection] (Reference)
└── [field] → [Collection] (MultiReference)

✅ Validation Results:
- Collection name available: Yes
- Within plan limits: X/Y collections
- Multi-reference count: X/5
- All field types valid: Yes
- Dependencies resolved: Yes

⚠️ Type "create" to proceed.

検証チェック:

Before showing preview:
1. ✅ Collection name available
2. ✅ Within plan collection limit
3. ✅ All field types supported
4. ✅ Multi-reference limit ≤ 5
5. ✅ Referenced collections exist or queued
6. ✅ No circular dependencies
7. ✅ Field names follow conventions
フェーズ5:作成のベストプラクティス

コレクションの作成:

Required fields:
- displayName (required)
- singularName (required)
- slug (optional, auto-generated if omitted)

Always include both names for clarity:
✅ {"displayName": "Blog Posts", "singularName": "Blog Post"}
❌ {"displayName": "Blog Posts"} (missing singular)

エラー処理:

If collection creation fails:
❌ Collection Creation Failed

Error: [Error message from API]

Common causes:
- Collection name already exists
- Invalid characters in name/slug
- Plan limit reached
- API authentication issue

Would you like to:
1. Try a different collection name
2. Check existing collections
3. Upgrade plan
4. Cancel operation
フェーズ6:フィールド作成のベストプラクティス

フィールドの作成順序:

Create fields in this order:
1. Static fields (Text, Rich Text, Number, etc.)
2. Option fields (with options defined)
3. Reference fields (after referenced collections exist)

For each field:
- Set displayName
- Set isRequired flag
- Add helpText if provided by user
- Set validation rules if applicable

フィールド作成ツール:

Field Type → Tool to use:

PlainText, RichText, Email, Phone, Link, Number,
Image, MultiImage, File, Video, DateTime, Switch, Color
→ data_cms_tool with action create_collection_static_field

Option
→ data_cms_tool with action create_collection_option_field
   (requires metadata.options array)

Reference, MultiReference
→ data_cms_tool with action create_collection_reference_field
   (requires metadata.collectionId)

進捗の報告:

For each field created:
✅ [field-name] ([FieldType])

If field fails:
❌ [field-name] - [Error message]

Continue with remaining fields even if one fails.
Report all failures at end.

オプションフィールドの作成:

{
  "type": "Option",
  "displayName": "Status",
  "isRequired": false,
  "metadata": {
    "options": [
      {"name": "Draft"},
      {"name": "Published"},
      {"name": "Archived"}
    ]
  }
}

Notes:
- Options have name property
- Options cannot have ID (auto-generated)
- Minimum 2 options required
- Maximum: unlimited

Reference フィールドの作成:

{
  "type": "Reference",
  "displayName": "Author",
  "isRequired": true,
  "metadata": {
    "collectionId": "abc123..."
  }
}

For MultiReference:
{
  "type": "MultiReference",
  "displayName": "Tags",
  "metadata": {
    "collectionId": "def456..."
  }
}

Notes:
- Must provide collectionId of referenced collection
- Referenced collection must already exist
- Max 5 MultiReference fields per collection
フェーズ7:検証のベストプラクティス

作成後の検証:

After creating collection and fields:
1. Call data_cms_tool with action get_collection_details with collection ID
2. Verify all fields present
3. Check field properties match request
4. Confirm relationships configured correctly

最終レポートの形式:

🎉 Collection Setup Complete!

Collection: [Name]
ID: [collection-id]
Slug: [slug]

Fields Created ([X]):
├── name (PlainText, required) ← Auto
├── slug (PlainText, required) ← Auto
├── [field-1] ([Type])
├── [field-2] ([Type])
└── [field-n] ([Type])

[If relationships exist]
Relationships:
├── [field] → [Collection]
└── [field] → [Collection]

[If any failures]
⚠️ Failed Fields ([Y]):
├── [field]: [error]
└── [field]: [error]

---

💡 Next Steps:
[Relevant suggestions based on collection type]

次のステップの提案:

For any collection:
1. Use bulk-cms-update to add initial items
2. Create collection template page in Designer
3. Create collection list page
4. Configure SEO settings

For collections with relationships:
5. Create referenced collections first
6. Add items in dependency order
7. Test relationship displays

For e-commerce:
5. Set up payment integration
6. Configure inventory management
7. Create checkout flow
フェーズ8:エラー処理

一般的なエラー:

1. コレクション名の競合:

❌ Collection Already Exists

A collection named "Blog Posts" already exists on this site.

Existing collection:
- Name: Blog Posts
- ID: xyz789...
- Created: 2025-12-15

Would you like to:
1. Choose a different name
2. View existing collection
3. Add fields to existing collection
4. Cancel

2. プラン上限に到達:

❌ Plan Limit Reached

Cannot create collection. You've reached your plan limit.

Current: 20/20 collections (CMS Plan)

Options:
1. Upgrade to Business Plan (40 collections)
2. Delete unused collections
3. Contact Webflow support

Would you like me to show your existing collections?

3. 無効なフィールドタイプ:

❌ Invalid Field Type

Field type "dropdown" is not supported by Webflow.

Did you mean:
- "Option" - Single choice from list
- "Reference" - Link to another collection
- "MultiReference" - Link to multiple items

Which would you like to use?

4. 参照先のコレクションが見つからない:

❌ Referenced Collection Not Found

Cannot create reference field to "Authors" collection.

Issue: "Authors" collection doesn't exist yet.

Solutions:
1. Create "Authors" collection first
2. Remove reference field for now
3. Let me create both collections in order

Your choice? (1/2/3)

5. マルチリファレンスの上限超過:

❌ Too Many Multi-Reference Fields

You requested 6 multi-reference fields.
Webflow limit: 5 per collection

Requested:
1. Tags
2. Categories
3. Related Products
4. Features
5. Certifications
6. Compatible Products ← Exceeds limit

Choose 5 to keep, or convert one to Reference field.
フェーズ9:高度なシナリオ

自己参照コレクション:

Example: Categories with parent categories

Collection: Categories
Fields:
├── name (PlainText, required)
├── slug (PlainText, required)
├── parent-category (Reference → Categories)
└── level (Number) - 1, 2, 3 for hierarchy

Implementation:
{
  "type": "Reference",
  "displayName": "Parent Category",
  "isRequired": false,
  "metadata": {
    "collectionId": "[same-collection-id]"
  }
}

Note: Must create collection first, then add self-reference field

複数コレクションの設定:

When creating multiple related collections:

1. Identify dependencies:
   - Which collections reference others?
   - What's the creation order?

2. Create in order:
   - Independent collections first
   - Dependent collections after

3. Show overall progress:
   [1/4] Creating Categories...
   [2/4] Creating Brands...
   [3/4] Creating Tags...
   [4/4] Creating Products...

4. Report collectively:
   All 4 collections created successfully!

複雑なオプションフィールド:

For complex dropdowns:

User: "Create status field with Draft, In Review, Approved, Published, Archived"

Option field with 5 choices:
{
  "type": "Option",
  "displayName": "Status",
  "isRequired": true,
  "metadata": {
    "options": [
      {"name": "Draft"},
      {"name": "In Review"},
      {"name": "Approved"},
      {"name": "Published"},
      {"name": "Archived"}
    ]
  }
}

Tip: Use workflow order for options

本番環境向けチェックリスト

コレクションの設定を完了とみなす前に:

✅ 確認
  • サイトが選択され、確認済み
  • プラン上限を確認済み
  • 既存のコレクションを一覧表示済み
  • 名前の競合なし
  • ユーザーに適切な権限がある
✅ 要件
  • 表示名を確認済み
  • 単数形の名前を確認済み
  • すべてのフィールドについて種類を定義済み
  • 必須項目と任意項目を指定済み
  • 関連付けを特定済み
✅ 検証
  • すべてのフィールド型が有効
  • 複数参照の数が 5 以下
  • 参照先のコレクションが存在する、または作成待ちである
  • 循環依存がない
  • フィールド名が規則に従っている
  • プランの上限内である
✅ プレビュー
  • スキーマ全体が表示されている
  • すべてのフィールドとプロパティが一覧表示されている
  • リレーションシップが表示されている
  • 検証結果が表示されている
  • ユーザーの確認を得ている
✅ 作成
  • コレクションが正常に作成されている
  • コレクション ID を取得している
  • すべてのフィールドが作成されている
  • フィールド作成時のエラーに対処している
  • 進捗をユーザーに表示している
✅ 確認
  • コレクションを取得して検証している
  • すべてのフィールドが存在する
  • フィールドのプロパティが正しい
  • リレーションシップが設定されている
  • エラーがあれば報告している
✅ 報告
  • 最終的な概要を提示している
  • コレクション ID を共有している
  • フィールドを一覧表示している
  • 失敗があれば報告している
  • 次の手順を提案している
✅ エラー処理
  • コレクションの競合に対処している
  • プランの上限を確認している
  • 無効なフィールド型を検出している
  • 参照先の不足を検出している
  • 部分的な失敗を報告している

コメント