From ce66de633129abc94df03ab5da91ba2ca2e93330 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 6 May 2026 06:09:02 -0500 Subject: feat(claude): add claude config and wire it into make install I moved Claude Code's user-level config into this repo so it travels with rulesets across machines instead of being machine-specific. The three pieces are settings.json, .mcp.json, and commands/refactor.md. I extended make install, uninstall, and list to handle the new .claude/ directory. The wildcard for CLAUDE_CONFIG matches both `*.json` and `.*.json` because make's glob skips dotfiles by default. Without the dot variant, .mcp.json wouldn't get picked up. I also added settings.local.json to .gitignore. That file is per-machine by convention and shouldn't ever land in the shared repo. --- Makefile | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 62cb9d8..c368e2f 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,15 @@ .DEFAULT_GOAL := help SHELL := /bin/bash -SKILLS_DIR := $(HOME)/.claude/skills -RULES_DIR := $(HOME)/.claude/rules -HOOKS_DIR := $(HOME)/.claude/hooks -SKILLS := $(patsubst %/SKILL.md,%,$(wildcard */SKILL.md)) -RULES := $(wildcard claude-rules/*.md) -HOOKS := $(wildcard hooks/*.sh hooks/*.py) -LANGUAGES := $(notdir $(wildcard languages/*)) +SKILLS_DIR := $(HOME)/.claude/skills +RULES_DIR := $(HOME)/.claude/rules +HOOKS_DIR := $(HOME)/.claude/hooks +CLAUDE_DIR := $(HOME)/.claude +SKILLS := $(patsubst %/SKILL.md,%,$(wildcard */SKILL.md)) +RULES := $(wildcard claude-rules/*.md) +HOOKS := $(wildcard hooks/*.sh hooks/*.py) +CLAUDE_CONFIG := $(wildcard .claude/*.json) $(wildcard .claude/.*.json) +LANGUAGES := $(notdir $(wildcard languages/*)) # Pick target project — use PROJECT= or interactive fzf over local .git dirs. # Defined inline in each recipe (not via $(shell)) so fzf only runs when needed. @@ -131,6 +133,29 @@ install: ## Symlink skills and rules into ~/.claude/ echo " link claude-rules → $(SKILLS_DIR)/claude-rules"; \ fi @echo "" + @echo "Claude config:" + @for f in $(CLAUDE_CONFIG); do \ + name=$$(basename $$f); \ + if [ -L "$(CLAUDE_DIR)/$$name" ]; then \ + echo " skip $$name (already linked)"; \ + elif [ -e "$(CLAUDE_DIR)/$$name" ]; then \ + echo " WARN $$name exists and is not a symlink — skipping"; \ + else \ + ln -s "$(CURDIR)/$$f" "$(CLAUDE_DIR)/$$name"; \ + echo " link $$name → $(CLAUDE_DIR)/$$name"; \ + fi \ + done + @if [ -d ".claude/commands" ]; then \ + if [ -L "$(CLAUDE_DIR)/commands" ]; then \ + echo " skip commands (already linked)"; \ + elif [ -e "$(CLAUDE_DIR)/commands" ]; then \ + echo " WARN commands exists and is not a symlink — skipping"; \ + else \ + ln -s "$(CURDIR)/.claude/commands" "$(CLAUDE_DIR)/commands"; \ + echo " link commands → $(CLAUDE_DIR)/commands"; \ + fi \ + fi + @echo "" @echo "done" uninstall: ## Remove global symlinks from ~/.claude/ @@ -163,6 +188,23 @@ uninstall: ## Remove global symlinks from ~/.claude/ echo " skip claude-rules (not a symlink)"; \ fi @echo "" + @echo "Claude config:" + @for f in $(CLAUDE_CONFIG); do \ + name=$$(basename $$f); \ + if [ -L "$(CLAUDE_DIR)/$$name" ]; then \ + rm "$(CLAUDE_DIR)/$$name"; \ + echo " rm $$name"; \ + else \ + echo " skip $$name (not a symlink)"; \ + fi \ + done + @if [ -L "$(CLAUDE_DIR)/commands" ]; then \ + rm "$(CLAUDE_DIR)/commands"; \ + echo " rm commands"; \ + else \ + echo " skip commands (not a symlink)"; \ + fi + @echo "" @echo "done" list: ## Show global install status @@ -194,6 +236,21 @@ list: ## Show global install status echo " - $$name"; \ fi \ done + @echo "" + @echo "Claude config:" + @for f in $(CLAUDE_CONFIG); do \ + name=$$(basename $$f); \ + if [ -L "$(CLAUDE_DIR)/$$name" ]; then \ + echo " ✓ $$name (installed)"; \ + else \ + echo " - $$name"; \ + fi \ + done + @if [ -L "$(CLAUDE_DIR)/commands" ]; then \ + echo " ✓ commands (installed)"; \ + else \ + echo " - commands"; \ + fi install-hooks: ## Symlink global hooks into ~/.claude/hooks/ + print settings.json snippet @mkdir -p $(HOOKS_DIR) -- cgit v1.2.3