blob: 0e6e1294d42b2180d7277fcdbb789ebe2500b6e9 (
plain)
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
|
#!/usr/bin/env bash
# Install a team publishing overlay into a single target project.
# Usage: install-team.sh <team> <project-path>
#
# Copies the team overlay's rule file(s) into the project's .claude/rules/.
# A team overlay carries only its own rules — no generic rules, hooks,
# githooks, or settings (those belong to the global install or a language
# bundle). Re-runnable; the authoritative source overwrites.
#
# The overlay is NOT a global rule: it lands in one project's .claude/rules/
# and loads only there. The companion sync-language-bundle.sh keeps it fresh
# at that project's startup.
set -euo pipefail
TEAM="${1:-}"
PROJECT="${2:-}"
if [ -z "$TEAM" ] || [ -z "$PROJECT" ]; then
echo "Usage: $0 <team> <project-path>" >&2
exit 1
fi
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SRC="$REPO_ROOT/teams/$TEAM"
if [ ! -d "$SRC/claude/rules" ]; then
echo "ERROR: no team overlay rules for '$TEAM' (expected $SRC/claude/rules/)" >&2
exit 1
fi
if [ ! -d "$PROJECT" ]; then
echo "ERROR: project path does not exist: $PROJECT" >&2
exit 1
fi
PROJECT="$(cd "$PROJECT" && pwd)"
echo "Installing team overlay '$TEAM' into $PROJECT"
mkdir -p "$PROJECT/.claude/rules"
count=0
for f in "$SRC/claude/rules"/*.md; do
[ -f "$f" ] || continue
cp "$f" "$PROJECT/.claude/rules/$(basename "$f")"
count=$((count + 1))
done
echo " [ok] .claude/rules/ — $count overlay rule(s) from teams/$TEAM/"
echo "Loads only in this project. Startup keeps it synced via sync-language-bundle.sh."
|