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.

feat(finops-bridge): wire ops skills to finops-dashboard /api/ops/*

auroracapital344207af0412
diff --git a/claude-ops/agents/yolo-cfo.md b/claude-ops/agents/yolo-cfo.md
index 3d70adb9..4de2289d 100644
--- a/claude-ops/agents/yolo-cfo.md
+++ b/claude-ops/agents/yolo-cfo.md
@@ -24,6 +24,29 @@ The calling skill has pre-gathered AWS cost data, project revenue stages, regist
**External projects**: Factor Shopify GMV and external SaaS revenue into the financial picture. Flag external projects with auth_expired credentials as revenue risk (especially Shopify stores). Include external service costs in the total burn rate analysis.
+### Single source of truth — finops-dashboard first
+
+Before re-querying raw APIs, ALWAYS try the finops-dashboard bridge first.
+The dashboard is the canonical store for spend, anomalies, perks, and
+per-DBA Stripe revenue snapshots — re-computing from raw APIs creates
+drift and burns tokens.
+
+```bash
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh snapshot # canonical state
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh anomalies # open anomalies
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh revenue project # per-DBA MRR
+```
+
+Only fall through to the raw `aws ce`, RevenueCat, and Stripe queries
+below when the bridge returns `{}` or `[]` (dashboard unreachable / token
+unset). When you DO compute fresh numbers, push them back so the
+dashboard stays current:
+
+```bash
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh push-event \
+ action <project> <amount_saved> "<title>" '<payload_json>'
+```
+
## Your mandate
### 1. Actual burn rate vs. what we think it is
diff --git a/claude-ops/scripts/finops-bridge.sh b/claude-ops/scripts/finops-bridge.sh
new file mode 100755
index 00000000..77c31b73
--- /dev/null
+++ b/claude-ops/scripts/finops-bridge.sh
@@ -0,0 +1,130 @@
+#!/usr/bin/env bash
+# finops-bridge.sh — bidirectional bridge between claude-ops and finops-dashboard.
+#
+# READ helpers (used by ops-go / ops-revenue / ops-fires / yolo-cfo agent):
+# finops-bridge.sh snapshot -> /api/ops/snapshot (full canonical state)
+# finops-bridge.sh anomalies [severity] -> /api/ops/anomalies
+# finops-bridge.sh revenue [by] -> /api/ops/revenue (by=project|account|entity)
+#
+# PUSH helpers (used by ops-yolo / ops-merge / stripe-mapper / etc.):
+# finops-bridge.sh push-event <kind> <project> [amount_saved] [title] [payload_json]
+# finops-bridge.sh resolve-anomaly <id> [project] [amount_saved]
+#
+# Auth:
+# FINOPS_OPS_API_TOKEN — bearer token (from Doppler `finops-dashboard` prd config)
+# FINOPS_DASHBOARD_URL — base URL of your finops-dashboard install
+#
+# Both must be set in the user's shell or pulled from Doppler. There is no
+# default — public repo, no real URLs hardcoded.
+#
+# All commands FAIL OPEN with empty JSON ({} for objects, [] for lists) on any
+# error — so consumers can fall back gracefully to raw API queries.
+
+set -euo pipefail
+
+BASE="${FINOPS_DASHBOARD_URL:-}"
+TOKEN="${FINOPS_OPS_API_TOKEN:-}"
+
+if [[ -z "$BASE" || -z "$TOKEN" ]] && command -v doppler >/dev/null 2>&1; then
+ [[ -z "$TOKEN" ]] && TOKEN="$(doppler secrets get FINOPS_OPS_API_TOKEN --plain --project finops-dashboard --config prd 2>/dev/null || true)"
+ [[ -z "$BASE" ]] && BASE="$(doppler secrets get FINOPS_DASHBOARD_URL --plain --project finops-dashboard --config prd 2>/dev/null || true)"
+fi
+
+if [[ -z "$BASE" ]]; then
+ case "${1:-}" in
+ snapshot|anomalies|revenue|push-event|resolve-anomaly)
+ case "${1:-}" in
+ anomalies) echo "[]" ;;
+ *) echo "{}" ;;
+ esac
+ exit 0
+ ;;
+ esac
+fi
+
+CURL_OPTS=(--silent --show-error --connect-timeout 5 --max-time 15)
+[[ -n "$TOKEN" ]] && CURL_OPTS+=(-H "Authorization: Bearer ${TOKEN}")
+CURL_OPTS+=(-H "Accept: application/json")
+
+emit_empty() {
+ case "$1" in
+ list) echo "[]" ;;
+ *) echo "{}" ;;
+ esac
+}
+
+cmd_snapshot() {
+ curl "${CURL_OPTS[@]}" "${BASE}/api/ops/snapshot" 2>/dev/null || emit_empty obj
+}
+
+cmd_anomalies() {
+ local sev="${1:-}"
+ local url="${BASE}/api/ops/anomalies?status=open&limit=50"
+ [[ -n "$sev" ]] && url="${url}&severity=${sev}"
+ curl "${CURL_OPTS[@]}" "$url" 2>/dev/null || emit_empty list
+}
+
+cmd_revenue() {
+ local by="${1:-project}"
+ curl "${CURL_OPTS[@]}" "${BASE}/api/ops/revenue?by=${by}" 2>/dev/null || emit_empty obj
+}
+
+cmd_push_event() {
+ local kind="${1:?kind required}"
+ local project="${2:-}"
+ local amount="${3:-}"
+ local title="${4:-}"
+ local payload_json="${5:-{}}"
+ local idem="${6:-$(date +%s%N)-$$-${RANDOM}}"
+
+ [[ -z "$TOKEN" ]] && {
+ echo "{\"error\":\"FINOPS_OPS_API_TOKEN not set\"}" >&2
+ return 1
+ }
+
+ local body
+ body=$(jq -nc \
+ --arg kind "$kind" --arg project "$project" --arg title "$title" \
+ --arg idem "$idem" --argjson payload "$payload_json" \
+ --arg amount "$amount" \
+ '{kind:$kind, project:($project|select(length>0)),
+ amount_saved:($amount|select(length>0)|tonumber? // null),
+ title:($title|select(length>0)), payload:$payload,
+ source:"claude-ops", idempotency_key:$idem}')
+
+ curl "${CURL_OPTS[@]}" -X POST "${BASE}/api/ops/events" \
+ -H "Content-Type: application/json" -d "$body" 2>/dev/null || emit_empty obj
+}
+
+cmd_resolve_anomaly() {
+ local id="${1:?anomaly id required}"
+ local project="${2:-}"
+ local amount="${3:-}"
+
+ [[ -z "$TOKEN" ]] && return 1
+
+ local body
+ body=$(jq -nc --arg project "$project" --arg amount "$amount" \
+ '{project:($project|select(length>0)),
+ amount_saved:($amount|select(length>0)|tonumber? // null),
+ source:"claude-ops"}')
+
+ curl "${CURL_OPTS[@]}" -X POST "${BASE}/api/ops/anomalies/${id}/resolve" \
+ -H "Content-Type: application/json" -d "$body" 2>/dev/null || emit_empty obj
+}
+
+case "${1:-}" in
+ snapshot) shift; cmd_snapshot "$@" ;;
+ anomalies) shift; cmd_anomalies "$@" ;;
+ revenue) shift; cmd_revenue "$@" ;;
+ push-event) shift; cmd_push_event "$@" ;;
+ resolve-anomaly) shift; cmd_resolve_anomaly "$@" ;;
+ ""|-h|--help)
+ sed -n '/^#/p' "$0" | sed 's/^# \{0,1\}//' | head -25
+ exit 0
+ ;;
+ *)
+ echo "unknown command: $1" >&2
+ exit 64
+ ;;
+esac
diff --git a/claude-ops/skills/ops-fires/SKILL.md b/claude-ops/skills/ops-fires/SKILL.md
index 366859fc..efc07f21 100644
--- a/claude-ops/skills/ops-fires/SKILL.md
+++ b/claude-ops/skills/ops-fires/SKILL.md
@@ -89,6 +89,17 @@ If the flag is NOT set, use standard parallel subagents.
${CLAUDE_PLUGIN_ROOT}/bin/ops-infra 2>/dev/null || echo '{"clusters":[],"error":"infra check failed"}'
```
+### FinOps dashboard — open anomalies
+
+Live anomaly feed from finops-dashboard (spend spikes, idle services,
+expired credits, drift detections). High-severity items belong in the
+FIRES table alongside infra outages. Falls open to `[]` if the dashboard
+isn't configured.
+
+```!
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh anomalies high 2>/dev/null || echo "[]"
+```
+
## CI failures (last 24h)
```!
diff --git a/claude-ops/skills/ops-go/SKILL.md b/claude-ops/skills/ops-go/SKILL.md
index bb9b5b22..80420524 100644
--- a/claude-ops/skills/ops-go/SKILL.md
+++ b/claude-ops/skills/ops-go/SKILL.md
@@ -82,7 +82,22 @@ If the flag is NOT set, use standard fire-and-forget subagents.
## Pre-gathered data
-All data below was collected by shell scripts in <10 seconds:
+All data below was collected by shell scripts in <10 seconds.
+
+### FinOps snapshot (canonical state from finops-dashboard)
+
+Pulls current burn, anomalies, and revenue from the dashboard. Fails open
+to `{}` if `FINOPS_DASHBOARD_URL` / `FINOPS_OPS_API_TOKEN` are unset — in
+that case the briefing falls back to the per-source data below.
+
+```!
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh snapshot 2>/dev/null || echo "{}"
+```
+
+When this snapshot is non-empty, prefer it for the burn/runway/anomaly
+lines in the briefing. The per-source `Infrastructure` and AWS Cost
+Explorer sections below are kept as a fallback when the dashboard is
+unreachable.
### Infrastructure
diff --git a/claude-ops/skills/ops-revenue/SKILL.md b/claude-ops/skills/ops-revenue/SKILL.md
index b423b7da..e33ea3d9 100644
--- a/claude-ops/skills/ops-revenue/SKILL.md
+++ b/claude-ops/skills/ops-revenue/SKILL.md
@@ -50,6 +50,25 @@ Before executing, load available context:
## Phase 1 — Gather financial data in parallel
+### FinOps dashboard — canonical revenue + burn
+
+If `FINOPS_DASHBOARD_URL` and `FINOPS_OPS_API_TOKEN` are configured, the
+dashboard is the single source of truth for per-project MRR, 30d revenue,
+and current burn. Per-DBA breakdown comes from the Stripe revenue
+snapshots ingested via `/api/ops/revenue`. Falls open to `{}` if unset —
+the per-source AWS / RevenueCat queries below run as fallback.
+
+```!
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh snapshot 2>/dev/null || echo "{}"
+```
+
+```!
+${CLAUDE_PLUGIN_ROOT}/scripts/finops-bridge.sh revenue project 2>/dev/null || echo "{}"
+```
+
+When the dashboard returns data, render the per-project MRR section from
+`groups[]` rather than from RevenueCat-only data.
+
### AWS costs (current month)
```bash