[PR #7013] fix(tool): require PR template check before creating PRs #12201

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

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

State: open
Merged: No


Closes #12397

Summary

Adds mandatory PR template checking to bash tool's PR creation workflow, using Glob tool for flexible discovery and providing a fallback format.

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.

Solution

  1. Use Glob tool instead of hardcoded paths to find:

    • **/pull_request_template.md, **/PULL_REQUEST_TEMPLATE.md
    • **/AGENTS.md, **/CONTRIBUTING.md
  2. Provide fallback format when no template exists:

    ## Summary
    - Concise description of changes (1-3 bullet points)
    
    ## Changes
    - List key modifications
    
  3. Removed hardcoded example that caused agents to ignore templates

Changes

  • Step 1: Use Glob to find template files (not hardcoded paths)
  • Step 3: Follow template if found, otherwise use fallback format
  • Added explicit fallback structure for projects without templates
  • Removed misleading example section

Impact

Agents will now:

  1. Use Glob to flexibly find templates anywhere in repo
  2. Follow project templates when they exist
  3. Use a consistent fallback format when no template exists
  4. Not blindly use hardcoded formats
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7013 **State:** open **Merged:** No --- Closes #12397 ## Summary Adds mandatory PR template checking to bash tool's PR creation workflow, using Glob tool for flexible discovery and providing a fallback format. ## 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. ## Solution 1. **Use Glob tool** instead of hardcoded paths to find: - `**/pull_request_template.md`, `**/PULL_REQUEST_TEMPLATE.md` - `**/AGENTS.md`, `**/CONTRIBUTING.md` 2. **Provide fallback format** when no template exists: ``` ## Summary - Concise description of changes (1-3 bullet points) ## Changes - List key modifications ``` 3. **Removed hardcoded example** that caused agents to ignore templates ## Changes - Step 1: Use Glob to find template files (not hardcoded paths) - Step 3: Follow template if found, otherwise use fallback format - Added explicit fallback structure for projects without templates - Removed misleading example section ## Impact Agents will now: 1. Use Glob to flexibly find templates anywhere in repo 2. Follow project templates when they exist 3. Use a consistent fallback format when no template exists 4. Not blindly use hardcoded formats
yindo added the pull-request label 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#12201