{"id":113255,"plugin_id":"plugin_asdk_app_6afac4102aa08191ad672ce9a52d2e4d","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-24T12:13:46.259Z","digest":"cc4b89073971438ba8fa82963b0949b980c3f32a8a5e814f7f37f5d4e02afc7e","against":null,"payload":{"description":"One-screen review of a single SubscriptionFlow customer — subscriptions, invoices, balance, payments, contacts, a health score and suggested next steps. Use when the user asks \"tell me about Acme\", \"how is Acme doing\", \"customer 360\", \"account review\", \"prep me for a call with Acme\", or names a customer and wants the full picture. Requires the SubscriptionFlow connector (staff_* tools).","included_files":[{"relative_path":"assets/customer-360.html","size_in_bytes":13768},{"relative_path":"references/health.md","size_in_bytes":880}],"name":"customer-360","skill_md_contents":"---\nname: customer-360\ndescription: One-screen review of a single SubscriptionFlow customer — subscriptions, invoices, balance, payments, contacts, a health score and suggested next steps. Use when the user asks \"tell me about Acme\", \"how is Acme doing\", \"customer 360\", \"account review\", \"prep me for a call with Acme\", or names a customer and wants the full picture. Requires the SubscriptionFlow connector (staff_* tools).\n---\n\n# Customer 360\n\nTurn \"tell me about Copperfield Logistics\" into a complete, interactive account card built from live SubscriptionFlow data: what they pay for, what they owe, what changed recently, how healthy the account is, and what to do next.\n\nRead-only. Never change anything unless the user then asks for one of the suggested actions.\n\n## 1. Find the customer\n\n- If you have an id, use it.\n- Otherwise call `staff_list_records` on `customers` with `company` `$contains` the name the user gave, and separately `name` `$contains` it (people often give either), select `id`, `name`, `company`, `email`. If both are empty, try `email` `$equals`.\n- More than one match: show the matches (name, company, email) and ask which one. Do not guess.\n\n## 2. Gather the data (run in parallel)\n\n| What | Tool call |\n|---|---|\n| Customer with everything attached, including saved payment methods | `staff_get_record` on `customers`, `id`, `include` `[\"subscriptions\",\"invoices\",\"transactions\",\"contacts\",\"payment_methods\"]` (max 5 related lists) |\n| Recent activity | `staff_get_record` is limited to 5 related lists, so fetch `activities` separately only if you need it: `staff_get_record` on `customers` with `include` `[\"activities\"]` |\n\nPayment methods belong to the customer through `parent_id`, not `customer_id`; the related list name is `payment_methods` (underscore).\n\nField names you will use: customer `company`, `name`, `email`, `customer_number`, `terms`, `currency`, `auto_charge`, `portal_is_enabled`, `billing_city`, `billing_country`, `created_at`. Subscription `name`, `display_name`, `status`, `total_amount`, `next_bill_date`, `termed_start_date`, `billing_end_date`, `cancelled_at`, `cancellation_reason`, `suspended_at`. Invoice `name`, `status`, `total_amount`, `received_payment`, `due_date`, `invoice_date`. Never show a field key to the user; use plain words.\n\nAmount due on an invoice = `total_amount − received_payment`. Days late = today − `due_date` (only for invoices that are not Paid).\n\n## 3. Score the account\n\nApply `references/health.md` exactly and keep the list of reasons it produced. The score is a guide, not a fact; always show the reasons next to it.\n\n## 4. Spot what matters\n\nWrite 2–5 short signals, most serious first. Look for:\n- invoices more than 60 days late, or past due but still marked \"Due\";\n- auto-charge on with no saved payment method;\n- subscriptions cancelled or suspended in the last 30 days (possible churn), and cancellations with no reason;\n- a Draft subscription whose next bill date has passed (it will never bill);\n- an Active subscription whose next bill date has passed (billing may be stuck);\n- no contacts and no activity on file.\n\n## 5. Build the card\n\n1. Read `assets/customer-360.html`.\n2. Build one JSON object matching the data contract below.\n3. Replace the line `const DATA = window.__SF_DATA__ || SAMPLE;` with `const DATA = <your JSON>;` and change nothing else.\n4. Show it as an interactive HTML view where the client supports it (for example an artifact or canvas), titled \"<Company> – customer review\".\n\nIf the client cannot render HTML, use the text fallback in section 7.\n\n```json\n{\n  \"generated_at\": \"2026-10-20\",\n  \"customer\": { \"company\": \"\", \"name\": \"\", \"number\": \"\", \"email\": \"\", \"city\": \"\", \"country\": \"\", \"terms\": \"\", \"currency\": \"USD\", \"since\": \"2026-03-21\", \"auto_charge\": true, \"portal\": true, \"payment_methods\": 0 },\n  \"health\": { \"score\": 0, \"band\": \"healthy | watch | at_risk\", \"reasons\": [\"-30 invoice over 60 days late\"] },\n  \"kpis\": { \"open_balance\": 0, \"open_count\": 0, \"overdue\": 0, \"overdue_count\": 0, \"oldest_days\": 0, \"active_subs\": 0, \"total_subs\": 0, \"paid_to_date\": 0 },\n  \"subscriptions\": [{ \"number\": \"\", \"name\": \"\", \"status\": \"\", \"amount\": 0, \"detail\": \"next bill 8 Nov 2026\" }],\n  \"invoices\": [{ \"number\": \"\", \"status\": \"\", \"amount_due\": 0, \"due_date\": \"\", \"days_late\": 0, \"note\": \"\" }],\n  \"signals\": [{ \"level\": \"bad | warn | info\", \"title\": \"\", \"detail\": \"\" }],\n  \"actions\": [{ \"label\": \"\", \"say\": \"\", \"primary\": true }],\n  \"notes\": []\n}\n```\n\nList open invoices first (most days late first), then up to 3 most recent paid ones. Use `null` for anything you could not get.\n\n## 6. Suggested actions\n\nOffer at most three, chosen from what the data shows. Each is a sentence the user can send:\n- overdue invoices → \"Email <company>'s overdue invoices to them\";\n- auto-charge on but no payment method → \"Ask <company> to add a payment method in their portal\";\n- Draft subscription past its bill date → \"Show me the Draft subscription <number>\";\n- recent cancellation with no reason → \"Why did <company> cancel <number>?\".\n\nWhen the user sends one, use the normal tools; anything that changes data goes through its preview and confirmation.\n\n## 7. Text fallback\n\nOne line with company, health score and band, open balance and overdue. Then the signals as bullets, a short table of open invoices, the subscriptions with status, and the suggested actions.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}