AgentSkillsCN

Skill

技能

SKILL.md

SKILL: Customer Spend Monitor

Name

customer-spend-monitor

Description

Daily customer revenue pace monitor. Compares current MTD revenue against prorated prior month for each customer, flags significant changes, and surfaces a watch list of customers with escalations or stale tickets. Posts alerts to Slack and/or Telegram.

Schedule

Cron: 43 8 * * 2,4 (8:43 AM CT on Tuesdays and Thursdays)

Commands

bash
# Full run — posts to all configured channels
bash scripts/customer-spend-monitor.sh

# Dry run — calculate and print, don't post
bash scripts/customer-spend-monitor.sh --dry-run

# Save output to file
bash scripts/customer-spend-monitor.sh --output report.txt

# Single customer only
bash scripts/customer-spend-monitor.sh --customer "Ringba"

# Post to Slack only
bash scripts/customer-spend-monitor.sh --slack-only

# Post to Telegram only
bash scripts/customer-spend-monitor.sh --telegram-only

Environment Variables

VariableRequiredDescription
TABLEAU_PAT_SECRETYesTableau Personal Access Token secret
SLACK_BOT_TOKENYes*Slack bot token with chat:write scope
TELEGRAM_BOT_TOKENNoTelegram bot token (if using Telegram)
CONFIG_PATHNoPath to config JSON (default: ./config/config.json)
DRY_RUNNoSet true to skip posting

* Required unless using --telegram-only

Built-in Resilience

  • Config validation at startup — catches missing/invalid settings early
  • Retry logic — 3 attempts with exponential backoff on transient failures
  • Curl timeouts — 10s connect, 30s max per request
  • Tableau fallback — falls back to billing A2A agent if Tableau is unreachable
  • Dry-run mode — preview output without posting

Dependencies

  • bash, curl, jq, bc
  • Network access to Tableau Server
  • Network access to revenue-agents.query.prod.telnyx.io:8000 (fallback)

Author

team-telnyx / CSM team

Tags

revenue, monitoring, tableau, slack, telegram, cron, spend-tracking