mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-04-24 13:08:11 +08:00
## What Was Broken (ROADMAP #130e Category B)
Two remaining surface-level help outliers after #130e-A:
$ claw plugins --help
Unknown /plugins action '--help'. Use list, install, enable, disable, uninstall, or update.
$ claw prompt --help
claw v0.1.0 (top-level help — wrong help topic)
`plugins` treated `--help` as an invalid subaction name. `prompt`
was explicitly listed in the early `wants_help` interception with
commit/pr/issue, which routed to top-level help instead of
prompt-specific help.
## Root Cause (Traced)
1. **plugins**: `parse_local_help_action()` didn't have a "plugins"
arm, so `["plugins", "--help"]` returned None and continued into
the `"plugins"` parser arm (main.rs:1031), which treated `--help`
as the `action` argument. Runtime layer then rejected it as
"Unknown action".
2. **prompt**: At main.rs:~800, there was an early interception for
`--help` following certain subcommands (prompt, commit, pr, issue)
that forced `wants_help = true`, routing to generic top-level help
instead of letting parse_local_help_action produce a prompt-specific
topic.
## What This Fix Does
Same pattern as #130c/#130d/#130e-A:
1. **LocalHelpTopic enum extended** with Plugins, Prompt variants
2. **parse_local_help_action() extended** to map both new cases
3. **Help topic renderers added** with accurate usage info
4. **Early prompt-interception removed** — prompt now falls through to
parse_local_help_action like other subcommands. commit/pr/issue
(which aren't actual subcommands yet) remain in the early list.
## Dogfood Verification
Before fix:
$ claw plugins --help
Unknown /plugins action '--help'. Use list, install, enable, ...
$ claw prompt --help
claw v0.1.0
(top-level help, not prompt-specific)
After fix:
$ claw plugins --help
Plugins
Usage claw plugins [list|install|enable|disable|uninstall|update] [<target>]
Purpose manage bundled and user plugins from the CLI surface
...
$ claw prompt --help
Prompt
Usage claw prompt <prompt-text>
Purpose run a single-turn, non-interactive prompt and exit
Flags --model · --allowedTools · --output-format · --compact
...
## Non-Regression Verification
- `claw plugins` (no args) → still displays plugin inventory ✅
- `claw plugins list` → still works correctly ✅
- `claw prompt "text"` → still requires credentials, runs prompt ✅
- All 180 binary tests pass ✅
- All 466 library tests pass ✅
## Regression Tests Added (4+ assertions)
- `plugins --help` → HelpTopic(Plugins)
- `prompt --help` → HelpTopic(Prompt)
- Short forms `plugins -h` / `prompt -h` both work
- `prompt "hello world"` still routes to Prompt action with correct text
## HELP-PARITY SWEEP COMPLETE
All 22 top-level subcommands now emit proper help topics:
| Command | Status |
|---|---|
| help --help | ✅ #130e-A |
| version --help | ✅ pre-existing |
| status --help | ✅ pre-existing |
| sandbox --help | ✅ pre-existing |
| doctor --help | ✅ pre-existing |
| acp --help | ✅ pre-existing |
| init --help | ✅ pre-existing |
| state --help | ✅ pre-existing |
| export --help | ✅ pre-existing |
| diff --help | ✅ #130c |
| config --help | ✅ #130d |
| mcp --help | ✅ pre-existing |
| agents --help | ✅ pre-existing |
| plugins --help | ✅ #130e-B (this commit) |
| skills --help | ✅ pre-existing |
| submit --help | ✅ #130e-A |
| prompt --help | ✅ #130e-B (this commit) |
| resume --help | ✅ #130e-A |
| system-prompt --help | ✅ pre-existing |
| dump-manifests --help | ✅ pre-existing |
| bootstrap-plan --help | ✅ pre-existing |
Zero outliers. Contract universally enforced.
## Related
- Closes #130e Category B (plugins, prompt surface-parity)
- Completes entire help-parity sweep family (#130c, #130d, #130e)
- Stacks on #130e-A (dispatch-order fixes) on same worktree