setup · davepoon — скилл для Claude Code: что делает и как установить
Скилл setup для Claude Code запускает пошаговую настройку плагина claude-ops: устанавливает CLI, связывает каналы уведомлений и сохраняет параметры проекта в локальный реестр.
MIT ★ 3 785 обновлён 2026-10-25
/plugin marketplace add davepoon/buildwithclaude
/plugin install claude-ops@buildwithclaudeЧто делает setup
Скилл запускает диалоговый мастер для плагина claude-ops. Агент опрашивает пользователя через меню выбора, проверяет наличие утилит командной строки и подключает внешние сервисы: Telegram, WhatsApp, Slack, Notion, Linear, Sentry, Vercel и почту. Все фоновые проверки и сканирование доступов выполняются в фоне без лишнего вывода команд в консоль.
Конфигурация записывается только в три места: файл пользовательских настроек preferences.json внутри каталога данных плагина, локальный реестр проектов registry.json и файл .mcp.json в виде плейсхолдеров ${user_config.*}. Если включена переменная CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, мастер поднимает команду субагентов для одновременного поиска доступов к разным сервисам.
Инструмент выбора вариантов строго ограничен четырьмя пунктами на один экран, поэтому настройка длинных списков интеграций разбивается на последовательные шаги.
Какие задачи решает
- настроить окружение и переменные для плагина
claude-ops - установить недостающие консольные утилиты для каналов связи
- подключить интеграции с Telegram, Slack, Linear и Sentry
- собрать локальный реестр проектов в
registry.json
Примеры запросов агенту
- Запусти мастер первичной настройки claude-ops
- Настрой интеграцию с Telegram и Slack через setup
- Обнови конфигурацию каналов для claude-ops
Как установить setup
1Через маркетплейс плагинов
/plugin marketplace add davepoon/buildwithclaude/plugin install claude-ops@buildwithclaudeКоманда ставит плагин claude-ops целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add davepoon/buildwithclaude --skill setup -a claude-code3Вручную: положить файлы
~/.claude/skills/setup/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/setup/
1Через Skills CLI (Vercel)
npx skills add davepoon/buildwithclaude --skill setup -a codex2Вручную: положить файлы
.agents/skills/setup/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add davepoon/buildwithclaude --skill setup -a cursor2Вручную: положить файлы
.cursor/skills/setup/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install davepoon/buildwithclaude plugins/claude-ops/skills/setup2Вручную: положить файлы
.github/skills/setup/SKILL.md1Через Skills CLI (Vercel)
npx skills add davepoon/buildwithclaude --skill setup -a gemini-cli2Командой платформы
gemini skills install https://github.com/davepoon/buildwithclaude --path plugins/claude-ops/skills/setupВручную: положить файлы
.devin/skills/setup/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о setup
Как установить setup в Claude Code?
Сначала добавьте маркетплейс командой /plugin marketplace add davepoon/buildwithclaude, затем установите плагин через /plugin install claude-ops@buildwithclaude.
Что делает скилл setup?
Он пошагово опрашивает пользователя, проверяет системные утилиты, ищет или запрашивает токены каналов связи и формирует реестр проектов.
Куда мастер сохраняет найденные токены и настройки?
Секреты и предпочтения попадают в $PREFS_PATH (preferences.json), список проектов — в registry.json, а в .mcp.json записываются только плейсхолдеры ${user_config.*}.
Исходный текст
SKILL.md · MIT
---
name: setup
description: Interactive setup wizard for the claude-ops plugin. Installs missing CLIs, configures env vars for each channel (Telegram, WhatsApp, Email, Slack, Notion, Linear, Sentry, Vercel), builds the project registry, and saves user preferences. Run once after installing the plugin or any time to reconfigure.
argument-hint: "[section]"
allowed-tools:
- Bash
- Read
- Write
- Edit
- AskUserQuestion
- Agent
- TeamCreate
- SendMessage
effort: high
maxTurns: 80
---
# OPS ► SETUP WIZARD
You are running an **interactive configuration wizard** for the `claude-ops` plugin. The user wants you to walk them through every step needed to get the plugin working: installing CLIs, setting env vars, configuring channels, populating the project registry, and saving preferences.
---
**RULE ZERO — EVERY BASH CALL USES `run_in_background: true`**
This is non-negotiable. EVERY SINGLE Bash tool call in this entire setup wizard MUST set `run_in_background: true`. There are ZERO exceptions. This applies to:
- Credential scans, CLI installs, OAuth flows, npm/brew installs
- Daemon starts, daemon reloads, launchctl commands
- Keychain writes, Doppler queries, Chrome history queries
- Autolink scripts, sync/backfill, smoke tests
- File writes, config writes, env appends
- ANY command, no matter how fast you think it will be
While background commands run, immediately continue to the next independent step or ask the user the next question. Handle results when the `<task-notification>` arrives. The setup wizard must NEVER show `(ctrl+b to run in background)` — if the user sees that prompt, you violated this rule.
**RULE ONE — SILENT BASH CALLS**
Every Bash tool call MUST include a short `description` parameter (5-10 words, e.g. "Install missing CLIs", "Scout keychain for Telegram creds", "Reload daemon"). This is what the user sees instead of the raw command. Keep setup clean and quiet — the user should see progress titles, not shell scripts.
---
**Other hard rules:**
- This is a _conversation_, not a script dump. Use `AskUserQuestion` for every decision — never ask in prose when a structured selector will do.
- Confirm actions via `AskUserQuestion` where the user hasn't already opted in (e.g., "Configure all" covers everything — no per-action confirmation needed after that).
- Skip sections the user declines. Don't nag.
- **NEVER auto-skip a channel or integration.** Every channel/service the user selected must get an explicit `AskUserQuestion` with skip as one of the options. If a credential isn't found, present the [Paste manually] / [Deep hunt] / [Skip] options. If a smoke test fails, ask the user whether to retry, reconfigure, or skip. The ONLY acceptable way to skip is the user choosing a "Skip" option. Do not silently move past a service because scanning found nothing — that's when the user needs to be asked the most.
- Show what's already configured first, so the user only fills gaps.
- **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).
- 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.
- **`${CLAUDE_PLUGIN_ROOT}/.mcp.json`** — only to add `${user_config.*}` placeholders, never hardcoded tokens.
- The user's shell profile (`~/.zshrc` etc.) — append-only, never rewrite.
- At the top of every wizard step, make sure `$PREFS_PATH`'s parent directory exists: `mkdir -p "$(dirname "$PREFS_PATH")"`. Claude Code creates `~/.claude/plugins/data/ops-ops-marketplace/` on plugin install but don't assume.
---
## Agent Teams support
If `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set, use **Agent Teams** when multiple "Deep hunt" credential agents are needed simultaneously. This enables:
- Credential scouts run in parallel across Doppler, keychains, browser profiles, and password managers
- Agents share findings (e.g., Doppler agent finds a partial config → keychain agent knows to skip that service)
- You can steer mid-hunt: "found the Telegram token, stop hunting for that one"
**Team setup** (only when flag is enabled, multiple deep hunts triggered):
```
TeamCreate("setup-hunters")
Agent(team_name="setup-hunters", name="hunt-telegram", model="haiku", ...)
Agent(team_name="setup-hunters", name="hunt-sentry", model="haiku", ...)
Agent(team_name="setup-hunters", name="hunt-shopify", model="haiku", ...)
```
Each agent reports back its findings. Merge results and present to the user for confirmation.
If the flag is NOT set, use independent fire-and-forget subagents with `run_in_background: true`.
---
## Setup agent delegation pattern
When the user asks a complex integration-specific question during setup (e.g., "how does /ops:ecom handle multi-store setups?"), the setup agent can load the related skill's SKILL.md for deeper context:
```bash
cat "${CLAUDE_PLUGIN_ROOT}/skills/ops-ecom/SKILL.md"
```
Each sub-step below includes a `> **Deep-dive:**` pointer to the related skill file. Follow these pointers instead of duplicating operational details in this wizard.
---
## Step 0 — Preflight (runs in background while you read)
```!
${CLAUDE_PLUGIN_ROOT}/bin/ops-setup-preflight &>/dev/null &
```
**Preflight data**: All probe results are cached at `/tmp/ops-preflight/`. Before running ANY diagnostic command, check if the result already exists there:
- CLI status: `cat /tmp/ops-preflight/clis.txt`
- Slack: `cat /tmp/ops-preflight/slack.json`
- Telegram: `cat /tmp/ops-preflight/telegram.txt`
- gog/Gmail: `cat /tmp/ops-preflight/gog-gmail.json`
- gog/Calendar: `cat /tmp/ops-preflight/gog-cal.json`
- WhatsApp: `cat /tmp/ops-preflight/wacli-doctor.json` and `wacli-chats.json`
- MCP servers: `cat /tmp/ops-preflight/mcp-servers.txt`
- GitHub: `cat /tmp/ops-preflight/gh-auth.txt`
- AWS: `cat /tmp/ops-preflight/aws-identity.json`
- Projects: `cat /tmp/ops-preflight/projects.txt`
- Existing registry: `cat /tmp/ops-preflight/existing-registry.json`
- Existing prefs: `cat /tmp/ops-preflight/existing-prefs.json`
- Doppler: `cat /tmp/ops-preflight/doppler.json`
Wait for `/tmp/ops-preflight/.complete` to exist before reading (it should be ready within 2-3 seconds). NEVER re-run a probe that already has cached results — read the cache file instead.
---
## Step 0b — Detect current state
Run the detector and parse its JSON output (or read from preflight cache if available):
```!
${CLAUDE_PLUGIN_ROOT}/bin/ops-setup-detect 2>/dev/null
```
If `CLAUDE_PLUGIN_ROOT` is unset, fall back to the latest installed cache dir at `~/.claude/plugins/cache/ops-marketplace/ops/<latest-version>/`. Store the resolved path as `PLUGIN_ROOT` for the rest of the session.
Also resolve `PREFS_PATH` once and reuse it everywhere:
```bash
PREFS_PATH="${CLAUDE_PLUGIN_DATA_DIR:-$HOME/.claude/plugins/data/ops-ops-marketplace}/preferences.json"
mkdir -p "$(dirname "$PREFS_PATH")"
```
Print a compact status header to the user, one line per category:
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OPS ► SETUP WIZARD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Shell: zsh → ~/.zshrc
Core CLIs: ✓ jq ✓ git ✓ gh ✓ aws ✓ node
Channels: ✓ wacli ✓ gog ○ telegram (no token)
Secrets: ✓ doppler (project: my-app, config: dev)
MCPs: ✓ linear ✓ sentry ○ slack ○ vercel
Registry: 19 projects
Preferences: not set
──────────────────────────────────────────────────────
```
Use `✓` for present/set, `○` for missing/unset, `✗` for broken.
---
## Step 1 — Ask which sections to configure
First, offer a quick "set up everything" option:
```
How would you like to run setup?
[Set up everything — install CLIs, configure all channels, MCPs, registry, daemon, preferences (Recommended)]
[Pick sections — choose which parts to configure]
[Re-run a specific section — I know what I need]
```
If the user selects "Set up everything", select ALL sections across all batches and run them in order (Step 2 → 2b → 2c → 3 → 4 → 5 → 5b → 6 → 7), skipping any already fully configured. Within each step, use the "Configure all" fast-path where available.
If the user selects "Re-run a specific section", show a single `AskUserQuestion` listing the section names (cli, daemon, channels, mcp, registry, prefs, env, ecom, mktg, voice, revenue) and jump directly to that step.
If the user selects "Pick sections", proceed with the batched selection below.
Use `AskUserQuestion` with `multiSelect: true`. Offer **only sections that need attention** (skip ones already green). Because AskUserQuestion allows max 4 options, batch into logical groups:
**Batch 1 — Core setup (run early so the daemon can pre-warm caches while you finish):**
| Option | Header | Description |
| ------------------ | -------- | ----------------------------------------------------------------------------- |
| Install CLIs | cli | Install missing command-line tools via Homebrew |
| Background daemon | daemon | Install ops-daemon early — pre-warms briefing cache while remaining setup runs |
| Configure MCPs | mcp | Enable Linear, Sentry, Vercel, Gmail MCP servers |
| Build registry | registry | Register projects Claude should manage |
**Batch 2 — Channels & plugins:**
| Option | Header | Description |
| ------------------ | -------- | ------------------------------------------------------------- |
| Configure channels | channels | Set tokens for Telegram, WhatsApp, Email, Slack |
| Companion plugins | plugins | Install GSD for project roadmap tracking |
| Save preferences | prefs | Owner name, timezone, default priorities |
| Shell env | env | Export `CLAUDE_PLUGIN_ROOT` in shell profile |
**Batch 3 — Extras (only show if not already configured):**
| Option | Header | Description |
| ------------------- | -------- | ------------------------------------------------------------- |
| Configure ecommerce | ecom | Set Shopify store URL + admin token, ShipBob |
| Configure marketing | mktg | Set Klaviyo, Meta Ads, GA4, Search Console keys |
| Configure voice | voice | Set Bland AI, ElevenLabs, Groq API keys |
| Configure revenue | revenue | Set Stripe + RevenueCat keys for live MRR tracking |
Present each batch as a separate `AskUserQuestion` call. Skip batches where all items are already green. Collect all selections across batches and run each selected section in order.
---
## Step 2 — Install CLIs (if selected)
If multiple CLIs are missing, offer a bulk install first:
```
Missing CLIs detected: jq, gh, wacli. What would you like to do?
[Install all missing CLIs (Recommended)]
[Pick which to install]
[Skip CLI installation]
```
If the user selects "Install all", install every missing tool in sequence without further prompts. If "Pick which to install", ask per tool:
```
Install jq? [Yes, install now] [Skip]
Install gh? [Yes, install now] [Skip]
Install wacli? [Yes, install now] [Skip — manual install required]
```
For each `Yes`, run:
```bash
${PLUGIN_ROOT}/bin/ops-setup-install <tool>
```
Report success/failure. If Homebrew is missing on macOS, stop and tell the user to install it from https://brew.sh first — do not attempt to install brew automatically.
After installation, re-run `ops-setup-detect` to refresh status before continuing.
---
## Step 2b — Companion plugins (if selected)
### GSD (Get Shit Done)
GSD is a third-party Claude Code plugin that adds project roadmap tracking. When installed, claude-ops dashboards (`/ops:go`, `/ops:projects`, `/ops:next`, `/ops:yolo`) automatically show active phases, progress, and next actions per project. Without it, those sections are simply omitted.
Check if GSD is already installed:
```bash
find ~/.claude -name "gsd-progress" -path "*/skills/*" 2>/dev/null | head -1 | grep -q . && echo "installed" || echo "not_installed"
```
If not installed, ask via `AskUserQuestion`:
```
GSD adds project roadmap tracking to your ops dashboards.
/ops:go shows active phases and progress per project
/ops:projects shows GSD state alongside CI/PR status
/ops:next factors in GSD work priority
[Install GSD (latest)] [Skip — I don't need roadmap tracking]
```
On install, run the commands directly — do NOT tell the user to run them manually:
```bash
# Install GSD in one shot — no user intervention needed
claude plugin marketplace add gsd-build/get-shit-done 2>/dev/null && \
claude plugin install gsd@gsd-build-get-shit-done 2>/dev/null
```
If `claude` CLI is not available in the path, fall back to the plugin cache mechanism:
```bash
# Direct marketplace clone fallback
GSD_MARKETPLACE_DIR="$HOME/.claude/plugins/marketplaces/gsd-build-get-shit-done"
if [ ! -d "$GSD_MARKETPLACE_DIR" ]; then
git clone https://github.com/gsd-build/get-shit-done.git "$GSD_MARKETPLACE_DIR" 2>/dev/null
fi
```
Report success/failure. Record `plugins.gsd = "installed"` in `$PREFS_PATH`.
If they skip:
```
Skipped GSD. Install later with: /plugin marketplace add gsd-build/get-shit-done
```
---
## Step 2c — Background Daemon (early install, pre-warm caches)
**Why install the daemon this early?** Running the daemon in parallel with the rest of setup lets it start pre-warming the briefing cache (`ops-gather` results for infra/git/PRs/CI), so by the time the user reaches Step 7 and runs `/ops:go`, the briefing is already cached and loads in under 3 seconds instead of 10. Channel-dependent services (wacli-sync, message-listener, inbox-digest, store-health) are added later in Step 5b once their channels are configured.
### Platform support
The background daemon ships with a `launchd` integration (macOS only). Detect the platform before attempting install:
```bash
case "$(uname -s)" in
Darwin) OS=macos ;;
Linux) grep -qi microsoft /proc/version 2>/dev/null && OS=wsl || OS=linux ;;
MINGW*|MSYS*|CYGWIN*) OS=windows ;;
*) OS=unknown ;;
esac
```
- **macOS** (`OS=macos`): proceed with the full `launchctl bootstrap` flow below.
- **Linux / WSL** (`OS=linux|wsl`): `launchctl` is not available. The daemon script (`${CLAUDE_PLUGIN_ROOT}/scripts/ops-daemon.sh`) runs fine under `bash`, but installing it as a user service requires `systemd --user` (Linux) or a custom cron/at wrapper (WSL). That work is **out of scope for this patch** — track as future work. For now, print:
```
○ Background daemon — skipped (Linux/WSL install via systemd --user is pending; see docs/daemon-guide.md).
You can still launch it manually with: nohup ${CLAUDE_PLUGIN_ROOT}/scripts/ops-daemon.sh &
```
Write `daemon.enabled = false` and `daemon.skip_reason = "platform:<os>"` to `$PREFS_PATH` and continue to Step 3.
- **Windows** (native, `OS=windows`): the daemon is **not installed**. Print `○ Background daemon — not supported on native Windows. Use WSL or run ops-daemon.sh manually.` and continue.
If `OS=macos`, check whether the daemon is already installed:
```bash
launchctl print gui/$(id -u)/com.claude-ops.daemon 2>/dev/null | head -1
```
If already loaded, print `✓ Background daemon already running — will reconcile services in Step 5b.` and skip to Step 3.
Otherwise ask via `AskUserQuestion`:
```
Install the ops background daemon now?
Starts pre-warming briefing cache while you finish the rest of setup.
Auto-heals on failure. Single launchd agent (com.claude-ops.daemon).
Channel services (wacli-sync, message-listener) added after channels are set up.
[Yes — install now] [Skip — I'll run it manually later]
```
On `Yes`, run the install (use `run_in_background: true` — RULE ZERO):
```bash
# Always resolve CLAUDE_PLUGIN_ROOT to the CURRENT installed version — never hardcode a version number.
# If CLAUDE_PLUGIN_ROOT is not set, detect it from the plugin cache:
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(ls -d "$HOME/.claude/plugins/cache/ops-marketplace/ops"/*/ 2>/dev/null | sort -V | tail -1)}"
DAEMON_SCRIPT="${PLUGIN_ROOT}/scripts/ops-daemon.sh"
chmod +x "$DAEMON_SCRIPT"
PLIST_TEMPLATE="${PLUGIN_ROOT}/scripts/com.claude-ops.daemon.plist"
PLIST_DEST="$HOME/Library/LaunchAgents/com.claude-ops.daemon.plist"
DATA_DIR="${CLAUDE_PLUGIN_DATA_DIR:-$HOME/.claude/plugins/data/ops-ops-marketplace}"
LOG_DIR="$DATA_DIR/logs"
mkdir -p "$LOG_DIR"
# Resolve bash 4+ (required for associative arrays in ops-daemon.sh).
# macOS ships bash 3; Homebrew installs bash 5 at /opt/homebrew/bin/bash.
BASH_PATH="/bin/bash"
if [[ -x /opt/homebrew/bin/bash ]]; then
BASH_PATH="/opt/homebrew/bin/bash"
elif [[ -x /usr/local/bin/bash ]]; then
BASH_PATH="/usr/local/bin/bash"
fi
# Generate plist
sed -e "s|__DAEMON_SCRIPT_PATH__|$DAEMON_SCRIPT|g" \
-e "s|__BASH_PATH__|$BASH_PATH|g" \
-e "s|__PLUGIN_ROOT__|$PLUGIN_ROOT|g" \
-e "s|__LOG_DIR__|$LOG_DIR|g" \
-e "s|__HOME__|$HOME|g" \
"$PLIST_TEMPLATE" > "$PLIST_DEST"
# Write a minimal initial services config — only the services that don't depend on
# channels yet. `briefing-pre-warm` runs ops-gather every 2 minutes so the next
# /ops:go is instant. `memory-extractor` runs but stays idle until channels exist.
SERVICES_CONFIG="$DATA_DIR/daemon-services.json"
cat > "$SERVICES_CONFIG" <<JSON
{
"services": {
"briefing-pre-warm": {
"enabled": true,
"command": "${CLAUDE_PLUGIN_ROOT}/bin/ops-gather",
"cron": "*/2 * * * *",
"_note": "Pre-warms /ops:go cache. Runs every 2 minutes."
},
"memory-extractor": {
"enabled": true,
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/ops-memory-extractor.sh",
"cron": "*/30 * * * *",
"health_file": "~/.claude/plugins/data/ops-ops-marketplace/memories/.health",
"_note": "Idle until channels are configured; will extract profiles once wacli/gog are live."
}
}
}
JSON
# Remove the old standalone wacli keepalive if present
launchctl bootout gui/$(id -u)/com.claude-ops.wacli-keepalive 2>/dev/null || true
rm -f "$HOME/Library/LaunchAgents/com.claude-ops.wacli-keepalive.plist"
# Load daemon in background — does NOT block the wizard
launchctl bootout gui/$(id -u) "$PLIST_DEST" 2>/dev/null || true
launchctl bootstrap gui/$(id -u) "$PLIST_DEST"
```
Write `daemon.enabled = true` and `daemon.installed_at_step = "2c"` to `$PREFS_PATH` so Step 5b knows to reconcile services instead of re-installing.
Print:
```
✓ Background daemon — installed. Pre-warming briefing cache in parallel while you finish setup.
Channel-dependent services will be added after channels are configured (Step 5b).
```
Continue immediately to Step 3 — do NOT wait for the daemon to confirm startup. The health file check is deferred to Step 5b.
> **Deep-dive:** see `${CLAUDE_PLUGIN_ROOT}/docs/daemon-guide.md` for full operational instructions, CLI reference, and troubleshooting for the background daemon. The setup agent can load that file directly when it needs more depth than this wizard provides.
---
## Step 3 — Configure channels (if selected)
First, offer a quick "configure everything" option before individual selection. Use `AskUserQuestion`:
```
How would you like to configure channels and integrations?
[Configure all — set up every available channel and service (Recommended)]
[Pick individually — choose which channels to configure]
[Skip all — configure channels later]
```
If the user selects "Configure all", run every channel sub-flow below in sequence (Telegram → WhatsApp → Email → Slack → Notion → Calendar → Doppler → Vault), skipping any already configured. If the user selects "Skip all", move to Step 4.
If the user selects "Pick individually", ask which channels using `AskUserQuestion` with `multiSelect: true`. Because AskUserQuestion allows max 4 options, batch into two groups. Skip channels already configured (show only those needing attention).
**Batch 1 — Messaging:**
| Option | Header | Description |
| -------- | -------- | ----------------------------------------------------------------------- |
| Telegram | telegram | Bot token + owner ID for `/ops-comms telegram` |
| WhatsApp | whatsapp | wacli doctor + auto-heal + backfill |
| Email | email | gog CLI → Gmail MCP fallback for `/ops-inbox email` |
| Slack | slack | Slack MCP server (managed by Claude Code) |
**Batch 2 — Knowledge & Services:**
| Option | Header | Description |
| -------- | -------- | ----------------------------------------------------------------------- |
| Notion | notion | Notion MCP — workspace search, comments, tasks, knowledge base |
| Calendar | calendar | gog calendar → Google Calendar MCP fallback — schedule context for briefings |
| Doppler | doppler | Secrets manager — set default project + config for all ops skills |
| Vault | vault | Password manager — 1Password, Dashlane, Bitwarden, or macOS Keychain |
Present each batch as a separate `AskUserQuestion` call. Skip batches where all items are already configured. For each selected channel, run the matching sub-flow below.
---
#### Shared: detect the host OS before suggesting installs
The claude-ops wizard runs on macOS, Linux (all major distros + WSL), and Windows (native + WSL). Before printing any install command, the skill MUST detect the host OS and pick the OS-appropriate variant. Never print a `brew install …` command to a Windows user, and never print `winget install …` to a macOS user.
Minimal detection snippet (bash — works on macOS, Linux, WSL, MSYS/Cygwin):
```bash
case "$(uname -s)" in
Darwin*) OS=macos ;;
Linux*)
if grep -qi microsoft /proc/version 2>/dev/null; then OS=wsl
elif [ -f /etc/os-release ]; then
. /etc/os-release
case "$ID" in
arch|manjaro) OS=arch ;;
fedora|rhel|centos|rocky|almalinux) OS=fedora ;;
debian|ubuntu|pop|linuxmint) OS=debian ;;
alpine) OS=alpine ;;
opensuse*|sles) OS=suse ;;
*) OS=linux ;;
esac
else OS=linux; fi ;;
MINGW*|MSYS*|CYGWIN*) OS=windows ;;
*) OS=unknown ;;
esac
```
Cascade for the package manager (pick the first one available):
1. `brew` (macOS + Linuxbrew) — preferred on macOS.
2. Native OS manager — `apt-get` (debian/ubuntu), `dnf` (fedora/rhel), `pacman` (arch), `zypper` (suse), `apk` (alpine).
3. `winget` (Windows 10 1809+) → `scoop` → `choco` → build-from-source as last resort on Windows.
When the preferred manager isn't installed, fall forward to the next available option rather than aborting the flow. Every `AskUserQuestion` "[Install now — …]" prompt below uses an OS-aware command table — print only the row(s) that match the detected OS.
For the authoritative cross-OS detection logic, reuse `bin/ops-setup-detect` (which emits `os`, `pkg_mgr`, `arch`, `keyring_backend`, `shell`, `browser_profiles_found` in its JSON output).
---
#### Shared: prefer OAuth over manual tokens
Whenever a channel has a **browser-based OAuth flow** available, offer that first and put manual-token entry behind it as a fallback. OAuth is safer (scoped, revocable, no secrets in dotfiles), and usually faster for the user.
| Channel | OAuth path | Manual fallback |
| -------------- | ---------------------------------------------------------- | -------------------------------------- |
| Email (gog) | `gog auth add <email> --services gmail,calendar,drive,contacts,docs,sheets` (browser) | n/a — gog is OAuth-only |
| Calendar (gog) | same `gog auth add` with calendar in `--services` | n/a |
| Slack | `claude mcp add slack` (handles OAuth through Claude Code) | bot token via auto-scan + manual paste |
| Linear | `claude mcp add linear` | API key |
| Sentry | `claude mcp add sentry` | DSN / auth token |
| Vercel | `claude mcp add vercel` | personal access token |
| Telegram | ❌ no OAuth (Bot API is token-only by design) | auto-scan + manual paste (only option) |
| WhatsApp | QR pairing via `wacli auth` (similar UX to OAuth) | n/a — paired sessions only |
When a channel supports OAuth, the default `AskUserQuestion` should lead with it:
```
[Connect via OAuth (recommended)] [Enter a token manually] [Skip]
```
Only go into the credential auto-scan flow below when the user picks "manually" or when the channel (Telegram, local tools) has no OAuth path.
---
---
## Universal Credential Auto-Scan
**BEFORE asking the user for ANY credential**, run this scan sequence. This applies to ALL steps — channels, ecommerce, marketing, voice, and MCPs. The user should never be asked to find a key that's already on their system.
**CRITICAL — exhaust ALL sources before reporting.** Run every scan source (1-10 below) in a single batch, THEN analyze the combined results. Do NOT report "no credentials found" after checking only env vars and Dashlane — Chrome history, .env files, Doppler, and keychain may have the answer. If API tokens are missing but the store/service identity was found (e.g. store URL in Chrome history, login entry in Dashlane), report what you found and skip to the token step with the identity pre-filled. The user saying "find it" or "check all available sources" means you did not search thoroughly enough — never ask the user to look for something you can find programmatically.
For each variable name (e.g. `TELEGRAM_BOT_TOKEN`, `SHOPIFY_ACCESS_TOKEN`, `KLAVIYO_API_KEY`):
1. **Current shell environment** — `printenv <VAR>`. Running shell inherits exports, Doppler injections, dotenv-loaded files. Most likely to be correct.
2. **Shell profile files** — grep `~/.zshrc`, `~/.bashrc`, `~/.zprofile`, `~/.config/fish/config.fish`, `~/.envrc` (direnv) for `<VAR>=` or `export <VAR>=`. Show the file path next to the value so the user knows where it's from.
3. **Doppler (all projects)** — if `command -v doppler` succeeds:
```bash
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 var "$VAR" --arg proj "$proj" \
'to_entries[] | select(.key == $var) | "\(.value.computed) (doppler:\($proj)/prd)"'
done
```
Also try the default project config (dev/staging) if prd fails. Show source attribution `(project: <slug>, config: <config>)`.
4. **Dashlane CLI** — if `command -v dcli` succeeds:
```bash
dcli password "$SERVICE_KEYWORD" --output json 2>/dev/null
```
Map service keywords: `shopify` → SHOPIFY vars, `klaviyo` → KLAVIYO vars, `bland` / `bland-ai` → BLAND vars, etc.
5. **macOS Keychain** — for specific services:
```bash
security find-generic-password -s "$SERVICE" -w 2>/dev/null
```
Use service names matching common patterns (e.g. `shopify-admin-token`, `klaviyo-api-key`, `bland-ai-api-key`).
6. **OpenClaw config** — if `~/.openclaw/openclaw.json` exists:
```bash
jq -r --arg var "$VAR" '.agents.defaults.env[$var] // empty' ~/.openclaw/openclaw.json 2>/dev/null
```
7. **Installed MCP configs** — read each `.mcp.json` the detector found. For each server entry, look at `.env` and `.args` for the variable name or for literal values that look like the target. Show the MCP server name as the source.
8. **Plugin preferences** — check existing `$PREFS_PATH` for the key under the relevant section (e.g. `.ecom.shopify.admin_token`, `.marketing.klaviyo.api_key`). If found and not a `doppler:` reference, show it as a source.
9. **Chrome history** — for services with web admin UIs (Shopify, Klaviyo, etc.), query Chrome's History SQLite DB for admin URLs that reveal the account/store identity:
```bash
sqlite3 ~/Library/Application\ Support/Google/Chrome/Default/History \
"SELECT DISTINCT url FROM urls WHERE url LIKE '%<service_domain>%' ORDER BY last_visit_time DESC LIMIT 10" 2>/dev/null
```
Extract identifiers (e.g. `*.myshopify.com` store slugs, account IDs) from the URLs.
10. **Project .env files** — scan `~/Projects/*/.env*` for the variable name or service domain patterns. These often contain credent...
© Lifecycle Innovations Limited · MIT · davepoon/buildwithclaude
Похожие скиллы
Все скиллы по теме «Настройка агента: память, контекст, субагенты» →Сначала — setup от других авторов.