feat(cli): overhaul cli core#617
Draft
sarahxsanders wants to merge 5 commits into
Draft
Conversation
Core of the CLI overhaul: adds the ProgramCliSurface type, snapshots context-mill's cli-manifest.json into a build-time TS module (schema-validated via ajv in prebuild — a fetched-but-invalid manifest fails the build), adds the native + skill command factories, the `wizard audit` family with an interactive picker (recommended leaf pre-highlighted), and the `wizard skill` catalog (internal role hidden by default). Old single-purpose command entry files are replaced by manifest-derived commands. Manifest contract uses context-mill's role/command/skill/internal + recommended vocabulary (renamed from the earlier surface/public/catalog + default). Generated-By: PostHog Code Task-Id: 4debb1ba-a98a-494f-ba44-29df9fd1d87b
🧙 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. |
…cute - flatSkillCommand: graceful fallback when a manifest entry is missing, instead of throwing at import (which took down the whole CLI); both flat commands now resolve by stable skillId - command.ts: declare positionals so `skill [name]` parses under strictOptions; correct the `recommended` doc comment - skill: `wizard skill` lists, `wizard skill <name>` runs, `wizard skill search <query>` searches; reject unknown skill names - agentSkillConfig: add a run recipe so `wizard skill <name>` and the narrow audit leaves actually run (were silently skipped via skipAgent) - family-picker: document the argv-bypass on the picker path - tests: regression guard for the agentSkillConfig run recipe Generated-By: PostHog Code Task-Id: b42696d8-ac3c-4cd2-ba12-747a846b8c23
…sive audit Move the `recommended` flag from `audit all` to `audit-events` so a bare `wizard audit` pre-highlights the events audit. `audit all` stays a selectable leaf — dropping it (and the auditConfig/screen cleanup that requires) is deferred to the multi-select PR. Mirrors the matching context-mill `cli:` change; the build currently sources this bootstrap snapshot since context-mill hasn't released the manifest yet. Generated-By: PostHog Code Task-Id: b42696d8-ac3c-4cd2-ba12-747a846b8c23
…ill id AuditRunScreen picked the slide deck by checking `session.skillId === 'events-audit'`, but context-mill renamed that skill to `audit-events` (the bootstrap manifest and the programs-cli dispatch test both use `audit-events`). The stale check silently fell through to the comprehensive AUDIT_AREA_SLIDES, so `wizard audit events` showed the wrong deck. Match the current id. Generated-By: PostHog Code Task-Id: 95407a79-1f13-4f1d-a37b-43fe4a62b857
Replaces the build-time CLI manifest snapshot with a runtime resolver
that reads cliEntries from skill-menu.json each invocation. Adding a
skill-backed subcommand is now a context-mill release; no wizard release
needed.
How it fits together:
- dispatch-family.ts owns the runtime resolution. dispatchFamily(family,
argv) tries the native handler registry first (today: just
audit/web-analytics), then fetches skill-menu.json and matches
parentCommand + command -> skillId. The comprehensive `audit all`
keeps its specialized auditConfig; everything else runs through the
generic agent-skill program with the resolved skillId injected.
- family-command-factory.ts wraps dispatchFamily as a yargs Command
(name: `<family> [skill]`). interactiveDefault opens the picker with
native + live entries combined; the recommended leaf is
pre-highlighted.
- audit.ts collapses to one factory call. migrate.ts / revenue.ts swap
flatSkillCommand for nativeCommandFactory now that the config has
the right command name and skillId. skill.ts fetches the catalog
at handler time instead of reading a baked snapshot.
Deletions:
- audit-3000 retired (skill, screens, registry entry, agent-interface
model branch, playground demo, screen-registry wiring)
- skill-command-factory.ts + flat-skill-command.ts: the runtime resolver
replaces both, including the empty-manifest fallback flat-skill-command
existed to work around
- cli-manifest.bootstrap.json, cli-manifest.schema.bootstrap.json,
scripts/generate-cli-manifest.cjs, src/lib/programs/cli-manifest.generated.ts
- ajv dev-dep; the generate-cli-manifest.cjs step in prebuild; three
.gitignore lines covering the deleted bootstrap apparatus
Test surface: programs-cli mocks fetchSkillMenu and asserts dispatchFamily
routing (skill-backed, native, comprehensive). family-picker keeps its
auditCommand shape assertion but flipped to "no static children by design".
program-registry catches the revenue-analytics command-name rename.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
CLI OVERHAULLLL
context-mill #178 publishes a
cli:block per skill and emits theresolved entries inside
skill-menu.json. this PR rewires the wizardto consume that at runtime instead of baking a snapshot at build time.
three things happening here:
audit-3000is retiredhow dispatch works now
every family (
wizard audit,wizard migrate,wizard revenue-analytics)is a yargs command with a
[skill]positional and a handler. the handleris
dispatchFamily, which:audit web-analytics). runs immediately if matched — no network.skill-menu.json, finds the entry whereparentCommand + commandmatch, and runs the resolved skill.wizard auditwith no positional opens the existing family picker,which fetches at picker-open time and shows native + live entries
together. the
recommendedleaf from context-mill is pre-highlighted.adding a new audit subcommand (e.g.
wizard audit web-vitals) is now acontext-mill release with a new skill +
cli:block. no wizardrelease needed. adding a new family (
wizard investigate) is still awizard PR. that's the explicit split.
audit-3000
dropped on the wizard side too (context-mill already dropped it). this
removes:
src/lib/programs/audit-3000/src/ui/tui/screens/audit-3000/program-registry,screen-registry,screen-sequencesagent-interface.tsaudit-3000 · area slidesdeck in the playgroundtesting
pnpm typecheckgreenpnpm jest(no e2e): 817/817 tests passing across 53 suitesprograms-cli.test.tsrewritten to mockfetchSkillMenuand assertdispatchFamilyrouting (skill-backed entry, native handler, thecomprehensive
audit allspecial case)family-picker.test.tsflipped to match the newreality (
auditCommand.childrenis undefined by design now)program-registry.test.tsupdated for therevenue-analyticscommand-name rename (was
revenue)local end-to-end check (pointing at a local context-mill build via
--local-mcp/LOCAL_SKILLS_BASE_URL=http://localhost:8765):wizard audit eventsresolvesaudit-eventsover the wirewizard audit web-analyticsruns the native doctor (no network)wizard auditopens the picker with native + live entrieswizard audit unknown-thingprints the available list andexits non-zero
wizard auditwith the registry unreachable prints a clearerror and exits non-zero