Skip to content

fix: Plan orchestrator createPR should load PR templates #42

@nigel-dev

Description

@nigel-dev

Description

The standalone mc_pr tool (updated in #38) loads PR templates from .github/pull_request_template.md and 4 other candidate paths. The plan orchestrator's createPR() method in orchestrator.ts does not — it generates its own body with a job status table but completely ignores the project's PR template.

This means:

  • Standalone jobs (mc_launchmc_pr): PR uses the project template ✅
  • Plan jobs (mc_plan → auto PR): PR ignores the project template ❌

Current Behavior

orchestrator.ts createPR() builds a hardcoded body:

const body = [
  '## Summary',
  `Orchestrated plan **${plan.name}** with ${plan.jobs.length} job(s).`,
  '## Jobs',
  // ... job table
  '## Testing',
  // ... test info
].join('\n');

No template loading. No awareness of .github/pull_request_template.md.

Expected Behavior

The orchestrator should:

  1. Load the PR template (using the same loadPrTemplate() from src/tools/pr.ts or a shared utility)
  2. Populate the template sections with plan-specific data (job table, test results)
  3. Fall back to the current generated body if no template exists

Proposed Solution

  1. Extract loadPrTemplate() from src/tools/pr.ts into a shared utility (e.g., src/lib/pr-template.ts)
  2. In orchestrator.ts createPR():
    • Load the template
    • If template exists, populate ## Summary with plan description, ## Changes with job table, ## Testing with test results, ## Notes with integration metadata
    • If no template, use the current generated body
  3. Import and use the shared utility in both mc_pr and orchestrator.ts

Files

  • src/tools/pr.ts — extract loadPrTemplate() to shared utility
  • src/lib/orchestrator.ts — use template in createPR()
  • New: src/lib/pr-template.ts — shared template loading utility

Priority

P3 — cosmetic improvement. PRs still get created, just without the template structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: lowNice to have — polish, cleanup, or long-termenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions