Skip to content

feat(cli): enforce MCP tool CLI/skill parity and rich subcommand help#213

Merged
ScriptedAlchemy merged 3 commits into
masterfrom
codex/tool-skill-cli-parity
Jul 2, 2026
Merged

feat(cli): enforce MCP tool CLI/skill parity and rich subcommand help#213
ScriptedAlchemy merged 3 commits into
masterfrom
codex/tool-skill-cli-parity

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

The MCP server may become optional (or expose only a subset of tools) in the future, so the CLI must be a fully self-sufficient agent interface. This PR closes the loop in both directions and brings CLI help up to an agent-navigable standard (modeled on the Hermes agent CLI: quick-start epilog, per-subcommand examples, related-command cross-references).

Coverage parity (tools ↔ CLI ↔ skills)

  • Audit result: all 98 advertised MCP tools were already invocable via tracedecay tool <name>; 4 tools were not taught by any bundled skill: tracedecay_skill_list, tracedecay_skill_view, tracedecay_automation_run_artifact_view, tracedecay_hermes_skill_bridge.
  • New skill inspecting-managed-skills (both bundles, byte-identical; registered in CURSOR_PLUGIN_SKILLS, EMBEDDED_PLUGIN_FILES, CODEX_EMBEDDED_PLUGIN_FILES) covers that cluster — read-only inspection of automation-produced managed skills, run artifacts, and Hermes-owned skill state. Coverage is now 98/98 in both bundles.
  • New reverse coverage tests (tests/agent_suite/tool_skill_coverage_test.rs), the complement of the skill-lint's forward skill→tool checks:
    • tracedecay tool (discovery listing) names every tool from get_tool_definitions();
    • tracedecay tool <name> --help succeeds end-to-end through the shipped binary for every tool;
    • every tool is mentioned (word-boundary match) by at least one skill in each bundle, with a documented SKILL_COVERAGE_EXCEPTIONS list for genuinely internal tools (currently empty) plus a guard that exceptions reference real tools.

Rich CLI help

  • New src/cli/help.rs: every visible top-level subcommand now has a when-to-use long_about and an Examples:/Related:/Notes: after_help trailer with real flag combinations (all example flags verified against the actual tool schemas / clap args).
  • Top-level tracedecay --help gains a quick-start epilog that teaches the MCP tool discovery flow (list → per-tool help → invoke with --args/@file) and the --json / project-scoping conventions.
  • tracedecay tool <name> --help now prints a ready-to-copy Usage: line with the tool's required flags plus @file guidance; the tracedecay tool listing gained a reserved-flags footer.
  • New parse tests pin the contract so future subcommands cannot ship bare help: every_visible_top_level_subcommand_ships_rich_help, every_visible_nested_subcommand_has_a_purpose_line, top_level_help_teaches_the_tool_discovery_flow.

Skill update

  • using-the-cli (both bundles, byte-identical) documents the improved discovery flow: per-tool usage lines, and that every subcommand's --help carries Examples/Related sections.

New-skill frontmatter follows the incoming plugin-validation lint rules (kebab-case name, trigger-first description ≥50 chars, no angle brackets, terminal punctuation, unique description, within the 6,000-char metadata budget).

Test plan

  • cargo check --all-targets / cargo clippy --all-targets — clean (only pre-existing vendored libsql warnings)
  • cargo fmt
  • cargo test --test agent_suite — 356 passed (includes plugin_skill_contract_test, codex/cursor byte-parity tests, and the 4 new coverage tests)
  • cargo test --bin tracedecay parse_tests — 34 passed (includes 3 new help-contract tests)
  • cargo test --lib hooks (36), --lib agents (136), --lib mcp::tools (46), --bin tracedecay tool_command (18)
  • cargo test --test core_cli_suite cli_help — 3 passed
  • Smoke: tracedecay --help, tracedecay tool --help, tracedecay tool search --help, tracedecay memory --help render the new trailers; all 98 tracedecay tool <name> --help invocations succeed

The MCP server may become optional or expose only a subset of tools, so
the CLI must stay a fully self-sufficient agent interface.

- Add reverse coverage tests: every advertised MCP tool must be listed
  by `tracedecay tool`, invocable via `tracedecay tool <name> --help`
  (end-to-end through the binary), and taught by at least one bundled
  skill in each plugin bundle, with a documented-exceptions list for
  genuinely internal tools (currently empty).
- Add the `inspecting-managed-skills` skill (both bundles, byte-parity)
  covering the four previously untaught tools: tracedecay_skill_list,
  tracedecay_skill_view, tracedecay_automation_run_artifact_view, and
  tracedecay_hermes_skill_bridge.
- Give every visible top-level subcommand a when-to-use long_about and
  an Examples/Related after_help trailer (src/cli/help.rs), plus a
  top-level quick-start epilog teaching the tool discovery flow; pin
  the contract with parse tests so new subcommands cannot ship bare.
- Teach `tracedecay tool <name> --help` to print a ready-to-copy usage
  line and @file guidance, and add a reserved-flags footer to the tool
  listing.
- Update the using-the-cli skill to document the improved discovery
  flow (byte-identical across bundles).
@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ea4c66b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e76dc1d456

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/agent_suite/tool_skill_coverage_test.rs Outdated
@ScriptedAlchemy ScriptedAlchemy merged commit 10c148b into master Jul 2, 2026
14 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the codex/tool-skill-cli-parity branch July 2, 2026 08:56
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.

1 participant