From 3be23304c4eaccdd3430d5ca8ea745aa0063d319 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Sat, 22 Nov 2025 09:47:55 -0800 Subject: [PATCH] [development] Fix humanlayer plugins Removes model specification to better support Claude Code Pro plan. Because of this, I also re-removed this role from home-darwin-work as we can take advantage of more powerful models in that context. We will just need to install the plugins external from nix. Eventually I can turn this into a config option of course. Also made sure we are installing the agents from the plugin in addition to the commands. --- home/home-darwin-work.nix | 1 - home/roles/development/default.nix | 31 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/home/home-darwin-work.nix b/home/home-darwin-work.nix index 823e808..525902e 100644 --- a/home/home-darwin-work.nix +++ b/home/home-darwin-work.nix @@ -222,7 +222,6 @@ in home.roles = { base.enable = true; - development.enable = true; }; imports = [ diff --git a/home/roles/development/default.nix b/home/roles/development/default.nix index 87b82f7..e7fbef7 100644 --- a/home/roles/development/default.nix +++ b/home/roles/development/default.nix @@ -31,24 +31,41 @@ in programs.kubectl-secure.enable = true; - # Install Claude Code humanlayer command plugins + # Install Claude Code humanlayer command and agent plugins home.activation.claudeCodeCommands = lib.hm.dag.entryAfter ["writeBoundary"] '' - # Clean up old plugin-installed commands to avoid duplicates + # Clean up old plugin-installed commands and agents to avoid duplicates rm -f ~/.claude/commands/humanlayer:* 2>/dev/null || true + rm -f ~/.claude/agents/humanlayer:* 2>/dev/null || true - # Create commands directory if it doesn't exist + # Create directories if they don't exist mkdir -p ~/.claude/commands + mkdir -p ~/.claude/agents - # Copy all humanlayer command files + # Copy all humanlayer command files and remove model specifications for file in ${claudePluginsRepo}/humanlayer/commands/*.md; do if [ -f "$file" ]; then filename=$(basename "$file" .md) - # Create symlink with the namespace prefix - ln -sf "$file" ~/.claude/commands/humanlayer:''${filename}.md + dest="$HOME/.claude/commands/humanlayer:''${filename}.md" + + # Copy file and remove the "model:" line from frontmatter + # This allows Claude Code Pro to use the default model + ${pkgs.gnused}/bin/sed '/^model:/d' "$file" > "$dest" fi done - $DRY_RUN_CMD echo "Claude Code humanlayer commands installed successfully" + # Copy all humanlayer agent files and remove model specifications + for file in ${claudePluginsRepo}/humanlayer/agents/*.md; do + if [ -f "$file" ]; then + filename=$(basename "$file" .md) + dest="$HOME/.claude/agents/humanlayer:''${filename}.md" + + # Copy file and remove the "model:" line from frontmatter + # This allows Claude Code Pro to use the default model + ${pkgs.gnused}/bin/sed '/^model:/d' "$file" > "$dest" + fi + done + + $DRY_RUN_CMD echo "Claude Code humanlayer commands and agents installed successfully (model selection removed)" ''; # Note: modules must be imported at top-level home config