-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·46 lines (39 loc) · 1.65 KB
/
Copy pathsetup
File metadata and controls
executable file
·46 lines (39 loc) · 1.65 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
#!/usr/bin/env bash
# ours-stack setup — link skills + create state dir
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
mkdir -p "$HOME/.claude/skills" "$HOME/.grok/skills"
ln -sfn "$REPO_ROOT" "$HOME/.claude/skills/ours-stack"
# Remove orphaned flat skill symlinks pointing into this repo (stale skill renames).
for link in "$HOME/.grok/skills"/*; do
[ -L "$link" ] || continue
target="$(readlink "$link")"
case "$target" in
"$REPO_ROOT"/*)
[ -e "$target" ] || rm -f "$link"
;;
esac
done
# Some runtimes discover flat ~/.grok/skills/<name>/SKILL.md links, not nested ours-stack paths.
for skill_dir in "$REPO_ROOT"/*/SKILL.md; do
[ -f "$skill_dir" ] || continue
skill_name="$(basename "$(dirname "$skill_dir")")"
ln -sfn "$(dirname "$skill_dir")" "$HOME/.grok/skills/$skill_name"
done
OURS_STACK_HOME="${OURS_STACK_HOME:-$HOME/.ours-stack}"
mkdir -p "$OURS_STACK_HOME"
touch "$OURS_STACK_HOME/learnings.jsonl"
touch "$OURS_STACK_HOME/studies-index.jsonl"
if command -v jq >/dev/null 2>&1; then
"$REPO_ROOT/bin/ours-stack-backfill-index" 2>/dev/null || true
else
echo " note: install jq for study index backfill (brew install jq)"
fi
echo "ours-stack ready"
echo " nested skill link -> ~/.claude/skills/ours-stack"
echo " flat skill links -> ~/.grok/skills/{bear-hours,source-scout,...}"
echo " state -> $OURS_STACK_HOME"
echo ""
echo "Use: /bear-hours /source-scout /dense-read /deep-research /layout-html /mind-map /memory-palace /infographic /council /dialogue /study-status"
echo "Open this repo as workspace for studies/ (or any repo with studies/<slug>/)."
"$REPO_ROOT/bin/ours-stack-doctor" 2>/dev/null || true