From c4fecf6bfdaa846c5657b82325501047189aed5d Mon Sep 17 00:00:00 2001 From: Franck Cuny <59291+fcuny@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:24:13 -0800 Subject: =?UTF-8?q?=F0=9F=A4=96=20Add=20LLM=20tooling=20and=20prompts=20fo?= =?UTF-8?q?r=20Git=20workflow=20automation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add new section in README about LLM tooling installation - Create prompts directory with templates for commit and PR messages - Add new llm.nix module with: - Configuration for prompt file locations - Fish shell aliases for generating commit and PR messages using Claude 3.5 - Add `llm` recipe in justfile to install llm CLI tool and Anthropic provider - Integrate LLM module into home-manager configuration The changes introduce automation for generating high-quality commit messages and PR descriptions using AI, while keeping the prompts configurable and version controlled. --- nix/users/fcuny/home-manager.nix | 1 + nix/users/fcuny/llm.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 nix/users/fcuny/llm.nix (limited to 'nix') diff --git a/nix/users/fcuny/home-manager.nix b/nix/users/fcuny/home-manager.nix index 9fd2983..0a3f6fc 100644 --- a/nix/users/fcuny/home-manager.nix +++ b/nix/users/fcuny/home-manager.nix @@ -11,6 +11,7 @@ ./shell.nix ./ssh.nix ./git.nix + ./llm.nix ] ++ lib.optionals darwin [ ./1password.nix diff --git a/nix/users/fcuny/llm.nix b/nix/users/fcuny/llm.nix new file mode 100644 index 0000000..48604c3 --- /dev/null +++ b/nix/users/fcuny/llm.nix @@ -0,0 +1,16 @@ +{ ... }: +{ + + home.file.".config/prompts/pr-prompt.txt".text = + builtins.readFile ../../../configs/prompts/pr-prompt.txt; + + home.file.".config/prompts/commit-system-prompt.txt".text = + builtins.readFile ../../../configs/prompts/commit-system-prompt.txt; + + 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)"; + }; + }; +} -- cgit v1.2.3