opencode
opencode copied to clipboard
fix(tool): require PR template check before creating PRs
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
-
Use Glob tool instead of hardcoded paths to find:
-
**/pull_request_template.md,**/PULL_REQUEST_TEMPLATE.md -
**/AGENTS.md,**/CONTRIBUTING.md
-
-
Provide fallback format when no template exists:
## Summary - Concise description of changes (1-3 bullet points) ## Changes - List key modifications -
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:
- Use Glob to flexibly find templates anywhere in repo
- Follow project templates when they exist
- Use a consistent fallback format when no template exists
- Not blindly use hardcoded formats