Skip to content

About

Semantic diff engine & regression analyzer for AI agent prompts, token budgets, and prompt smells

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

prompt-diff

License: MIT

A zero-dependency semantic diff engine and regression detector for AI agent system prompts, skills, and LLM instruction templates.


Why prompt-diff?

Standard git diff only cares about character changes. When working with AI coding agents:

  • Adding a single casual paragraph can quietly add 300+ tokens to every single execution.
  • Soft instructions ("Please do not forget...") weaken model steerability and cause silent hallucinations.
  • Unintentional ALL-CAPS shouting degrades reasoning coherence.

prompt-diff evaluates prompt edits with token-budget deltas and automated prompt smell detection.


What it detects

  • Token Delta: Exact token count shift and percentage drift (+45 tokens (+18%)).
  • Weak Negations: Flags phrases like "Don't forget to..." or "Never under any circumstances...".
  • Pleading & Politeness: Flags filler tokens like "Please", "Kindly", "You are a helpful assistant".
  • CoT Overuse: Flags unnecessary "Think step by step" triggers on models with native reasoning loops.
  • Caps Shouting: Detects aggressive multi-word ALL CAPS bloat.

Quick Usage

# Compare two prompt iterations
npx prompt-diff system_prompt_v1.md system_prompt_v2.md

# Output JSON for CI automated checks
npx prompt-diff prompt_base.txt prompt_pr.txt --json

License

MIT © luckdevx

About

Semantic diff engine & regression analyzer for AI agent prompts, token budgets, and prompt smells

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages