feat: system prompt overspec audit and mitigation#16343
Open
micuintus wants to merge 8 commits intoanomalyco:devfrom
Open
feat: system prompt overspec audit and mitigation#16343micuintus wants to merge 8 commits intoanomalyco:devfrom
micuintus wants to merge 8 commits intoanomalyco:devfrom
Conversation
added 8 commits
March 6, 2026 11:21
Create script/audit-overspecification.ts that: - Audits all session and agent prompt files - Measures tokens (chars/4), directives (MUST/NEVER/ALWAYS/IMPORTANT/CRITICAL), and examples (XML and markdown patterns) - Compares against thresholds by prompt type: - Provider: ≤1500 tokens, ≤12 directives, ≤5 examples - Utility: ≤200 tokens, ≤4 directives, ≤0 examples - Agent: ≤400 tokens, ≤6 directives, ≤3 examples - Meta: ≤800 tokens, ≤0 directives, ≤0 examples - Outputs structured report to stdout, violations to stderr - Runs in warning mode (exit 0) for CI integration Issue: anomalyco#16339
Reduce token count from 3843 to ~2400 by: - Remove New Applications section (~500 tokens) - Remove 3 verbose examples (Delete temp, Write tests, Find config) - Keep 5 most illustrative examples - Remove redundant tool usage instructions Issue: anomalyco#16339
Reduce token count from 2770 to ~1200 by: - Consolide repetitive 'keep going' directives - Simplify 10-step workflow to 9 concise steps - Remove Reading Files section (redundant) - Remove Writing Prompts section (not relevant) - Compress Communication Guidelines - Keep Memory section as flagged for review Issue: anomalyco#16339
Reduce token count from 2425 to ~1700 by: - Remove duplicate IMPORTANT statements about conciseness - Reduce examples from 18 to 7 - Remove redundant tool usage instructions - Consolidate security warnings Issue: anomalyco#16339
Reduce token count from 1937 to ~1400 by: - Reduce examples from 18 to 7 - Remove duplicate IMPORTANT statements - Consolidate verbosity guidelines Issue: anomalyco#16339
Remove verbose task management examples and explanations Streamline tool usage policy section Keep core functionality intact Issue: anomalyco#16339
Reduce examples from 10 to 5 Bring token count under 400 threshold Issue: anomalyco#16339
Add npm script to run prompt overspecification audit Usage: bun run audit:prompts Issue: anomalyco#16339
Contributor
|
Thanks for updating your PR! It now meets our contributing 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 #16339
Type of change
What does this PR do?
How did you verify your code works?
Manual testing
Screenshots / recordings
No UI change
Checklist