opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix(tool): require PR template check before creating PRs

Open scarf005 opened this issue 1 week ago • 3 comments

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

scarf005 avatar Jan 06 '26 01:01 scarf005