diff options
| author | Craig Jennings <c@cjennings.net> | 2026-03-29 16:27:59 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-03-29 16:27:59 -0500 |
| commit | f894e07ea3c39620e37245f1e1bf829e853bbe5b (patch) | |
| tree | 1ddfd779e37b53e397ec67e3796ad7933eeb7d21 /Makefile | |
| parent | 861bab677b4632e9d30e6318bc2a35c36ee77105 (diff) | |
| download | rulesets-f894e07ea3c39620e37245f1e1bf829e853bbe5b.tar.gz rulesets-f894e07ea3c39620e37245f1e1bf829e853bbe5b.zip | |
Add hooks settings.json with install-hooks target
Hooks provide:
- PostEditTool: ruff format/check on Python, terraform fmt on .tf
- PreCommit: block commits containing hardcoded secrets (AWS keys, API tokens, passwords)
Install per-project with: make install-hooks TARGET=/path/to/project
Won't overwrite existing settings.json — shows diff command instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -3,7 +3,7 @@ RULES_DIR := $(HOME)/.claude/rules SKILLS := c4-analyze c4-diagram debug add-tests respond-to-review review-pr fix-issue security-check RULES := $(wildcard claude-rules/*.md) -.PHONY: install uninstall list +.PHONY: install uninstall install-hooks list install: @mkdir -p $(SKILLS_DIR) $(RULES_DIR) @@ -34,6 +34,20 @@ install: @echo "" @echo "done" +install-hooks: +ifndef TARGET + $(error Usage: make install-hooks TARGET=/path/to/project) +endif + @mkdir -p $(TARGET)/.claude + @if [ -e "$(TARGET)/.claude/settings.json" ]; then \ + echo " WARN $(TARGET)/.claude/settings.json already exists — not overwriting"; \ + echo " Compare with: diff $(CURDIR)/hooks/settings.json $(TARGET)/.claude/settings.json"; \ + else \ + cp "$(CURDIR)/hooks/settings.json" "$(TARGET)/.claude/settings.json"; \ + echo " copy settings.json → $(TARGET)/.claude/settings.json"; \ + fi + @echo "done" + uninstall: @echo "Skills:" @for skill in $(SKILLS); do \ |
