[PR #7012] fix(tool): require PR template check before creating PRs #12199

Closed
opened 2026-02-16 18:17:07 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7012

State: closed
Merged: No


Summary

Adds mandatory PR template checking step to bash tool's PR creation workflow.

Problem

The bash tool's "Creating pull requests" section had a hardcoded example format (## Summary) that agents would blindly follow, ignoring project-specific PR templates like .github/pull_request_template.md or project guidelines in AGENTS.md.

This caused agents to create PRs with generic formats instead of following the actual template structure required by the project.

Solution

Added Step 1 to the PR creation workflow that requires checking:

  • .github/pull_request_template.md or PULL_REQUEST_TEMPLATE.md
  • AGENTS.md or .github/AGENTS.md for PR-specific instructions
  • CONTRIBUTING.md for contribution guidelines

Removed the hardcoded example format and replaced with explicit instruction to follow project templates.

Changes

  • Added template checking as mandatory first step
  • Removed misleading <example> section with hardcoded ## Summary format
  • Added warning: "CRITICAL: If a PR template exists, follow its exact structure. Do NOT use a generic format."
  • Renumbered steps to accommodate new template check

Impact

Agents will now:

  1. Read project-specific templates BEFORE drafting PR body
  2. Follow the exact structure required by each project
  3. Not use generic formats that violate project conventions
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7012 **State:** closed **Merged:** No --- ## Summary Adds mandatory PR template checking step to bash tool's PR creation workflow. ## Problem The bash tool's "Creating pull requests" section had a hardcoded example format (`## Summary`) that agents would blindly follow, ignoring project-specific PR templates like `.github/pull_request_template.md` or project guidelines in `AGENTS.md`. This caused agents to create PRs with generic formats instead of following the actual template structure required by the project. ## Solution Added Step 1 to the PR creation workflow that requires checking: - `.github/pull_request_template.md` or `PULL_REQUEST_TEMPLATE.md` - `AGENTS.md` or `.github/AGENTS.md` for PR-specific instructions - `CONTRIBUTING.md` for contribution guidelines Removed the hardcoded example format and replaced with explicit instruction to follow project templates. ## Changes - Added template checking as mandatory first step - Removed misleading `<example>` section with hardcoded `## Summary` format - Added warning: "**CRITICAL**: If a PR template exists, follow its exact structure. Do NOT use a generic format." - Renumbered steps to accommodate new template check ## Impact Agents will now: 1. Read project-specific templates BEFORE drafting PR body 2. Follow the exact structure required by each project 3. Not use generic formats that violate project conventions
yindo added the pull-request label 2026-02-16 18:17:07 -05:00
yindo closed this issue 2026-02-16 18:17:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12199