Skip to content

CLI mirror for loopover_draft_pr_body #6741

Description

@JSONbored

Context

The MCP tool loopover_draft_pr_body (src/mcp/server.ts:2678, via draftPrBody/analyzeLocalBranch at src/mcp/server.ts:4460-4470) calls buildPublicPrBodyDraft(analysis) (src/services/pr-body-draft.ts:146) on top of a LocalBranchAnalysis. The CLI's existing loopover_prepare_pr_packet stdio tool (loopover-mcp.js:1800-1809) already fetches this same analysis via analyzeCurrentBranch/POST /v1/local/branch-analysis but returns only { local, prPacket } — no draft-body field.

Requirements

  • Export buildPublicPrBodyDraft from @loopover/engine so the CLI can compute the draft locally from the analysis it already has, matching the local-write-tools.ts re-export pattern.
  • Add registerStdioTool("loopover_draft_pr_body", ...) and a --format markdown output option.

Deliverables

  • buildPublicPrBodyDraft exported from @loopover/engine
  • registerStdioTool("loopover_draft_pr_body", ...)
  • Unit test

Test Coverage Requirements

99%+ Codecov patch coverage on every changed line and branch in the new route/tool/CLI code, plus a test asserting output parity between the mirrored surfaces for identical input.

Expected Outcome

A contributor can draft a PR body from the CLI before opening the PR, without needing the MCP server.

Links & Resources

Precedent: registerStdioTool("loopover_prepare_pr_packet", ...) at loopover-mcp.js:1800-1809.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions