Communitygithub.com

unity-technologies/generate-editor-search-query

自然言語でのUnityアセットやシーンオブジェクトの検索リクエストをUnity Search / Quick Searchのクエリに変換し、Unity Searchウィンドウを開きます。

generate-editor-search-query とは?

このスキルは、ユーザーがUnity Editor上でアセットやシーンオブジェクトを検索・参照する際に、「find」「search」「locate」「list」「filter」といった自然言語のリクエストを、Unity Search / Quick Searchで利用可能なクエリ文字列に自動変換します。対応する対象は、マテリアル、テクスチャ、プレハブ、シーン、スクリプト、シェーダー、GameObject、コンポーネント、ライト、カメラ、UIオブジェクト、ラベル、パス、参照関係、選択・名前付きアセットなど幅広い範囲をカバーします。適切なクエリを生成した後、Editor側でC#コードを実行してUnity Searchウィンドウを開き、ユーザーがすぐに検索結果を確認できるようにします。クエリのみの提供や、検索ウィンドウを開かないように明示された場合には、ウィンドウは開かずにクエリ文字列のみを表示します。このスキルはプロジェクトの概要説明、フォルダ構造の要約、ゲームプレイ・システムの解説、プログラミングのHow-To質問、Web検索、リポジトリテキスト検索、ビルドログ調査、パッケージインストール、メニュー・設定検索、結果の修正などには使用しません。また、ユーザーが「これ」「選択中」「現在の」といったあいまいな表現を使った場合は、アセット名やパスを尋ねてからクエリを生成します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/unity-technologies/skills/tree/main/skills/generate-editor-search-query

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

自然言語によるUnity Editor検索リクエストを有用なUnity Searchクエリに変換し、簡単に説明して、適切な場合にUnity Searchウィンドウをそのクエリで開きます。

デフォルトの動作

プロンプトに「Unity Search」、「Quick Search」、「Search window」、「open Search」、またはUnity Searchクエリの要求が明示的に含まれている場合、ターゲットがライティング、UI、物理、オーディオ、アニメーションなど別のドメインに属していても、このスキルで検索リクエストを処理します。

「find」、「search」、「locate」、「list」、「filter」、「look up」、「where is」、「which assets use」、「what references」などの具体的なUnityアセットやシーンオブジェクトに関するリクエストの場合:

  1. リクエストが主にプロジェクトアセットに関するものか、シーンオブジェクトに関するものか、またはその両方かを判断します。
  2. 簡潔なUnity Searchクエリを1つ作成します。
  3. 検索を開く前または開くと同時に、応答にクエリを表示します。
  4. ユーザーが明示的にクエリテキストのみを要求していない限り、Editor側のスニペットを実行してUnity Searchを開きます。
  5. 検索の開始に失敗した場合は、クエリを返し、ユーザーにUnity Searchに手動で貼り付けるよう伝えます。

ユーザーが「Searchを開かないで」、「クエリのみ」、「どんなクエリを使えばいい?」、「クエリだけ教えて」などと言った場合は、検索を開かないでください。

ユーザーが一般的な説明、プロジェクト概要、フォルダ構造の要約、アーキテクチャウォークスルー、ゲームプレイシステムの概要、「どうやって~するの?」というプログラミングの質問をした場合は、プロンプトにUnity Search、Searchクエリ、またはSearchウィンドウを開くことが明示的に含まれていない限り、このスキルを使用しないでください。

ユーザーが「これ」、「選択中」、「現在の」といった表現を、関連するアセット、シーンオブジェクト、名前、パスなしで使用した場合は、名前やパスをでっち上げるのではなく、それを尋ねてください。

スコープ

読み取り専用のUnity Search / Quick Searchクエリを以下の対象に限定します:

  • プロジェクトアセット:マテリアル、テクスチャ、プレハブ、シーン、スクリプト、シェーダー、オーディオクリップ、スプライト、メッシュ、モデル、アニメーション、フォント、レンダーテクスチャ、ScriptableObjectアセットなど。
  • シーンオブジェクトとコンポーネント:カメラ、ライト、Rigidbody、Collider、Renderer、Canvasオブジェクト、UIコンポーネント、ParticleSystem、AudioSource、Animator、Terrainオブジェクト、名前付きGameObjectなど。
  • パス、ラベル、タイプ、ファイル名、キーワード、および参照指向のアセット検索。
  • 会話または添付ファイルから名前/パスが利用可能な場合の、選択済みまたは名前付きアセット。

パッケージのインストール、メニューコマンドの実行、アセットの編集、シーンの変更、外部ドキュメントの検索、リポジトリテキストの検索、ビルドログの調査、結果の削除、検索結果の修正、依存関係グラフの分析は行いません。ユーザーが結果に対してアクションを実行するよう求めた場合、最初にSearchを開くかクエリを提供し、その後、別の変更スキルやワークフローを実行する前に確認を求めてください。

