Skip to content

fix(agent-help): wire skills metas and correct 'plugin skills' command labels#379

Closed
christso wants to merge 1 commit into
mainfrom
fix/371-agent-help
Closed

fix(agent-help): wire skills metas and correct 'plugin skills' command labels#379
christso wants to merge 1 commit into
mainfrom
fix/371-agent-help

Conversation

@christso
Copy link
Copy Markdown
Contributor

Summary

Fixes two related defects in the --agent-help surface for the skills subcommand group:

  1. skillsListMeta, skillsAddMeta, and skillsRemoveMeta were defined in src/cli/metadata/plugin-skills.ts but never imported by src/cli/agent-help.ts, so AI agents could not discover the skills list / add / remove commands at all.
  2. Each meta's command field was labeled 'plugin skills *', but the runtime command path is 'skills *' because skillsCmd is registered as a top-level group in src/cli/index.ts. Same drift was present in the --json envelopes and the --plugin ambiguity-hint strings inside the handlers.

Changes

  • src/cli/agent-help.ts: import and add skillsListMeta, skillsAddMeta, skillsRemoveMeta to allCommands.
  • src/cli/metadata/plugin-skills.ts: rename command values to 'skills *'. Updated examples: entries to match.
  • src/cli/commands/plugin-skills.ts: update every jsonOutput({ ..., command: 'plugin skills X' ... }) and the in-message hint strings to use the runtime path.
  • tests/unit/cli/agent-help.test.ts: include the three new metas in the test fixture and bump expected count from 13 → 16.

Test plan

  • bun run build succeeds
  • bun test — 1191 pass / 0 fail
  • Verification gate from the issue passes end-to-end:
    • allagents --agent-help | jq -e '.commands | map(.command) | contains(["skills list", "skills add", "skills remove"])'true
    • allagents --agent-help "skills list" | jq -e '.command == "skills list"'true (and same for add / remove)
    • allagents --json skills list | jq -e '.command == "skills list"'true
    • grep "'plugin skills " src/cli/metadata/plugin-skills.ts → no matches

Closes #371

…untime path

The skills subcommand metas (skillsListMeta/skillsAddMeta/skillsRemoveMeta) were
defined but not wired into agent-help's allCommands array, so AI agents had no
way to discover them. Their `command` fields also incorrectly read
'plugin skills *' while the actual runtime path is 'skills *' (skillsCmd is
registered as a top-level group, not under pluginCmd). Same drift affected the
JSON envelope's `command` field and the in-error hint strings.

- Add skills metas to allCommands in src/cli/agent-help.ts
- Rename meta `command` values from 'plugin skills X' to 'skills X'
- Rewrite handler json-envelopes and ambiguity-hint strings to use 'skills X'
- Update agent-help.test.ts to cover the three new entries

Closes #371
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 810faa8
Status: ✅  Deploy successful!
Preview URL: https://1780f833.allagents.pages.dev
Branch Preview URL: https://fix-371-agent-help.allagents.pages.dev

View logs

@christso
Copy link
Copy Markdown
Contributor Author

Code Review: ✅ APPROVE (with one non-blocking suggestion)

Correctness

Both defects from #371 are addressed:

  1. agent-help.ts::allCommands now imports and includes skillsListMeta, skillsAddMeta, skillsRemoveMeta.
  2. The command: labels in both plugin-skills.ts metadata and the JSON envelope error/success paths are now 'skills *', matching the runtime registration in src/cli/index.ts.

All 16 jsonOutput({...}) call sites in commands/plugin-skills.ts were updated consistently. The two ambiguity-hint error strings (Use --plugin to specify: allagents skills <add|remove> ...) were also updated, keeping user-facing tips consistent with the runtime path.

CLAUDE.md compliance

  • Conventional commit title (fix(agent-help): ...) ✓
  • No Co-Authored-By
  • Test added/updated alongside the change ✓
  • One-test-per-distinct-path principle respected ✓

Verification gate

All four checks from the issue are covered.

Non-blocking suggestion (follow-up)

The issue's Implementation notes explicitly recommended:

Add a unit test that asserts every AgentCommandMeta.command resolves to a real command path in the cmd-ts tree. This guards against future drift between metadata and runtime registration.

This guardrail is not in this PR — the new tests only assert the metadata array has 16 entries and contains the three new ones, which would still pass if a future meta drifted from its registered command (i.e., the exact class of bug being fixed here). Consider a follow-up agent-help-drift.test.ts that walks the cmd-ts tree and asserts every meta.command maps to a real subcommand chain. Not blocking — the immediate fix is correct.

@christso
Copy link
Copy Markdown
Contributor Author

Superseded by #380 (skill rename) which landed first and includes all of this PR's changes (metas wired into agent-help + corrected command labels) under the new singular form.

@christso christso closed this May 12, 2026
@christso christso deleted the fix/371-agent-help branch May 12, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: --agent-help omits the skills subcommand group and metadata.command labels say 'plugin skills'

1 participant