forked from joewalnes/skills
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (53 loc) · 1.74 KB
/
Makefile
File metadata and controls
58 lines (53 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
SKILLS_DIR := $(CURDIR)/skills
TARGET_DIR := $(HOME)/.claude/skills
SKILL_DIRS := $(wildcard $(SKILLS_DIR)/*)
.PHONY: install uninstall list
install:
@mkdir -p "$(TARGET_DIR)"
@for skill in $(SKILL_DIRS); do \
name=$$(basename "$$skill"); \
target="$(TARGET_DIR)/$$name"; \
if [ -L "$$target" ] && [ "$$(readlink "$$target")" = "$$skill" ]; then \
echo " ok $$name (already linked)"; \
elif [ -e "$$target" ]; then \
echo " SKIP $$name — already exists at $$target (not overwriting)"; \
else \
ln -s "$$skill" "$$target"; \
echo " link $$name → $$skill"; \
fi; \
done
@echo ""
@echo "Done. Skills are available as /skill-name in all projects."
uninstall:
@for skill in $(SKILL_DIRS); do \
name=$$(basename "$$skill"); \
target="$(TARGET_DIR)/$$name"; \
if [ -L "$$target" ] && [ "$$(readlink "$$target")" = "$$skill" ]; then \
rm "$$target"; \
echo " unlink $$name"; \
elif [ -e "$$target" ]; then \
echo " SKIP $$name — exists but not our symlink (not touching)"; \
else \
echo " ok $$name (not installed)"; \
fi; \
done
list:
@echo "Skills in this repo:"
@for skill in $(SKILL_DIRS); do \
name=$$(basename "$$skill"); \
desc=$$(awk '/^description:/{sub(/^description: */, ""); print; exit}' "$$skill/SKILL.md" 2>/dev/null || echo "(no description)"); \
echo " $$name — $$desc"; \
done
@echo ""
@echo "Installed symlinks in $(TARGET_DIR):"
@for skill in $(SKILL_DIRS); do \
name=$$(basename "$$skill"); \
target="$(TARGET_DIR)/$$name"; \
if [ -L "$$target" ] && [ "$$(readlink "$$target")" = "$$skill" ]; then \
echo " ✓ $$name"; \
elif [ -e "$$target" ]; then \
echo " ✗ $$name (exists, not our link)"; \
else \
echo " - $$name (not installed)"; \
fi; \
done