参考資料

複雑なクエリを生成する前に、references/query-patterns.mdを読んでください。

Searchウィンドウを開く前に、references/open-search-window.mdを読んでください。

公式英語リファレンス:

evalへのC#の受け渡し

evalはファイルではなくステートメントブロックをコンパイルします。これには2つの結果があり、どちらもコンパイルエラーになります:

  • usingディレクティブは使用不可。 コンパイラはusing UnityEditor;をリソース破棄ステートメントと見なし、拒否します (CS0210)。
  • 型は完全修飾名で指定する必要があります。 裸のSearchServiceは解決されず (CS0246)、裸のObjectはobjectと曖昧になります (CS0104)。

unity-cliスキルが前提条件(CLIのインストール、接続されたEditorの確認、プロジェクトへのcom.unity.pipelineパッケージの追加、コマンドカタログの検出)を担当します。特にevalが必要です。evalがない場合は、クエリテキストを生成し、ウィンドウを開けないことを伝えてください。

クエリ生成ルール

要求された結果を生成する可能性が最も高い、最もシンプルなクエリを使用します。

  • アセットやコンポーネントのリクエストには、タイプフィルタを優先します(例:t:material、t:texture、t:prefab、t:scene、t:script、t:shader、t:Light、t:Rigidbody)。
  • ユーザーが指定した名前やキーワードは、引用符が必要でない限り、プレーンなクエリ用語として保持します。
  • ユーザーがフォルダを指定したり、「Assets/...の中」、「~の下」と言った場合は、dir:を使用します。
  • ユーザーがUnityアセットラベルを尋ねた場合は、l:を使用します。
  • ユーザーが何を参照しているか、何を使用しているか、何に依存しているか、何を含んでいるか、何に接続しているかを尋ねた場合は、ref=を使用します。
  • Search式は、クエリを明らかに改善する場合にのみ使用します(例:t:prefab ref={t:texture}、t:scene ref={t:prefab})。
  • 「選択中/現在の」という表現については、チャットコンテキストに既知の選択アセット名またはパスが存在する場合のみそれを使用し、そうでない場合はそれを尋ねてください。
  • 「Rigidbodyはどこで使われている?」のような広範な関係リクエストには、まずシンプルなキーワードまたはコンポーネントクエリを使用し、ユーザーが徹底的なコード/プロパティ分析を必要とする場合は、スクリプト監査は別途必要であると述べてください。
  • 検索と修復作業が混在するリクエストの場合、最初にクエリを生成して開き、ユーザーが別のフォローアップアクションを明示的に確認しない限り、結果を変更しないでください。
  • 不確かなリクエストに対して、サポートされていないフィルタをでっち上げないでください。リクエストをUnity Search構文で確実に表現できない場合は、最も近い安全なクエリを開き、その制限を明記してください。

Unity Searchを開く

EditorでC#を実行するのは、Searchウィンドウを開くためだけです。これはEditor UIアクションであり、プロジェクトアセットやシーンコンテンツを変更してはなりません。

Searchを開くとき:

  1. 生成されたC#文字列内でクエリを安全にエスケープします。
  2. このv1スキルでは、アセットプロバイダーとシーンプロバイダーを優先します。
  3. プロバイダーが利用できない場合は、アクティブなプロバイダーにフォールバックします。
  4. 開かれたクエリをログに記録します。
  5. コマンドが失敗した場合、Searchが開かれたと決して主張しないでください。

応答フォーマット

ユーザー向けの応答は簡潔に保ちます:

クエリ: `t:material`
Unity Searchをそのクエリで開きました。

Searchを開かない場合:

クエリ: `t:prefab ref={t:texture}`
これをUnity Searchに貼り付けてください。

リクエストがあいまいでも検索可能な場合は、最も可能性の高いクエリを選択し、その前提について言及します。検索対象が推測できない場合(例:「あれを探して」、アセット、シーン、タイプ、名前、コンテキストなし)にのみ、質問をしてください。

検証チェックリスト

成功を報告する前に:

  • 生成されたクエリがユーザーに表示されている
  • クエリがアセット、シーンオブジェクト、またはその両方を対象としている
  • ユーザーがオプトアウトしなかった場合にのみSearchが開かれた
  • フォールバックや不確実性があればそれが明確に述べられている
  • アセット、シーン、パッケージ、プロジェクト設定、検索結果が一切変更されていない

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

unity-technologies/2d-pixel-perfect

Sets up, diagnoses, and fixes pixel perfect 2D rendering in Unity projects. Use when working on any retro-style or pixel art 2D game.

