-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·139 lines (124 loc) · 4.97 KB
/
setup.sh
File metadata and controls
executable file
·139 lines (124 loc) · 4.97 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/env bash
# Dailybot skill pack setup — creates symlinks so each sub-skill is independently
# discoverable by any agent platform.
#
# Usage:
# ./setup # auto-detect agent platform
# ./setup --host claude # explicit: Claude Code
# ./setup --host cursor # explicit: Cursor
# ./setup --host codex # explicit: OpenAI Codex
# ./setup --host auto # detect all installed agents
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PACK_NAME="dailybot"
# ─── Parse flags ──────────────────────────────────────────────
HOST=""
while [ $# -gt 0 ]; do
case "$1" in
--host) [ -z "$2" ] && echo "Missing value for --host" >&2 && exit 1; HOST="$2"; shift 2 ;;
--host=*) HOST="${1#--host=}"; shift ;;
-h|--help)
echo "Usage: ./setup.sh [--host claude|cursor|codex|windsurf|copilot|cline|gemini|auto]"
echo ""
echo "Creates symlinks for each Dailybot sub-skill so your agent discovers them."
echo "Run without --host to auto-detect, or specify an agent explicitly."
exit 0
;;
*) shift ;;
esac
done
# ─── Agent skill directory map ────────────────────────────────
resolve_skills_dir() {
local agent="$1"
case "$agent" in
claude) echo "$HOME/.claude/skills" ;;
cursor) echo "$HOME/.cursor/skills" ;;
codex) echo "$HOME/.codex/skills" ;;
windsurf) echo "$HOME/.codeium/windsurf/skills" ;;
copilot) echo "$HOME/.copilot/skills" ;;
cline) echo "$HOME/.cline/skills" ;;
gemini) echo "$HOME/.gemini/skills" ;;
*) echo "" ;;
esac
}
# ─── Sub-skills to link ──────────────────────────────────────
SKILLS=("report" "messages" "email" "health")
# ─── Link one agent ──────────────────────────────────────────
link_agent() {
local agent="$1"
local skills_dir
skills_dir="$(resolve_skills_dir "$agent")"
if [ -z "$skills_dir" ]; then
echo "Unknown agent: $agent" >&2
return 1
fi
mkdir -p "$skills_dir"
local linked=()
# Ensure the pack directory itself is accessible.
# If the repo was cloned directly into the skills dir (e.g. ~/.cursor/skills/dailybot/),
# no pack-level symlink is needed. Otherwise, create one.
local pack_target="$skills_dir/$PACK_NAME"
if [ ! -e "$pack_target" ] && [ "$SCRIPT_DIR" != "$pack_target" ]; then
ln -snf "$SCRIPT_DIR" "$pack_target"
echo " $PACK_NAME -> $SCRIPT_DIR"
fi
for skill in "${SKILLS[@]}"; do
local skill_dir="$SCRIPT_DIR/$skill"
if [ -f "$skill_dir/SKILL.md" ]; then
local link_name="dailybot-$skill"
local target="$skills_dir/$link_name"
if [ -L "$target" ] || [ ! -e "$target" ]; then
ln -snf "$skill_dir" "$target"
linked+=("$link_name")
else
echo " skipped $link_name (real file/directory exists)" >&2
fi
fi
done
if [ ${#linked[@]} -gt 0 ]; then
echo " linked: ${linked[*]}"
fi
}
# ─── Auto-detect installed agents ────────────────────────────
detect_agents() {
local found=()
# Check for agent-specific directories or commands
[ -d "$HOME/.claude" ] && found+=("claude")
[ -d "$HOME/.cursor" ] && found+=("cursor")
command -v codex >/dev/null 2>&1 && found+=("codex")
[ -d "$HOME/.codex" ] && found+=("codex")
[ -d "$HOME/.codeium/windsurf" ] && found+=("windsurf")
[ -d "$HOME/.copilot" ] && found+=("copilot")
[ -d "$HOME/.cline" ] && found+=("cline")
[ -d "$HOME/.gemini" ] && found+=("gemini")
# Deduplicate
printf '%s\n' "${found[@]}" | sort -u
}
# ─── Main ─────────────────────────────────────────────────────
echo "Dailybot skill pack setup"
echo "Pack directory: $SCRIPT_DIR"
echo ""
if [ -z "$HOST" ] || [ "$HOST" = "auto" ]; then
agents=($(detect_agents))
if [ ${#agents[@]} -eq 0 ]; then
echo "No known agent platforms detected."
echo "Install the pack manually by cloning into your agent's skill directory."
echo "See README.md for paths."
exit 0
fi
for agent in "${agents[@]}"; do
echo "[$agent]"
link_agent "$agent"
done
else
echo "[$HOST]"
link_agent "$HOST"
fi
echo ""
echo "Done. Available skills:"
echo " dailybot-report — report progress after completing work"
echo " dailybot-messages — check for pending messages from the team"
echo " dailybot-email — send emails via Dailybot"
echo " dailybot-health — announce agent status and receive messages"
echo ""
echo "The root 'dailybot' skill acts as a router if your agent discovers it."