Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

fix: consistent auto-scan + background-by-default across all setup flows (#59)

Aurora Capital3b8250eea6ac
diff --git a/claude-ops/CLAUDE.md b/claude-ops/CLAUDE.md
index 7c1b9280..e8cd74a9 100644
--- a/claude-ops/CLAUDE.md
+++ b/claude-ops/CLAUDE.md
@@ -40,3 +40,7 @@ When a skill says "tell the user to run X in a separate terminal" or "Run `comma
- **OAuth flows** (`gog auth login`, `doppler login`, `op signin`): run via Bash with `run_in_background: true` — the browser will open automatically.
- **Password manager unlock** (`bw unlock`, `dcli configure`): run via Bash tool directly.
- **Exception — QR-based auth** (`wacli auth`): this genuinely requires the user's phone camera pointed at the terminal. This is the ONLY case where you should tell the user to act in a separate terminal.
+
+## Rule 3 — Background by default during setup and configuration flows
+
+During `/ops:setup` and any skill's setup/configure flow, use `run_in_background: true` on **every** Bash call unless you need the result immediately for the very next decision. This includes: credential scans, CLI installs, OAuth flows, npm installs, brew installs, autolink scripts, smoke tests, keychain writes, Doppler queries, Chrome history queries. While background commands run, continue to the next independent step or ask the user the next question. Never block the conversation waiting for a command the user isn't actively waiting for.
diff --git a/claude-ops/skills/ops-ecom/SKILL.md b/claude-ops/skills/ops-ecom/SKILL.md
index 6daf9e54..b7a93a3d 100644
--- a/claude-ops/skills/ops-ecom/SKILL.md
+++ b/claude-ops/skills/ops-ecom/SKILL.md
@@ -449,39 +449,59 @@ Use `AskUserQuestion` for action selection.
## SETUP FLOW
-Guide the user through configuring Shopify credentials:
+**Before asking the user for anything**, auto-discover store URLs and tokens. Run ALL of these scans in a single batch:
+```bash
+# 1. Env vars
+printenv SHOPIFY_ACCESS_TOKEN SHOPIFY_ADMIN_TOKEN SHOPIFY_STORE_URL SHOPIFY_ADMIN_API_ACCESS_TOKEN 2>/dev/null
+
+# 2. Shell profiles
+grep -h 'SHOPIFY\|myshopify' ~/.zshrc ~/.bashrc ~/.zprofile ~/.envrc 2>/dev/null | grep -v '^#'
+
+# 3. Doppler — ALL projects, not just default
+for proj in $(doppler projects --json 2>/dev/null | jq -r '.[].slug'); do
+ doppler secrets --project "$proj" --config prd --json 2>/dev/null | \
+ jq -r --arg proj "$proj" 'to_entries[] | select(.key | test("SHOPIFY|STORE"; "i")) | "\(.key)=\(.value.computed) (doppler:\($proj)/prd)"'
+done
+
+# 4. Dashlane — URLs reveal store identity
+dcli password shopify --output json 2>/dev/null | jq -r '.[].url // empty' | grep -oE '[a-z0-9-]+\.myshopify\.com' | sort -u
+
+# 5. Keychain
+security find-generic-password -s "shopify-admin-token" -w 2>/dev/null
+security find-generic-password -s "shopify-access-token" -w 2>/dev/null
+
+# 6. Chrome history — reveals store URLs from admin sessions
+sqlite3 ~/Library/Application\ Support/Google/Chrome/Default/History \
+ "SELECT DISTINCT url FROM urls WHERE url LIKE '%myshopify.com/admin%' OR url LIKE '%admin.shopify.com/store/%' ORDER BY last_visit_time DESC LIMIT 10" 2>/dev/null | \
+ grep -oE '[a-z0-9-]+\.myshopify\.com|admin\.shopify\.com/store/[a-z0-9-]+' | sort -u
+
+# 7. Project .env files
+grep -rhE 'myshopify\.com|SHOPIFY_STORE|SHOPIFY.*TOKEN' ~/Projects/*/.env* 2>/dev/null | grep -v '^#' | head -5
+
+# 8. Existing prefs + userConfig
+jq -r '.ecom.shopify // empty' "$PREFS_PATH" 2>/dev/null
```
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
- OPS ► ECOM ► SETUP
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-To connect your Shopify store, you need:
-
-1. Store URL (e.g., mystore.myshopify.com)
-2. Admin API access token (shpat_...)
-
-To get your Admin API token:
- 1. Go to your Shopify Admin > Settings > Apps and sales channels
- 2. Click "Develop apps" > "Create an app"
- 3. Under "Configuration", enable Admin API scopes:
- read_orders, write_orders, read_products, write_products,
- read_customers, read_inventory, write_inventory,
- read_fulfillments, write_fulfillments, read_analytics
- 4. Click "Install app" to generate the access token
- 5. Copy the token (starts with shpat_)
-
-Store the credentials via one of:
- a) Plugin userConfig: set shopify_store_url + shopify_admin_token
- b) Environment: export SHOPIFY_STORE_URL=... SHOPIFY_ACCESS_TOKEN=...
- c) Doppler: doppler secrets set SHOPIFY_STORE_URL SHOPIFY_ACCESS_TOKEN
-
-ShipBob (optional):
- Get your Personal Access Token from app.shipbob.com > Developer > API
- Store as shipbob_access_token in userConfig or $SHIPBOB_ACCESS_TOKEN
+**Token acquisition — automate before asking.** If store URL found but no token:
+
+1. **Doppler deep scan** — check ALL projects/configs (dev, staging, prd)
+2. **Shopify CLI** — if `command -v shopify` succeeds: `shopify auth login --store <store>.myshopify.com` (opens browser OAuth), then generate token
+3. **Browser automation** — if Kapture/Playwright available, navigate to `admin.shopify.com/store/<slug>/settings/apps/development` and automate app creation with scopes: `read_orders,write_orders,read_products,write_products,read_customers,read_inventory,write_inventory,read_fulfillments,write_fulfillments,read_analytics`
+4. **Manual fallback** — only if all automated approaches fail:
+
```
+No automated path for <store>.myshopify.com.
+ 1. Go to https://admin.shopify.com/store/<slug>/settings/apps/development
+ 2. Create an app → Configure → grant scopes → Install → copy token
+ Token starts with "shpat_"
+```
+
+**Multi-store**: If multiple stores discovered, process each independently. Present all found stores with their token status before asking for input.
+
+Store credentials via: userConfig (preferred) → Doppler → env vars. ShipBob optional — check `SHIPBOB_ACCESS_TOKEN` in same scan.
-Use `AskUserQuestion` to collect store URL, then verify connectivity:
+Verify connectivity after acquisition:
```bash
curl -s -H "X-Shopify-Access-Token: ${PROVIDED_TOKEN}" \
diff --git a/claude-ops/skills/ops-marketing/SKILL.md b/claude-ops/skills/ops-marketing/SKILL.md
index ec7b7c6f..a64b4ace 100644
--- a/claude-ops/skills/ops-marketing/SKILL.md
+++ b/claude-ops/skills/ops-marketing/SKILL.md
@@ -458,28 +458,51 @@ For any channel with missing credentials, show `[not configured — /ops:marketi
## setup
-Guide user through configuring each marketing service:
+**Before asking for anything**, auto-scan ALL sources for existing credentials. Run in a single background batch:
-```
-MARKETING SETUP
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+```bash
+# Env vars
+printenv KLAVIYO_API_KEY KLAVIYO_PRIVATE_KEY META_ACCESS_TOKEN FACEBOOK_ACCESS_TOKEN META_AD_ACCOUNT_ID GA4_PROPERTY_ID GA_MEASUREMENT_ID 2>/dev/null
+
+# Shell profiles
+grep -h 'KLAVIYO\|META_\|FACEBOOK\|GA4\|GA_MEASUREMENT' ~/.zshrc ~/.bashrc ~/.zprofile ~/.envrc 2>/dev/null | grep -v '^#'
+
+# Doppler — ALL projects, ALL configs
+for proj in $(doppler projects --json 2>/dev/null | jq -r '.[].slug'); do
+ for cfg in dev stg prd; do
+ doppler secrets --project "$proj" --config "$cfg" --json 2>/dev/null | \
+ jq -r --arg proj "$proj" --arg cfg "$cfg" 'to_entries[] | select(.key | test("KLAVIYO|META|FACEBOOK|GA4|GOOGLE"; "i")) | "\(.key)=\(.value.computed) (doppler:\($proj)/\($cfg))"'
+ done
+done
+
+# Dashlane — check for tokens in password entries
+dcli password klaviyo --output json 2>/dev/null | jq -r '.[] | select(.password != null and .password != "") | "\(.title): token found"'
+dcli password facebook --output json 2>/dev/null | jq -r '.[] | select(.password != null and .password != "") | "\(.title): token found"'
+dcli password meta --output json 2>/dev/null | jq -r '.[] | select(.password != null and .password != "") | "\(.title): token found"'
+
+# Keychain
+security find-generic-password -s "klaviyo-api-key" -w 2>/dev/null
+security find-generic-password -s "meta-ads-token" -w 2>/dev/null
+
+# gcloud ADC (for GA4 + Search Console)
+gcloud auth application-default print-access-token 2>/dev/null | head -c 10 && echo "...gcloud-ok"
+
+# Chrome history — reveals account identity
+sqlite3 ~/Library/Application\ Support/Google/Chrome/Default/History \
+ "SELECT DISTINCT url FROM urls WHERE url LIKE '%klaviyo.com%' OR url LIKE '%analytics.google.com%' OR url LIKE '%business.facebook.com%' OR url LIKE '%search.google.com/search-console%' ORDER BY last_visit_time DESC LIMIT 15" 2>/dev/null
-Which service do you want to configure?
- 1. Klaviyo (email)
- 2. Meta Ads (paid social)
- 3. Google Analytics 4
- 4. Google Search Console
- 5. All of the above
+# Existing prefs + userConfig
+jq -r '.marketing // empty' "$PREFS_PATH" 2>/dev/null
```
-For each selected service, prompt for required credentials and save via `claude plugin config set <key> <value>`.
+Present ALL findings before asking for anything. Only prompt for values NOT found in any source. Run all smoke tests with `run_in_background: true`.
-**Klaviyo:** Ask for Private API Key (from Klaviyo → Settings → API Keys). Save as `klaviyo_private_key`.
+**Klaviyo:** If `KLAVIYO_PRIVATE_KEY` or Dashlane entry with `ck_*` key found, use it directly. Note: Klaviyo private keys start with `ck_` (older) or `pk_` (newer). Smoke test: `curl -s -H "Authorization: Klaviyo-API-Key $KEY" -H "revision: 2024-10-15" "https://a.klaviyo.com/api/lists?page[size]=1"`.
-**Meta Ads:** Ask for Access Token (from Meta Business → System Users → Generate Token with `ads_read` + `ads_management`). Ask for Ad Account ID (format: `act_XXXXXXXXX`). Save as `meta_ads_token` and `meta_ad_account_id`.
+**Meta Ads:** If found in Doppler, use directly. Need both `META_ACCESS_TOKEN` and `META_AD_ACCOUNT_ID`. Smoke test: `graph.facebook.com/v20.0/$AD_ACCOUNT_ID/campaigns?limit=1`.
-**GA4:** Prompt user to run `gcloud auth application-default login` and provide their GA4 Property ID (numeric, from Admin → Property Settings). Save as `ga4_property_id`.
+**GA4:** Only needs Property ID + gcloud ADC. If gcloud ADC not set up, run `gcloud auth application-default login` in background (opens browser). Check Chrome history for GA4 property URLs to auto-detect the property ID.
-**Search Console:** Prompt for site URL as registered (e.g. `https://example.com`). Save as `google_search_console_site`. Uses same gcloud ADC as GA4.
+**Search Console:** Only needs site URL + gcloud ADC. Check Chrome history for `search.google.com/search-console` URLs to auto-detect the site.
-After saving, validate each credential with a test API call and report: `[service] ✓ connected` or `[service] ✗ invalid key`.
+Save via userConfig (preferred) or Doppler. Report: `[service] ✓ connected` or `[service] ✗ invalid key — [error]`.
diff --git a/claude-ops/skills/ops-voice/SKILL.md b/claude-ops/skills/ops-voice/SKILL.md
index d623e1d9..cc4e1358 100644
--- a/claude-ops/skills/ops-voice/SKILL.md
+++ b/claude-ops/skills/ops-voice/SKILL.md
@@ -127,13 +127,41 @@ echo "$TRANSCRIPT"
### `setup` — Configure voice API keys
-Walk through credential setup interactively. Check which keys are missing, then prompt for each:
+**Before asking for anything**, auto-scan ALL sources in a single background batch:
-1. Check `BLAND_AI_API_KEY` → if missing, prompt and add to Doppler or shell profile
-2. Check `ELEVENLABS_API_KEY` → if missing, prompt
-3. Check `GROQ_API_KEY` → if missing, prompt
-4. Verify each key with a lightweight API call (list voices for ElevenLabs, check balance for Bland AI, list models for Groq)
-5. Report status for all three services
+```bash
+# Env vars
+printenv BLAND_AI_API_KEY BLAND_API_KEY ELEVENLABS_API_KEY GROQ_API_KEY 2>/dev/null
+
+# Shell profiles
+grep -h 'BLAND\|ELEVENLABS\|GROQ' ~/.zshrc ~/.bashrc ~/.zprofile ~/.envrc 2>/dev/null | grep -v '^#'
+
+# Doppler — ALL projects
+for proj in $(doppler projects --json 2>/dev/null | jq -r '.[].slug'); do
+ for cfg in dev stg prd; do
+ doppler secrets --project "$proj" --config "$cfg" --json 2>/dev/null | \
+ jq -r --arg proj "$proj" --arg cfg "$cfg" 'to_entries[] | select(.key | test("BLAND|ELEVENLABS|GROQ"; "i")) | "\(.key)=\(.value.computed | .[0:12])... (doppler:\($proj)/\($cfg))"'
+ done
+done
+
+# Dashlane
+dcli password bland --output json 2>/dev/null | jq -r '.[] | select(.password != null) | "\(.title): key found"'
+dcli password elevenlabs --output json 2>/dev/null | jq -r '.[] | select(.password != null) | "\(.title): key found"'
+dcli password groq --output json 2>/dev/null | jq -r '.[] | select(.password != null) | "\(.title): key found"'
+
+# Keychain
+security find-generic-password -s "bland-ai-api-key" -w 2>/dev/null
+security find-generic-password -s "elevenlabs-api-key" -w 2>/dev/null
+security find-generic-password -s "groq-api-key" -w 2>/dev/null
+```
+
+Present all findings. Only prompt for keys NOT found in any source. Then validate each found key in background:
+
+1. **Bland AI**: `curl -s -H "authorization: $KEY" https://api.bland.ai/v1/me` — check balance
+2. **ElevenLabs**: `curl -s -H "xi-api-key: $KEY" https://api.elevenlabs.io/v1/voices?page_size=1` — list voices
+3. **Groq**: `curl -s -H "Authorization: Bearer $KEY" https://api.groq.com/openai/v1/models` — list models
+
+Report: `[service] ✓ connected` or `[service] ✗ invalid key — [error]`
---
diff --git a/claude-ops/skills/setup/SKILL.md b/claude-ops/skills/setup/SKILL.md
index 7bc061c8..b5584a8c 100644
--- a/claude-ops/skills/setup/SKILL.md
+++ b/claude-ops/skills/setup/SKILL.md
@@ -25,7 +25,7 @@ You are running an **interactive configuration wizard** for the `claude-ops` plu
- **Never show the user's real name or email in output unless the user explicitly provided it in THIS session.** Do not read from memory, existing configs, or environment variables to populate display names.
- **Max 4 options per `AskUserQuestion` call.** The tool schema enforces `<=4` items in the `options` array. When a step lists >4 choices, filter already-configured items first, then batch the rest into multiple sequential calls of <=4 options each, grouped logically. Use `[More options...]` as the last option to bridge between batches.
- Run ALL diagnostic/probe commands in parallel when possible. Use multiple Bash tool calls in a single message. Never run sequential probes when they're independent (e.g., `gog auth status` AND `wacli doctor` AND keychain scouts should all run simultaneously).
-- Background any command that might take >2 seconds (sync, backfill, npm install, brew install).
+- **Auto-background ALL Bash commands during setup.** Use `run_in_background: true` on every Bash call unless you need the result immediately to make the next decision. This includes: credential scans, CLI installs, OAuth flows, npm installs, brew installs, sync/backfill, smoke tests, keychain writes, Doppler queries, Chrome history queries, autolink scripts. While commands run in background, continue to the next independent step or ask the user the next question. Check results when the notification arrives. The setup wizard should never block on a command the user isn't waiting for.
- All writes go to one of these paths — and nothing else:
- **`$PREFS_PATH`** — per-user preferences + secrets. Resolves to `${CLAUDE_PLUGIN_DATA_DIR:-$HOME/.claude/plugins/data/ops-ops-marketplace}/preferences.json`. Lives in Claude Code's plugin data dir so it survives plugin reinstalls and version bumps. Never committed to git.
- **`${CLAUDE_PLUGIN_ROOT}/scripts/registry.json`** — per-user project registry (gitignored in the source repo). `mkdir -p` its parent if missing.