Skip to content

feat: Science based system prompt overspec audit and mitigation#16174

Closed
micuintus wants to merge 8 commits intoanomalyco:devfrom
micuintus:feature/issues/16170_Overspec_Audit_and_Mitgation
Closed

feat: Science based system prompt overspec audit and mitigation#16174
micuintus wants to merge 8 commits intoanomalyco:devfrom
micuintus:feature/issues/16170_Overspec_Audit_and_Mitgation

Conversation

@micuintus
Copy link

Issue for this PR

Closes #16170

Type of change

  • Bug fix
  • New feature

What does this PR do?

  • Add a system prompt audit to CI (warning, not blocking)
  • Audit the current system prompts
  • Remove redundancies in current system prompt

How did you verify your code works?

Testing

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Hey! Your PR title Science based system prompt overspec audit and mitigation doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@micuintus micuintus force-pushed the feature/issues/16170_Overspec_Audit_and_Mitgation branch from 36bbfa3 to c4538b1 Compare March 5, 2026 12:44
@micuintus micuintus requested a review from adamdotdevin as a code owner March 5, 2026 12:44
@micuintus micuintus changed the title Science based system prompt overspec audit and mitigation feat: Science based system prompt overspec audit and mitigation Mar 5, 2026
Michael Voigt added 8 commits March 5, 2026 12:47
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
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
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
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
Reduce token count from 1937 to ~1400 by:

- Reduce examples from 18 to 7

- Remove duplicate IMPORTANT statements

- Consolidate verbosity guidelines
Remove verbose task management examples and explanations

Streamline tool usage policy section

Keep core functionality intact
Reduce examples from 10 to 5

Bring token count under 400 threshold
Add npm script to run prompt overspecification audit

Usage: bun run audit:prompts
@micuintus micuintus force-pushed the feature/issues/16170_Overspec_Audit_and_Mitgation branch from c4538b1 to d0af084 Compare March 5, 2026 12:47
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

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.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 5, 2026
@github-actions github-actions bot closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: System prompt over specification audit and mitigation

1 participant