Skip to content

ai usage-prompt renders the local template, so the checked-in AI docs are machine-dependent #105

Closed

Description

@f3rdy

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.md

therefore 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 --parent sub-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.md

Proposed 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:

  1. 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.
  2. Have scripts/check_ai_prompt.py generate its baseline from
    get_default_ai_prompt_template() directly, so the hook at least detects the drift
    even if regeneration stays manual.
  3. 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

  1. added
    documentation
    on Aug 1, 2026
  2. f3rdy commented on Aug 13, 2026

    @f3rdy
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions