-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·68 lines (56 loc) · 2.07 KB
/
bootstrap.sh
File metadata and controls
executable file
·68 lines (56 loc) · 2.07 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
#!/usr/bin/env bash
# bootstrap.sh — one-time setup for a project forked from agent-template.
#
# Run this once after cloning. It pulls the playbook submodule and
# installs npm dependencies. After this, run `claude` to start a
# Claude Code session and `npm run arch:preview` to view the diagram.
set -euo pipefail
# --- Sanity checks ---
if ! command -v git >/dev/null 2>&1; then
echo "❌ git is not installed. Install git first, then re-run."
exit 1
fi
if ! [ -d .git ]; then
echo "❌ This doesn't look like a git repository. Run inside a project root."
exit 1
fi
# --- Submodules (playbook lives here) ---
if [ -f .gitmodules ]; then
echo "→ Pulling submodules (playbook)..."
git submodule update --init --recursive
else
echo "ℹ No .gitmodules found; skipping submodule init."
echo " If you want the agent-playbook submodule, run:"
echo " git submodule add git@github.com:thaddeus-git/agent-playbook.git docs/playbook"
fi
# --- npm install (for likec4) ---
if [ -f package.json ]; then
if ! command -v npm >/dev/null 2>&1; then
echo "⚠ package.json exists but npm is not installed."
echo " Install Node.js v20+ from https://nodejs.org, then re-run this script."
exit 1
fi
echo "→ Installing npm dependencies (this may take a minute)..."
npm install
else
echo "ℹ No package.json found; skipping npm install."
fi
# --- Builder-mode context (CLAUDE.local.md) ---
if [ -f CLAUDE.local.md ]; then
echo "ℹ CLAUDE.local.md already exists; not overwriting."
elif [ -f CLAUDE.local.md.example ]; then
echo "→ Creating CLAUDE.local.md from CLAUDE.local.md.example (builder-mode context — gitignored)."
cp CLAUDE.local.md.example CLAUDE.local.md
else
echo "ℹ No CLAUDE.local.md.example found; skipping local-context bootstrap."
fi
# --- Done ---
echo ""
echo "✅ Setup complete."
echo ""
echo "Next steps:"
echo " 1. Read QUICKSTART.md (1 page) for the daily workflow."
echo " 2. Run 'claude' to start a Claude Code session."
if [ -f package.json ]; then
echo " 3. Run 'npm run arch:preview' to view the architecture diagram."
fi