Skip to content

feat: add the generate-editor-search-query skill - #12

Open
ziyiunity wants to merge 1 commit into
wave-2-skillsfrom
feat/add-generate-editor-search-query
Open

feat: add the generate-editor-search-query skill#12
ziyiunity wants to merge 1 commit into
wave-2-skillsfrom
feat/add-generate-editor-search-query

Conversation

@ziyiunity

Copy link
Copy Markdown
Collaborator

Adds generate-editor-search-query — generates Unity Search / Quick Search queries and opens the Search window pre-populated. 3 files.

Why this changed

Written for Unity AI Assistant, where a built-in tool ran C# in the Editor. That tool does not exist in a third-party coding agent, so the three references to it now point at the Unity CLI (unity command eval), and the Editor-side snippet lost its IRunCommand wrapper. description is byte-identical; the query-generation rules are untouched.

The one constraint that shapes the snippets

eval compiles a statement block, not a file. using UnityEditor; inside a method body is read as a resource-disposal statement rather than a namespace import, so it fails outright (CS0210) — and with no import, short type names are unknown (CS0246) and a bare Object is ambiguous with object (CS0104).

So snippets meant for eval are fully qualified and carry no usings. Snippets meant to be saved into the project as a .cs file keep their usings and short names, because that is correct for a file. Every eval-destined snippet here was compile-checked against a live Unity 6 Editor, by prefixing it with an unreachable early return so it type-checks without executing.

What changed specifically

  • The IRunCommand class in references/open-search-window.md became a plain snippet, fully qualified — UnityEditor.Search.SearchService, System.Linq.Enumerable.Where/ToArray rather than LINQ extension syntax, since there is no using System.Linq.
  • result.Log("Opened Unity Search with query: {0}", query) became a return — through the CLI, logs go to the Editor console and the caller never sees them.
  • Three prose references to the old tool now describe the action instead ("open Unity Search by running the Editor-side snippet"), and prerequisites are delegated to the unity-cli skill rather than restated.
  • Added a note that if eval is unavailable, the skill should still generate the query text and say the window can't be opened — the query is useful on its own.

Tested

The search-window snippet compiles cleanly against a live Editor. Its read-only nature is preserved: the skill states this must not create, modify, delete, import, install or save anything.

What would be most useful to review

The query patterns in references/query-patterns.md. Unity Search syntax is the part that goes stale, and it's unchanged from your original.

@ziyiunity
ziyiunity requested a review from a team as a code owner August 11, 2026 18:20
@ziyiunity
ziyiunity changed the base branch from main to wave-2-skills August 17, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant