Repository navigation
Description
Problem
budjira ai usage-prompt renders settings.ai_prompt_template, and
Settings.load_ai_prompt_template() returns the contents of
~/.config/budjira/ai-prompt-template.toml when that file exists, falling back to
get_default_ai_prompt_template() (the code defaults) only when it does not.
The regeneration command documented in CLAUDE.md and in the pre-commit hook
uv run budjira -q ai usage-prompt --plain > .claude/ai-usage-prompt.mdtherefore produces different output on different machines. On a machine that has
ever written a local template, the committed .claude/ai-usage-prompt.md reflects that
local file rather than the current code.
Observed impact
On a developer machine with an older local template, the checked-in prompt was missing
whole sections that exist in the code defaults:
- the
--parentsub-task documentation (added in v1.21.0) - the "Sprint Management (Write Operations)" section
Regenerating on that machine did not restore them — it reproduced the stale local
template. The file was only corrected by generating with an isolated XDG_CONFIG_HOME
so the code defaults applied (see PR #104).
Why the freshness hook cannot catch it
scripts/check_ai_prompt.py::generate_expected_prompt() builds its comparison baseline
with the same command:
["uv", "run", "budjira", "-q", "ai", "usage-prompt", "--plain"]So on a machine with a stale local template, the generated baseline is stale too, the
comparison matches, and the hook reports the file as up to date while it is missing
documented features. The hook is not wrong about the file it compares — it compares the
wrong thing.
Reproduction
# 1. Regenerate normally (uses the local template if present)
uv run budjira -q ai usage-prompt --plain > /tmp/local.md
# 2. Regenerate against code defaults only
XDG_CONFIG_HOME=$(mktemp -d) XDG_DATA_HOME=$(mktemp -d) \
uv run budjira -q ai usage-prompt --plain > /tmp/defaults.md
# 3. On a machine with a local template, these differ
diff /tmp/local.md /tmp/defaults.mdProposed direction
The repo's AI docs should be a function of the code, never of one developer's config.
Options, roughly in order of preference:
- Add a flag such as
--defaults(or--no-user-template) that bypasses the local
template, and use it in both the documented regeneration command and
scripts/check_ai_prompt.py. - Have
scripts/check_ai_prompt.pygenerate its baseline from
get_default_ai_prompt_template()directly, so the hook at least detects the drift
even if regeneration stays manual. - Decide that the local template overlay is not worth its cost for a file that is
committed, and drop the user-template layer for this command.
Option 1 keeps the user-template feature intact for interactive use while making the
committed artifact reproducible.
Notes
Found while regenerating the prompt for #101. Not a regression from that work — the
drift predates it.
Activity
f3rdy commentedon Aug 13, 2026
Released in v1.23.0: https://github.com/cdds-ab/budjira/releases/tag/v1.23.0