From 068e80aa3dc9e04ac6f557df9ea9a64b66584875 Mon Sep 17 00:00:00 2001 From: Hrithik-Gavankar Date: Wed, 9 Sep 2026 02:11:12 +0530 Subject: [PATCH] fix(gitignore): ignore team-brain runtime artifacts and supabase admin setup env --- .gitignore | 1 + .team-brain/.gitignore | 5 + .team-brain/TEAM.md | 49 ++++ core/scripts/team-brain-admin-setup.sh | 293 ++++++++++++++++---- core/scripts/team-brain-bootstrap.sh | 59 +++- docs/team-brain-onboarding.md | 15 + platforms/cursor/skills/team-brain/SKILL.md | 15 + supabase/admin.setup.env.example | 43 +++ supabase/project.public.env.example | 19 +- 9 files changed, 417 insertions(+), 82 deletions(-) create mode 100644 .team-brain/.gitignore create mode 100644 .team-brain/TEAM.md create mode 100644 supabase/admin.setup.env.example diff --git a/.gitignore b/.gitignore index 8d4bdc0..01a3906 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ website/.docusaurus/ # Commit-safe pin (.team-brain/project.json) SHOULD be committed — never put anon/api_key/invite there. # team.yaml holds URL+anon locally — gitignored above; prefer supabase/project.public.env. supabase/project.public.env +supabase/admin.setup.env # Bootstrap-generated combined SQL (may be large; never commit crew secrets beside it) supabase/.bootstrap-migrations.combined.sql diff --git a/.team-brain/.gitignore b/.team-brain/.gitignore new file mode 100644 index 0000000..c4c406b --- /dev/null +++ b/.team-brain/.gitignore @@ -0,0 +1,5 @@ +credentials.json +cache/ +metrics.json +sync/ +notify/ diff --git a/.team-brain/TEAM.md b/.team-brain/TEAM.md new file mode 100644 index 0000000..95caa27 --- /dev/null +++ b/.team-brain/TEAM.md @@ -0,0 +1,49 @@ +# [Team Name] — Team Brain + +> Last updated: [DATE] +> Scope: shared team context (not personal). Personal growth stays in each engineer's BRAIN.md. + +--- + +## Identity + +- **Team:** [Team name] +- **Org / product:** [Product or org] +- **Mission:** [1–2 sentences] +- **Primary repos:** [repo1, repo2, …] +- **Standup channel:** [Slack/Teams thread] + +--- + +## Norms + +- [How you review PRs] +- [How you break down epics] +- [Definition of done / quality bar] +- [How AI context is shared — what is OK to `remember` into initiative memory] + +--- + +## Members (opt-in) + +| Name | Role | Primary focus | Share scope | +|------|------|---------------|-------------| +| [Name] | [Role] | [Focus] | research / metrics / none | + +--- + +## Active Initiatives + +| ID | Title | Status | Owners | Initiative file | +|----|-------|--------|--------|-----------------| +| [TICKET-1] | [Title] | active | [names] | `initiatives/TICKET-1.md` | + +--- + +## Sync notes + +- **Preferred:** `sync.backend: supabase` — register/join once; captures sync for the whole team; each initiative mirrors to `initiatives/.md` +- **Fallback:** `local` — share `.team-brain/` via git commit/PR/pull +- Jira keys identify initiatives; do not dump personal `BRAIN.md` into team files + +Use `/team-brain register` then `/team-brain attach `. diff --git a/core/scripts/team-brain-admin-setup.sh b/core/scripts/team-brain-admin-setup.sh index c9b5d65..a4fd135 100755 --- a/core/scripts/team-brain-admin-setup.sh +++ b/core/scripts/team-brain-admin-setup.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash # Team Brain — one-shot ADMIN setup # -# Creates the crew (register → admin role). Colleagues use team-brain-member-setup.sh. +# Fill ONE file, then run (no flags required): +# cp supabase/admin.setup.env.example supabase/admin.setup.env +# bash core/scripts/team-brain-admin-setup.sh # -# DEMO DEFAULTS (Brainstack Day 0 workshop only — change for your crew): -# Epic: KAN-4 · Crew: Workshop Crew -# Override: --jira YOUR-EPIC --team "Your Crew" --jira-site https://your-org.atlassian.net -# Or env: TEAM_BRAIN_DEMO_JIRA_KEY, TEAM_BRAIN_DEMO_TEAM_NAME, TEAM_BRAIN_DEMO_JIRA_SITE +# After success (auto-written — gitignored unless noted): +# supabase/project.public.env runtime URL/anon for team-brain-api.sh +# .team-brain/credentials.json your api_key + invite +# .team-brain/share-bundle.txt DM to members +# .team-brain/project.json commit-safe pin # set -euo pipefail @@ -14,23 +17,26 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" BOOTSTRAP="$SCRIPT_DIR/team-brain-bootstrap.sh" API="$SCRIPT_DIR/team-brain-api.sh" +ADMIN_SETUP_ENV="${TEAM_BRAIN_ADMIN_SETUP_ENV:-$REPO_ROOT/supabase/admin.setup.env}" +ADMIN_SETUP_EXAMPLE="$REPO_ROOT/supabase/admin.setup.env.example" +PUBLIC_ENV="${TEAM_BRAIN_PUBLIC_ENV:-$REPO_ROOT/supabase/project.public.env}" # shellcheck source=team-brain-secret-utils.sh source "$SCRIPT_DIR/team-brain-secret-utils.sh" -# --- demo defaults (override for production crews) --- -DEFAULT_JIRA_KEY="${TEAM_BRAIN_DEMO_JIRA_KEY:-KAN-4}" -DEFAULT_JIRA_TITLE="${TEAM_BRAIN_DEMO_JIRA_TITLE:-Brainstack context layer — workshop spike}" -DEFAULT_JIRA_SITE="${TEAM_BRAIN_DEMO_JIRA_SITE:-https://brainstack-org.atlassian.net}" -DEFAULT_TEAM_NAME="${TEAM_BRAIN_DEMO_TEAM_NAME:-Workshop Crew}" - -ADMIN_NAME="${TEAM_BRAIN_ADMIN_NAME:-}" -TEAM_NAME="$DEFAULT_TEAM_NAME" -JIRA_KEY="$DEFAULT_JIRA_KEY" -JIRA_TITLE="$DEFAULT_JIRA_TITLE" -JIRA_SITE="$DEFAULT_JIRA_SITE" +ADMIN_NAME="" +TEAM_NAME="" +JIRA_KEY="" +JIRA_TITLE="" +JIRA_SITE="" +SUPABASE_URL="" +ANON_KEY="" +DB_URL="" +USE_LOCAL=0 +SKIP_MIGRATIONS=0 SKIP_START=0 DRY_RUN=0 +CONFIG_PATH="$ADMIN_SETUP_ENV" BOOTSTRAP_ARGS=() die() { echo "error: $*" >&2; exit 1; } @@ -38,80 +44,248 @@ info() { echo "→ $*" >&2; } ok() { echo "✓ $*" >&2; } warn() { echo "⚠ $*" >&2; } -print_demo_notice() { - cat >&2 <&2 < --name "Bob" --role member +Team Brain admin onboarding — one file: + + 1. cp supabase/admin.setup.env.example supabase/admin.setup.env + 2. Edit every value in supabase/admin.setup.env + 3. bash core/scripts/team-brain-admin-setup.sh + +Quick init: + bash core/scripts/team-brain-admin-setup.sh --init -See: docs/workshop-brainstack-day0.md EOF } +validate_admin_config() { + local missing=() + + is_placeholder_name "$ADMIN_NAME" && missing+=("TEAM_BRAIN_ADMIN_NAME") + is_placeholder_team "$TEAM_NAME" && missing+=("TEAM_BRAIN_TEAM_NAME") + is_placeholder_jira "$JIRA_KEY" && missing+=("TEAM_BRAIN_JIRA_KEY") + [ -z "$JIRA_TITLE" ] && missing+=("TEAM_BRAIN_JIRA_TITLE") + [ -z "$JIRA_SITE" ] && missing+=("TEAM_BRAIN_JIRA_SITE") + + if [ "$USE_LOCAL" -eq 0 ]; then + is_placeholder_url "$SUPABASE_URL" && missing+=("TEAM_BRAIN_SUPABASE_URL") + is_placeholder_anon "$ANON_KEY" && missing+=("TEAM_BRAIN_SUPABASE_ANON_KEY") + fi + + if [ "${#missing[@]}" -gt 0 ]; then + warn "Still placeholders or empty in $CONFIG_PATH:" + local field + for field in "${missing[@]}"; do + echo " • $field" >&2 + done + print_setup_guide + die "Fill admin.setup.env, then re-run." + fi +} + while [ $# -gt 0 ]; do case "$1" in + --config) CONFIG_PATH="${2:-}"; shift 2 ;; + --init) + cp "$ADMIN_SETUP_EXAMPLE" "$ADMIN_SETUP_ENV" + chmod 600 "$ADMIN_SETUP_ENV" 2>/dev/null || true + ok "Created $ADMIN_SETUP_ENV" + echo "Edit every value, then run: bash core/scripts/team-brain-admin-setup.sh" >&2 + exit 0 + ;; --admin|-a) ADMIN_NAME="${2:-}"; shift 2 ;; --team) TEAM_NAME="${2:-}"; shift 2 ;; --jira) JIRA_KEY="${2:-}"; shift 2 ;; --jira-site) JIRA_SITE="${2:-}"; shift 2 ;; --jira-title) JIRA_TITLE="${2:-}"; shift 2 ;; + --url) SUPABASE_URL="${2:-}"; shift 2 ;; + --anon) ANON_KEY="${2:-}"; shift 2 ;; + --db-url) DB_URL="${2:-}"; shift 2 ;; + --local) USE_LOCAL=1; shift ;; + --skip-migrations) SKIP_MIGRATIONS=1; shift ;; --skip-start) SKIP_START=1; shift ;; --dry-run) DRY_RUN=1; BOOTSTRAP_ARGS+=(--dry-run); shift ;; - --help|-h) usage; exit 0 ;; - --url|--anon|--db-url) - [ $# -ge 2 ] || die "$1 requires a value" - BOOTSTRAP_ARGS+=("$1" "$2"); shift 2 ;; - --local|--skip-migrations) - BOOTSTRAP_ARGS+=("$1"); shift ;; + --help-credentials) print_setup_guide; exit 0 ;; + -h|--help) usage; exit 0 ;; *) - die "unknown option: $1 (colleagues use team-brain-member-setup.sh)" + die "unknown option: $1 (try --help)" ;; esac done -[ -n "$ADMIN_NAME" ] || die "--admin \"Your Name\" is required (see --help)" [ -f "$BOOTSTRAP" ] || die "bootstrap script not found: $BOOTSTRAP" +if [ ! -f "$CONFIG_PATH" ]; then + print_setup_guide + die "Missing $CONFIG_PATH — run: bash core/scripts/team-brain-admin-setup.sh --init" +fi + +load_admin_setup_env "$CONFIG_PATH" || die "could not load $CONFIG_PATH (missing or not readable)" +ok "Loaded admin config from $CONFIG_PATH" + JIRA_KEY=$(echo "$JIRA_KEY" | tr '[:lower:]' '[:upper:]') -print_demo_notice + +if [ "$DRY_RUN" -eq 0 ]; then + validate_admin_config +else + info "Dry run — skipping validation" +fi cd "$REPO_ROOT" export TEAM_BRAIN_DIR="${TEAM_BRAIN_DIR:-$REPO_ROOT/.team-brain}" -bash "$BOOTSTRAP" \ - --team "$TEAM_NAME" \ - --admin "$ADMIN_NAME" \ - --jira "$JIRA_KEY" \ - --jira-title "$JIRA_TITLE" \ - --jira-site "$JIRA_SITE" \ - --write-env \ - "${BOOTSTRAP_ARGS[@]}" +BOOTSTRAP_ARGS+=(--team "$TEAM_NAME" --admin "$ADMIN_NAME" --jira "$JIRA_KEY") +BOOTSTRAP_ARGS+=(--jira-title "$JIRA_TITLE" --jira-site "$JIRA_SITE" --write-env) + +if [ "$USE_LOCAL" -eq 1 ]; then + BOOTSTRAP_ARGS+=(--local) +elif [ -n "$SUPABASE_URL" ] && [ -n "$ANON_KEY" ]; then + BOOTSTRAP_ARGS+=(--url "$SUPABASE_URL" --anon "$ANON_KEY") +fi + +[ -n "$DB_URL" ] && BOOTSTRAP_ARGS+=(--db-url "$DB_URL") +[ "$SKIP_MIGRATIONS" -eq 1 ] && BOOTSTRAP_ARGS+=(--skip-migrations) + +set +e +bash "$BOOTSTRAP" ${BOOTSTRAP_ARGS[@]+"${BOOTSTRAP_ARGS[@]}"} +bootstrap_rc=$? +set -e + +if [ "$bootstrap_rc" -eq 2 ]; then + echo "" >&2 + echo "═══════════════════════════════════════════════════════════════" >&2 + echo " One-time pause — apply migrations in Supabase SQL Editor" >&2 + echo "═══════════════════════════════════════════════════════════════" >&2 + echo " 1. Supabase Dashboard → SQL Editor" >&2 + echo " 2. Paste and run:" >&2 + echo " $REPO_ROOT/supabase/.bootstrap-migrations.combined.sql" >&2 + echo " 3. Re-run the SAME command (no config changes):" >&2 + echo " bash core/scripts/team-brain-admin-setup.sh" >&2 + echo "═══════════════════════════════════════════════════════════════" >&2 + exit 2 +fi + +[ "$bootstrap_rc" -eq 0 ] || die "bootstrap failed (exit $bootstrap_rc)" if [ "$DRY_RUN" -eq 1 ]; then info "Dry run — would run pin set, doctor, start $JIRA_KEY" @@ -145,6 +319,7 @@ echo "" echo "═══════════════════════════════════════════════════════════════" echo " Admin setup complete" echo "═══════════════════════════════════════════════════════════════" +echo " Config: $CONFIG_PATH" echo " Role: admin" echo " Epic: $JIRA_KEY — $JIRA_TITLE" if [ -n "$invite" ]; then @@ -152,13 +327,15 @@ if [ -n "$invite" ]; then echo " Full invite + anon: $bundle_path (gitignored — share via DM only)" else echo " Invite: (run: bash core/scripts/team-brain-api.sh whoami)" - echo " Full bundle: $bundle_path (if bootstrap wrote it)" fi echo "" -echo " Colleague (member) — use invite from $bundle_path or credentials.json:" -echo " bash core/scripts/team-brain-member-setup.sh --invite --name \"Bob\" --role member" +echo " Auto-written:" +echo " $PUBLIC_ENV" +echo " $TEAM_BRAIN_DIR/credentials.json" +echo " $bundle_path ← DM to members" +echo " $TEAM_BRAIN_DIR/project.json (commit-safe pin)" echo "" -echo " Do NOT paste invite/anon into git, PRs, or public Slack." -echo " (Demo used KAN-4 / Workshop Crew — pass --jira / --team for your epic.)" +echo " Members:" +echo " bash core/scripts/team-brain-member-setup.sh --invite --name \"Bob\" --role member" echo "═══════════════════════════════════════════════════════════════" tb_print_no_paste_warning diff --git a/core/scripts/team-brain-bootstrap.sh b/core/scripts/team-brain-bootstrap.sh index 40638f4..63602d1 100755 --- a/core/scripts/team-brain-bootstrap.sh +++ b/core/scripts/team-brain-bootstrap.sh @@ -189,15 +189,16 @@ migration_blocked_manual_sql() { Dashboard → SQL Editor → paste and run: $combined -──────── Step 2 — register (one copy-paste line) ─── - --skip-migrations is a flag on bootstrap, not its own command. +──────── Step 2 — re-run admin setup (same command) ─── + Migrations are auto-detected — no flags or config edits needed: -EOF - # Print a ready-to-run single line (admin's machine; anon already in project.public.env) - printf '%s\n' "bash \"$API\" bootstrap --team \"$TEAM_NAME\" --admin \"$ADMIN_NAME\" --url \"$SUPABASE_URL\" --anon \"$ANON_KEY\" ${rerun_jira:+--jira \"$rerun_jira\"} --write-env --skip-migrations" >&2 - cat >&2 </dev/null) || return 1 + http=$(echo "$resp" | tail -n1) + body=$(echo "$resp" | sed '$d') + if echo "$body" | grep -Eqi 'Could not find the function public\.join_team|PGRST202'; then + return 1 + fi + if echo "$body" | grep -Eqi 'function digest\(|digest\(text|42883'; then + return 1 + fi + if echo "$body" | grep -Eqi 'invite code required|rate limit exceeded|invalid role|display name required'; then + return 0 + fi + [ "$http" -ge 200 ] && [ "$http" -lt 300 ] && return 0 + return 1 +} + write_combined_sql() { local out="${1:-$REPO_ROOT/supabase/.bootstrap-migrations.combined.sql}" if [ "$DRY_RUN" -eq 1 ]; then @@ -400,11 +429,10 @@ print_plan if [ "$USE_LOCAL" -eq 0 ]; then if is_placeholder_url "$SUPABASE_URL" || is_placeholder_anon "$ANON_KEY"; then die "Supabase URL/anon missing or still placeholders. - Fix one of: - • Pass --url and --anon - • Export TEAM_BRAIN_SUPABASE_URL / TEAM_BRAIN_SUPABASE_ANON_KEY - • Edit $PUBLIC_ENV then re-run - • Use --local for Docker + Admin: fill supabase/admin.setup.env (one file), then: + bash core/scripts/team-brain-admin-setup.sh + + Or pass --url and --anon / use --local for Docker. Create a project: https://supabase.com → Project Settings → API" fi fi @@ -422,6 +450,11 @@ export TEAM_BRAIN_SUPABASE_ANON_KEY="$ANON_KEY" export TEAM_BRAIN_JIRA_SITE="$JIRA_SITE" # Migrations +if [ "$SKIP_MIGRATIONS" -eq 0 ] && migrations_already_applied; then + ok "Migrations already applied on this Supabase project — skipping apply" + SKIP_MIGRATIONS=1 +fi + if [ "$SKIP_MIGRATIONS" -eq 0 ]; then if [ "$USE_LOCAL" -eq 1 ]; then ok "Local mode: migrations applied by supabase start" @@ -450,7 +483,7 @@ else fi if [ "$MIGRATION_BLOCKED" -eq 1 ]; then - warn "Bootstrap paused after writing config — finish Step 1 (SQL Editor), then run the Step 2 line above." + warn "Bootstrap paused — apply SQL once in Supabase Dashboard, then re-run admin-setup." exit 2 fi diff --git a/docs/team-brain-onboarding.md b/docs/team-brain-onboarding.md index 46a0aef..170d39b 100644 --- a/docs/team-brain-onboarding.md +++ b/docs/team-brain-onboarding.md @@ -231,6 +231,21 @@ Run it **once** when the spike gets long — not every command. Cursor agents al Only one person does this for a new crew. **You need a Supabase account** (free tier is fine). Joiners do not. +### Quick path — one config file (recommended) + +Fill **everything** in one place, then run one command: + +```bash +cd /path/to/brainstack +bash core/scripts/team-brain-admin-setup.sh --init +# edit supabase/admin.setup.env (admin name, crew, Jira epic, Supabase URL + anon) +bash core/scripts/team-brain-admin-setup.sh +``` + +`supabase/admin.setup.env` is gitignored. The script writes runtime files (`project.public.env`, `credentials.json`, share bundle, pin). + +If migrations cannot auto-apply (no `psql`), bootstrap stops with SQL Editor instructions — set `TEAM_BRAIN_SKIP_MIGRATIONS=true` in the same file and re-run after pasting `supabase/.bootstrap-migrations.combined.sql`. + > **macOS / no `psql`?** Use **Step 2A (SQL Editor)** below — you do **not** need `psql`, Supabase CLI, or `--db-url`. ### Step 1 — Create a Supabase project diff --git a/platforms/cursor/skills/team-brain/SKILL.md b/platforms/cursor/skills/team-brain/SKILL.md index 17becb7..ba0426f 100644 --- a/platforms/cursor/skills/team-brain/SKILL.md +++ b/platforms/cursor/skills/team-brain/SKILL.md @@ -229,6 +229,7 @@ Never invent stories without recalled memories. | `sync-status` | active \| sleep \| stopped (+ `compliance`) | | `compliance` | Soft MCP-first gate (`research_ok`, `agent_action`) | | `bootstrap` | Admin one-shot setup + share bundle | +| `admin-setup` | **Preferred admin path** — fill `supabase/admin.setup.env`, then run script (no flags) | | `onboard` / `register` / `join` | Membership | | `attach` | Bind Jira key | | `recall` / `remember` | Search / save (`learning` kind ok); on `redundant_candidate` recall + same `source_ref` or `--queue`; admin may `--force` | @@ -243,6 +244,20 @@ MCP also exposes `prepare_research` (recall + compliance in one call). Beginner guide: `docs/team-brain-onboarding.md` +### Admin onboarding (once per crew) + +One file — no scattered flags/env: + +```bash +cp supabase/admin.setup.env.example supabase/admin.setup.env +# edit every TEAM_BRAIN_* value (admin name, crew, Jira epic, Supabase URL + anon) +bash core/scripts/team-brain-admin-setup.sh +``` + +Or: `bash core/scripts/team-brain-admin-setup.sh --init` then edit `supabase/admin.setup.env`. + +After success, DM `.team-brain/share-bundle.txt` to members. Runtime config lands in `supabase/project.public.env` (auto-written). + ## Hard rules - User’s one step: **`start`** (or ask you to start) diff --git a/supabase/admin.setup.env.example b/supabase/admin.setup.env.example new file mode 100644 index 0000000..ca2fee0 --- /dev/null +++ b/supabase/admin.setup.env.example @@ -0,0 +1,43 @@ +# Team Brain — ADMIN setup (fill this ONE file, then run admin-setup) +# +# cp supabase/admin.setup.env.example supabase/admin.setup.env +# # edit every value below +# bash core/scripts/team-brain-admin-setup.sh +# +# Gitignored — never commit live keys or invite codes. +# +# ── Where to get values ───────────────────────────────────────────────────── +# Supabase (hosted): https://supabase.com → your project → Settings → API +# TEAM_BRAIN_SUPABASE_URL → Project URL +# TEAM_BRAIN_SUPABASE_ANON_KEY → anon / public key (NOT service_role) +# Migrations (optional): Settings → Database → connection string → TEAM_BRAIN_DB_URL +# Jira site: your org URL, e.g. https://redhat.atlassian.net +# +# Local Docker demo instead of hosted Supabase: set TEAM_BRAIN_USE_LOCAL=true +# (requires Docker + supabase CLI — URL/anon auto-filled) + +# --- Required: you --- +TEAM_BRAIN_ADMIN_NAME=Your Name + +# --- Required: crew + Jira epic --- +TEAM_BRAIN_TEAM_NAME=Your Crew +TEAM_BRAIN_JIRA_KEY=YOUR-EPIC +TEAM_BRAIN_JIRA_TITLE=Short title for your epic or spike +TEAM_BRAIN_JIRA_SITE=https://your-org.atlassian.net + +# --- Required for hosted Supabase (leave empty when USE_LOCAL=true) --- +TEAM_BRAIN_SUPABASE_URL=https://YOUR_REF.supabase.co +TEAM_BRAIN_SUPABASE_ANON_KEY=your-anon-key + +# --- Optional --- +# Postgres URI for auto migrations (needs psql). Never commit. +# One-time fully automated path (skip SQL Editor): +# brew install libpq && brew link --force libpq +# TEAM_BRAIN_DB_URL=postgresql://postgres:YOUR_PASSWORD@db.YOUR_REF.supabase.co:5432/postgres +TEAM_BRAIN_DB_URL= +# true = local Docker stack (supabase start) instead of hosted URL/anon above +TEAM_BRAIN_USE_LOCAL=false +# Usually leave false — admin-setup auto-detects migrations after SQL Editor run +TEAM_BRAIN_SKIP_MIGRATIONS=false +# true = skip team-brain-api.sh start at end of admin setup +TEAM_BRAIN_SKIP_START=false diff --git a/supabase/project.public.env.example b/supabase/project.public.env.example index acbac6e..80f1e22 100644 --- a/supabase/project.public.env.example +++ b/supabase/project.public.env.example @@ -1,16 +1,13 @@ -# Team Brain project config — copy to project.public.env (gitignored). -# cp supabase/project.public.env.example supabase/project.public.env -# Each crew admin fills these with THEIR Supabase project (never commit live keys). -# Supabase "anon" key is a client key — RLS/RPCs protect data. -# Do NOT put service_role keys or member api_keys here. +# Team Brain — runtime config (usually AUTO-WRITTEN by admin-setup → bootstrap). +# +# Admins: fill supabase/admin.setup.env instead (one file), then run: +# bash core/scripts/team-brain-admin-setup.sh # -# Admin (once): prefer bootstrap (see supabase/README.md): -# bash core/scripts/team-brain-api.sh bootstrap --team "Crew" --admin "You" --url … --anon … --write-env -# Or: create project → apply migrations → fill below → register → share invite. +# Joiners: admin sends .team-brain/share-bundle.txt via DM — copy URL + anon here +# or pass --url / --anon to team-brain-member-setup.sh. # -# Joiners: need the crew's URL + anon (from your admin, Slack, etc.) in this file -# or in team.yaml / env, plus: onboard "Your Name" [JIRA-KEY] +# Do NOT put service_role keys or member api_keys here. -TEAM_BRAIN_SUPABASE_URL=https://YOUR_PROJECT_REF.supabase.co +TEAM_BRAIN_SUPABASE_URL=https://YOUR_REF.supabase.co TEAM_BRAIN_SUPABASE_ANON_KEY=your-anon-key TEAM_BRAIN_JIRA_SITE=https://your-org.atlassian.net