unity-technologies/audio-setup-mixers

Scans the scene and audio assets to appropriately route Audio Sources into existing Audio Mixer Groups, classifying each source by what it plays. Use when the user asks about cleaning up mixer assignments, routing audio through a mixer, or which group a sound belongs in. Creating mixers and groups, and setting volumes, are not automated — the skill inventories what exists and asks the user to add anything missing.

unity-technologies/build-live-game

Build and operate a live game using Unity Services. Use when the user needs to implement, connect, or debug backend-driven features — battle passes, achievements, player progression, cloud saves, leaderboards, matchmaking, virtual economies, server-authoritative logic, anti-cheat, player accounts and authentication, remote configuration, feature flags, A/B testing, analytics, or cloud resource deployment. Triggers on live-ops, live service, backend, server authority, cloud code, cloud save, remote config, player data, retention, monetization loop, season pass, ranking, multiplayer sessions, lobbies, or any Unity Services integration.

unity-technologies/implement-in-app-purchases

Implement, configure, and debug Unity In-App Purchases (IAP) — store connection, product catalog, consumable/non-consumable/subscription purchases, two-step pending-confirm flow, receipt validation, entitlement checking, restore transactions, Apple extensions (promotional purchases, Ask-to-Buy, code redemption), and Google Play extensions (subscription upgrade/downgrade), D2C Capabilities(direct to customer), 3rd party payment provider (Stripe/Coda) via Unity IAP/Unity Cloud. Use when the user needs to add, modify, debug, or migrate from native Android/iOS billing, 3rd party packages(RevenueCat/Adapty/Essential Kit/Unipay supported) to IAP. Triggers on microtransactions (MTX), monetization, real-money purchases, store purchases, buying items, support D2C, purchase via Stripe/Coda, migrate from native billing(Google's BillingClient or Apple's StoreKit/SKPaymentQueue/SKProduct)/RevenueCat/Adapty/EssentialKit/Unipay.

unity-technologies/initialize-ai-navigation

Sets up and configures the Unity AI Navigation system — NavMesh surfaces, NavMesh agents, obstacles, links, modifiers, areas and costs. Use when creating walkable navigation meshes, adding pathfinding agents, setting up patrol routes, configuring obstacle avoidance and carving, connecting separate NavMeshes with links, coupling navigation with animation, or troubleshooting navigation issues.

unity-technologies/levelplay-unity-integration

Integrates the LevelPlay Mediation SDK via the Ads Mediation UPM package. Use when a developer asks about adding ads to a Unity game, implementing rewarded, interstitial, or banner ads, setting up ad mediation, configuring ad networks, installing or updating the Ads Mediation package, troubleshooting LevelPlay namespace errors, resolving Android gradle or iOS CocoaPods dependency issues for ads, configuring ATT or privacy settings for ad compliance, tracking impression-level revenue (ILRD), initializing the LevelPlay SDK, or setting up ad unit IDs. Also use when a developer wants to monetize their Unity game with ads, asks how to get started with LevelPlay, ads, or mediation, or needs help with any part of the LevelPlay integration workflow including platform-specific setup for iOS or Android. Also use when upgrading the LevelPlay or IronSource SDK version, migrating from deprecated IronSource.Agent APIs, or migrating a game from Unity Ads to LevelPlay.

unity-technologies/localization

Sets up and configures Unity Localization, including locales, String/Asset Tables, CJK font support, and Addressables workflows. Use when the user wants to add languages to a project, translate UI text, support Asian (CJK) languages with TMP fonts, or mentions i18n, l10n, multilingual support, or making a game support multiple languages.

unity-technologies/manage-sprite-atlas

Manage SpriteAtlas using prebuild pipeline with IPreprocessBuildWithReport (DEFAULT approach). Use it to configure master atlases, variant atlases, texture settings, packing settings, and platform-specific configurations. Use when the user asks about creating sprite atlases, optimizing sprites, configuring atlas settings, adding sprites to atlases, creating variant atlases, implementing automated atlas generation, or runtime sprite atlas access. Always use prebuild approach unless user explicitly requests manual authoring.

unity-technologies/migrate-birp-to-urp

Plans, executes, and troubleshoots Unity projects moving from the Built-in Render Pipeline (BiRP/BIRP/Built-in RP) to the Universal Render Pipeline (URP). Use when the user asks to upgrade, convert, switch, or migrate a project, scene, material, or shader to URP/Universal Render Pipeline; fix pink or magenta materials after URP; convert Built-in materials/shaders; move a 2D project to URP 2D; review lighting, quality, post-processing, baked lightmaps, or reflection probes after URP; or diagnose visual problems after a render-pipeline migration.

関連スキル