fix(cli): register the skill <skill-name> positional so strict parsing accepts it - #1027
Open
gewenyu99 wants to merge 4 commits into
Open
fix(cli): register the skill <skill-name> positional so strict parsing accepts it#1027gewenyu99 wants to merge 4 commits into
skill <skill-name> positional so strict parsing accepts it#1027gewenyu99 wants to merge 4 commits into
Conversation
…ing accepts it The `skill` command declared its positional only in the command-name string, not through the `positionals` field. Under `.strictOptions()`, yargs treats a command-string positional as an "Unknown argument" unless it is also registered via `.positional()`, so `wizard skill <name>` failed with `Unknown arguments: skill-name, skillName`. Declare `skill-name` in `positionals` (matching the pattern the audit family factory already uses) so the value is accepted. Generated-By: PostHog Code Task-Id: 5c8a2c20-3055-4927-8952-114480ce3c72
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
gewenyu99
marked this pull request as ready for review
July 29, 2026 17:13
gewenyu99
commented
Jul 29, 2026
| // `.positional()` too (see the `positionals` note on the Command interface). | ||
| // Declare `skill-name` here so `wizard skill <id>` actually accepts its value. | ||
| positionals: { | ||
| 'skill-name': { |
Collaborator
Author
There was a problem hiding this comment.
Hmm, valid, but rejects invalid skills after log in 🤔
Member
There was a problem hiding this comment.
weird... the cli rejects the argument? or does the agent reject the skill later downstream
Collaborator
Author
There was a problem hiding this comment.
It rejects invalid skills downstream. I want this to reject before log in. Looking for where we have access to skill registry
Member
There was a problem hiding this comment.
yeayea that makes sense. i think it's an mcp tool call
Addresses review feedback that an invalid `wizard skill <name>` was only rejected far downstream, after the user had already authenticated. `skillCommand` now fetches the skill menu and rejects an unknown id up front with a friendly "run `wizard skill list`" message. The check resolves against the same set `downloadSkill` uses (categories flattened by id), so it can't false-reject a skill the download would accept. If the registry is unreachable we stay silent and defer to the download step's own failure handling rather than adding a second blocking network dependency. Generated-By: PostHog Code Task-Id: 5c8a2c20-3055-4927-8952-114480ce3c72
edwinyjlim
approved these changes
Jul 29, 2026
The handler is now async (it validates the skill id against the registry before running), so the two handler tests that asserted synchronously no longer saw runSkillMode called. Mock fetchSkillMenu, await the fire-and-forget work, and add coverage for the two new branches: defer-and-run when the registry is unreachable, and reject-before-run on an unknown skill id. Generated-By: PostHog Code Task-Id: 5c8a2c20-3055-4927-8952-114480ce3c72
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.
Problem
wizard skill <skill-name>was documented but broken — running e.g.npx @posthog/wizard skill feature-flags-nextjsfailed withUnknown arguments: skill-name, skillName. The command declared its positional only in the command-name string, so under.strictOptions()yargs rejected the value as unknown. Users had to fall back to the retired--skillroute.Changes
Register
skill-namethrough the command'spositionalsfield (the same pattern theauditfamily factory already uses), so strict parsing accepts the value. The registry-reading and skill-running machinery was already intact — this was purely the missing.positional()registration.Test plan
wizard skill feature-flags-nextjsno longer errors withUnknown arguments.wizard skill ""still gives the friendly "needs a skill name" message.wizard skill listunaffected.wizard skill -hrenders the positional correctly; no extra option spam.src/__tests__/cli.test.tspasses (33/33).Created with PostHog from a Slack thread