-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·57 lines (46 loc) · 1.57 KB
/
install.sh
File metadata and controls
executable file
·57 lines (46 loc) · 1.57 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
#!/usr/bin/env bash
set -euo pipefail
SKILL_NAME="codebase-docs"
REPO_URL="https://github.com/ekohe/codebase-docs.git"
CLAUDE_SKILLS_DIR="${HOME}/.claude/skills/${SKILL_NAME}"
CURSOR_SKILLS_DIR="${HOME}/.cursor/skills/${SKILL_NAME}"
info() { printf "\033[1;34m==>\033[0m %s\n" "$1"; }
ok() { printf "\033[1;32m ✓\033[0m %s\n" "$1"; }
warn() { printf "\033[1;33m !\033[0m %s\n" "$1"; }
error() { printf "\033[1;31m ✗\033[0m %s\n" "$1"; exit 1; }
if ! command -v git &>/dev/null; then
error "git is required but not installed."
fi
TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT
info "Cloning ${SKILL_NAME}..."
git clone --depth 1 --quiet "$REPO_URL" "$TMPDIR"
install_to() {
local dest="$1"
mkdir -p "$dest"
rm -rf "${dest:?}/"*
cp -R "$TMPDIR"/SKILL.md "$dest/"
cp -R "$TMPDIR"/references "$dest/"
cp -R "$TMPDIR"/scripts "$dest/"
ok "Installed to $dest"
}
if [ -d "${HOME}/.claude" ]; then
install_to "$CLAUDE_SKILLS_DIR"
fi
if [ -d "${HOME}/.cursor/skills" ]; then
install_to "$CURSOR_SKILLS_DIR"
fi
if [ ! -d "$CLAUDE_SKILLS_DIR" ] && [ ! -d "$CURSOR_SKILLS_DIR" ]; then
info "No Claude or Cursor skills directory found. Installing to Claude default..."
install_to "$CLAUDE_SKILLS_DIR"
fi
echo ""
info "Done! The '${SKILL_NAME}' skill is now available."
echo ""
echo " Usage:"
echo " Ask Claude: \"document this repo\" or \"generate docs for my project\""
echo ""
echo " Standalone script (requires ANTHROPIC_API_KEY):"
echo " pip install anthropic"
echo " python ${CLAUDE_SKILLS_DIR}/scripts/generate_docs.py --repo /path/to/repo"
echo ""