CraftBot icon indicating copy to clipboard operation
CraftBot copied to clipboard

[V1.3.4] Prompt Optimizations

Open ahmad-ajmal opened this issue 5 months ago • 0 comments

Prompt optimization, version control & profiling

Problem

Prompts in agent_core/core/prompts/ have grown to ~1,600 lines with duplicated instructions and dead fragments. We pay for this bloat on every LLM call, prompt edits are buried in unrelated code diffs, and we have no way to measure if a change helped.

Goals

  • Chunk prompts into reusable fragments (role, policy, action-space, etc.) so shared text is defined once.
  • Dedupe & prune redundant instructions and unused constants.
  • Version control each prompt as a first-class unit — every prompt gets a name + version, and changes are independently diffable, revertible, and trackable (not lost inside larger code commits). Built on top of the existing PromptRegistry.
  • Profile token cost per prompt and add a basic quality eval so changes report a delta, not vibes.

Acceptance criteria

  • [ ] Prompts split into fragments; no instruction duplicated across modules.
  • [ ] Dead prompts removed; token reduction documented (before/after).
  • [ ] Each prompt has a name + version with an auditable, diffable history.
  • [ ] Prompt changes can be reverted independently of surrounding code.
  • [ ] Per-prompt token profiling available.
  • [ ] A quality eval reports a delta on a prompt change.
  • [ ] Backward compat preserved via app/prompt.py re-exports.

ahmad-ajmal avatar Jun 10 '26 02:06 ahmad-ajmal