feat: label CLI invocations with caller and skill (blocked on CLI-951) - #31
Open
ziyiunity wants to merge 1 commit into
Open
feat: label CLI invocations with caller and skill (blocked on CLI-951)#31ziyiunity wants to merge 1 commit into
ziyiunity wants to merge 1 commit into
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.
Do not merge yet. The two flags this adds do not exist in the CLI, and
unity commandrejects unknown options:error: unknown option '--caller' (Did you mean --all?). Merging before the CLI accepts them would make every CLI invocation in these six skills fail. This is blocked on CLI-951.What this does
Labels every
unity commandinvocation with who produced it, so plugin-driven CLI usage can be told apart from a user typing the same command, and broken down by which skill drove it.Six skills carry the flags:
unity-cli,optimize-web,urp-postprocessing,optimize-audio,audio-setup-mixers,sprite-editor. Eight lines in total, since three of them repeat the canonical invocation in a reference file.unity-clialso gains an explicit rule, because it is the skill others delegate to:Why flags in the skill text rather than an environment variable
The marker has to reach the
unity commandprocess. A plugin manifest can setenvonly on an MCP server it declares, which coversunity mcp, notunity command. This plugin ships skills only and declares no MCP server, so there is no environment-variable path to the invocations that need marking.Flags work because the skill text is the thing that produces the invocation. It also cannot be forgotten at runtime the way a prose instruction can.
What these numbers will and will not show
Worth stating here, because per-skill counts are easy to over-read.
A skill's trigger is not observable. Triggering happens inside the agent and touches no Unity process. What gets counted is that a skill ran and reached its CLI step. A skill that triggers and then skips that step produces nothing, so the numbers undercount, and undercount most in the runs that went wrong.
Three skills will read as zero.
new-unity-project,unity-package-managementandinitialize-ai-navigationmake no CLI calls of their own; they delegate the mechanics tounity-cli, with 8, 3 and 1 references respectively and 0 own invocations. Their work will be attributed tounity-cli, which will look correspondingly inflated. Anyone reading this data as "most used skill" would getunity-cliat the top andnew-unity-projectat zero, which is backwards: the latter is the one a new user is most likely to reach first.Fixing that needs the originating skill's label to survive a delegation, which skill text cannot do on its own. Out of scope here.
Not changed
CHANGELOG.mdandSECURITY.mdinunity-clialso mentionunity command eval, andreferences/integration-advanced.mdcarries several examples. Those document the CLI rather than instructing the agent, so adding two flags to each would add noise without changing behavior.Checked
claude plugin validatepasses.