From b9b5aaea288ad81de679cae9eacacbac73e87cff Mon Sep 17 00:00:00 2001 From: Franck Cuny <59291+fcuny@users.noreply.github.com> Date: Fri, 28 Feb 2025 19:19:53 -0800 Subject: =?UTF-8?q?=F0=9F=9A=80=20Refactor=20LLM=20config:=20Move=20to=20s?= =?UTF-8?q?tandardized=20templates=20and=20improve=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Migrated prompts from text files to YAML templates in `.config/llm/templates/` directory - Updated fish shell aliases to use the new template system with `-t` flag instead of reading files - Enhanced justfile's `llm` target with proper Claude model setup and 1Password integration - Added `LLM_USER_PATH` environment variable for consistent configuration path - Fixed PR prompt format to better organize content and remove issue resolution section - Updated Nix configuration to support the new file structure The changes standardize our LLM prompt system and make it more maintainable, while improving the setup experience for new users. 🧰 --- nix/users/fcuny/llm.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'nix') diff --git a/nix/users/fcuny/llm.nix b/nix/users/fcuny/llm.nix index 48604c3..407cead 100644 --- a/nix/users/fcuny/llm.nix +++ b/nix/users/fcuny/llm.nix @@ -1,16 +1,22 @@ { ... }: { - home.file.".config/prompts/pr-prompt.txt".text = - builtins.readFile ../../../configs/prompts/pr-prompt.txt; + # we need this path to be created. + home.file.".configs/llm/templates/.keep".text = "# Managed by Home Manager"; + home.file.".config/llm/templates/pr-prompt.yaml".text = + builtins.readFile ../../../configs/llm/templates/pr-prompt.yaml; - home.file.".config/prompts/commit-system-prompt.txt".text = - builtins.readFile ../../../configs/prompts/commit-system-prompt.txt; + home.file.".config/llm/templates/commit-prompt.yaml".text = + builtins.readFile ../../../configs/llm/templates/commit-prompt.yaml; programs.fish = { shellAliases = { - commit-msg = "git diff HEAD | llm -m claude-3.5-sonnet -s (cat ~/.config/prompts/commit-system-prompt.txt |psub)"; - pr-msg = "git diff HEAD | llm -m claude-3.5-sonnet -s (cat ~/.config/prompts/pr-prompt.txt |psub)"; + commit-msg = "git diff --cached | llm -t commit-prompt"; + pr-msg = "git diff HEAD | llm -t pr-prompt"; }; }; + + home.sessionVariables = { + LLM_USER_PATH = "$HOME/.config/llm"; + }; } -- cgit v1.2.3