Add Repository Custom Instructions validation (existence + 4000-char limit)#9
Draft
Copilot wants to merge 3 commits into
Draft
Add Repository Custom Instructions validation (existence + 4000-char limit)#9Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Copilot
AI
changed the title
[WIP] Validate 4000 character limit for custom instruction files
Add Repository Custom Instructions validation (existence + 4000-char limit)
May 12, 2026
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.
New Feature
GitHub Copilot silently truncates or ignores Repository Custom Instructions files that exceed 4,000 characters. This adds an explicit validation script that catches violations across all repositories and halts with a non-zero exit code.
What does this feature do?
Implementation details
validate_custom_instructions.py— follows the same patterns as existing assessment scripts (parallelThreadPoolExecutor, rate-limit guard,CONFIGdict):Excel report (
custom_instructions_violations_YYYYMMDD_HHMMSS.xlsx) columns: Repository · File Path · Character Count · Limit · Excess Characters · GitHub Copilot Rule. Falls back to CSV whenopenpyxlis not installed.test_validate_custom_instructions.py— 19unittesttests covering: no file found, file within limit, file over limit, exact-boundary (4000 chars valid / 4001 invalid), multi-repo violations,instructions/directory scanning, Excel output integrity.Other changes
.gitignore— added*.xlsxREADME.md/AGENTS.md— documented new script, install step (pip install openpyxl), exit codes, and output format