feat: add the generate-editor-search-query skill - #12
Open
ziyiunity wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 itsIRunCommandwrapper.descriptionis byte-identical; the query-generation rules are untouched.The one constraint that shapes the snippets
evalcompiles 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 bareObjectis ambiguous withobject(CS0104).So snippets meant for
evalare fully qualified and carry no usings. Snippets meant to be saved into the project as a.csfile 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
IRunCommandclass inreferences/open-search-window.mdbecame a plain snippet, fully qualified —UnityEditor.Search.SearchService,System.Linq.Enumerable.Where/ToArrayrather than LINQ extension syntax, since there is nousing System.Linq.result.Log("Opened Unity Search with query: {0}", query)became areturn— through the CLI, logs go to the Editor console and the caller never sees them.unity-cliskill rather than restated.evalis 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.