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.
Shell agent-teamsai-agentai-automationanthropicautonomous-agentawsbusiness-operationsclaudeclaude-codeclaude-code-plugindevopsecommerceinbox-zeroklaviyomarketingmcpmorning-briefingpr-automationshopifyterminal
feat: wire feature-dev into ops routing and fix plugin:agent auto-swap (#619)
Aurora Capital34aa0a8f9c89
diff --git a/claude-ops/.claude-plugin/plugin.json b/claude-ops/.claude-plugin/plugin.jsonindex 10915107..93ff8285 100644--- a/claude-ops/.claude-plugin/plugin.json+++ b/claude-ops/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "ops","version": "2.34.1",- "description": "Business operations command center for Claude Code — 58 skills, 21 agents, and a smart background daemon that manage communications (WhatsApp/Email/Slack/Telegram), projects, infrastructure (all AWS services), revenue (Stripe + RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4/GSC), monitoring (Datadog/New Relic/OTEL), and voice (Bland AI/ElevenLabs/Whisper). Includes /ops:ops-ar A&R (audio analysis + demo verdict cards), /gtm go-to-market planner, /ops:projects portfolio dashboard, YOLO mode for autonomous operation with 4 parallel C-suite agents, /ops:ops-home smart home control via Homey Pro, and /ops:ops-unifi UniFi network control (Site Manager + Network + Protect APIs).",+ "description": "Business operations command center for Claude Code — 59 skills, 21 agents, and a smart background daemon that manage communications (WhatsApp/Email/Slack/Telegram), projects, infrastructure (all AWS services), revenue (Stripe + RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4/GSC), monitoring (Datadog/New Relic/OTEL), and voice (Bland AI/ElevenLabs/Whisper). Includes /ops:ops-ar A&R (audio analysis + demo verdict cards), /gtm go-to-market planner, /ops:projects portfolio dashboard, YOLO mode for autonomous operation with 4 parallel C-suite agents, /ops:ops-home smart home control via Homey Pro, /ops:ops-unifi UniFi network control (Site Manager + Network + Protect APIs), and /ops:ops-feature-dev overlay for the feature-dev companion plugin.","author": {"name": "Lifecycle Innovations Limited","url": "https://github.com/Lifecycle-Innovations-Limited"diff --git a/claude-ops/bin/ops-suggest-specialized-agent b/claude-ops/bin/ops-suggest-specialized-agentindex fda12d05..8fe02599 100755--- a/claude-ops/bin/ops-suggest-specialized-agent+++ b/claude-ops/bin/ops-suggest-specialized-agent@@ -16,6 +16,8 @@ description=$(printf '%s' "$INPUT" | jq -r '.tool_input.description // ""' 2>/decombined=$(printf '%s\n%s' "$description" "$prompt" | tr '[:upper:]' '[:lower:]')mkdir -p "${HOME}/.claude/logs/ops" "${HOME}/.claude/agents" 2>/dev/null+. "$PLUGIN_ROOT/scripts/lib/agent-installed.sh"+# Layered keyword map: user override → plugin defaultUSER_MAP="${HOME}/.claude/plugins/data/ops-ops-marketplace/specialist-keywords.json"PLUGIN_MAP="$PLUGIN_ROOT/config/specialist-keywords.example.json"@@ -24,22 +26,6 @@ MAP=""[ -z "$MAP" ] && [ -f "$PLUGIN_MAP" ] && MAP="$PLUGIN_MAP"[ -z "$MAP" ] && exit 0-# Agent existence check — true if installed (any of the locations claude-code searches)-agent_installed() {- local name="$1"- [ -f "${HOME}/.claude/agents/${name}.md" ] && return 0- [ -f "$PLUGIN_ROOT/agents/${name}.md" ] && return 0- # built-in / plugin-marketplace agents (presence indicated by registry — coarse: assume true if no user override)- case "$name" in- general-purpose|statusline-setup) return 0 ;;- esac- # claude-code marketplace: cache dirs- for d in "${HOME}/.claude/plugins/cache"/*/agents "${HOME}/.claude/plugins/cache"/*/*/agents; do- [ -f "$d/${name}.md" ] && return 0- done- return 1-}-# Iterate rules; first match where agent is installed winssuggest=""while IFS=$'\t' read -r pattern agent; dodiff --git a/claude-ops/config/specialist-keywords.example.json b/claude-ops/config/specialist-keywords.example.jsonindex 1779126d..58e072f4 100644--- a/claude-ops/config/specialist-keywords.example.json+++ b/claude-ops/config/specialist-keywords.example.json@@ -1,5 +1,5 @@{- "_doc": "Maps a regex pattern (matched against subagent description+prompt) → canonical specialist subagent_type. Used by ops-suggest-specialized-agent hook to silently swap general-purpose calls for a better fit. First match wins; order matters. Override by copying to ~/.claude/plugins/data/ops-ops-marketplace/specialist-keywords.json and editing.",+ "_doc": "Maps a regex pattern (matched against subagent description+prompt) → canonical specialist subagent_type. Used by ops-suggest-specialized-agent hook to silently swap general-purpose calls for a better fit. First match wins; order matters. Namespaced agents (feature-dev:code-reviewer) require scripts/lib/agent-installed.sh. Override by copying to ~/.claude/plugins/data/ops-ops-marketplace/specialist-keywords.json and editing.","_format": "Each rule: { pattern: <egrep regex>, agent: <subagent_type> }. Patterns are case-insensitive.","rules": [{@@ -18,8 +18,8 @@{ "pattern": "devops|terraform|ecs|cloudformation|aws cdk|cicd|github action", "agent": "DevOps Engineer" },{ "pattern": "typescript|tsconfig|type[- ]check|\\btsc\\b", "agent": "typescript-reviewer" },{ "pattern": "review.*pr|code review|review code", "agent": "feature-dev:code-reviewer" },- { "pattern": "explore|map.*codebase|trace.*execution|architecture", "agent": "feature-dev:code-explorer" },{ "pattern": "design.*architecture|blueprint|implementation plan", "agent": "feature-dev:code-architect" },+ { "pattern": "explore|map.*codebase|trace.*execution|architecture", "agent": "feature-dev:code-explorer" },{ "pattern": "simplify|refactor.*for clarity", "agent": "code-simplifier:code-simplifier" }]}diff --git a/claude-ops/docs/agents.md b/claude-ops/docs/agents.mdindex 460d1c5b..8f83d3c9 100644--- a/claude-ops/docs/agents.md+++ b/claude-ops/docs/agents.md@@ -79,7 +79,9 @@ The default map ships at [`config/specialist-keywords.example.json`](../config/sEach value is an array of substrings (case-insensitive). The hook scans the `prompt` field of the `Agent` input. First match wins.-To extend: copy the file to `~/.claude/config/specialist-keywords.json` and add your own. User file overrides the plugin default.+To extend: copy [`config/specialist-keywords.example.json`](../config/specialist-keywords.example.json) to `~/.claude/plugins/data/ops-ops-marketplace/specialist-keywords.json` and edit. User file overrides the plugin default.++**Cross-plugin agents** use `plugin:agent` names (e.g. `feature-dev:code-explorer`). The hook resolves them against Claude Code and Cursor plugin caches (`scripts/lib/agent-installed.sh`).---diff --git a/claude-ops/docs/flow-guide.md b/claude-ops/docs/flow-guide.mdindex adbc57ad..26758c5b 100644--- a/claude-ops/docs/flow-guide.md+++ b/claude-ops/docs/flow-guide.md@@ -31,6 +31,7 @@ You never choose the mode — the router does, from `bin/flow-state`./flow plan # project → gsd-plan-phase; ad-hoc → /autoplan/flow design # → /design-consultation → /design-shotgun → /design-html/flow build # project → gsd-execute-phase; ad-hoc → direct edits (worktree)+/flow feature-dev … # → /feature-dev (optional overlay; explore → architect → implement → review)/flow review # → /review + /cso (+ gsd-code-review in project-mode)/flow test # → /qa + /browse (/ios-qa for iOS)/flow ship # project → gsd-ship; ad-hoc → /ship; salvage → /ops:ops-mergediff --git a/claude-ops/docs/skills-reference.md b/claude-ops/docs/skills-reference.mdindex 8cf6085f..de90ff7e 100644--- a/claude-ops/docs/skills-reference.md+++ b/claude-ops/docs/skills-reference.md@@ -2,10 +2,10 @@# Skills Reference-_All 58 skills available in claude-ops — your business operations command surface (v2.0 added `/ops:deploy-fix`, `/ops:recap`, `/ops:rotate`, `/ops:rotate-setup`; v2.0.6 added `/ops:credentials`; v2.0.8 added multi-workspace Slack)_+_All 59 skills available in claude-ops — your business operations command surface (v2.0 added `/ops:deploy-fix`, `/ops:recap`, `/ops:rotate`, `/ops:rotate-setup`; v2.0.6 added `/ops:credentials`; v2.0.8 added multi-workspace Slack; feature-dev overlay via `/ops:ops-feature-dev`)_[](../CHANGELOG.md)-[](.)+[](.)[](../LICENSE)[](.)@@ -273,6 +273,20 @@ Voice channel management. Make phone calls (Bland AI), text-to-speech (ElevenLab---+## 🛠 Feature Development (companion plugin)++### `/ops:feature-dev` · `skills/ops-feature-dev/SKILL.md`++Delegates to the **feature-dev** plugin's 7-phase workflow (explore → architect → implement → review). Overlay only — does not replace `/flow build`, `gsd-execute-phase`, or gstack `/review`.++- `/ops:feature-dev Add OAuth to settings` — run full feature-dev pipeline+- `/flow feature-dev …` — same via lifecycle router+- `/feature-dev …` — invoke plugin command directly++Install companion via `/ops:setup` Step 2c. Auto-swap to `feature-dev:code-*` agents when explore/architect/review keywords match.++---+## 🤖 Orchestration & Automation### `/ops:orchestrate` · `skills/ops-orchestrate/SKILL.md`diff --git a/claude-ops/scripts/lib/agent-installed.sh b/claude-ops/scripts/lib/agent-installed.shnew file mode 100644index 00000000..c96bb597--- /dev/null+++ b/claude-ops/scripts/lib/agent-installed.sh@@ -0,0 +1,51 @@+#!/usr/bin/env bash+# agent-installed.sh — resolve whether a subagent_type is installed (ops hook + tests).+# Supports bare names (triage-agent) and namespaced plugin agents (feature-dev:code-reviewer).++agent_installed() {+ local name="$1"+ local plugin="" agent="$name"++ if [[ "$name" == *:* ]]; then+ plugin="${name%%:*}"+ agent="${name#*:}"+ fi++ [ -f "${HOME}/.claude/agents/${name}.md" ] && return 0+ if [ -z "$plugin" ]; then+ [ -f "${HOME}/.claude/agents/${agent}.md" ] && return 0+ fi+ if [ -n "${PLUGIN_ROOT:-}" ]; then+ [ -f "$PLUGIN_ROOT/agents/${name}.md" ] && return 0+ if [ -z "$plugin" ]; then+ [ -f "$PLUGIN_ROOT/agents/${agent}.md" ] && return 0+ fi+ fi++ case "$name" in+ general-purpose|statusline-setup) return 0 ;;+ esac++ for cache_root in "${HOME}/.claude/plugins/cache" "${HOME}/.cursor/plugins/cache"; do+ [ -d "$cache_root" ] || continue++ if [ -n "$plugin" ]; then+ local f+ for f in \+ "$cache_root"/*/"$plugin"/*/agents/"$agent".md \+ "$cache_root"/*/*/"$plugin"/*/agents/"$agent".md \+ "$cache_root"/*/"$plugin"/agents/"$agent".md; do+ [ -f "$f" ] && return 0+ done+ continue+ fi++ local d+ for d in "$cache_root"/*/agents "$cache_root"/*/*/agents; do+ [ -f "$d/${name}.md" ] && return 0+ [ -f "$d/${agent}.md" ] && return 0+ done+ done++ return 1+}diff --git a/claude-ops/skills/flow/FLOW.md b/claude-ops/skills/flow/FLOW.mdindex 11d9483a..95ceb2f5 100644--- a/claude-ops/skills/flow/FLOW.md+++ b/claude-ops/skills/flow/FLOW.md@@ -47,8 +47,8 @@ For each stage exactly **one** canonical command runs. The rest are| **spec** | gstack `/spec` (5-phase → GitHub issue → worktree agent) | feeds GSD engine | `gsd-spec-phase` (engine, not entrypoint) || **plan** | **GSD** `gsd-plan-phase` / `gsd-ultraplan-phase` (goal-backward, `.planning/PLAN.md`) wrapped by gstack `/autoplan` role reviews | `gsd-plan-review-convergence` | `/plan-*-review` (run via `/autoplan`); `giga plan` || **design** | gstack `/design-consultation` → `/design-shotgun` → `/design-html` | Pencil/Figma (DESIGN-FIRST rule) | — |-| **build** | project → **GSD** `gsd-execute-phase` (fresh-context waves) / `gsd-master-orchestrator` (multi-project, ≤5 subagents/action); ad-hoc → direct edits + worktree | worktree isolation (mandatory) | `ops:ops-orchestrate`, `superpowers:dispatching-parallel-agents`, personal `subagents`/`orchestrator` |-| **review** | gstack `/review` (pre-land) + `/cso` (security) | project also runs `gsd-code-review` (phase-gated → CODE-REVIEW.md) | standalone `code-review` / `security-review`; `gsd-review` |+| **build** | project → **GSD** `gsd-execute-phase` (fresh-context waves) / `gsd-master-orchestrator` (multi-project, ≤5 subagents/action); ad-hoc → direct edits + worktree | optional overlay: **feature-dev** `/feature-dev` (explore → architect → implement → review); worktree isolation (mandatory) | `ops:ops-orchestrate`, `superpowers:dispatching-parallel-agents`, personal `subagents`/`orchestrator` |+| **review** | gstack `/review` (pre-land) + `/cso` (security) | project also runs `gsd-code-review` (phase-gated → CODE-REVIEW.md); optional **feature-dev** Phase 6 via explicit `/feature-dev` or auto-swap `feature-dev:code-reviewer` | standalone `code-review` / `security-review`; `gsd-review` || **test** | gstack `/qa` + `/browse` (web), `/ios-qa` (iOS) | project also runs `gsd-verify-work` + `gsd-add-tests` | standalone `e2e` || **ship** | project → **GSD** `gsd-ship` (phase→PR, `.planning`-filtered branch); ad-hoc single-repo → gstack `/ship`; multi-repo salvage → `ops:ops-merge` | `gsd-pr-branch` cleans the branch | `commit-commands:commit-push-pr` || **deploy** | claude-ops `ops:ops-deploy` + gstack `/land-and-deploy` → `/canary` | `ops:ops-deploy-fix` (autofix) | `/setup-deploy` (config only) |@@ -73,6 +73,7 @@ resolve via `bin/flow-state`. Mirrors the `/ops:ops` routing-table pattern.| ultraplan, deep-plan | plan | `gsd-ultraplan-phase` || design, ui, mockup, html | design | `/design-consultation` || build, execute, implement, code | build | project → `gsd-execute-phase`; multi-project → `gsd-master-orchestrator`; ad-hoc → direct + worktree |+| feature-dev, fd, feature, architect-feature | build | `/feature-dev $REST` (overlay; does not replace GSD execute) || review, code-review, cr | review | `/review` (+ `gsd-code-review` if project) || security, cso, sec-review | review | `/cso` || test, qa, e2e | test | `/qa` (+ `gsd-verify-work` if project) |diff --git a/claude-ops/skills/flow/SKILL.md b/claude-ops/skills/flow/SKILL.mdindex d2a817b9..fe8a7eec 100644--- a/claude-ops/skills/flow/SKILL.md+++ b/claude-ops/skills/flow/SKILL.md@@ -78,6 +78,7 @@ Route `$ARGUMENTS` (first token = intent) using this table:| ultraplan, deep-plan | `gsd-ultraplan-phase` || design, ui, mockup, html | `/design-consultation $REST` || build, execute, implement, code | **project** → `gsd-execute-phase`; **multi-project** → `gsd-master-orchestrator`; **ad-hoc** → direct edits in an isolated worktree |+| feature-dev, fd, feature, architect-feature | `/feature-dev $REST` (overlay — optional structured pipeline before/alongside build; does not replace GSD execute) || review, code-review, cr | `/review` — **project** also runs `gsd-code-review` || security, cso, sec-review | `/cso` || test, qa | `/qa $REST` — **project** also runs `gsd-verify-work` |diff --git a/claude-ops/skills/ops-feature-dev/SKILL.md b/claude-ops/skills/ops-feature-dev/SKILL.mdnew file mode 100644index 00000000..5b0bc913--- /dev/null+++ b/claude-ops/skills/ops-feature-dev/SKILL.md@@ -0,0 +1,62 @@+---+name: ops-feature-dev+description: Guided feature development — delegates to the feature-dev plugin's 7-phase workflow (explore, architect, implement, review). Use before ad-hoc builds or as pre-work before gsd-execute-phase.+argument-hint: '[feature description]'+allowed-tools:+ - Skill+ - Agent+ - AskUserQuestion+ - TodoWrite+ - Read+ - TeamCreate+ - SendMessage+effort: medium+maxTurns: 40+---++## Agent Teams support++If `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is set, use **Agent Teams** when+feature-dev phases fan out in parallel (e.g. explore + architect, or implement ++review). This enables:++- Phase agents share findings mid-flight (explore surfaces a constraint → architect+ adjusts before implementation starts)+- You can steer priorities in real time ("finish API contract first, then UI")+- Agents report progress as each phase completes++**Team setup** (only when the flag is enabled, and only for genuinely parallel phases):++```bash+TeamCreate("feature-dev-lifecycle")+Agent(team_name="feature-dev-lifecycle", name="phase-explore", ...)+Agent(team_name="feature-dev-lifecycle", name="phase-architect", ...)+```++Steer with `SendMessage` / `broadcast`; share work via `TaskCreate`/`TaskUpdate`.++If the flag is NOT set, fall back to standard fire-and-forget subagents (the+default), or invoke `/feature-dev` inline via the Skill tool.++# OPS ► FEATURE DEV++Thin router into the **feature-dev** companion plugin. Do not re-implement its phases here.++## When to use++- **Ad-hoc repos** (no `.planning/`): optional structured alternative to jumping straight into `/flow build`.+- **Project repos** (`.planning/` present): run **before** `gsd-execute-phase` when you want exploration + architecture + clarifying questions; execution still canonical via GSD.+- **Review**: gstack `/review` and `gsd-code-review` stay canonical; feature-dev Phase 6 is available via explicit `/feature-dev` or auto-swap to `feature-dev:code-reviewer`.++## Routing++If `$ARGUMENTS` is empty, invoke `/feature-dev` with no args (discovery phase).++Otherwise invoke `/feature-dev $ARGUMENTS` via the **Skill** tool.++## Integration notes++- Requires the **feature-dev** plugin installed (`/ops:setup` Step 2c or `/plugin install feature-dev`).+- Specialist auto-swap (`feature-dev:code-*`) is handled by `bin/ops-suggest-specialized-agent` when the plugin is present.+- Does **not** replace `/flow build`, `/review`, or `gsd-execute-phase` — it overlays them.+diff --git a/claude-ops/skills/ops/SKILL.md b/claude-ops/skills/ops/SKILL.mdindex f33728da..51716b5d 100644--- a/claude-ops/skills/ops/SKILL.md+++ b/claude-ops/skills/ops/SKILL.md@@ -52,6 +52,7 @@ Route `$ARGUMENTS` to the correct ops skill:| integrate, connect, add-api, saas, partner | `/ops:ops-integrate $ARGUMENTS` || speedup, clean, optimize, cleanup | `/ops:ops-speedup` || orchestrate, subagents, agents, dispatch, run | `/ops:ops-orchestrate $ARGUMENTS` |+| feature, feature-dev, fd, architect-feature, explore-feature | `/ops:ops-feature-dev $ARGUMENTS` || secret-sync, secrets, doppler-sync, drift | `/ops:ops-secret-sync $ARGUMENTS` || home, homey, lights, flow, scene, energy, climate, presence, alarm, smart-home, iot, thermostat, dim, door, lock | `/ops:ops-home $ARGUMENTS` || statusline, status-line, cockpit | `/ops:statusline $ARGUMENTS` |diff --git a/claude-ops/skills/setup/SKILL.md b/claude-ops/skills/setup/SKILL.mdindex e0c24d70..b5b11286 100644--- a/claude-ops/skills/setup/SKILL.md+++ b/claude-ops/skills/setup/SKILL.md@@ -247,7 +247,7 @@ Use `AskUserQuestion` with `multiSelect: true`. Offer **only sections that need| Option | Header | Description || ------------------ | -------- | ----------------------------------------------- || Configure channels | channels | Set tokens for Telegram, WhatsApp, Email, Slack |-| Companion plugins | plugins | Install GSD for project roadmap tracking |+| Companion plugins | plugins | Install GSD, Superpowers, and feature-dev companion plugins || Save preferences | prefs | Owner name, timezone, default priorities || Shell env | env | Export `CLAUDE_PLUGIN_ROOT` in shell profile |@@ -400,7 +400,45 @@ Install later with: /plugin marketplace add obra/superpowers-marketplace----## Step 2c — Background Daemon (early install, pre-warm caches)+## Step 2c — Feature-dev (optional, recommended for structured builds)++The **feature-dev** plugin adds a 7-phase feature pipeline (`code-explorer`, `code-architect`, `code-reviewer` agents). claude-ops routes to it via `/ops:ops-feature-dev`, `/flow feature-dev`, and silent auto-swap when `general-purpose` agents match explore/architect/review keywords.++Check if feature-dev is already installed:++```bash+find ~/.claude ~/.cursor -path "*/feature-dev/*/agents/code-explorer.md" 2>/dev/null | head -1 | grep -q . && echo "installed" || echo "not_installed"+```++If not installed, ask via `AskUserQuestion`:++```plaintext+Feature-dev adds structured feature development (explore → architect → implement → review).++ [Install feature-dev (latest)] [Skip — I'll add it later]+```++On install, try the Claude Code plugin CLI when available:++```bash+# Cursor / Claude Code — plugin id varies by marketplace; verify with: claude plugin list+claude plugin install feature-dev 2>/dev/null || true+```++Re-check with the find command above. If still `not_installed`, tell the user to install **feature-dev** from Cursor Settings → Plugins (or their Claude Code marketplace UI), then re-run `/ops:setup`.++Report success/failure. Record `plugins.feature_dev = "installed"` in `$PREFS_PATH` only when the find check passes.++If they skip:++```plaintext+Skipped feature-dev. Install later from Cursor plugins or run /feature-dev after installing the feature-dev plugin.+Structured builds still work via /flow build and gsd-execute-phase without it.+```++---++## Step 2d — 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 (message-listener, inbox-digest) are added later in Step 5b once their channels are configured.@@ -426,7 +464,7 @@ esac> Generates `~/.config/systemd/user/claude-ops-daemon.service` from `scripts/systemd/claude-ops-daemon.service`, enables linger (so the daemon survives logout), chowns `~/.claude/plugins/cache/` back to the user if it was left root-owned by a prior `sudo` run, then `daemon-reload + enable --now`. Idempotent. See `scripts/install-ops-daemon-linux.sh --help` for `--dry-run` and `--uninstall`.- Write `daemon.enabled = true`, `daemon.installed_at_step = "2c"`, `daemon.platform = "linux-systemd"` to `$PREFS_PATH` and continue immediately to Step 3 — health verification is deferred to Step 5b.+ Write `daemon.enabled = true`, `daemon.installed_at_step = "2d"`, `daemon.platform = "linux-systemd"` to `$PREFS_PATH` and continue immediately to Step 3 — health verification is deferred to Step 5b.- **WSL** (`OS=wsl`): `systemd --user` works on WSL2 with `systemd=true` in `/etc/wsl.conf`. If `systemctl --user status` succeeds, run the Linux installer above. Otherwise fall back to:@@ -466,7 +504,7 @@ bash "$PLUGIN_ROOT/scripts/install-ops-daemon.sh"> Generates `~/Library/LaunchAgents/com.claude-ops.daemon.plist` from the bundled template, writes the initial channel-independent services config (`briefing-pre-warm` + `memory-extractor`), removes any legacy whatsapp-bridge keepalive, and bootstraps the daemon. Idempotent — re-running re-bootstraps cleanly. See `scripts/install-ops-daemon.sh` for the full procedure.-Write `daemon.enabled = true` and `daemon.installed_at_step = "2c"` to `$PREFS_PATH` so Step 5b knows to reconcile services instead of re-installing.+Write `daemon.enabled = true` and `daemon.installed_at_step = "2d"` to `$PREFS_PATH` so Step 5b knows to reconcile services instead of re-installing.Print:@@ -481,13 +519,13 @@ Continue immediately to Step 3 — do NOT wait for the daemon to confirm startup----## Step 2d — Recap Marquee (multi-session digest in tmux status-right)+## Step 2e — Recap Marquee (multi-session digest in tmux status-right)The recap marquee is a separate launchd daemon (`com.claude-ops.recap-daemon`) that synthesizes a one-line digest across all parallel Claude Code sessions and recent shell activity, then exposes it via `/tmp/claude-recap-digest` for tmux to scroll across `status-right`. Independent from the main ops daemon — it can run on its own.Skip this step entirely if `recap_marquee_enabled = false` in userConfig.-### Step 2d.1 — Ask the user+### Step 2e.1 — Ask the userUse `AskUserQuestion`:@@ -502,9 +540,9 @@ If `What is this?`: explain (the daemon polls per-session recap files written byIf `No`: write `recap.enabled = false` to `$PREFS_PATH` and skip to Step 3.-### Step 2d.2 — Install launchd plist (macOS only)+### Step 2e.2 — Install launchd plist (macOS only)-Same platform gate as Step 2c. On Linux/WSL/Windows, print:+Same platform gate as Step 2e. On Linux/WSL/Windows, print:```○ Recap daemon — skipped (launchd is macOS-only). Linux users: see@@ -520,7 +558,7 @@ bash "$PLUGIN_ROOT/scripts/install-recap-daemon.sh"> Generates `~/Library/LaunchAgents/com.claude-ops.recap-daemon.plist` from the bundled template and bootstraps the agent. Macos-only (the script no-ops cleanly on Linux). See `scripts/install-recap-daemon.sh` for the full procedure.-### Step 2d.3 — Display surface integration (tmux OR Claude Code statusLine)+### Step 2e.3 — Display surface integration (tmux OR Claude Code statusLine)The daemon writes `/tmp/claude-recap-digest`. Two display surfaces can render it (and they can coexist):@@ -532,11 +570,11 @@ Detect tmux availability and branch:```bashif ! command -v tmux >/dev/null 2>&1; thenecho "○ tmux not installed — offering Claude Code statusLine fallback instead."- # → jump to Step 2d.3b (statusLine fallback)+ # → jump to Step 2e.3b (statusLine fallback)fi```-If `recap_marquee_auto_configure_tmux = false`, print the tmux snippet and skip the rest of this step (let user wire manually). The statusLine fallback in Step 2d.3b still applies if tmux is absent.+If `recap_marquee_auto_configure_tmux = false`, print the tmux snippet and skip the rest of this step (let user wire manually). The statusLine fallback in Step 2e.3b still applies if tmux is absent.If tmux is present and `recap_marquee_auto_configure_tmux = true`, ask:@@ -576,9 +614,9 @@ TMUXtmux info >/dev/null 2>&1 && tmux source-file "$TMUX_CONF" 2>/dev/null```-### Step 2d.3b — Claude Code statusLine fallback (no tmux)+### Step 2e.3b — Claude Code statusLine fallback (no tmux)-When `command -v tmux` returned non-zero in Step 2d.3, offer the Claude Code `statusLine` setting as the marquee surface. Same digest file (`/tmp/claude-recap-digest`), different render target. This is also safe to layer alongside tmux if both are present — but typically only run when tmux is absent.+When `command -v tmux` returned non-zero in Step 2e.3, offer the Claude Code `statusLine` setting as the marquee surface. Same digest file (`/tmp/claude-recap-digest`), different render target. This is also safe to layer alongside tmux if both are present — but typically only run when tmux is absent.Ask via `AskUserQuestion` (Rule 1 — exactly 4 options):@@ -589,20 +627,20 @@ No tmux detected. Wire the recap marquee into Claude Code's statusLine instead?On `Help`: explain that Claude Code reads `~/.claude/settings.json` → `statusLine` and runs the configured command on each refresh, displaying the output in its own status bar. Then re-ask.-On `Show me the JSON`: print the snippet below and continue to Step 2d.4 with `recap.statusline_wired = false`.+On `Show me the JSON`: print the snippet below and continue to Step 2e.4 with `recap.statusline_wired = false`.-On `Skip`: write `recap.statusline_wired = false` and continue to Step 2d.4.+On `Skip`: write `recap.statusline_wired = false` and continue to Step 2e.4.On `Add to Claude Code statusLine`:-0. **Pre-check — `jq` availability**: Step 2d.3b uses `jq` for every settings.json read/merge. If `jq` is missing, all subsequent `jq` calls silently fail (suppressed by `2>/dev/null`), `existing` evaluates to empty, and the merge step is skipped — but the success path would still record `recap.statusline_wired = true` in prefs, leaving the user in an inconsistent state. Guard up front:+0. **Pre-check — `jq` availability**: Step 2e.3b uses `jq` for every settings.json read/merge. If `jq` is missing, all subsequent `jq` calls silently fail (suppressed by `2>/dev/null`), `existing` evaluates to empty, and the merge step is skipped — but the success path would still record `recap.statusline_wired = true` in prefs, leaving the user in an inconsistent state. Guard up front:```bashif ! command -v jq >/dev/null 2>&1; thenecho "○ jq not installed — cannot merge statusLine automatically."echo " Install jq (e.g. brew install jq, apt install jq) and re-run /ops:recap configure."# Do NOT mark statusline_wired=true. Treat as Skip:- # write recap.statusline_wired = false in Step 2d.5 and continue to Step 2d.4.+ # write recap.statusline_wired = false in Step 2e.5 and continue to Step 2e.4.fi```@@ -658,7 +696,7 @@ On `Add to Claude Code statusLine`:✓ Claude Code statusLine wired — restart Claude Code (or open a new session) to activate.```- Then write `recap.statusline_wired = true` before continuing to Step 2d.4.+ Then write `recap.statusline_wired = true` before continuing to Step 2e.4.The JSON snippet to show on `Show me the JSON`:@@ -672,7 +710,7 @@ The JSON snippet to show on `Show me the JSON`:}```-### Step 2d.4 — Verify daemon is producing output+### Step 2e.4 — Verify daemon is producing outputWait up to 60s for the daemon to write its first digest. Run in background; do NOT block the wizard:@@ -686,19 +724,19 @@ Wait up to 60s for the daemon to write its first digest. Run in background; do N) &```-### Step 2d.5 — Persist preferences+### Step 2e.5 — Persist preferencesWrite to `$PREFS_PATH`. Set both `"tmux_wired"` and `"statusline_wired"` dynamically based on the user’s actual choices:-- `"tmux_wired"`: `true` when tmux was installed and the user chose to wire `status-right` in Step 2d.3; `false` when tmux was missing, the user chose **Skip**, or **Show me the line**.-- `"statusline_wired"`: `true` only after **Add to Claude Code statusLine** successfully merged recap into `~/.claude/settings.json` in Step 2d.3b; `false` after **Skip**, **Show me the JSON**, the nested **Skip** when an existing statusLine was detected, or if Step 2d.3b did not run (e.g. tmux-only path).+- `"tmux_wired"`: `true` when tmux was installed and the user chose to wire `status-right` in Step 2e.3; `false` when tmux was missing, the user chose **Skip**, or **Show me the line**.+- `"statusline_wired"`: `true` only after **Add to Claude Code statusLine** successfully merged recap into `~/.claude/settings.json` in Step 2e.3b; `false` after **Skip**, **Show me the JSON**, the nested **Skip** when an existing statusLine was detected, or if Step 2e.3b did not run (e.g. tmux-only path).```json{"recap": {"enabled": true,- "tmux_wired": "<true|false — based on Step 2d.3 outcome>",- "statusline_wired": "<true|false — based on Step 2d.3b outcome>",+ "tmux_wired": "<true|false — based on Step 2e.3 outcome>",+ "statusline_wired": "<true|false — based on Step 2e.3b outcome>","installed_at_step": "2d","platform": "macos"}@@ -715,17 +753,17 @@ Print:Manage anytime: /ops:recap status | tail | configure | restart```-Continue to Step 2e.+Continue to Step 2f.----## Step 2e — Statusline Cockpit (if selected)+## Step 2f — Statusline Cockpit (if selected)Configures the Claude Code `statusLine` setting — a 3-line terminal cockpit showing context-window health, quota gauges, git branch, fleet state, sys metrics, and per-project ops badges.**Rule Zero**: every Bash call in this step MUST use `run_in_background: true`.-### Step 2e.1 — Resolve paths (run_in_background: true)+### Step 2f.1 — Resolve paths (run_in_background: true)```bashPLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(ls -d "$HOME/.claude/plugins/cache/ops-marketplace/ops"/*/ 2>/dev/null | sort -V | tail -1)}"@@ -747,7 +785,7 @@ If `RENDERER_SRC` does not exist, print:Then skip the rest of this step and continue to Step 3.-### Step 2e.2 — Ask preset (max 4 options per Rule 1)+### Step 2f.2 — Ask preset (max 4 options per Rule 1)Use `AskUserQuestion`:@@ -763,7 +801,7 @@ On Skip: write `statusline.enabled = false` to `$PREFS_PATH` and continue to SteSet `CHOSEN_PRESET` from the user's choice (`cockpit`, `minimal`, or `full`).-### Step 2e.3 — Ask theme (max 4 options per Rule 1)+### Step 2f.3 — Ask theme (max 4 options per Rule 1)Use `AskUserQuestion`:@@ -777,7 +815,7 @@ Which color theme?Set `CHOSEN_THEME`.-### Step 2e.4 — Run registry auto-suggest (run_in_background: true)+### Step 2f.4 — Run registry auto-suggest (run_in_background: true)```bashSUGGESTED=$("$SUGGEST_BIN" --preset "$CHOSEN_PRESET" --theme "$CHOSEN_THEME" 2>/tmp/ops-statusline-suggest.log)@@ -786,7 +824,7 @@ PROJ_COUNT=$(printf '%s' "$SUGGESTED" | jq -r '._detected.projects_found // 0' 2Print detection summary: `Detected $PROJ_COUNT projects from registry.`-### Step 2e.5 — Install renderer (run_in_background: true)+### Step 2f.5 — Install renderer (run_in_background: true)```bashcp "$RENDERER_SRC" "$RENDERER_DST"@@ -795,7 +833,7 @@ chmod +x "$RENDERER_DST"Validate: `[ -x "$RENDERER_DST" ] && echo "✓ Renderer installed at $RENDERER_DST"`-### Step 2e.6 — Write config (run_in_background: true)+### Step 2f.6 — Write config (run_in_background: true)```bashTMP=$(mktemp)@@ -805,7 +843,7 @@ mv "$TMP" "$CFG_DST"jq . "$CFG_DST" >/dev/null 2>&1 && echo "✓ Config written" || echo "✗ Config JSON invalid"```-### Step 2e.7 — Merge settings.json statusLine (run_in_background: true)+### Step 2f.7 — Merge settings.json statusLine (run_in_background: true)**IMPORTANT**: use `jq` to _merge_ — never clobber the entire settings.json.@@ -844,7 +882,7 @@ If `existing_statusline` is non-empty, use `AskUserQuestion`:On Yes: run the merge above with the new command.On No: skip the merge and note `statusline.settings_wired = false`.-### Step 2e.8 — Quick preview (run_in_background: true)+### Step 2f.8 — Quick preview (run_in_background: true)```bashPAYLOAD='{"model":{"display_name":"Claude Sonnet"},"rate_limits":{"five_hour":{"used_percentage":30}},"context_window":{"used_percentage":20},"cost":{"total_cost_usd":0.05}}'@@ -860,7 +898,7 @@ If the render fails (exit non-zero or empty output), print a non-fatal note:Manage with: /ops:statusline preview | doctor | config```-### Step 2e.9 — Persist preferences (run_in_background: true)+### Step 2f.9 — Persist preferences (run_in_background: true)```bashjq -n \@@ -1284,11 +1322,11 @@ After auto-discovery (or if the user selects "I'll enter projects manually"):## Step 5b — Daemon Service Reconciliation-By now, the daemon was already installed in Step 2c and has been pre-warming the briefing cache in the background while the user configured channels. This step adds **channel-dependent services** (`whatsapp-bridge`, `message-listener`, `inbox-digest`, `store-health`, `competitor-intel`) now that we know which channels and integrations are configured.+By now, the daemon was already installed in Step 2d and has been pre-warming the briefing cache in the background while the user configured channels. This step adds **channel-dependent services** (`whatsapp-bridge`, `message-listener`, `inbox-digest`, `store-health`, `competitor-intel`) now that we know which channels and integrations are configured.**Skip conditions:**-- If the user declined daemon install in Step 2c, skip this step entirely.+- If the user declined daemon install in Step 2d, skip this step entirely.- If `daemon.enabled != true` in `$PREFS_PATH`, skip.Otherwise continue — reconcile the services list:@@ -1324,9 +1362,9 @@ If the health file is missing (daemon may still be initializing), wait 5 more setail -20 ~/.claude/plugins/data/ops-ops-marketplace/logs/ops-daemon.log```-**3. Build the full services list and reconcile with the config written in Step 2c:**+**3. Build the full services list and reconcile with the config written in Step 2d:**-Determine which services to enable based on what was configured in earlier steps. The `briefing-pre-warm` and `memory-extractor` services were already enabled at Step 2c — preserve them. Add channel-dependent services based on what's now configured:+Determine which services to enable based on what was configured in earlier steps. The `briefing-pre-warm` and `memory-extractor` services were already enabled at Step 2d — preserve them. Add channel-dependent services based on what's now configured:- `whatsapp-bridge` — always include if WhatsApp is configured (`channels.whatsapp` is set)- `memory-extractor` — always include@@ -1355,7 +1393,7 @@ fiecho "Services to enable: $SERVICES"```-Write daemon services config to `$DATA_DIR/daemon-services.json` — merge with the existing config from Step 2c, preserving `briefing-pre-warm` and `memory-extractor`, and enabling the new channel-dependent services. **Every service MUST include a `command` field** — the daemon's `start_service()` skips any service without one. Use `${CLAUDE_PLUGIN_ROOT}` (resolved at runtime) for script paths. Each service entry should include:+Write daemon services config to `$DATA_DIR/daemon-services.json` — merge with the existing config from Step 2d, preserving `briefing-pre-warm` and `memory-extractor`, and enabling the new channel-dependent services. **Every service MUST include a `command` field** — the daemon's `start_service()` skips any service without one. Use `${CLAUDE_PLUGIN_ROOT}` (resolved at runtime) for script paths. Each service entry should include:- `briefing-pre-warm`: `{ "enabled": true, "command": "${CLAUDE_PLUGIN_ROOT}/bin/ops-gather", "cron": "*/2 * * * *" }` — pre-warms /ops:go cache (installed in 2c)- `whatsapp-bridge`: `{ "enabled": true, "command": "launchctl kickstart -k gui/$UID/com.${USER}.whatsapp-bridge", "health_check": "lsof -i :8080 | grep LISTEN", "restart_delay": 60, "max_restarts": 10 }` — only if WhatsApp configured (matches `daemon-services.default.json`; bridge is owned by LaunchAgent, not a plugin script)diff --git a/claude-ops/tests/run-all.sh b/claude-ops/tests/run-all.shindex 6196b6fd..f49169a8 100755--- a/claude-ops/tests/run-all.sh+++ b/claude-ops/tests/run-all.sh@@ -37,6 +37,7 @@ run_suite "$TESTS_DIR/test-skills-lint.sh"run_suite "$TESTS_DIR/test-agents-lint.sh"run_suite "$TESTS_DIR/test-bin-scripts.sh"run_suite "$TESTS_DIR/test-hooks.sh"+run_suite "$TESTS_DIR/test-specialist-agent-swap.sh"run_suite "$TESTS_DIR/test-template.sh"run_suite "$TESTS_DIR/test-claude-md.sh"run_suite "$TESTS_DIR/test-no-secrets.sh"diff --git a/claude-ops/tests/test-specialist-agent-swap.sh b/claude-ops/tests/test-specialist-agent-swap.shnew file mode 100755index 00000000..5fb4fc46--- /dev/null+++ b/claude-ops/tests/test-specialist-agent-swap.sh@@ -0,0 +1,75 @@+#!/usr/bin/env bash+# test-specialist-agent-swap.sh — agent_installed() resolves plugin:agent namespaces+set -euo pipefail++PLUGIN_ROOT="$(cd "$(dirname "$0")/.." && pwd)"+TMP_HOME=""+pass=0+fail=0++ok() { echo " PASS: $1"; pass=$((pass + 1)); }+err() { echo " FAIL: $1"; fail=$((fail + 1)); }++cleanup() {+ if [ -n "$TMP_HOME" ] && [ -d "$TMP_HOME" ]; then+ rm -rf "$TMP_HOME"+ fi+}+trap cleanup EXIT++TMP_HOME="$(mktemp -d)"+export HOME="$TMP_HOME"+export PLUGIN_ROOT++. "$PLUGIN_ROOT/scripts/lib/agent-installed.sh"++echo "Checking agent_installed()..."+echo ""++mkdir -p "$TMP_HOME/.claude/agents"+echo '---' > "$TMP_HOME/.claude/agents/code-reviewer.md"++if agent_installed "feature-dev:code-reviewer"; then+ err "bare code-reviewer must not satisfy feature-dev:code-reviewer"+else+ ok "namespaced agent ignores unrelated bare agent file"+fi++mkdir -p "$TMP_HOME/.cursor/plugins/cache/claude-code-plugins/feature-dev/abc123/agents"+echo '---' > "$TMP_HOME/.cursor/plugins/cache/claude-code-plugins/feature-dev/abc123/agents/code-reviewer.md"++if agent_installed "feature-dev:code-reviewer"; then+ ok "feature-dev:code-reviewer found in Cursor plugin cache"+else+ err "feature-dev:code-reviewer not resolved (namespace bug)"+fi++if agent_installed "other-plugin:code-reviewer"; then+ err "other-plugin:code-reviewer should not resolve from feature-dev cache"+else+ ok "plugin namespace remains isolated for same agent name"+fi++if agent_installed "feature-dev:code-explorer"; then+ err "feature-dev:code-explorer should be missing"+else+ ok "missing plugin agent correctly returns false"+fi++echo '---' > "$TMP_HOME/.claude/agents/triage-agent.md"++if agent_installed "triage-agent"; then+ ok "bare agent name in ~/.claude/agents"+else+ err "bare agent name not found"+fi++if agent_installed "general-purpose"; then+ ok "general-purpose always available"+else+ err "general-purpose should always be available"+fi++echo ""+echo "Results: $pass passed, $fail failed"+[ "$fail" -eq 0 ] || exit 1