{"id":"778fc707-aea0-4a34-a156-fa540d2419a5","shortId":"qWhj6r","kind":"skill","title":"setup-memory","tagline":"Set up persistent memory for this coding agent using secondbrain: install the CLI,\ninitialize a local PGLite or Supabase brain, register MCP, capture per-remote\ntrust policy. One command from zero to \"persistent memory is running and this\nagent can call it.\" Use when: \"setup memo","description":"## Preamble\n\n```bash\neval \"$(~/.vibestack/bin/vibe-slug 2>/dev/null)\" 2>/dev/null || SLUG=\"unknown\"\n_LEARN_FILE=\"${VIBESTACK_HOME:-$HOME/.vibestack}/projects/${SLUG:-unknown}/learnings.jsonl\"\nif [ -f \"$_LEARN_FILE\" ]; then\n  _LEARN_COUNT=$(wc -l < \"$_LEARN_FILE\" 2>/dev/null | tr -d ' ')\n  echo \"LEARNINGS: $_LEARN_COUNT entries loaded\"\n  if [ \"$_LEARN_COUNT\" -gt 5 ] 2>/dev/null; then\n    ~/.vibestack/bin/vibe-learnings-search --limit 5 2>/dev/null || true\n  fi\nelse\n  echo \"LEARNINGS: none yet\"\nfi\n```\n\n# /setup-memory — Persistent Memory Setup\n\nYou are setting up persistent memory for this coding agent. The underlying engine\nis secondbrain, a knowledge base that runs as both\na CLI and an MCP tool on the user's local Mac.\n\n**Scope honesty:** This skill's MCP registration step (5a) uses\n`claude mcp add` and targets Claude Code specifically. Other local hosts\n(Cursor, Codex CLI, etc.) will still get the secondbrain CLI on PATH — they can\nregister `secondbrain serve` in their own MCP config manually after setup.\n\n**Audience:** local-Mac users. openclaw/hermes agents typically run in cloud\ndocker containers with their own memory engine; \"sharing\" a brain between them\nand local Claude Code is only possible through shared Postgres (Supabase).\n\n## User-invocable\nWhen the user types `/setup-memory`, run this skill. Three shortcut modes:\n\n- `/setup-memory` — full flow (default)\n- `/setup-memory --repo` — only flip the per-remote policy for the current repo\n- `/setup-memory --switch` — only migrate the engine (PGLite ↔ Supabase)\n- `/setup-memory --resume-provision <ref>` — re-enter a previously interrupted\n  Supabase auto-provision at the polling step\n- `/setup-memory --cleanup-orphans` — list + delete in-flight Supabase projects\n\nParse the invocation args yourself — these are prose hints to the skill, not\nimplemented as a dispatcher binary.\n\n---\n\n## Concurrent-run lock\n\nAt skill start:\n```bash\nmkdir ~/.vibestack/.setup-memory.lock.d 2>/dev/null || {\n  echo \"Another /setup-memory instance is running. Wait for it, or remove the lock with:\"\n  echo \"  rm -rf ~/.vibestack/.setup-memory.lock.d\"\n  exit 1\n}\n```\n\nRelease the lock on normal exit AND in the SIGINT trap.\n\n---\n\n## Step 1: Detect current state\n\n```bash\nSBRAIN_ON_PATH=false\nSBRAIN_VERSION=\"\"\nSBRAIN_CONFIG_EXISTS=false\nSBRAIN_ENGINE=\"\"\nSBRAIN_DOCTOR_OK=false\nMEMORY_SYNC_MODE=\"\"\n\ncommand -v secondbrain >/dev/null 2>&1 && SBRAIN_ON_PATH=true\n$SBRAIN_ON_PATH && SBRAIN_VERSION=$(secondbrain --version 2>/dev/null || echo \"\")\n[ -f \"$HOME/.secondbrain/config.json\" ] && SBRAIN_CONFIG_EXISTS=true\nif $SBRAIN_CONFIG_EXISTS; then\n  SBRAIN_ENGINE=$(python3 -c \"import json; d=json.load(open('$HOME/.secondbrain/config.json')); print(d.get('engine',''))\" 2>/dev/null || echo \"\")\nfi\nif $SBRAIN_ON_PATH; then\n  secondbrain doctor --json >/tmp/vibe-memory-doctor.json 2>/dev/null\n  STATUS=$(python3 -c \"import json; d=json.load(open('/tmp/vibe-memory-doctor.json')); print(d.get('status',''))\" 2>/dev/null || echo \"\")\n  [ \"$STATUS\" = \"ok\" ] || [ \"$STATUS\" = \"warnings\" ] && SBRAIN_DOCTOR_OK=true\nfi\nMEMORY_SYNC_MODE=$(vibe-config get memory_sync_mode 2>/dev/null || echo \"\")\n\necho \"Detected: memory_engine=secondbrain on_path=$SBRAIN_ON_PATH version=${SBRAIN_VERSION:-none} engine=${SBRAIN_ENGINE:-none} doctor_ok=$SBRAIN_DOCTOR_OK sync=${MEMORY_SYNC_MODE:-off}\"\n```\n\nReport the detected state in one line. Skip downstream steps that are already done.\n\nBranch on the `--repo`, `--switch`, `--resume-provision`, `--cleanup-orphans`\ninvocation flags here and skip to the matching step.\n\nAlso capture `sbrain_local_status` (one of `ok`, `broken-db`, `broken-config`,\n`no-cli`, `missing-config`), `sbrain_mcp_name` (the registered MCP name —\n`memex`, `secondbrain`, or other compliant brand) and `sbrain_mcp_mode`\n(`local-stdio`, `remote-http`, or empty) so Step 1.5 and Step 2 can branch on\nthem. Compute them inline:\n\n```bash\nSBRAIN_LOCAL_STATUS=\"ok\"\nif ! $SBRAIN_ON_PATH; then\n  SBRAIN_LOCAL_STATUS=\"no-cli\"\nelif ! $SBRAIN_CONFIG_EXISTS; then\n  SBRAIN_LOCAL_STATUS=\"missing-config\"\nelif ! $SBRAIN_DOCTOR_OK; then\n  # Distinguish broken-db (config valid but engine unreachable) from broken-config\n  # (config malformed). Falls back to broken-db if json parse worked at Step 1.\n  if [ -n \"$SBRAIN_ENGINE\" ]; then SBRAIN_LOCAL_STATUS=\"broken-db\"; else SBRAIN_LOCAL_STATUS=\"broken-config\"; fi\nfi\n# Detect any compliant brain MCP — backend-agnostic per vibestack policy.\n# `claude mcp list` lines look like:\n#   memex: https://brain.example.com/mcp (HTTP) - ✓ Connected\n#   secondbrain: /Users/foo/.bun/bin/secondbrain serve - ✓ Connected\n# Match either name, strip the trailing colon, and infer mode from the (HTTP)\n# marker. First match wins; downstream code should NOT assume the name is\n# `secondbrain`.\n_BRAIN_LINE=$(claude mcp list 2>/dev/null | awk '/^(memex|secondbrain):[[:space:]]/{print; exit}')\nSBRAIN_MCP_NAME=$(printf '%s\\n' \"$_BRAIN_LINE\" | awk '{name=$1; sub(/:$/, \"\", name); print name}')\nSBRAIN_MCP_MODE=$(printf '%s\\n' \"$_BRAIN_LINE\" | awk '{print (tolower($3)==\"(http)\")?\"remote-http\":\"local-stdio\"}')\n[ -z \"$_BRAIN_LINE\" ] && SBRAIN_MCP_MODE=\"\"\necho \"sbrain_local_status=$SBRAIN_LOCAL_STATUS sbrain_mcp_name=${SBRAIN_MCP_NAME:-none} sbrain_mcp_mode=${SBRAIN_MCP_MODE:-none}\"\n```\n\n---\n\n## Step 1.5: Broken-local-engine remediation\n\nIf `SBRAIN_LOCAL_STATUS` is `broken-db` or `broken-config` AND no shortcut flag\nwas passed, the user has a non-working local engine (config exists but the\nengine it points at isn't reachable, OR the config itself is malformed). Fire\na targeted AskUserQuestion BEFORE Step 2:\n\n> D# — Your local secondbrain engine isn't responding. How do you want to fix it?\n> Project/branch/task: <one-sentence grounding using detected slug + branch>\n> ELI10: secondbrain has a config at `~/.secondbrain/config.json` but the engine\n> it points at isn't reachable. That could be a transient outage (Postgres container\n> stopped, Tailscale down) OR a stale config you want to abandon. Different\n> remediation for each case.\n> Stakes if we pick wrong: \"Switch to PGLite\" overwrites your existing config\n> (one-way door if the user actually wanted the broken engine). \"Retry\" preserves\n> existing state for transient cases.\n> Recommendation: A (Retry) — always try the cheap option first; if engine is\n> just temporarily down it'll come back without any destructive change.\n> Note: options differ in kind, not coverage — no completeness score.\n> A) Retry — re-probe the engine (recommended; ~80ms)\n>   ✅ Cheapest test: re-runs `secondbrain doctor --json` to see if engine is back\n>   ✅ Zero side effects; existing config preserved\n>   ❌ If engine is permanently dead, retries forever; user must choose another option\n> B) Switch to local PGLite (one-way — moves existing config to .bak)\n>   ✅ Fastest path to a working local engine if user has abandoned the old one\n>   ✅ ~30s; no accounts; private to this machine\n>   ❌ Destructive — existing config moved to ~/.secondbrain/config.json.vibestack-bak-{ts}\n> C) Switch brain mode (continue to Step 2 path picker)\n>   ✅ Lets user pick Path 1/2/3/4 to re-init from scratch\n>   ✅ Preserves existing config until they explicitly init the new one\n>   ❌ Longer flow if user just wants to repair to PGLite\n> D) Quit (do nothing)\n>   ✅ No cons — this is a hard-stop choice\n>   ❌ N/A\n> Net: A is the right starting move; B/C are explicit destructive paths; D bails.\n\n**If A (Retry)**: re-run the detect block from Step 1. If the new\n`sbrain_local_status` is `ok`, continue to Step 2. If still `broken-db` or\n`broken-config`, fire the same AskUserQuestion again (the user picks again).\n\n**If B (Switch to PGLite)** — execute the rollback-safe init sequence:\n\n```bash\nBACKUP=\"$HOME/.secondbrain/config.json.vibestack-bak-$(date +%s)\"\nmv \"$HOME/.secondbrain/config.json\" \"$BACKUP\"\nif ! secondbrain init --pglite --json; then\n  # Restore on failure\n  mv \"$BACKUP\" \"$HOME/.secondbrain/config.json\"\n  echo \"secondbrain init failed. Your previous config was restored at $HOME/.secondbrain/config.json.\" >&2\n  echo \"PGLite directory at ~/.secondbrain/pglite/ may be in a partial state — \\`rm -rf ~/.secondbrain/pglite\\` if needed before retrying.\" >&2\n  exit 1\nfi\necho \"Switched to local PGLite. Previous config saved at $BACKUP — review before deleting.\"\n```\n\nThen jump to Step 5a (MCP registration; the new PGLite engine is registered as\nlocal-stdio).\n\n**If C (Switch brain mode)**: continue to Step 2's normal path picker.\n\n**If D (Quit)**: STOP the skill cleanly.\n\nFor `SBRAIN_LOCAL_STATUS` values of `no-cli` or `missing-config`, do NOT fire\nStep 1.5 — fall through to Step 2 (where `no-cli` triggers Step 3 install and\n`missing-config` triggers Step 4 init).\n\n---\n\n## Step 2: Pick a path (AskUserQuestion)\n\nOnly fire this if Step 1 shows no existing working config AND no shortcut\nflag was passed. **Special case:** if `sbrain_mcp_mode=remote-http` in the\ndetect output (regardless of whether `sbrain_mcp_name` is `memex`,\n`secondbrain`, or another compliant brand), an HTTP MCP brain is already\nregistered — skip directly to Step 5a verification (re-test the existing\nregistration under its detected name) and Step 6 onward, treating this run\nas idempotent. Don't ask Step 2 again, and **never register a parallel\n`secondbrain` entry pointing at the same URL** — that creates a duplicate\nbrain in `claude mcp list`.\n\nThe question title: \"Where should your brain live?\"\n\nOptions (present based on detected state):\n\n- **1 — Supabase, I already have a connection string.** Cloud-agent users\n  whose openclaw/hermes provisioned one already. Paste the Session Pooler\n  URL from the Supabase dashboard (Settings → Database → Connection Pooler\n  → Session). *Trust-surface caveat:* \"Pasting this URL gives your local\n  Claude Code full read/write access to every page your cloud agent can see.\n  If that's not the trust level you want, pick PGLite local instead and\n  accept the brains are disjoint.\"\n- **2a — Supabase, auto-provision a new project.** You'll need a Supabase\n  Personal Access Token (~90 seconds). Best choice for a shared team brain.\n- **2b — Supabase, create manually.** Walk through supabase.com signup\n  yourself; paste the URL back when ready.\n- **3 — PGLite local.** Zero accounts, ~30 seconds. Isolated brain on this\n  Mac only. Best for try-first.\n- **4 — Remote secondbrain MCP.** Someone else (or another machine of yours) is\n  already running `secondbrain serve` with HTTP transport. You paste the MCP URL\n  + a bearer token; this skill registers it as your MCP. No local brain DB,\n  no local install needed. Recommended when the brain is shared across\n  machines or run by a teammate.\n- **Switch** (only if Step 1 detected an existing engine): \"You already have\n  a `<engine>` brain. Migrate it to the other engine?\" → runs\n  `secondbrain migrate --to <other>` wrapped in `timeout 180s`.\n\nDo NOT silently pick; fire the AskUserQuestion.\n\n---\n\n## Step 3: Install memory CLI (secondbrain)\n\n**SKIP entirely on Path 4 (Remote MCP).** Path 4 doesn't need a local secondbrain\nbinary — all calls go through MCP to the remote server. Jump to Step 4 (the\nPath 4 subsection).\n\nFor Paths 1, 2a, 2b, 3, switch — only if `SBRAIN_ON_PATH=false`:\n\n```bash\n# Try bun first, fall back to npm\nif command -v bun >/dev/null 2>&1; then\n  bun install -g secondbrain\nelif command -v npm >/dev/null 2>&1; then\n  npm install -g secondbrain\nelse\n  echo \"ERROR: Neither bun nor npm found. Install one first.\"\n  exit 1\nfi\n```\n\nAfter install, verify:\n```bash\nsecondbrain --version\n```\n\nIf `secondbrain --version` fails, check PATH:\n```bash\n# bun global bin\nexport PATH=\"$HOME/.bun/bin:$PATH\"\nsecondbrain --version\n```\n\nIf it still fails, surface the error and STOP — the environment is broken until\nthe user fixes PATH. Do not continue the skill.\n\n**PATH-shadow validation.** Even when `secondbrain --version` succeeds, another\nbinary earlier on `$PATH` may be shadowing the one we just installed (a stale\nglobal from a prior install, a colleague's fork checked into `~/bin/`, etc.).\nValidate that the resolved `secondbrain` lives in the expected install\ndirectory:\n\n```bash\nRESOLVED=$(command -v secondbrain)\nEXPECTED_DIRS=(\"$HOME/.bun/install/global/node_modules/secondbrain\" \"$HOME/.npm/global/node_modules/secondbrain\" \"$(npm prefix -g 2>/dev/null)/lib/node_modules/secondbrain\")\nSHADOWED=true\nfor d in \"${EXPECTED_DIRS[@]}\"; do\n  if printf '%s' \"$RESOLVED\" | grep -q \"$(dirname \"$d\")\"; then SHADOWED=false; break; fi\ndone\nif $SHADOWED; then\n  echo \"WARN: \\`secondbrain\\` resolves to $RESOLVED, which is outside the expected global install paths.\"\n  echo \"      Another binary may be shadowing your install. Check \\`type -a secondbrain\\` and rearrange PATH if needed.\"\nfi\n```\n\nThe warning is non-blocking — the user may have intentionally installed a fork —\nbut surface it before continuing so half-broken setups don't get silently wired.\n\n---\n\n## Step 4: Initialize the brain\n\nPath-specific.\n\n### Path 1 (Supabase, existing URL)\n\nCollect the URL securely (never as argv):\n\n```bash\nprintf \"Paste Session Pooler URL: \"\nread -rs SBRAIN_POOLER_URL\necho\nprintf \"URL received (redacted): %s\\n\" \"$(echo \"$SBRAIN_POOLER_URL\" | sed 's#://[^@]*@#://***@#')\"\n```\n\nValidate structurally (must start with `postgresql://` and contain port 6543):\n\n```bash\necho \"$SBRAIN_POOLER_URL\" | grep -qE '^postgresql://.+:6543/' || {\n  echo \"ERROR: URL does not look like a Session Pooler URL (expected port 6543).\"\n  echo \"Get it from: Supabase dashboard → Settings → Database → Connection Pooler → Session\"\n  exit 1\n}\n```\n\nOn success, hand off to the memory CLI via env var (never argv):\n\n```bash\nexport SBRAIN_DATABASE_URL=\"$SBRAIN_POOLER_URL\"\nsecondbrain init --non-interactive --json\nunset SBRAIN_POOLER_URL SBRAIN_DATABASE_URL\n```\n\nThe URL is now persisted in `~/.secondbrain/config.json` at mode 0600 by the secondbrain CLI itself.\n\n### Path 2a (Supabase, auto-provision)\n\nShow the PAT scope disclosure BEFORE collecting the token:\n\n> *This Supabase Personal Access Token grants full read/write/delete access\n> to every project in your Supabase account, not just the `secondbrain` one we're\n> about to create. Supabase doesn't currently support scoped tokens. We use\n> this PAT only to: create one project, poll it until healthy, read the\n> Session Pooler URL — then discard it from process memory. The token\n> remains valid on Supabase's side until you manually revoke it at\n> https://supabase.com/dashboard/account/tokens — we recommend revoking\n> immediately after setup completes.*\n\nThen collect securely:\n\n```bash\nprintf \"Paste PAT: \"\nread -rs SUPABASE_ACCESS_TOKEN\necho\nexport SUPABASE_ACCESS_TOKEN\n```\n\nAsk the tier prompt via AskUserQuestion: \"Which Supabase tier?\" Present\nFree (2-project limit, pauses after 7d inactivity) vs Pro ($25/mo, no\npauses, recommended for real use). Explain that tier is **org-level** — user\npicks their org based on its current tier.\n\nList orgs:\n\n```bash\ncurl -s -H \"Authorization: Bearer $SUPABASE_ACCESS_TOKEN\" \\\n  https://api.supabase.com/v1/organizations\n```\n\nIf the orgs array is empty, surface: \"Your Supabase account has no\norganizations. Create one at https://supabase.com/dashboard, then re-run\n`/setup-memory`.\" STOP.\n\nIf multiple orgs, use AskUserQuestion to pick one.\n\nAsk the user for a region (default `us-east-1`).\n\nGenerate the DB password (never shown to the user):\n\n```bash\nexport DB_PASS=$(openssl rand -base64 24)\n```\n\nSet up a SIGINT trap:\n\n```bash\ntrap 'echo \"\"; echo \"vibe-setup-memory: interrupted. In-flight ref: $INFLIGHT_REF\"; \\\n      echo \"Resume: /setup-memory --resume-provision $INFLIGHT_REF\"; \\\n      echo \"Delete: https://supabase.com/dashboard/project/$INFLIGHT_REF\"; \\\n      unset SUPABASE_ACCESS_TOKEN DB_PASS; \\\n      rm -rf ~/.vibestack/.setup-memory.lock.d; exit 130' INT TERM\n```\n\nCreate + wait + fetch:\n\n```bash\n# Create project\nCREATE_RESULT=$(curl -s -X POST \\\n  -H \"Authorization: Bearer $SUPABASE_ACCESS_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"name\\\":\\\"secondbrain\\\",\\\"organization_id\\\":\\\"$ORG_ID\\\",\\\"region\\\":\\\"$REGION\\\",\\\"db_pass\\\":\\\"$DB_PASS\\\"}\" \\\n  https://api.supabase.com/v1/projects)\nINFLIGHT_REF=$(echo \"$CREATE_RESULT\" | python3 -c \"import json,sys; print(json.load(sys.stdin).get('id',''))\")\n\n# Poll until healthy (max 3 min)\nATTEMPTS=0\nuntil curl -s -H \"Authorization: Bearer $SUPABASE_ACCESS_TOKEN\" \\\n    \"https://api.supabase.com/v1/projects/$INFLIGHT_REF\" \\\n    | python3 -c \"import json,sys; d=json.load(sys.stdin); exit(0 if d.get('status')=='ACTIVE_HEALTHY' else 1)\" 2>/dev/null; do\n  ATTEMPTS=$((ATTEMPTS+1))\n  [ \"$ATTEMPTS\" -ge 36 ] && echo \"ERROR: project did not become healthy in 3 minutes\" && exit 1\n  sleep 5\ndone\n\n# Fetch pooler URL\nPOOLER=$(curl -s -H \"Authorization: Bearer $SUPABASE_ACCESS_TOKEN\" \\\n  \"https://api.supabase.com/v1/projects/$INFLIGHT_REF/database/connection\")\nexport SBRAIN_DATABASE_URL=$(echo \"$POOLER\" | python3 -c \"import json,sys; print(json.load(sys.stdin).get('db_url',''))\")\nsecondbrain init --non-interactive --json\nunset SUPABASE_ACCESS_TOKEN DB_PASS SBRAIN_DATABASE_URL INFLIGHT_REF\ntrap - INT TERM\n```\n\nAfter success, emit the PAT revocation reminder:\n\n> \"Setup complete. Revoke the PAT you pasted at\n> https://supabase.com/dashboard/account/tokens — we've already discarded\n> it from memory and don't need it again. The memory project will continue\n> working because it uses its own embedded database password.\"\n\n### Path 2b (Supabase, manual)\n\nWalk the user through the supabase.com steps:\n1. Login at https://supabase.com/dashboard\n2. Click \"New Project,\" name it `secondbrain`, pick a region\n3. Wait ~2 min for the project to initialize\n4. Settings → Database → Connection Pooler → Session → copy the URL (port 6543)\n\nThen follow the same secret-read + verify + init flow as Path 1.\n\n### Path 3 (PGLite local)\n\n```bash\nsecondbrain init --pglite --json\n```\n\nDone. No network, no secrets.\n\n### Path 4 (Remote secondbrain MCP — HTTP transport with bearer token)\n\nFor users whose brain runs on another machine (Tailscale, ngrok, internal\nLAN, or a teammate's server). No local secondbrain CLI install, no local DB.\nThis skill registers the remote MCP and stops; ingestion + indexing happens\non the brain host.\n\n**4a. Collect MCP URL.** Prompt the user:\n\n```\nPaste your secondbrain MCP URL (e.g. https://wintermute.tail554574.ts.net:3131/mcp):\n```\n\nRead with plain `read -r` (no secret hygiene needed — the URL alone isn't\na credential). Validate it starts with `https://` (require TLS for any\nnon-loopback host); refuse `http://` for non-localhost.\n\n```bash\nprintf \"Paste secondbrain MCP URL: \"\nread -r MCP_URL\ncase \"$MCP_URL\" in\n  https://*) ;;\n  http://localhost*|http://127.0.0.1*) ;;\n  *) echo \"ERROR: Non-localhost URLs must use https://. Got: $MCP_URL\"; exit 1 ;;\nesac\n```\n\n**4b. Collect bearer token securely (never argv).**\n\n```bash\nprintf \"Paste bearer token: \"\nread -rs SBRAIN_MCP_TOKEN\necho\nprintf \"Token received (redacted): %s***\\n\" \"$(printf '%s' \"$SBRAIN_MCP_TOKEN\" | head -c 4)\"\nexport SBRAIN_MCP_TOKEN\n```\n\n**4c. Verify the MCP server is reachable + authed + on a compatible protocol.**\n\n```bash\nverify_resp=$(curl -sS -X POST \\\n  -H 'Content-Type: application/json' \\\n  -H 'Accept: application/json, text/event-stream' \\\n  -H \"Authorization: Bearer $SBRAIN_MCP_TOKEN\" \\\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\",\"params\":{}}' \\\n  \"$MCP_URL\" 2>&1)\nverify_exit=$?\nif [ \"$verify_exit\" -ne 0 ]; then\n  echo \"ERROR: Could not reach $MCP_URL (curl exit $verify_exit). Network/DNS/firewall?\"\n  echo \"       Raw: $verify_resp\"\n  unset SBRAIN_MCP_TOKEN\n  exit 1\nfi\nif printf '%s' \"$verify_resp\" | grep -q '\"error\"'; then\n  echo \"ERROR: MCP server rejected the request. Likely auth failure (bad/expired token) or unsupported method.\"\n  echo \"       Raw: $verify_resp\"\n  unset SBRAIN_MCP_TOKEN\n  exit 1\nfi\nSERVER_VERSION=$(printf '%s' \"$verify_resp\" | python3 -c \"import json,sys; d=json.load(sys.stdin); print(d.get('result',{}).get('serverInfo',{}).get('version','unknown'))\" 2>/dev/null || echo \"unknown\")\necho \"Verified: secondbrain server v$SERVER_VERSION reachable at $MCP_URL\"\n```\n\nIf verify fails, surface the classified failure (network / auth / malformed)\nand STOP with a clear \"fix and re-run /setup-memory\" message. Do NOT continue\nto Step 5a on a failed verify — partial registration would leave the user\nwith a half-broken state.\n\n**4d. (Path 4) Offer local PGLite for code search.** Ask:\n\n> D# — Want symbol-aware code search on this machine?\n> ELI10: The remote brain at `<MCP_URL>` is great for cross-machine knowledge,\n> but symbol queries like `secondbrain code-def` / `code-refs` / `code-callers`\n> need a local index of THIS machine's code. We can spin up a tiny isolated\n> PGLite database (~30 seconds, no accounts, ~120 MB disk) just for code,\n> separate from your remote brain. Local PGLite stays code-only.\n> Stakes: without it, semantic code search in this repo's worktrees falls\n> back to Grep.\n> Recommendation: A — 30 seconds, no ongoing cost, unlocks the symbol tools.\n> A) Yes, set up local PGLite for code (recommended)\n> B) No, remote MCP only\n\n**If A (Yes)**: install + init local PGLite with rollback-safe semantics:\n\n```bash\n# Install secondbrain CLI per Step 3 (skipped above for Path 4 — run it now).\nif ! command -v secondbrain >/dev/null 2>&1; then\n  if command -v bun >/dev/null 2>&1; then bun install -g secondbrain; else npm install -g secondbrain; fi\nfi\nif [ -f \"$HOME/.secondbrain/config.json\" ]; then\n  BACKUP=\"$HOME/.secondbrain/config.json.vibestack-bak-$(date +%s)\"\n  mv \"$HOME/.secondbrain/config.json\" \"$BACKUP\"\nfi\nif ! secondbrain init --pglite --json; then\n  if [ -n \"${BACKUP:-}\" ] && [ -f \"$BACKUP\" ]; then mv \"$BACKUP\" \"$HOME/.secondbrain/config.json\"; fi\n  echo \"secondbrain init failed. Existing config (if any) was restored. PGLite at ~/.secondbrain/pglite/ may be in a partial state — \\`rm -rf ~/.secondbrain/pglite\\` to reset.\" >&2\n  echo \"Continuing setup without local code search; you can re-run /setup-memory to retry.\" >&2\nfi\n```\n\nThen continue to Step 5a. The remote-http MCP registration in 5a runs as\ndescribed in the Path 4 subsection; the local PGLite is independent of MCP\nregistration (Claude Code talks to the remote brain via MCP for queries;\n`secondbrain` CLI talks to local PGLite for code-def/refs/callers).\n\n**If B (No)**: skip the install + init. The local engine stays absent.\nSkip Step 7.5 (transcript ingest) — memory-stage routes through the remote\nbrain in remote-http mode.\n\n**4e. Token handoff.** `SBRAIN_MCP_TOKEN` stays in process env until Step 5a's\n`claude mcp add --header` consumes it; then `unset SBRAIN_MCP_TOKEN`\nimmediately. Trade-off: brief argv exposure during `claude mcp add` (visible\nto `ps` for ~10ms), resting state in `~/.claude.json` mode 0600.\n\n### Switch (from detected existing-engine state)\n\n```bash\n# Going PGLite → Supabase, collect URL first (Path 1 flow), then:\ntimeout 180s secondbrain migrate --to supabase --url \"$URL\" --json\n# Going Supabase → PGLite:\ntimeout 180s secondbrain migrate --to pglite --json\n```\n\nIf `timeout` returns 124: surface \"Migration didn't complete in 3 minutes —\nanother session may be holding a lock on the source brain. Close other\nworkspaces and re-run `/setup-memory --switch`. Your original brain is\nuntouched.\" STOP.\n\n---\n\n## Step 5: Verify memory health\n\n**SKIP entirely on Path 4 (Remote MCP).** The brain host runs its own\ndoctor; we don't have local DB access to introspect. Step 4c's verify\nround-trip already proved the server is reachable, authed, and on a\ncompatible MCP version.\n\nFor Paths 1, 2a, 2b, 3, switch:\n\n```bash\ndoctor=$(secondbrain doctor --json)\nstatus=$(echo \"$doctor\" | python3 -c \"import json,sys; print(json.load(sys.stdin).get('status',''))\")\n```\n\nIf status is `ok` or `warnings`, proceed. Anything else → surface the full\ndoctor output and STOP.\n\n---\n\n## Step 5a: Register memory (secondbrain) as Claude Code MCP\n\nOnly if `which claude` resolves. Ask: \"Give Claude Code MCP access to persistent\nmemory (secondbrain)? (recommended yes)\"\n\nThe registration form depends on the path picked in Step 2:\n\n### Path 4 (Remote MCP — HTTP transport with bearer)\n\nReuse the detected MCP name when one already exists; otherwise default to\n`secondbrain`. This prevents the skill from creating a duplicate `secondbrain`\nregistration when the user already has a brain wired under a different name\n(typically `memex`).\n\n```bash\nTARGET_NAME=\"${SBRAIN_MCP_NAME:-secondbrain}\"\n# Tear down any prior registration under the same name (could be local-stdio\n# from an old setup, or stale remote-http with a rotated token).\nclaude mcp remove \"$TARGET_NAME\" -s user 2>/dev/null || true\nclaude mcp remove \"$TARGET_NAME\" 2>/dev/null || true\nclaude mcp add --scope user --transport http \"$TARGET_NAME\" \"$MCP_URL\" \\\n  --header \"Authorization: Bearer $SBRAIN_MCP_TOKEN\"\nunset SBRAIN_MCP_TOKEN  # zero from process env after registration\nclaude mcp list | grep \"$TARGET_NAME\"  # verify: should show \"✓ Connected\"\n```\n\n**Token-storage note:** `claude mcp add --header \"Authorization: Bearer ...\"`\nputs the bearer on argv during process startup, briefly visible to `ps` for\n~10ms. The token's resting state is `~/.claude.json` (mode 0600 — Claude\nCode's own credential surface for every MCP server). If a future Claude Code\nrelease adds a stdin or env-var input form for headers, switch to that.\n\n### Paths 1, 2a, 2b, 3 (Local stdio)\n\nRegister at **user scope** with an **absolute path** to the secondbrain\nbinary. User scope makes the MCP available in every Claude Code session on\nthis machine, not just the current workspace. Absolute path avoids PATH\nresolution issues when Claude Code spawns `secondbrain serve` as a subprocess.\n\n```bash\nTARGET_NAME=\"${SBRAIN_MCP_NAME:-secondbrain}\"\nSBRAIN_BIN=$(command -v secondbrain)\n[ -z \"$SBRAIN_BIN\" ] && SBRAIN_BIN=\"$HOME/.bun/bin/secondbrain\"\n# Remove any existing local-scope registration under the same name\nclaude mcp remove \"$TARGET_NAME\" -s user 2>/dev/null || true\nclaude mcp remove \"$TARGET_NAME\" 2>/dev/null || true\nclaude mcp add --scope user \"$TARGET_NAME\" -- \"$SBRAIN_BIN\" serve\nclaude mcp list | grep \"$TARGET_NAME\"  # verify: should show \"✓ Connected\"\n```\n\n### Both paths\n\nIf `claude` is not on PATH: emit \"MCP registration skipped — register `secondbrain serve`\n(or your remote MCP URL) in your agent's MCP config manually.\" Continue to step 6.\n\nTell the user: \"Restart any open Claude Code sessions to see `mcp__secondbrain__*` tools\n— they're loaded at session start, not mid-session.\"\n\n---\n\n## Step 6: Per-remote policy\n\nIf we're in a git repo with an `origin` remote, check the policy:\n\n```bash\nREMOTE=$(git remote get-url origin 2>/dev/null | sed 's|\\.git$||' | sed 's|.*[:/]||2')\nCURRENT_TIER=$(vibe-config get \"secondbrain_policy_$REMOTE\" 2>/dev/null || echo \"unset\")\necho \"Current policy for $REMOTE: $CURRENT_TIER\"\n```\n\nBranches:\n- `read-write` → import this repo: `secondbrain import \"$(pwd)\" --no-embed` then\n  `secondbrain embed --stale &` in the background.\n- `read-only` → skip import (this tier is enforced by secondbrain resolver injection).\n- `deny` → do nothing.\n- `unset` → AskUserQuestion: \"How should `<normalized-remote>` interact with memory (secondbrain)?\"\n  - `read-write` — agent can search AND write new pages from this repo\n  - `read-only` — agent can search but never write\n  - `deny` — no interaction at all\n  - `skip-for-now` — don't persist, ask next time\n\n  On answer (other than skip-for-now):\n  ```bash\n  vibe-config set \"secondbrain_policy_$REMOTE\" \"$TIER\"\n  ```\n  Then import if `read-write`.\n\nIf outside a git repo OR no origin remote: skip this step with a note.\n\nFor `/setup-memory --repo` invocations, execute ONLY Step 6 and exit.\n\n---\n\n## Step 7: Offer memory sync\n\nSeparate AskUserQuestion: \"Also sync your vibestack session memory (learnings,\nplans, retros) to a private git repo that the memory engine (secondbrain) can index across machines?\"\n\nOptions:\n- Yes, full sync (everything allowlisted)\n- Yes, artifacts-only (plans, designs, retros — skip behavioral data)\n- No thanks\n\nIf yes:\n\n```bash\n# Initialize a sync repo (user provides URL or we create one)\n# Then set the mode in vibe-config\nvibe-config set memory_sync_mode artifacts-only\n# or \"full\" if user picked yes-full\n```\n\n---\n\n## Step 7.5: Transcript & memory ingest gate (single-machine)\n\n**SKIP entirely on Path 4 (Remote MCP).** Transcript ingest shells out to the\nlocal `secondbrain` CLI which Path 4 doesn't install when the user picked 4d-B\n(\"remote MCP only\"). When 4d-A (local PGLite for code) was picked, ingest is\nstill optional but useful: surface the prompt below.\n\nFor Paths 1, 2a, 2b, 3 (and Path 4 with PGLite code search enabled):\n\nAfter memory engine is initialized but before persisting the CLAUDE.md config\n(Step 8), offer to bring this Mac's coding-agent transcripts +\ncurated `~/.vibestack/` artifacts into secondbrain so the retrieval surface\nhas data to surface.\n\nProbe the current state inline (federation/cross-machine sync is intentionally\nout of scope — this is single-machine ingest only):\n\n```bash\nTRANS_ROOT=\"${VIBESTACK_HOME:-$HOME/.vibestack}/projects/${SLUG:-unknown}/sessions\"\nif [ -d \"$TRANS_ROOT\" ]; then\n  TOTAL_FILES=$(find \"$TRANS_ROOT\" -name '*.jsonl' -type f 2>/dev/null | wc -l | tr -d ' ')\n  TOTAL_BYTES=$(du -sk \"$TRANS_ROOT\" 2>/dev/null | awk '{print $1*1024}')\nelse\n  TOTAL_FILES=0; TOTAL_BYTES=0\nfi\necho \"Probe: $TOTAL_FILES transcript files, $TOTAL_BYTES bytes total.\"\n```\n\nIf `$TOTAL_FILES = 0`, skip — there's nothing to ingest. Set\n`vibe-config set transcript_ingest_mode incremental` silently and continue\nto Step 8.\n\nIf `$TOTAL_FILES < 200` AND `$TOTAL_BYTES < 100000000` (100MB): silent bulk\ningest, then set `transcript_ingest_mode=incremental`:\n\n```bash\nfind \"$TRANS_ROOT\" -name '*.jsonl' -type f 2>/dev/null | while IFS= read -r f; do\n  TITLE=\"session-$(basename \"$f\" .jsonl)\"\n  secondbrain put \"$TITLE\" < \"$f\" 2>/dev/null || true\ndone\nvibe-config set transcript_ingest_mode incremental\n```\n\nOtherwise (the \"many transcripts on disk\" path): AskUserQuestion with the\nexact counts AND the value promise. Default scope is **current repo only,\nlast 90 days**:\n\n> \"Found <N_repo> transcripts in THIS repo (<repo-slug>) over the last\n> 90 days, totalling <bytes>. Ingest into secondbrain?\n>\n> What you get: every vibestack skill auto-loads recent salience from your\n> past sessions in this repo, so the agent finds your prior work without you\n> describing it. You can query 'what was I doing on day X' and get a real\n> answer. Per-session pages are searchable, taggable, and deletable.\n>\n> What stays the same: nothing leaves this machine — vibestack does not sync\n> secondbrain across machines. Per-repo trust policies still apply.\n\nOptions:\n- A) Yes — this repo, last 90 days (recommended)\n- B) Yes — this repo, ALL history\n- C) Skip historical, track new from now (`transcript_ingest_mode=incremental`)\n- D) Never ingest transcripts (`transcript_ingest_mode=off`)\n\nAfter answer:\n```bash\nvibe-config set transcript_ingest_mode \"<choice>\"\n```\n\nReference doc for users: `setup-memory/memory.md` (linked from CLAUDE.md\nStep 8).\n\n---\n\n## Step 8: Persist ## Memory Configuration in CLAUDE.md\n\nFind-and-replace (or append) the section in CLAUDE.md. Block format depends on\nmode:\n\n### Path 4 (Remote MCP)\n\n```markdown\n## Memory Configuration (configured by /setup-memory)\n- Mode: remote-http\n- MCP URL: {MCP_URL}\n- Server version: secondbrain v{SERVER_VERSION}  (from Step 4c verify)\n- Setup date: {today}\n- MCP registered: yes (user scope)\n- Token: stored in ~/.claude.json (do not commit; never written to CLAUDE.md)\n- Memory sync: off (vibestack does not sync across machines)\n- Current repo policy: {read-write|read-only|deny|unset}\n```\n\nThe bearer token is **never** written to CLAUDE.md (CLAUDE.md is checked in\nto git in many projects). It lives only in `~/.claude.json` where\n`claude mcp add` placed it.\n\n### Paths 1, 2a, 2b, 3 (Local stdio)\n\n```markdown\n## Memory Configuration (configured by /setup-memory)\n- Mode: local-stdio\n- Engine: {pglite|postgres}\n- Config file: ~/.secondbrain/config.json (mode 0600)\n- Setup date: {today}\n- MCP registered: {yes/no}\n- Memory sync: {off|artifacts-only|full}\n- Current repo policy: {read-write|read-only|deny|unset}\n```\n\n**After Step 9 (smoke test) passes, also write the `## Memory Search Guidance`\nblock** so the coding agent learns when to prefer `secondbrain` over Grep.\nThis block is gated on the smoke test passing — write the Configuration block\nfirst (so the user knows what state they're in even if the smoke test fails),\nthen return here after Step 9 and write the guidance block only if smoke\ntest succeeded.\n\nWhen Step 9 passes, find-and-replace (or append) this block. Use HTML-comment\ndelimiters so removal regex is unambiguous and never eats user content. The\nblock content is machine-agnostic — no engine type, no page counts, no\nlast-sync time. Machine state stays in the Configuration block above.\n\n```markdown\n## Memory Search Guidance (configured by /setup-memory)\n<!-- vibestack-memory-search-guidance:start -->\n\nSecondbrain is set up on this machine. The agent should prefer secondbrain\nover Grep when the question is semantic or when you don't know the exact\nidentifier yet. Available via the `secondbrain` CLI and the `mcp__secondbrain__*`\ntools:\n- This repo's code (registered as `vibestack-code-<repo>` source when imported).\n- `~/.vibestack/` curated memory (registered as `vibestack-memory-<user>` source).\n\nPrefer secondbrain when:\n- \"Where is X handled?\" / semantic intent, no exact string yet:\n    `secondbrain search \"<terms>\"` or `secondbrain query \"<question>\"`\n- \"Where is symbol Y defined?\" / symbol-based code questions:\n    `secondbrain code-def <symbol>` or `secondbrain code-refs <symbol>`\n- \"What calls Y?\" / \"What does Y depend on?\":\n    `secondbrain code-callers <symbol>` / `secondbrain code-callees <symbol>`\n- \"What did we decide last time?\" / past plans, retros, learnings:\n    `secondbrain search \"<terms>\" --source vibestack-memory-<user>`\n\nGrep is still right for known exact strings, regex, multiline patterns, and\nfile globs. Re-run `/setup-memory` to refresh state.\n\n<!-- vibestack-memory-search-guidance:end -->\n```\n\nIf Step 9 smoke test fails, skip the guidance block write entirely. The user's\nnext `/setup-memory` run will re-evaluate capability and write the block when\nthe round-trip works.\n\n---\n\n## Step 9: Smoke test\n\n### Path 4 (Remote MCP)\n\nThe `mcp__secondbrain__*` tools aren't visible mid-session — they're loaded at\nClaude Code session start. So the live smoke test in this same skill run is\ninformational: print the curl-equivalent the user can run after restarting\nClaude Code. The verify round-trip in Step 4c already proved the server is\nreachable + authed + on a compatible MCP version, so we don't re-test that.\n\nPrint to stdout:\n\n```\nAfter restarting Claude Code, the `mcp__secondbrain__*` tools become callable.\nSmoke test: ask the agent to run `mcp__secondbrain__search` with any query\n(\"test page\" works). You should see a JSON list of pages.\n\nTo verify from the shell right now (without waiting for restart):\n  curl -s -X POST -H 'Content-Type: application/json' \\\n       -H 'Accept: application/json, text/event-stream' \\\n       -H 'Authorization: Bearer <YOUR_TOKEN>' \\\n       -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\",\"params\":{}}' \\\n       <YOUR_MCP_URL>\n```\n\nDo NOT print the actual token in the curl command — leave the placeholder\n`<YOUR_TOKEN>` so the snippet is safe to copy into chat / share.\n\n### Paths 1, 2a, 2b, 3 (Local stdio)\n\n```bash\nSLUG=\"setup-memory-smoke-test-$(date +%s)\"\necho \"Set up on $(date). Smoke test for /setup-memory.\" | secondbrain put \"$SLUG\"\nsecondbrain search \"smoke test\" | grep -i \"$SLUG\"\n```\n\nConfirms the round trip. On failure, surface `secondbrain doctor --json` output and STOP.\n\n---\n\n## Step 10: GREEN/YELLOW/RED verdict block (idempotent doctor output)\n\nAfter Steps 1-9 complete, summarize. Re-running `/setup-memory` on a configured\nMac is a first-class doctor path: every step detects existing state, repairs\nonly what's missing, and reports here.\n\n```bash\n# Re-detect to surface fresh state (matches the Step 1 detection block —\n# accept any compliant brain MCP name, strip trailing colon, infer mode from\n# the (HTTP) marker).\n_BRAIN_LINE=$(claude mcp list 2>/dev/null | awk '/^(memex|secondbrain):[[:space:]]/{print; exit}')\nSBRAIN_MCP_NAME=$(printf '%s\\n' \"$_BRAIN_LINE\" | awk '{name=$1; sub(/:$/, \"\", name); print name}')\nSBRAIN_MCP_MODE=$(printf '%s\\n' \"$_BRAIN_LINE\" | awk '{print (tolower($3)==\"(http)\")?\"remote-http\":\"local-stdio\"}')\n[ -z \"$_BRAIN_LINE\" ] && { SBRAIN_MCP_NAME=\"\"; SBRAIN_MCP_MODE=\"\"; }\nTRANSCRIPT_INGEST=$(vibe-config get transcript_ingest_mode 2>/dev/null || echo \"off\")\nMEMORY_SYNC=$(vibe-config get memory_sync_mode 2>/dev/null || echo \"off\")\n```\n\nPick the right verdict template based on `SBRAIN_MCP_MODE`. Each row is\n`[OK]/[FIX]/[WARN]/[ERR]`.\n\n### Path 4 (Remote MCP)\n\nSubstitute `{SBRAIN_MCP_NAME}` with the detected MCP name (e.g. `memex` or\n`secondbrain`) so the verdict reflects what's actually registered. The\n`mcp__*__*` tool prefix follows the same name.\n\n```\n{SBRAIN_MCP_NAME} status: GREEN  (mode: remote-http)\n\n  MCP ............. OK   {SBRAIN_MCP_NAME} v{SERVER_VERSION} at {MCP_URL}\n  Auth ............ OK   bearer accepted (verified via /tools/list)\n  Engine .......... N/A  remote mode\n  Doctor .......... N/A  remote mode (brain admin runs the engine's own doctor)\n  Repo policy ..... OK   {read-write|read-only|deny}\n  Memory sync ..... OK   {memory_sync_mode}\n  Transcripts ..... {OK|N/A declined at Step 4d}\n  Code search ..... {OK local-pglite (~/.secondbrain/pglite) | N/A declined at Step 4d}\n  CLAUDE.md ....... OK\n  Smoke test ...... INFO printed for post-restart manual verification\n\nRestart Claude Code to pick up the `mcp__{SBRAIN_MCP_NAME}__*` tools.\nRe-run `/setup-memory` any time the bearer rotates or the URL moves.\n```\n\n### Paths 1, 2a, 2b, 3 (Local stdio)\n\n```\nsecondbrain status: GREEN  (mode: local-stdio)\n\n  CLI ............. OK   <secondbrain version>\n  Engine .......... OK   <pglite|postgres> at <path>\n  doctor .......... OK\n  MCP ............. OK   registered (user scope)\n  Repo policy ..... OK   <read-write|read-only|deny>\n  Code import ..... OK   <last_imported_head>\n  Memory sync ..... {OK|off}\n  Transcripts ..... <N> sessions, last ingest <when> (or \"off\")\n  CLAUDE.md ....... OK\n  Smoke test ...... OK   put → search → delete round-trip\n\nRun `/setup-memory` again any time secondbrain feels off; it's safe and idempotent.\n```\n\nIf any row is YELLOW or RED, the verdict line says so and the failing rows\nsurface a one-line \"next action\" (e.g.,\n`Engine .......... ERR  PGLite corrupt — \\`rm -rf ~/.secondbrain/pglite\\` and re-run \\`/setup-memory\\``).\n\n---\n\n## `/setup-memory --cleanup-orphans`\n\nRe-collect a PAT (Step 4 path-2a scope disclosure), then:\n\n```bash\nexport SUPABASE_ACCESS_TOKEN=\"<collected from read -rs>\"\nprojects=$(curl -s -H \"Authorization: Bearer $SUPABASE_ACCESS_TOKEN\" \\\n  https://api.supabase.com/v1/projects)\n```\n\nParse the response, identify any project named starting with `secondbrain` whose\n`ref` doesn't match the user's active `~/.secondbrain/config.json` pooler URL.\nFor each orphan, AskUserQuestion per project: \"Delete orphan project\n`<ref>` (`<name>`, created `<created_at>`)?\" — NEVER batch; per-project\nconfirm is a one-way door.\n\nOn confirmed delete:\n```bash\ncurl -s -X DELETE -H \"Authorization: Bearer $SUPABASE_ACCESS_TOKEN\" \\\n  \"https://api.supabase.com/v1/projects/$REF\"\n```\n\nNever delete the active brain without a second explicit confirmation.\n\nAt end: `unset SUPABASE_ACCESS_TOKEN`. Revocation reminder.\n\n---\n\n## `/setup-memory --resume-provision <ref>`\n\nRe-collect a PAT, then poll until healthy using the saved `$INFLIGHT_REF`:\n\n```bash\nuntil curl -s -H \"Authorization: Bearer $SUPABASE_ACCESS_TOKEN\" \\\n    \"https://api.supabase.com/v1/projects/$INFLIGHT_REF\" \\\n    | python3 -c \"import json,sys; d=json.load(sys.stdin); exit(0 if d.get('status')=='ACTIVE_HEALTHY' else 1)\" 2>/dev/null; do\n  sleep 5\ndone\n```\n\nThen fetch the pooler URL and continue from memory init (`secondbrain init`) onward.\n\n---\n\n## Important Rules\n\n- **One rule for every secret.** PAT, DB_PASS, pooler URL: env-var only,\n  never argv, never logged, never persisted to disk by us. The only file\n  that holds the pooler URL long-term is `~/.secondbrain/config.json`, written\n  by the secondbrain CLI's own `init` at mode 0600.\n- **STOP points are hard.** Memory doctor not healthy, PATH shadow, migrate\n  timeout, smoke test failure — each is a STOP. Do not paper over.\n- **Concurrent-run lock.** Release `~/.vibestack/.setup-memory.lock.d` on\n  normal exit AND in the SIGINT trap.\n- **CLAUDE.md is the audit trail.** Always update it in Step 8 after a\n  successful setup.\n- **Never log secrets.** No `SUPABASE_ACCESS_TOKEN`, `DB_PASS`, pooler URL,\n  or any `postgresql://` substring in output or logs.","tags":["setup","memory","vibestack","timurgaleev","agent-skills","ai-agents","claude-code","cursor-ide","developer-tools","kiro","mcp","prompt-engineering"],"capabilities":["skill","source-timurgaleev","skill-setup-memory","topic-agent-skills","topic-ai-agents","topic-claude-code","topic-cursor-ide","topic-developer-tools","topic-kiro","topic-mcp","topic-prompt-engineering","topic-slash-commands"],"categories":["vibestack"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/timurgaleev/vibestack/setup-memory","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add timurgaleev/vibestack","source_repo":"https://github.com/timurgaleev/vibestack","install_from":"skills.sh"}},"qualityScore":"0.457","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 15 github stars · SKILL.md body (40,911 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:06:23.951Z","embedding":null,"createdAt":"2026-05-18T19:06:23.951Z","updatedAt":"2026-05-18T19:06:23.951Z","lastSeenAt":"2026-05-18T19:06:23.951Z","tsv":"'+1':2486 '-9':5409 '/.claude.json':3408,3776,4759,4808 '/.secondbrain/config.json':895,2104,4837,5880,6045 '/.secondbrain/config.json.vibestack-bak-':1073 '/.secondbrain/pglite':1234,1243,3253,3262,5673,5821 '/.vibestack':4356,5044 '/.vibestack/.setup-memory.lock.d':325,345,2385,6085 '/.vibestack/bin/vibe-learnings-search':99 '/.vibestack/bin/vibe-slug':54 '/bin':1862 '/dashboard':2618 '/dashboard,':2301 '/dashboard/account/tokens':2201,2574 '/dashboard/project/$inflight_ref':2376 '/dev/null':56,58,82,97,103,327,387,402,429,442,456,478,739,1748,1760,1888,2482,2976,3190,3198,3699,3707,3899,3907,4013,4030,4412,4424,4499,4516,5475,5535,5548,5989 '/learnings.jsonl':69 '/lib/node_modules/secondbrain':1889 '/mcp':700 '/mcp):':2741 '/memory.md':4692 '/projects':66,4393 '/refs/callers':3333 '/sessions':4396 '/setup-memory':112,237,244,248,261,269,287,330,2306,2366,3010,3278,3478,4160,4729,4827,4992,5139,5159,5374,5415,5706,5779,5826,5827,5940 '/tmp/vibe-memory-doctor.json':440,451 '/tools/list':5627 '/users/foo/.bun/bin/secondbrain':704 '/v1/organizations':2282 '/v1/projects)':2428,5860 '/v1/projects/$inflight_ref':2463,5970 '/v1/projects/$inflight_ref/database/connection':2519 '/v1/projects/$ref':5921 '0':2451,2473,2893,4432,4435,4450,5980 '0600':2107,3410,3778,4839,6056 '1':347,360,389,659,756,1155,1250,1352,1463,1653,1725,1750,1762,1780,1985,2063,2326,2480,2501,2613,2661,2803,2879,2886,2916,2951,3192,3200,3426,3536,3810,4320,4427,4816,5323,5351,5408,5451,5492,5717,5987 '1.5':589,808,1319 '1/2/3/4':1089 '10':5399 '100000000':4479 '100mb':4480 '1024':4428 '10ms':3404,3769 '120':3102 '124':3451 '127.0.0.1':2790 '130':2387 '180s':1676,3430,3442 '2':55,57,81,96,102,326,388,401,428,441,455,477,592,738,864,1082,1167,1229,1248,1290,1324,1342,1426,1749,1761,1887,2237,2481,2619,2631,2885,2975,3191,3199,3265,3281,3611,3698,3706,3898,3906,4012,4019,4029,4411,4423,4498,4515,5474,5534,5547,5988 '2.0':2877,5321 '200':4475 '24':2343 '25/mo':2246 '2a':1536,1726,2114,3537,3811,4321,4817,5352,5718,5840 '2b':1561,1727,2603,3538,3812,4322,4818,5353,5719 '3':772,1331,1576,1685,1728,2448,2498,2629,2663,3177,3458,3539,3813,4323,4819,5354,5508,5720 '30':1581,3098,3136 '30s':1061 '36':2489 '4':1339,1594,1694,1698,1718,1721,1977,2638,2677,2836,3036,3182,3302,3495,3613,4270,4284,4326,4721,5181,5569,5837 '4a':2726 '4b':2805 '4c':2841,3515,4746,5234 '4d':3034,4293,4300,5666,5678 '4d-a':4299 '4d-b':4292 '4e':3364 '5':95,101,2503,3487,5992 '5a':158,1269,1401,3017,3287,3295,3376,3576 '6':1415,3959,3985,4166 '6543':2028,2036,2050,2648 '7':4170 '7.5':3348,4258 '7d':2242 '8':4344,4471,4697,4699,6104 '80ms':1001 '9':4866,4922,4935,5145,5177 '90':1552,4550,4560,4647 'abandon':923,1057 'absent':3345 'absolut':3822,3847 'accept':1531,2866,5313,5454,5624 'access':1508,1550,2131,2136,2219,2224,2278,2379,2406,2459,2515,2545,3511,3594,5847,5856,5917,5936,5966,6114 'account':1063,1580,2143,2292,3101 'across':1642,4197,4632,4774 'action':5813 'activ':2477,5879,5925,5984 'actual':948,5331,5591 'add':162,3380,3399,3711,3752,3795,3911,4812 'admin':5637 'agent':11,43,125,202,1473,1514,3951,4087,4100,4353,4586,4880,5001,5272 'agnost':687,4966 'allowlist':4204 'alon':2753 'alreadi':520,1395,1466,1479,1606,1659,2577,3521,3627,3646,5235 'also':542,4176,4870 'alway':963,6099 'anoth':329,1032,1387,1601,1836,1930,2692,3460 'answer':4122,4609,4676 'anyth':3566 'api.supabase.com':2281,2427,2462,2518,5859,5920,5969 'api.supabase.com/v1/organizations':2280 'api.supabase.com/v1/projects)':2426,5858 'api.supabase.com/v1/projects/$inflight_ref':2461,5968 'api.supabase.com/v1/projects/$inflight_ref/database/connection':2517 'api.supabase.com/v1/projects/$ref':5919 'append':4710,4942 'appli':4640 'application/json':2412,2864,2867,5311,5314 'aren':5188 'arg':301 'argv':1995,2076,2811,3394,3760,6024 'array':2286 'artifact':4207,4247,4357,4850 'artifacts-on':4206,4246,4849 'ask':1424,2226,2316,3043,3589,4118,5270 'askuserquest':861,1180,1346,1683,2231,2312,4077,4175,4534,5886 'assum':728 'attempt':2450,2484,2485,2487 'audienc':196 'audit':6097 'auth':2848,2935,2998,3527,5241,5621 'author':2275,2403,2456,2512,2870,3721,3754,5317,5853,5914,5963 'auto':281,1539,2117,4573 'auto-load':4572 'auto-provis':280,1538,2116 'avail':3833,5022 'avoid':3849 'awar':3048 'awk':740,754,769,4425,5476,5490,5505 'b':1034,1187,3154,3335,4294,4650 'b/c':1137 'back':648,978,1015,1573,1741,3131 'backend':686 'backend-agnost':685 'background':4059 'backup':1199,1205,1216,1261,3217,3223,3233,3235,3238 'bad/expired':2937 'bail':1143 'bak':1046 'base':133,1459,2264,5078,5556 'base64':2342 'basenam':4508 'bash':52,323,364,600,1198,1736,1785,1794,1875,1996,2029,2077,2212,2271,2336,2349,2393,2666,2775,2812,2853,3171,3418,3541,3657,3862,4004,4129,4219,4387,4490,4677,5357,5440,5844,5908,5958 'batch':5894 'bearer':1619,2276,2404,2457,2513,2684,2807,2815,2871,3619,3722,3755,3758,4788,5318,5623,5710,5854,5915,5964 'becom':2495,5266 'behavior':4213 'best':1554,1589 'bin':1797,3870,3876,3878,3917 'binari':315,1705,1837,1931,3827 'block':1152,1952,4715,4876,4889,4900,4927,4944,4961,4984,5152,5169,5402,5453 'brain':23,216,683,733,752,767,781,1077,1285,1393,1444,1455,1533,1560,1584,1630,1639,1662,1980,2689,2724,3057,3112,3318,3358,3470,3482,3499,3649,5457,5469,5488,5503,5517,5636,5926 'brain.example.com':699 'brain.example.com/mcp':698 'branch':522,594,888,4040 'brand':574,1389 'break':1909 'brief':3393 'briefli':3764 'bring':4347 'broken':551,554,634,643,651,669,676,810,820,824,951,1171,1175,1816,1969,3032 'broken-config':553,642,675,823,1174 'broken-db':550,633,650,668,819,1170 'broken-local-engin':809 'bulk':4482 'bun':1738,1747,1752,1772,1795,3197,3202 'byte':4418,4434,4444,4445,4478 'c':418,445,1075,1283,2435,2465,2527,2835,2960,3550,4656,5972 'call':45,1707,5091 'callabl':5267 'calle':5105 'caller':3079,5101 'capabl':5165 'captur':26,543 'case':928,959,1365,2785 'caveat':1497 'chang':982 'chat':5348 'cheap':966 'cheapest':1002 'check':1792,1860,1937,4001,4797 'choic':1128,1555 'choos':1031 'class':5424 'classifi':2995 'claud':160,165,221,691,735,1446,1504,3312,3378,3397,3581,3587,3591,3691,3701,3709,3736,3750,3779,3792,3836,3854,3891,3901,3909,3919,3932,3966,4810,5198,5225,5260,5471,5692 'claude.md':4341,4695,4704,4714,4766,4794,4795,5679,5767,6094 'clean':1301 'cleanup':289,531,5829 'cleanup-orphan':288,530,5828 'clear':3004 'cli':16,139,173,180,558,615,1310,1328,1688,2071,2111,2706,3174,3324,4281,5026,5730,6050 'click':2620 'close':3471 'cloud':206,1472,1513 'cloud-ag':1471 'code':10,124,166,222,725,1505,3041,3049,3072,3075,3078,3088,3107,3117,3123,3152,3271,3313,3331,3582,3592,3780,3793,3837,3855,3967,4305,4329,4352,4879,5035,5040,5079,5083,5088,5100,5104,5199,5226,5261,5667,5693,5754 'code-cal':3077,5099 'code-calle':5103 'code-def':3071,3330,5082 'code-on':3116 'code-ref':3074,5087 'codex':172 'coding-ag':4351 'colleagu':1857 'collect':1989,2125,2210,2727,2806,3422,5833,5946 'colon':713,5462 'come':977 'command':33,384,1745,1757,1877,3187,3195,3871,5336 'comment':4948 'commit':4762 'compat':2851,3531,5244 'complet':991,2208,2565,3456,5410 'compliant':573,682,1388,5456 'comput':597 'con':1121 'concurr':317,6081 'concurrent-run':316,6080 'config':192,372,407,412,472,555,561,618,626,636,644,645,677,825,841,854,893,919,940,1020,1044,1070,1098,1176,1224,1258,1314,1336,1357,3246,3954,4024,4132,4238,4241,4342,4460,4521,4680,4835,5529,5542 'configur':4702,4726,4727,4824,4825,4899,4983,4990,5418 'confirm':5385,5898,5906,5931 'connect':702,706,1469,1491,2059,2641,3745,3928 'consum':3382 'contain':208,912,2026 'content':2410,2862,4959,4962,5309 'content-typ':2409,2861,5308 'continu':1079,1164,1287,1824,1965,2592,3014,3267,3284,3956,4468,6000 'copi':2644,5346 'corrupt':5818 'cost':3140 'could':906,2897,3673 'count':76,88,93,4538,4972 'coverag':989 'creat':1441,1563,2153,2167,2296,2390,2394,2396,2432,3638,4229,5892 'credenti':2757,3783 'cross':3063 'cross-machin':3062 'curat':4355,5045 'curl':2272,2398,2453,2509,2856,2902,5217,5303,5335,5850,5909,5960 'curl-equival':5216 'current':259,362,2157,2267,3845,4020,4034,4038,4370,4546,4776,4853 'cursor':171 'd':84,421,448,865,1116,1142,1296,1893,1905,2413,2469,2875,2964,3044,4398,4416,4667,5319,5976 'd.get':426,453,2475,2968,5982 'dashboard':1488,2056 'data':4214,4365 'databas':1490,2058,2080,2096,2522,2550,2600,2640,3097 'date':1201,3219,4749,4841,5364,5370 'day':4551,4561,4603,4648 'db':552,635,652,670,821,1172,1631,2329,2338,2381,2422,2424,2535,2547,2710,3510,6015,6116 'dead':1026 'decid':5109 'declin':5663,5675 'def':3073,3332,5084 'default':247,2322,3630,4543 'defin':5075 'delet':292,1264,2373,4618,5774,5889,5907,5912,5923 'delimit':4949 'deni':4073,4106,4785,4862,5653,5753 'depend':3604,4717,5096 'describ':3298,4593 'design':4210 'destruct':981,1068,1140 'detect':361,481,510,680,886,1151,1375,1411,1461,1654,3413,3622,5429,5443,5452,5578 'didn':3454 'differ':924,985,3653 'dir':1881,1896 'direct':1398 'directori':1232,1874 'dirnam':1904 'discard':2180,2578 'disclosur':2123,5842 'disjoint':1535 'disk':3104,4532,6030 'dispatch':314 'distinguish':632 'doc':4686 'docker':207 'doctor':378,438,463,498,501,629,1008,3504,3542,3544,3548,3571,5393,5404,5425,5632,5643,5737,6062 'doesn':1699,2155,4285,5873 'done':521,1911,2504,2671,4518,5993 'door':944,5904 'downstream':516,724 'du':4419 'duplic':1443,3640 'e.g':2738,5581,5814 'earlier':1838 'east':2325 'eat':4957 'echo':85,107,328,342,403,430,457,479,480,786,1218,1230,1252,1769,1915,1929,2007,2014,2030,2037,2051,2221,2351,2352,2364,2372,2431,2490,2524,2791,2822,2895,2907,2927,2942,2977,2979,3241,3266,3547,4031,4033,4437,5366,5536,5549 'effect':1018 'either':708 'eli10':889,3054 'elif':616,627,1756 'els':106,671,1599,1768,2479,3206,3567,4429,5986 'emb':4052,4055 'embed':2599 'emit':2559,3937 'empti':586,2288 'enabl':4331 'end':5933 'enforc':4068 'engin':128,213,266,376,416,427,483,494,496,639,663,812,840,845,869,898,952,970,999,1013,1023,1053,1275,1657,1668,3343,3416,4193,4334,4832,4968,5628,5640,5732,5815 'enter':275 'entir':1691,3492,4267,5154 'entri':89,1434 'env':2073,3373,3733,3800,6020 'env-var':3799,6019 'environ':1814 'equival':5218 'err':5567,5816 'error':1770,1810,2038,2491,2792,2896,2925,2928 'esac':2804 'etc':174,1863 'eval':53 'evalu':5164 'even':1831,4911 'everi':1510,2138,3786,3835,4569,5427,6012 'everyth':4203 'exact':4537,5019,5063,5128 'execut':1191,4163 'exist':373,408,413,619,842,939,955,1019,1043,1069,1097,1355,1407,1656,1987,3245,3415,3628,3882,5430 'existing-engin':3414 'exit':346,353,745,1249,1779,2062,2386,2472,2500,2802,2888,2891,2903,2905,2915,2950,4168,5481,5979,6088 'expect':1872,1880,1895,1925,2048 'explain':2253 'explicit':1101,1139,5930 'export':1798,2078,2222,2337,2520,2837,5845 'exposur':3395 'f':71,404,3214,3234,4410,4497,4504,4509,4514 'fail':1221,1791,1807,2992,3020,3244,4916,5148,5805 'failur':1214,2936,2996,5390,6071 'fall':647,1320,1740,3130 'fals':368,374,380,1735,1908 'fastest':1047 'federation/cross-machine':4373 'feel':5784 'fetch':2392,2505,5995 'fi':105,111,431,466,678,679,1251,1781,1910,1946,2917,2952,3211,3212,3224,3240,3282,4436 'file':62,73,80,4403,4431,4440,4442,4449,4474,4836,5134,6035 'find':4404,4491,4587,4706,4938 'find-and-replac':4705,4937 'fire':858,1177,1317,1348,1681 'first':721,968,1593,1739,1778,3424,4901,5423 'first-class':5422 'fix':878,1820,3005,5565 'flag':534,829,1361 'flight':295,2360 'flip':251 'flow':246,1107,2658,3427 'follow':2650,5597 'forev':1028 'fork':1859,1960 'form':3603,3803 'format':4716 'found':1775,4552 'free':2236 'fresh':5446 'full':245,1506,2134,3570,4201,4250,4256,4852 'futur':3791 'g':1754,1766,1886,3204,3209 'gate':4262,4891 'ge':2488 'generat':2327 'get':177,473,1973,2052,2442,2534,2970,2972,3557,4009,4025,4568,4606,5530,5543 'get-url':4008 'git':3995,4006,4016,4147,4188,4800 'give':1501,3590 'glob':5135 'global':1796,1851,1926 'go':1708,3419,3438 'got':2799 'grant':2133 'great':3060 'green':5605,5725 'green/yellow/red':5400 'grep':1902,2034,2923,3133,3739,3922,4887,5006,5122,5382 'ground':884 'gt':94 'guidanc':4875,4926,4989,5151 'h':2274,2402,2408,2455,2511,2860,2865,2869,5307,5312,5316,5852,5913,5962 'half':1968,3031 'half-broken':1967,3030 'hand':2066 'handl':5059 'handoff':3366 'happen':2721 'hard':1126,6060 'hard-stop':1125 'head':2834 'header':3381,3720,3753,3805 'health':3490 'healthi':2173,2446,2478,2496,5952,5985,6064 'hint':306 'histor':4658 'histori':4655 'hold':3464,6037 'home':64,4391 'home/.bun/bin':1800 'home/.bun/bin/secondbrain':3879 'home/.bun/install/global/node_modules/secondbrain':1882 'home/.npm/global/node_modules/secondbrain':1883 'home/.secondbrain/config.json':405,424,1204,1217,1228,3215,3222,3239 'home/.secondbrain/config.json.vibestack-bak-':1200,3218 'home/.vibestack':65,4392 'honesti':151 'host':170,2725,2769,3500 'html':4947 'html-comment':4946 'http':584,701,719,773,776,1372,1391,1611,2681,3291,3362,3616,3686,3715,4733,5467,5509,5512,5609 'hygien':2749 'id':2417,2419,2443,2878,5322 'idempot':1421,5403,5790 'identifi':5020,5864 'if':4501 'immedi':2205,3389 'implement':311 'import':419,446,2436,2466,2528,2961,3551,4044,4048,4064,4139,5043,5755,5973,6007 'in-flight':293,2358 'inact':2243 'increment':4465,4489,4526,4666 'independ':3308 'index':2720,3083,4196 'infer':715,5463 'inflight':2362,2370,2429,2552,5956 'info':5683 'inform':5213 'ingest':2719,3350,4261,4274,4308,4385,4456,4463,4483,4487,4524,4563,4664,4669,4672,4683,5526,5532,5764 'init':1093,1102,1196,1208,1220,1340,2086,2538,2657,2668,3163,3227,3243,3340,6003,6005,6053 'initi':17,1978,2637,4220,4336 'inject':4072 'inlin':599,4372 'input':3802 'instal':14,1332,1634,1686,1753,1765,1776,1783,1848,1855,1873,1927,1936,1958,2707,3162,3172,3203,3208,3339,4287 'instanc':331 'instead':1529 'int':2388,2555 'intent':1957,4376,5061 'interact':2089,2541,4080,4108 'intern':2696 'interrupt':278,2357 'introspect':3513 'invoc':232,300,533,4162 'isn':849,870,902,2754 'isol':1583,3095 'issu':3852 'json':420,439,447,654,1009,1210,2090,2437,2467,2529,2542,2670,2962,3229,3437,3447,3545,3552,5288,5394,5974 'json.load':422,449,2440,2470,2532,2965,3555,5977 'jsonl':4408,4495,4510 'jsonrpc':2876,5320 'jump':1266,1715 'kind':987 'know':4905,5017 'knowledg':132,3065 'known':5127 'l':78,4414 'lan':2697 'last':4549,4559,4646,4975,5110,5763 'last-sync':4974 'learn':61,72,75,79,86,87,92,108,4182,4881,5115 'leav':3025,4624,5337 'let':1085 'level':1523,2259 'like':696,2043,2934,3069 'limit':100,2239 'line':514,694,734,753,768,782,5470,5489,5504,5518,5800,5811 'link':4693 'list':291,693,737,1448,2269,3738,3921,5289,5473 'live':1456,1869,4805,5204 'll':976,1545 'load':90,3976,4574,5196 'local':19,148,169,198,220,545,580,602,611,622,666,673,778,788,791,811,816,839,867,1037,1052,1160,1255,1280,1304,1503,1528,1578,1629,1633,1703,2665,2704,2709,3038,3082,3113,3149,3164,3270,3305,3327,3342,3509,3676,3814,3884,4279,4302,4820,4830,5355,5514,5671,5721,5728 'local-mac':197 'local-pglit':5670 'local-scop':3883 'local-stdio':579,777,1279,3675,4829,5513,5727 'localhost':2774,2789,2795 'lock':319,340,350,3466,6083 'log':6026,6110,6126 'login':2614 'long':6042 'long-term':6041 'longer':1106 'look':695,2042 'loopback':2768 'mac':149,199,1587,4349,5419 'machin':1067,1602,1643,2693,3053,3064,3086,3841,4198,4265,4384,4626,4633,4775,4965,4978,4999 'machine-agnost':4964 'make':3830 'malform':646,857,2999 'mani':4529,4802 'manual':193,1564,2195,2605,3955,5689 'markdown':4724,4822,4986 'marker':720,5468 'match':540,707,722,5448,5875 'max':2447 'may':1235,1841,1932,1955,3254,3462 'mb':3103 'mcp':25,142,155,161,191,563,567,577,684,692,736,747,762,784,794,797,801,804,1270,1368,1381,1392,1447,1597,1616,1627,1696,1710,2680,2716,2728,2736,2779,2783,2786,2800,2820,2832,2839,2844,2873,2883,2900,2913,2929,2948,2988,3157,3292,3310,3320,3368,3379,3387,3398,3497,3532,3583,3593,3615,3623,3661,3692,3702,3710,3718,3724,3728,3737,3751,3787,3832,3866,3892,3902,3910,3920,3938,3947,3953,3971,4272,4296,4723,4734,4736,4751,4811,4843,5029,5183,5185,5245,5263,5275,5458,5472,5483,5498,5520,5523,5559,5571,5574,5579,5594,5602,5610,5613,5619,5698,5700,5739 'memex':569,697,741,1384,3656,5477,5582 'memo':50 'memori':3,7,38,114,121,212,381,467,474,482,504,1687,2070,2184,2356,2581,2589,3352,3489,3578,3597,4082,4172,4181,4192,4243,4260,4333,4691,4701,4725,4767,4823,4846,4873,4987,5046,5051,5121,5361,5538,5544,5654,5657,5757,6002,6061 'memory-stag':3351 'messag':3011 'method':2880,2941,5324 'mid':3982,5192 'mid-sess':3981,5191 'migrat':264,1663,1671,3432,3444,3453,6067 'min':2449,2632 'minut':2499,3459 'miss':560,625,1313,1335,5436 'missing-config':559,624,1312,1334 'mkdir':324 'mode':243,383,469,476,506,578,716,763,785,802,805,1078,1286,1369,2106,3363,3409,3777,4234,4245,4464,4488,4525,4665,4673,4684,4719,4730,4828,4838,5464,5499,5524,5533,5546,5560,5606,5631,5635,5659,5726,6055 'move':1042,1071,1136,5715 'multilin':5131 'multipl':2309 'must':1030,2022,2797 'mv':1203,1215,3221,3237 'n':661,751,766,2013,2828,3232,5487,5502 'n/a':1129,5629,5633,5662,5674 'name':564,568,709,730,748,755,758,760,795,798,1382,1412,2414,2623,3624,3654,3659,3662,3672,3695,3705,3717,3741,3864,3867,3890,3895,3905,3915,3924,4407,4494,5459,5484,5491,5494,5496,5521,5575,5580,5600,5603,5614,5701,5867 'ne':2892 'need':1245,1546,1635,1701,1945,2585,2750,3080 'neither':1771 'net':1130 'network':2673,2997 'network/dns/firewall':2906 'never':1429,1993,2075,2331,2810,4104,4668,4763,4791,4956,5893,5922,6023,6025,6027,6109 'new':1104,1158,1273,1542,2621,4092,4660 'next':4119,5158,5812 'ngrok':2695 'no-c':556,613,1308,1326 'no-emb':4050 'non':837,1951,2088,2540,2767,2773,2794 'non-block':1950 'non-interact':2087,2539 'non-localhost':2772,2793 'non-loopback':2766 'non-work':836 'none':109,493,497,799,806 'normal':352,1292,6087 'note':983,3749,4158 'noth':1119,4075,4454,4623 'npm':1743,1759,1764,1774,1884,3207 'offer':3037,4171,4345 'ok':379,459,464,499,502,549,604,630,1163,3562,5564,5611,5622,5646,5656,5661,5669,5680,5731,5733,5738,5740,5746,5756,5759,5768,5771 'old':1059,3680 'one':32,513,547,882,942,1040,1060,1105,1478,1777,1845,2148,2168,2297,2315,3626,4230,5810,5902,6009 'one-lin':5809 'one-sent':881 'one-way':941,1039,5901 'ongo':3139 'onward':1416,6006 'open':423,450,3965 'openclaw/hermes':201,1476 'openssl':2340 'option':967,984,1033,1457,4199,4311,4641 'org':2258,2263,2270,2285,2310,2418 'org-level':2257 'organ':2295,2416 'origin':3481,3999,4011,4151 'orphan':290,532,5830,5885,5890 'otherwis':3629,4527 'outag':910 'output':1376,3572,5395,5405,6124 'outsid':1923,4145 'overwrit':937 'page':1511,4093,4613,4971,5282,5291 'paper':6078 'parallel':1432 'param':2882,5326 'pars':298,655,5861 'partial':1239,3022,3258 'pass':831,1363,2339,2382,2423,2425,2548,4869,4896,4936,6016,6117 'password':2330,2601 'past':1480,1498,1570,1614,1998,2214,2570,2733,2777,2814,4579,5112 'pat':2121,2164,2215,2561,2568,5835,5948,6014 'path':182,367,392,396,435,486,489,608,1048,1083,1088,1141,1293,1345,1693,1697,1720,1724,1734,1793,1799,1801,1821,1828,1840,1928,1943,1982,1984,2113,2602,2660,2662,2676,3035,3181,3301,3425,3494,3535,3607,3612,3809,3823,3848,3850,3930,3936,4269,4283,4319,4325,4533,4720,4815,5180,5350,5426,5568,5716,5839,6065 'path-2a':5838 'path-shadow':1827 'path-specif':1981 'pattern':5132 'paus':2240,2248 'per':28,254,688,3175,3987,4611,4635,5887,5896 'per-project':5895 'per-remot':27,253,3986 'per-repo':4634 'per-sess':4610 'perman':1025 'persist':6,37,113,120,2102,3596,4117,4339,4700,6028 'person':1549,2130 'pglite':20,267,936,1038,1115,1190,1209,1231,1256,1274,1527,1577,2664,2669,3039,3096,3114,3150,3165,3228,3251,3306,3328,3420,3440,3446,4303,4328,4833,5672,5734,5817 'pick':932,1087,1184,1343,1526,1680,2261,2314,2626,3608,4253,4291,4307,5551,5695 'picker':1084,1294 'place':4813 'placehold':5339 'plain':2744 'plan':4183,4209,5113 'point':847,900,1435,6058 'polici':31,256,690,3989,4003,4027,4035,4135,4638,4778,4855,5645,5745 'poll':285,2170,2444,5950 'pooler':1483,1492,2000,2005,2016,2032,2046,2060,2083,2093,2177,2506,2508,2525,2642,5881,5997,6017,6039,6118 'port':2027,2049,2647 'possibl':225 'post':2401,2859,5306,5687 'post-restart':5686 'postgr':228,911,4834,5735 'preambl':51 'prefer':4884,5003,5053 'prefix':1885,5596 'present':1458,2235 'preserv':954,1021,1096 'prevent':3634 'previous':277,1223,1257 'print':425,452,744,759,770,2439,2531,2967,3554,4426,5214,5255,5329,5480,5495,5506,5684 'printf':749,764,1899,1997,2008,2213,2776,2813,2823,2829,2919,2955,5485,5500 'prior':1854,3667,4589 'privat':1064,4187 'pro':2245 'probe':997,4368,4438 'proceed':3565 'process':2183,3372,3732,3762 'project':297,1543,2139,2169,2238,2395,2492,2590,2622,2635,4803,5849,5866,5888,5891,5897 'project/branch/task':880 'promis':4542 'prompt':2229,2730,4316 'prose':305 'protocol':2852 'prove':3522,5236 'provid':4225 'provis':272,282,529,1477,1540,2118,2369,5943 'ps':3402,3767 'put':3756,4512,5376,5772 'pwd':4049 'python3':417,444,2434,2464,2526,2959,3549,5971 'q':1903,2924 'qe':2035 'queri':3068,3322,4597,5070,5280 'question':1450,5009,5080 'quit':1117,1297 'r':2746,2782,4503 'rand':2341 'raw':2908,2943 're':274,996,1005,1092,1148,1404,2150,2304,3008,3276,3476,3975,3992,4909,5137,5163,5195,5252,5413,5442,5704,5824,5832,5945 're-collect':5831,5944 're-detect':5441 're-ent':273 're-evalu':5162 're-init':1091 're-prob':995 're-run':1004,1147,2303,3007,3275,3475,5136,5412,5703,5823 're-test':1403,5251 'reach':2899 'reachabl':851,904,2847,2986,3526,5240 'read':2002,2174,2216,2655,2742,2745,2781,2817,4042,4061,4085,4098,4142,4502,4780,4783,4857,4860,5648,5651,5748,5751 'read-on':4060,4097,4782,4859,5650,5750 'read-writ':4041,4084,4141,4779,4856,5647,5747 'read/write':1507 'read/write/delete':2135 'readi':1575 'real':2251,4608 'rearrang':1942 'receiv':2010,2825 'recent':4575 'recommend':960,1000,1636,2203,2249,3134,3153,3599,4649 'red':5797 'redact':2011,2826 'ref':2361,2363,2371,2430,2553,3076,5089,5872,5957 'refer':4685 'reflect':5588 'refresh':5141 'refus':2770 'regardless':1377 'regex':4952,5130 'region':2321,2420,2421,2628 'regist':24,185,566,1277,1396,1430,1623,2713,3577,3816,3941,4752,4844,5036,5047,5592,5741 'registr':156,1271,1408,3023,3293,3311,3602,3642,3668,3735,3886,3939 'reject':2931 'releas':348,3794,6084 'remain':2187 'remedi':813,925 'remind':2563,5939 'remot':29,255,583,775,1371,1595,1695,1713,2678,2715,3056,3111,3156,3290,3317,3357,3361,3496,3614,3685,3946,3988,4000,4005,4007,4028,4037,4136,4152,4271,4295,4722,4732,5182,5511,5570,5608,5630,5634 'remote-http':582,774,1370,3289,3360,3684,4731,5510,5607 'remov':338,3693,3703,3880,3893,3903,4951 'repair':1113,5432 'replac':4708,4940 'repo':249,260,525,3127,3996,4046,4096,4148,4161,4189,4223,4547,4556,4583,4636,4645,4653,4777,4854,5033,5644,5744 'report':508,5438 'request':2933 'requir':2762 'reset':3264 'resolut':3851 'resolv':1867,1876,1901,1918,1920,3588,4071 'resp':2855,2910,2922,2945,2958 'respond':872 'respons':5863 'rest':3405,3773 'restart':3963,5224,5259,5302,5688,5691 'restor':1212,1226,3250 'result':2397,2433,2969 'resum':271,528,2365,2368,5942 'resume-provis':270,527,2367,5941 'retri':953,962,994,1027,1146,1247,3280 'retriev':4362 'retro':4184,4211,5114 'return':3450,4918 'reus':3620 'review':1262 'revoc':2562,5938 'revok':2196,2204,2566 'rf':344,1242,2384,3261,5820 'right':1134,5125,5297,5553 'rm':343,1241,2383,3260,5819 'rollback':1194,3168 'rollback-saf':1193,3167 'root':4389,4400,4406,4422,4493 'rotat':3689,5711 'round':3519,5173,5230,5387,5776 'round-trip':3518,5172,5229,5775 'rout':3354 'row':5562,5793,5806 'rs':2003,2217,2818 'rule':6008,6010 'run':40,135,204,238,318,333,1006,1149,1419,1607,1645,1669,2305,2690,3009,3183,3277,3296,3477,3501,5138,5160,5211,5222,5274,5414,5638,5705,5778,5825,6082 'safe':1195,3169,5344,5788 'salienc':4576 'save':1259,5955 'say':5801 'sbrain':365,369,371,375,377,390,394,397,406,411,415,433,462,487,491,495,500,544,562,576,601,606,610,617,621,628,662,665,672,746,761,783,787,790,793,796,800,803,815,1159,1303,1367,1380,1732,2004,2015,2031,2079,2082,2092,2095,2521,2549,2819,2831,2838,2872,2912,2947,3367,3386,3660,3723,3727,3865,3869,3875,3877,3916,5482,5497,5519,5522,5558,5573,5601,5612,5699 'scope':150,2122,2159,3712,3819,3829,3885,3912,4379,4544,4755,5743,5841 'score':992 'scratch':1095 'search':3042,3050,3124,3272,4089,4102,4330,4874,4988,5067,5117,5277,5379,5668,5773 'searchabl':4615 'second':1553,1582,3099,3137,5929 'secondbrain':13,130,179,186,386,399,437,484,570,703,732,742,868,890,1007,1207,1219,1385,1433,1596,1608,1670,1689,1704,1755,1767,1786,1789,1802,1833,1868,1879,1917,1940,2085,2110,2147,2415,2537,2625,2667,2679,2705,2735,2778,2981,3070,3173,3189,3205,3210,3226,3242,3323,3431,3443,3543,3579,3598,3632,3641,3663,3826,3857,3868,3873,3942,3972,4026,4047,4054,4070,4083,4134,4194,4280,4359,4511,4565,4631,4740,4885,4993,5004,5025,5030,5054,5066,5069,5081,5086,5098,5102,5116,5186,5264,5276,5375,5378,5392,5478,5584,5723,5783,5870,6004,6049 'secret':2654,2675,2748,6013,6111 'secret-read':2653 'section':4712 'secur':1992,2211,2809 'sed':2018,4014,4017 'see':1011,1516,3970,5286 'semant':3122,3170,5011,5060 'sentenc':883 'separ':3108,4174 'sequenc':1197 'serv':187,705,1609,3858,3918,3943 'server':1714,2702,2845,2930,2953,2982,2984,3524,3788,4738,4742,5238,5616 'serverinfo':2971 'session':1482,1493,1999,2045,2061,2176,2643,3461,3838,3968,3978,3983,4180,4507,4580,4612,5193,5200,5762 'set':4,118,1489,2057,2344,2639,3147,4133,4232,4242,4457,4461,4485,4522,4681,4995,5367 'setup':2,49,115,195,1970,2207,2355,2564,3268,3681,4690,4748,4840,5360,6108 'setup-memori':1,4689 'setup-memory-smoke-test':5359 'shadow':1829,1843,1890,1907,1913,1934,6066 'share':214,227,1558,1641,5349 'shell':4275,5296 'shortcut':242,828,1360 'show':1353,2119,3744,3927 'shown':2332 'side':1017,2192 'sigint':357,2347,6092 'signup':1568 'silent':1679,1974,4466,4481 'singl':4264,4383 'single-machin':4263,4382 'sk':4420 'skill':153,240,309,321,1300,1622,1826,2712,3636,4571,5210 'skill-setup-memory' 'skip':515,537,1397,1690,3178,3337,3346,3491,3940,4063,4112,4126,4153,4212,4266,4451,4657,5149 'skip-for-now':4111,4125 'sleep':2502,5991 'slug':59,67,887,4394,5358,5377,5384 'smoke':4867,4894,4914,4930,5146,5178,5205,5268,5362,5371,5380,5681,5769,6069 'snippet':5342 'someon':1598 'sourc':3469,5041,5052,5118 'source-timurgaleev' 'space':743,5479 'spawn':3856 'special':1364 'specif':167,1983 'spin':3091 'ss':2857 'stage':3353 'stake':929,3119 'stale':918,1850,3683,4056 'start':322,1135,2023,2760,3979,5201,5868 'startup':3763 'state':363,511,956,1240,1462,3033,3259,3406,3417,3774,4371,4907,4979,5142,5431,5447 'status':443,454,458,460,546,603,612,623,667,674,789,792,817,1161,1305,2476,3546,3558,3560,5604,5724,5983 'stay':3115,3344,3370,4620,4980 'stdin':3797 'stdio':581,779,1281,3677,3815,4821,4831,5356,5515,5722,5729 'stdout':5257 'step':157,286,359,517,541,588,591,658,807,863,1081,1154,1166,1268,1289,1318,1323,1330,1338,1341,1351,1400,1414,1425,1652,1684,1717,1976,2612,3016,3176,3286,3347,3375,3486,3514,3575,3610,3958,3984,4155,4165,4169,4257,4343,4470,4696,4698,4745,4865,4921,4934,5144,5176,5233,5398,5407,5428,5450,5665,5677,5836,6103 'still':176,1169,1806,4310,4639,5124 'stop':913,1127,1298,1812,2307,2718,3001,3485,3574,5397,6057,6075 'storag':3748 'store':4757 'string':1470,5064,5129 'strip':710,5460 'structur':2021 'sub':757,5493 'subprocess':3861 'subsect':1722,3303 'substitut':5572 'substr':6122 'succeed':1835,4932 'success':2065,2558,6107 'summar':5411 'supabas':22,229,268,279,296,1464,1487,1537,1548,1562,1986,2055,2115,2129,2142,2154,2190,2218,2223,2233,2277,2291,2378,2405,2458,2514,2544,2604,3421,3434,3439,5846,5855,5916,5935,5965,6113 'supabase.com':1567,2200,2300,2375,2573,2611,2617 'supabase.com/dashboard':2616 'supabase.com/dashboard,':2299 'supabase.com/dashboard/account/tokens':2199,2572 'supabase.com/dashboard/project/$inflight_ref':2374 'support':2158 'surfac':1496,1808,1962,2289,2993,3452,3568,3784,4314,4363,4367,5391,5445,5807 'switch':262,526,934,1035,1076,1188,1253,1284,1649,1729,3411,3479,3540,3806 'symbol':3047,3067,3143,5073,5077 'symbol-awar':3046 'symbol-bas':5076 'sync':382,468,475,503,505,4173,4177,4202,4222,4244,4374,4630,4768,4773,4847,4976,5539,5545,5655,5658,5758 'sys':2438,2468,2530,2963,3553,5975 'sys.stdin':2441,2471,2533,2966,3556,5978 'taggabl':4616 'tailscal':914,2694 'talk':3314,3325 'target':164,860,3658,3694,3704,3716,3740,3863,3894,3904,3914,3923 'team':1559 'teammat':1648,2700 'tear':3664 'tell':3960 'templat':5555 'temporarili':973 'term':2389,2556,6043 'test':1003,1405,4868,4895,4915,4931,5147,5179,5206,5253,5269,5281,5363,5372,5381,5682,5770,6070 'text/event-stream':2868,5315 'thank':4216 'three':241 'tier':2228,2234,2255,2268,4021,4039,4066,4137 'time':4120,4977,5111,5708,5782 'timeout':1675,3429,3441,3449,6068 'tini':3094 'titl':1451,4506,4513 'tls':2763 'today':4750,4842 'token':1551,1620,2127,2132,2160,2186,2220,2225,2279,2380,2407,2460,2516,2546,2685,2808,2816,2821,2824,2833,2840,2874,2914,2938,2949,3365,3369,3388,3690,3725,3729,3747,3771,4756,4789,5332,5848,5857,5918,5937,5967,6115 'token-storag':3746 'tolow':771,5507 'tool':143,3144,3973,5031,5187,5265,5595,5702 'tools/list':2881,5325 'topic-agent-skills' 'topic-ai-agents' 'topic-claude-code' 'topic-cursor-ide' 'topic-developer-tools' 'topic-kiro' 'topic-mcp' 'topic-prompt-engineering' 'topic-slash-commands' 'total':4402,4417,4430,4433,4439,4443,4446,4448,4473,4477,4562 'tr':83,4415 'track':4659 'trade':3391 'trade-off':3390 'trail':712,5461,6098 'tran':4388,4399,4405,4421,4492 'transcript':3349,4259,4273,4354,4441,4462,4486,4523,4530,4553,4663,4670,4671,4682,5525,5531,5660,5761 'transient':909,958 'transport':1612,2682,3617,3714 'trap':358,2348,2350,2554,6093 'treat':1417 'tri':964,1592,1737 'trigger':1329,1337 'trip':3520,5174,5231,5388,5777 'true':104,393,409,465,1891,3700,3708,3900,3908,4517 'trust':30,1495,1522,4637 'trust-surfac':1494 'try-first':1591 'ts':1074 'type':236,1938,2411,2863,4409,4496,4969,5310 'typic':203,3655 'unambigu':4954 'under':127 'unknown':60,68,2974,2978,4395 'unlock':3141 'unreach':640 'unset':2091,2377,2543,2911,2946,3385,3726,4032,4076,4786,4863,5934 'unsupport':2940 'untouch':3484 'updat':6100 'url':1439,1484,1500,1572,1617,1988,1991,2001,2006,2009,2017,2033,2039,2047,2081,2084,2094,2097,2099,2178,2507,2523,2536,2551,2646,2729,2737,2752,2780,2784,2787,2796,2801,2884,2901,2989,3423,3435,3436,3719,3948,4010,4226,4735,4737,5620,5714,5882,5998,6018,6040,6119 'us':2324,6032 'us-east':2323 'use':12,47,159,885,2162,2252,2311,2596,2798,4313,4945,5953 'user':146,200,231,235,833,947,1029,1055,1086,1109,1183,1474,1819,1954,2260,2318,2335,2608,2687,2732,3027,3645,3697,3713,3818,3828,3897,3913,3962,4224,4252,4290,4688,4754,4904,4958,5156,5220,5742,5877 'user-invoc':230 'v':385,1746,1758,1878,2983,3188,3196,3872,4741,5615 'valid':637,1830,1864,2020,2188,2758 'valu':1306,4541 'var':2074,3801,6021 've':2576 'verdict':5401,5554,5587,5799 'verif':1402,5690 'verifi':1784,2656,2842,2854,2887,2890,2904,2909,2921,2944,2957,2980,2991,3021,3488,3517,3742,3925,4747,5228,5293,5625 'version':370,398,400,490,492,1787,1790,1803,1834,2954,2973,2985,3533,4739,4743,5246,5617 'via':2072,2230,3319,5023,5626 'vibe':471,2354,4023,4131,4237,4240,4459,4520,4679,5528,5541 'vibe-config':470,4022,4130,4236,4239,4458,4519,4678,5527,5540 'vibe-setup-memori':2353 'vibestack':63,689,4179,4390,4570,4627,4770,5039,5050,5120 'vibestack-cod':5038 'vibestack-memori':5049,5119 'visibl':3400,3765,5190 'vs':2244 'wait':334,2391,2630,5300 'walk':1565,2606 'want':876,921,949,1111,1525,3045 'warn':461,1916,1948,3564,5566 'way':943,1041,5903 'wc':77,4413 'whether':1379 'whose':1475,2688,5871 'win':723 'wintermute.tail554574.ts.net:3131':2740 'wintermute.tail554574.ts.net:3131/mcp):':2739 'wire':1975,3650 'without':979,3120,3269,4591,5299,5927 'work':656,838,1051,1356,2593,4590,5175,5283 'workspac':3473,3846 'worktre':3129 'would':3024 'wrap':1673 'write':4043,4086,4091,4105,4143,4781,4858,4871,4897,4924,5153,5167,5649,5749 'written':4764,4792,6046 'wrong':933 'x':2400,2858,4604,5058,5305,5911 'y':5074,5092,5095 'yellow':5795 'yes':3146,3161,3600,4200,4205,4218,4255,4643,4651,4753 'yes-ful':4254 'yes/no':4845 'yet':110,5021,5065 'z':780,3874,5516 'zero':35,1016,1579,3730","prices":[{"id":"166acf7f-5c8d-4194-8ea6-13efcad2f936","listingId":"778fc707-aea0-4a34-a156-fa540d2419a5","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"timurgaleev","category":"vibestack","install_from":"skills.sh"},"createdAt":"2026-05-18T19:06:23.951Z"}],"sources":[{"listingId":"778fc707-aea0-4a34-a156-fa540d2419a5","source":"github","sourceId":"timurgaleev/vibestack/setup-memory","sourceUrl":"https://github.com/timurgaleev/vibestack/tree/main/skills/setup-memory","isPrimary":false,"firstSeenAt":"2026-05-18T19:06:23.951Z","lastSeenAt":"2026-05-18T19:06:23.951Z"}],"details":{"listingId":"778fc707-aea0-4a34-a156-fa540d2419a5","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"timurgaleev","slug":"setup-memory","github":{"repo":"timurgaleev/vibestack","stars":15,"topics":["agent-skills","ai-agents","claude-code","cursor-ide","developer-tools","kiro","mcp","prompt-engineering","slash-commands"],"license":"mit","html_url":"https://github.com/timurgaleev/vibestack","pushed_at":"2026-05-18T18:19:05Z","description":"vibestack is a portable skill pack for AI coding agents. Slash commands like /office-hours, /ship, /investigate, /tdd, /review install once and work across every agent that supports the Agent Skills open standard — Claude Code, Cursor, Kiro, and a growing list of others. ","skill_md_sha":"06b50718315afbdcfc142deea3c659a02918aa32","skill_md_path":"skills/setup-memory/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/timurgaleev/vibestack/tree/main/skills/setup-memory"},"layout":"multi","source":"github","category":"vibestack","frontmatter":{"name":"setup-memory","description":"Set up persistent memory for this coding agent using secondbrain: install the CLI,\ninitialize a local PGLite or Supabase brain, register MCP, capture per-remote\ntrust policy. One command from zero to \"persistent memory is running and this\nagent can call it.\" Use when: \"setup memory\", \"setup secondbrain\", \"connect secondbrain\",\n\"start secondbrain\", \"install secondbrain\", \"configure memory for this machine\"."},"skills_sh_url":"https://skills.sh/timurgaleev/vibestack/setup-memory"},"updatedAt":"2026-05-18T19:06:23.951Z"}}