Skip to content

pull-request skill: pre-create gate must verify non-empty '## Related' section #975

Description

@kyle-sexton

Context

The pr-issue-linkage gate requires BOTH a closing keyword (or explicit no-issue opt-out) AND a non-empty ## Related section. The source-control:pull-request skill's pre-create gate (create.md §2.4.2) greps only for the closing keyword — it never verifies ## Related — so agent-composed bespoke PR bodies pass the skill-side check and fail at CI. This is the top confirmed break behind the fleet's most-reported CI failure (5 of 6 recent claude-code-plugins linkage failures were the ## Related error; PR #934 shows the fail-at-open → edit-body → pass-81s-later churn cycle). Affects both cached plugin versions (0.15.8, 0.16.2) — logic gap, not staleness.

Proposed work

  • Extend the pre-create gate in the pull-request skill's create flow to verify a non-empty ## Related section (mirroring the gate's actual validation, ideally sourced from/tested against the ci-workflows pr-issue-linkage logic rather than a hand-copied regex)
  • Ensure the body-assembly path always scaffolds ## Related (with - N/A default) for bespoke bodies, not only the template heredoc path

Acceptance criteria

  • A PR body missing/empty ## Related is caught before gh pr create, with a fix hint
  • The skill-side check provably matches the gate's validation (test or shared source), so they cannot drift

References

  • medley docs/topics/cicd-fleet-audit/REPORT.md — issue-linkage root cause (break 1 of 3)
  • Evidence: .work/cicd-fleet-audit/data/issue-linkage-chain.md in medley
  • ci-workflows#153 (enforcement-scope decision for remaining body sections — coordinate)

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highSignificant impact, or blocks an imminent release; staff this cycle.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions