Churn and refund

From shogo-labs/shogo-ai · View interactive version

Churn and refund is an AI agent skill from the GitHub repository shogo-labs/shogo-ai. Surface churn-risk customers from Stripe + support signals and execute refunds with receipts after explicit confirmation

How to use this skill

Skill file

Churn & Refund Workflow

When triggered, run a churn-risk + refund pass:

  1. Confirm Stripe mode — Ask test vs live. Persist to memory for the session. Default to test if unspecified.
  2. Connect Stripe — search_integrations({ query: "stripe" }); install via Composio if missing. Refuse to proceed without it.
  3. Pull metrics — STRIPE_GET_BALANCE, STRIPE_LIST_PAYMENTS, STRIPE_LIST_CUSTOMERS, STRIPE_LIST_INVOICES. Render the KPI grid on the Revenue Dashboard.
  4. Detect churn risk — For each customer, combine signals from Stripe + (when connected) Gmail / Zendesk:

For every flagged customer, capture audit evidence (message ids, ticket ids, Stripe event ids).

  1. Show refund pane — Preview the refund batch: customer, charge id, amount, reason, total. Surface the policy (max per customer, escalation rules) read from memory.
  2. Wait for explicit approval — Do not refund until the user types an explicit confirmation including the count and total (e.g. "yes, refund 3 customers for $X"). If anything is ambiguous, ask again.
  3. Execute — Call STRIPE_REFUND_CHARGE per customer. Capture refund id and status.
  4. Receipts — Append to a canvas refunds table: refund id, charge id, customer, amount, reason, mode (test/live), approver, timestamp.
  5. Notify — send_message with the refund summary; if Slack is connected, post a parallel summary.

If anything fails (Stripe error, partial batch), stop, write what succeeded, and ask the user how to proceed. Never silently retry refunds.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.