Skip to content

Add a lean pm contracts --summary mode for cheap agent bootstrap #442

Closed

Description

@unbraind

Problem (current behavior)

pm contracts is the recommended machine-discovery entrypoint, but its sizes are hostile to agents:

  • default --json: 25,118 bytes
  • --availability-only: 24,666 bytes (despite the name, it still expands every extension * / package * subcommand)
  • --action create: 63,534 bytes
  • --full: 520,414 bytes

There is no minimal "command name + one-line intent" surface. An agent that just wants to know "what can pm do?" pays ~25KB up front before issuing a single real command.

Proposed improvement

Add a --summary / --lean mode that emits one line per top-level command: { command, intent } (collapsing extension/package subcommands and aliases), targeting a few KB. Keep --full for deep introspection. Also have --availability-only actually be lean (top-level commands only, no subcommand expansion) so the name matches the size.

Agent benefit

Lets an agent bootstrap its knowledge of the command surface for ~1–3KB instead of ~25KB, then drill into a single command via pm contracts --command <c> --flags-only --json or pm <c> --help --json as needed. Classic progressive-disclosure win.

Activity

  1. added
    enhancementNew feature or request
    agent-experienceImproves the AI agent / MCP / CLI ergonomics and token efficiency
    token-efficiencyReduces agent token/context cost
    on Jul 5, 2026
  2. coderabbitai commented on Jul 5, 2026

    @coderabbitai
    🔗 Related PRs

    #36 - [codex] Improve agent UX from manual pm audit [closed]
    #142 - Guard pm tracker path targeting for agents [closed]
    #343 - feat(sdk): describeExtensionActivation — single-call introspection of every registered surface [merged]
    #396 - refactor(sdk): decompose cli-contracts.ts monolith into flag-contracts + tool-schema modules [merged]
    #428 - Harden SDK extension runtime packaging [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. unbraind commented on Jul 8, 2026

    @unbraind
    OwnerAuthor

    Shipped in 05f91b7: pm contracts --summary lean bootstrap mode is live on main. Tracked as pm-vxxm (closed with evidence).

  4. unbraind commented on Jul 11, 2026

    @unbraind
    OwnerAuthor

    pm tracker item:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-experienceImproves the AI agent / MCP / CLI ergonomics and token efficiencyenhancementNew feature or requesttoken-efficiencyReduces agent token/context cost

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions