feat: AI tools ignore GitHub repo conventions - PR templates, CONTRIBUTING.md not auto-discovered #31899#31927
Closed
biisal wants to merge 2 commits into
Closed
feat: AI tools ignore GitHub repo conventions - PR templates, CONTRIBUTING.md not auto-discovered #31899#31927biisal wants to merge 2 commits into
biisal wants to merge 2 commits into
Conversation
…es to agent prompts
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #31899
Type of change
What does this PR do?
This PR fixes the issue where pull request templates and contributing guidelines are ignored during instruction file discovery, and ensures system prompts direct the agent to check and follow them.
The Issue
Changes Made
Discovery list expansion: Added CONTRIBUTING.md and common PR template paths (.github/pull_request_template.md, .github/PULL_REQUEST_TEMPLATE.md, pull_request_template.md, PULL_REQUEST_TEMPLATE.md) to instructionFiles in
instruction.ts.Search loop correction: Removed the break from the project-level loop in systemPaths(). Instead of stopping after the first matched file type, it now scans for all configured files. To prevent stacking duplicate rules from ancestor directories, it only adds matches[0] (the closest file instance of each type).
Multi-file resolution: Updated Instruction.find to return string[] (all matching instruction files in a folder) and modified resolve to iterate and attach all resolved paths.
Prompt updates: Added instructions to
default.txtandanthropic.txtprompting the model to check templates/guidelines before creating PRs, and to prioritize resolving bot-flagged issues within any response deadlines (e.g., a 2-hour edit window).
Testing: Added unit tests to
instruction.test.tsto verify that find and resolve work with multiple concurrent instruction files.How did you verify your code works?
1. Automated Unit Tests
Added and ran unit tests in instruction.test.ts to verify the new multi-file resolution behaviors:
find returns all existing instruction files in the directory: Confirmedfindreturns a list of all existing files in a single folder (e.g.AGENTS.mdandCONTRIBUTING.md).resolve returns multiple instruction files from subdirectory: Confirmed that reading a file in a subdirectory correctly resolves and attaches multiple parent instruction files.loads multiple project instruction files when both exist: Verified thatsystemPathsandsystemsuccessfully load both projectAGENTS.mdandCONTRIBUTING.mdinto the startup prompt context.Result: All 12 tests passed successfully.
2. Regression Testing
Ran the full session test suite to ensure the signature change to
findand the updated loop structure didn't introduce any regressions:Result: All 364 tests passed successfully.
3. Typechecking
Ran compiler verification inside the package directory:
cd packages/opencode bun typecheckResult: Completed successfully with no errors.
Checklist