Prompt Dir Task Brief¶
Implement the tnh-gen --prompt-dir global flag.
Goal¶
Allow one-off tnh-gen calls to override the prompt catalog directory from the command line.
Example:
Expected Behavior¶
- Add a global
--prompt-diroption totnh-gen. - The flag should override all lower-precedence prompt directory sources.
- The override should flow through the existing
tnh-genconfig loading path. - Existing config behavior should remain unchanged when
--prompt-diris not supplied.
Precedence To Preserve¶
Effective precedence should be:
- defaults and environment
- user config
- workspace config
- explicit
--config - CLI overrides, including
--prompt-dir
Likely Files¶
src/tnh_scholar/cli_tools/tnh_gen/tnh_gen.pysrc/tnh_scholar/cli_tools/tnh_gen/config_loader.pytests/cli_tools/test_tnh_gen.pytests/cli_tools/test_tnh_gen_coverage.pydocs/cli-reference/tnh-gen.md
Validation¶
At minimum, run targeted tests covering:
If the implementation changes broader config behavior, add or run the relevant config tests too.
Success Criteria¶
tnh-gen --prompt-dir <dir> listuses the supplied prompt directory.--prompt-dirwins over env, user config, workspace config, and explicit config file values.- Missing or invalid prompt directory errors remain clear.
- CLI reference docs mention the new global flag.
- Targeted tests pass.