From 2d645fcfcebf27e89dd30169e7122ff5bbb49dcc Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 15 May 2026 17:02:34 -0500 Subject: chore(make): fold bin/ai launcher install into rulesets The ai launcher's install/uninstall logic lived in claude-templates/Makefile when claude-templates was a separate repo. After the fold, that Makefile still works locally but rulesets' make install is the single entry point. Add ai-launcher targets to rulesets/Makefile so `make install` covers it alongside skills, rules, commands, and Claude config. Install detects an existing symlink pointing at a stale source (e.g. ~/projects/claude-templates/bin/ai from before the fold) and relinks to the new canonical path under ~/code/rulesets/claude-templates/bin/ai. --- Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 38d5151..087e734 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ SKILLS_DIR := $(HOME)/.claude/skills RULES_DIR := $(HOME)/.claude/rules HOOKS_DIR := $(HOME)/.claude/hooks CLAUDE_DIR := $(HOME)/.claude +LOCAL_BIN := $(HOME)/.local/bin +AI_LAUNCHER := $(CURDIR)/claude-templates/bin/ai SKILLS := $(patsubst %/SKILL.md,%,$(wildcard */SKILL.md)) RULES := $(wildcard claude-rules/*.md) HOOKS := $(wildcard hooks/*.sh hooks/*.py) @@ -206,6 +208,25 @@ install: ## Symlink skills and rules into ~/.claude/ fi \ fi @echo "" + @echo "ai launcher:" + @mkdir -p "$(LOCAL_BIN)" + @chmod +x "$(AI_LAUNCHER)" + @if [ -L "$(LOCAL_BIN)/ai" ]; then \ + target=$$(readlink "$(LOCAL_BIN)/ai"); \ + if [ "$$target" = "$(AI_LAUNCHER)" ]; then \ + echo " skip ai (already linked)"; \ + else \ + rm "$(LOCAL_BIN)/ai"; \ + ln -s "$(AI_LAUNCHER)" "$(LOCAL_BIN)/ai"; \ + echo " relink ai → $(AI_LAUNCHER) (was: $$target)"; \ + fi \ + elif [ -e "$(LOCAL_BIN)/ai" ]; then \ + echo " WARN ai exists and is not a symlink — skipping"; \ + else \ + ln -s "$(AI_LAUNCHER)" "$(LOCAL_BIN)/ai"; \ + echo " link ai → $(LOCAL_BIN)/ai"; \ + fi + @echo "" @echo "done" uninstall: ## Remove global symlinks from ~/.claude/ @@ -247,6 +268,14 @@ uninstall: ## Remove global symlinks from ~/.claude/ echo " skip commands (not a symlink)"; \ fi @echo "" + @echo "ai launcher:" + @if [ -L "$(LOCAL_BIN)/ai" ]; then \ + rm "$(LOCAL_BIN)/ai"; \ + echo " rm ai"; \ + else \ + echo " skip ai (not a symlink)"; \ + fi + @echo "" @echo "done" list: ## Show global install status -- cgit v1.2.3