ApexCloud Retention Ops
Use this skill to produce deterministic JSON answers from the ApexCloud Retention Operations API.
Operating Rules
- Read the task prompt and
input/payloads/answer_template.json first. The template is authoritative for keys, enum vocabulary, nullability, and top-level objects.
- Replace
<TASK_ENV_BASE_URL> with the base URL supplied by the task environment. Use only public GET endpoints mentioned by the prompt or environment access file. Never call judge or POST endpoints.
- Fetch source data, then filter client-side. Some documented per-account endpoint families may be exposed as global collection endpoints instead; tolerate
not_found and use the collection endpoint.
- Return JSON only. Preserve the template shape exactly, omit no required keys, and use controlled enum strings exactly as shown.
- Round only at output boundaries: currency to 2 decimals, percentages to 1 decimal, risk scores/counts as integers, and churn probabilities to 3 decimals.
Source Mapping
- Accounts:
/api/accounts and /api/accounts/{account_id} for legal names, segment, region, lifecycle, tenure, and renewal date.
- Monthly metrics:
/api/accounts/{account_id}/metrics?start=YYYY-MM&end=YYYY-MM for recognized revenue, usage, seats, and metric context.
- Tickets:
/api/accounts/{account_id}/tickets?start=YYYY-MM-DD&end=YYYY-MM-DD.
- NPS:
/api/accounts/{account_id}/nps?start=YYYY-MM-DD&end=YYYY-MM-DD.
- Billing ARR:
/api/billing/snapshots?as_of=YYYY-MM-DD; filter posted snapshots by account and as-of date.
- Receivables:
/api/finance/ar-aging?as_of=YYYY-MM-DD.
- Opportunities:
/api/opportunities?start=YYYY-MM-DD&end=YYYY-MM-DD; filter by close date, state, account, region, or product line as requested.
- HR:
/api/hr/summary?quarter=YYYY-QN; sum regions unless the prompt narrows scope.
- Events:
/api/events/performance?event=<event_id>&quarter=YYYY-QN.
- Churn exports:
/exports/churn/train.csv, /exports/churn/validation.csv, /exports/churn/candidates.csv.
- Monthly extract:
/exports/account_metric_extract.csv can cross-check cleaned monthly counts, but prefer live API records when prompt requests reconciliation.
Common Definitions
- Clean ticket: exclude tickets where
is_duplicate or is_spam is true, and exclude status == "cancelled". Include open and closed tickets.
- Clean ticket count: count clean tickets in the requested date range. For monthly packets, bucket by
created_date month.
- SLA compliance percent: among clean tickets, percentage where both
first_response_sla_met and resolution_sla_met are true. If no clean tickets exist, use 100.0 unless the template or prompt implies null/zero.
- SLA degradation reason: any clean ticket in the analysis period missed first response or resolution SLA.
- NPS score: exclude retracted responses. Use the latest response by
response_date for latest-NPS fields; for monthly packets, use that month's latest non-retracted response or null.
- NPS drop reason: latest NPS is below 40, or the first-to-latest non-retracted score drop is at least 10 points.
- Current ARR: use the posted billing snapshot on the requested as-of date. This is the REV-4 billing ARR source; do not use account
crm_arr or account-level current ARR when a billing snapshot exists.
- Overdue balance:
61_90 + 90_plus from A/R aging. Use only these older aging buckets for overdue triggers and receivables followups.
- Clean billings reason: overdue balance is exactly zero.
- Renewal window reason: renewal date is on or after the assessment/as-of date and no more than 90 days later.
- Usage decline reason: latest analysis-period product usage is below 65.0. If a prompt explicitly asks for trend rather than risk reasons, compare first and last period values.
- Low tenure high churn reason: account tenure is 18 months or less, or churn CSV tenure is 18 or less.
- Expansion pipeline: sum open opportunities whose close dates fall inside the requested period. Expansion is an offset/context reason, not a receivables trigger.
Risk Queues
For renewal risk queues or retention boards, compute reason flags first, then score:
renewal_window: +20
overdue_receivable: +25
nps_drop: +15
sla_degradation: +15
usage_decline: +10
low_tenure_high_churn: +10
- Add +5 for
segment == "Strategic".
- Add +5 for
lifecycle_status == "renewal_risk".
- Cap
risk_score at 100.
Risk levels:
critical: score >= 70
high: score >= 50
medium: score >= 30
low: score < 30
Reason code ordering:
renewal_window, overdue_receivable, nps_drop, sla_degradation, usage_decline, low_tenure_high_churn, expansion_offset, clean_billings.
Use expansion_offset when open expansion pipeline exists and the output asks for expansion context or the account has meaningful open expansion against its ARR. Use clean_billings when overdue balance is zero and the template includes reason codes.
Primary action priority:
collections_followup when overdue_receivable is present.
renewal_save when low tenure or renewal timing is the dominant non-collections risk.
technical_recovery when SLA, NPS, or usage health is the dominant risk.
nurture_monitor for low-risk monitoring when the enum supports it.
no_action for low-risk board rows when the enum supports it and the prompt asks for an action board.
Queue ordering:
- For "top N ranked accounts", sort by
risk_score descending, then current ARR descending, then account_id.
- For a standard retention action board, sort by risk level severity, then current ARR descending within each level. Include all requested accounts unless the prompt asks for a top N subset.
Portfolio/segment summaries:
critical_or_high_count: count rows with risk level critical or high.
- Risk queue
arr_at_risk: sum current ARR for critical and high rows.
- Action board
arr_at_risk: sum current ARR for all non-low rows.
collections_count: count rows whose primary action is collections_followup.
technical_recovery_count: count rows whose primary action is technical_recovery.
open_expansion_pipeline: sum open expansion pipeline for all included board accounts.
net_revenue_exposure: arr_at_risk - open_expansion_pipeline.
Risk policy codes:
risk_model_code: RS-6
arr_source_code: REV-4
support_hygiene_code: SUP-8
action_priority_code: ACT-5
- Board-specific:
board_sort_code = BORD-4, exposure_formula_code = EXP-6, calendar_policy_code = CAL-5
QBR Metric Packets
For each requested month:
revenue: monthly recognized_revenue from account metrics.
support_tickets: clean tickets created in that month.
sla_compliance_pct: clean-ticket SLA compliance for that month.
nps_score: latest non-retracted NPS response in that month, or null.
Highlights:
- Average revenue is the arithmetic mean of monthly revenue.
- Peak revenue/NPS/SLA months use the earliest month on ties.
ticket_trend is improving if final-month clean ticket count is lower than first-month count, worsening if higher, else flat.
Metric source enums:
- revenue:
crm_closed_won
- support_tickets:
support_export
- sla_compliance:
sla_report
- nps:
nps_survey
Review plan and agenda:
- Default
review_owner to customer_success.
- Set
needs_technical_signoff true only when sustained technical health is poor, such as average SLA below 90.0 or repeated severe SLA misses.
- Use four agenda topics. A reliable order is
partnership_overview, metrics topic for the period, one focus topic (technical_recovery if ticket/SLA health needs discussion, commercial_expansion if expansion dominates, otherwise performance_highlights), then next-period initiatives.
Receivables And Pipeline Reviews
Receivable trigger:
- Include A/R rows whose
61_90 + 90_plus is greater than zero.
overdue_total is the sum of those older buckets only.
- Match A/R customer names to CRM accounts by exact
legal_name; do not link aliases, subsidiaries, similarly named noise records, or fuzzy matches.
link_status is linked only on exact legal-name match; otherwise unlinked and account_id: null.
- Sort
overdue_followups by customer_name ascending.
- Use
collections_followup for receivables followup actions.
Pipeline summary:
- Filter opportunities by requested close-date window and requested region scope.
won_count/won_revenue: closed opportunities with stage == "Closed Won".
lost_count: closed opportunities with stage == "Closed Lost".
open_count/open_pipeline: opportunities with state == "open".
win_rate_pct: won_count / (won_count + lost_count) * 100.
top_open_product_line: product line with the largest summed open amount; break ties alphabetically.
Ops context:
- Sum HR
headcount and unpaid_claims_amount across requested regions.
- Use event
event_orders and event_revenue directly for the requested event/quarter.
Receivables policy codes:
receivable_trigger_code: RCP-7
crm_match_code: CM-5
pipeline_window_code: PW-6
followup_scope_code: FS-4
Churn Validation And Candidate Ranking
Use the churn CSV exports as a modeling task, not as account operational metrics.
Validation fields:
training_rows: count rows in train.csv.
validation_rows: count rows in validation.csv.
feature_count: count input columns excluding customer_id and Churn.
accuracy_pct: train a binary churn classifier on train.csv, predict validation.csv, and compute accuracy at threshold 0.5.
accuracy_band: below_70, 70_to_79, 80_to_89, or 90_plus.
tenure_coefficient_direction: direction of the fitted tenure coefficient.
Modeling procedure:
- Treat
Churn == "Yes" as 1 and "No" as 0.
- Use all 19 features. Standardize numeric features and one-hot encode categoricals.
- Prefer deterministic logistic regression with L2 regularization and a fixed solver. If no ML library exists, implement ridge logistic regression with Newton or batch gradient descent in standard Python.
- Rank only the candidate IDs requested in the prompt by unrounded predicted probability, then output the top N requested by the template/prompt.
- Round displayed
predicted_churn_probability to 3 decimals after sorting.
Churn cohort checks:
past_due_shortlist_count: top-ranked output rows whose candidate CSV InvoicePastDue is Yes.
low_tenure_shortlist_count: top-ranked output rows whose tenure is 18 or less.
average_probability_top5: arithmetic mean of displayed or equivalently rounded top-5 probabilities, to 3 decimals.
Outreach mapping:
- Invoice past due or operational overdue evidence:
collections_followup, reason overdue_receivable.
- Tenure <= 18 or month-to-month high-risk profile:
renewal_save, reason low_tenure_high_churn.
- SLA/support/usage technical weakness:
technical_recovery, reason sla_degradation, nps_drop, or usage_decline, whichever is strongest.
- Otherwise:
nurture_monitor, reason clean_billings.
Churn policy codes:
model_protocol_code: MOD-7
probability_scale_code: PRB-4
deployment_rule_code: DEP-5
outreach_mapping_code: OUT-2
1---2name: apexcloud-retention-ops-163description: Solve ApexCloud Retention Operations API tasks that ask for customer success, renewal risk, QBR metrics, receivables, pipeline, event/HR context, or churn-ranking JSON outputs. Use when a prompt references the ApexCloud Retention Operations API, account metrics, tickets, NPS, billing snapshots, A/R aging, opportunities, HR summaries, event performance, churn CSV exports, or controlled retention policy/action codes.4metadata:5 source: https://skillmd.com/skills/prism-shadow/apexcloud-retention-ops-166---78# ApexCloud Retention Ops910Use this skill to produce deterministic JSON answers from the ApexCloud Retention Operations API.1112## Operating Rules13141. Read the task prompt and `input/payloads/answer_template.json` first. The template is authoritative for keys, enum vocabulary, nullability, and top-level objects.152. Replace `<TASK_ENV_BASE_URL>` with the base URL supplied by the task environment. Use only public GET endpoints mentioned by the prompt or environment access file. Never call judge or POST endpoints.163. Fetch source data, then filter client-side. Some documented per-account endpoint families may be exposed as global collection endpoints instead; tolerate `not_found` and use the collection endpoint.174. Return JSON only. Preserve the template shape exactly, omit no required keys, and use controlled enum strings exactly as shown.185. Round only at output boundaries: currency to 2 decimals, percentages to 1 decimal, risk scores/counts as integers, and churn probabilities to 3 decimals.1920## Source Mapping2122- Accounts: `/api/accounts` and `/api/accounts/{account_id}` for legal names, segment, region, lifecycle, tenure, and renewal date.23- Monthly metrics: `/api/accounts/{account_id}/metrics?start=YYYY-MM&end=YYYY-MM` for recognized revenue, usage, seats, and metric context.24- Tickets: `/api/accounts/{account_id}/tickets?start=YYYY-MM-DD&end=YYYY-MM-DD`.25- NPS: `/api/accounts/{account_id}/nps?start=YYYY-MM-DD&end=YYYY-MM-DD`.26- Billing ARR: `/api/billing/snapshots?as_of=YYYY-MM-DD`; filter posted snapshots by account and as-of date.27- Receivables: `/api/finance/ar-aging?as_of=YYYY-MM-DD`.28- Opportunities: `/api/opportunities?start=YYYY-MM-DD&end=YYYY-MM-DD`; filter by close date, state, account, region, or product line as requested.29- HR: `/api/hr/summary?quarter=YYYY-QN`; sum regions unless the prompt narrows scope.30- Events: `/api/events/performance?event=<event_id>&quarter=YYYY-QN`.31- Churn exports: `/exports/churn/train.csv`, `/exports/churn/validation.csv`, `/exports/churn/candidates.csv`.32- Monthly extract: `/exports/account_metric_extract.csv` can cross-check cleaned monthly counts, but prefer live API records when prompt requests reconciliation.3334## Common Definitions3536- Clean ticket: exclude tickets where `is_duplicate` or `is_spam` is true, and exclude `status == "cancelled"`. Include open and closed tickets.37- Clean ticket count: count clean tickets in the requested date range. For monthly packets, bucket by `created_date` month.38- SLA compliance percent: among clean tickets, percentage where both `first_response_sla_met` and `resolution_sla_met` are true. If no clean tickets exist, use `100.0` unless the template or prompt implies null/zero.39- SLA degradation reason: any clean ticket in the analysis period missed first response or resolution SLA.40- NPS score: exclude retracted responses. Use the latest response by `response_date` for latest-NPS fields; for monthly packets, use that month's latest non-retracted response or `null`.41- NPS drop reason: latest NPS is below 40, or the first-to-latest non-retracted score drop is at least 10 points.42- Current ARR: use the posted billing snapshot on the requested as-of date. This is the REV-4 billing ARR source; do not use account `crm_arr` or account-level current ARR when a billing snapshot exists.43- Overdue balance: `61_90 + 90_plus` from A/R aging. Use only these older aging buckets for overdue triggers and receivables followups.44- Clean billings reason: overdue balance is exactly zero.45- Renewal window reason: renewal date is on or after the assessment/as-of date and no more than 90 days later.46- Usage decline reason: latest analysis-period product usage is below 65.0. If a prompt explicitly asks for trend rather than risk reasons, compare first and last period values.47- Low tenure high churn reason: account tenure is 18 months or less, or churn CSV tenure is 18 or less.48- Expansion pipeline: sum open opportunities whose close dates fall inside the requested period. Expansion is an offset/context reason, not a receivables trigger.4950## Risk Queues5152For renewal risk queues or retention boards, compute reason flags first, then score:5354- `renewal_window`: +2055- `overdue_receivable`: +2556- `nps_drop`: +1557- `sla_degradation`: +1558- `usage_decline`: +1059- `low_tenure_high_churn`: +1060- Add +5 for `segment == "Strategic"`.61- Add +5 for `lifecycle_status == "renewal_risk"`.62- Cap `risk_score` at 100.6364Risk levels:6566- `critical`: score >= 7067- `high`: score >= 5068- `medium`: score >= 3069- `low`: score < 307071Reason code ordering:7273`renewal_window`, `overdue_receivable`, `nps_drop`, `sla_degradation`, `usage_decline`, `low_tenure_high_churn`, `expansion_offset`, `clean_billings`.7475Use `expansion_offset` when open expansion pipeline exists and the output asks for expansion context or the account has meaningful open expansion against its ARR. Use `clean_billings` when overdue balance is zero and the template includes reason codes.7677Primary action priority:78791. `collections_followup` when `overdue_receivable` is present.802. `renewal_save` when low tenure or renewal timing is the dominant non-collections risk.813. `technical_recovery` when SLA, NPS, or usage health is the dominant risk.824. `nurture_monitor` for low-risk monitoring when the enum supports it.835. `no_action` for low-risk board rows when the enum supports it and the prompt asks for an action board.8485Queue ordering:8687- For "top N ranked accounts", sort by `risk_score` descending, then current ARR descending, then `account_id`.88- For a standard retention action board, sort by risk level severity, then current ARR descending within each level. Include all requested accounts unless the prompt asks for a top N subset.8990Portfolio/segment summaries:9192- `critical_or_high_count`: count rows with risk level `critical` or `high`.93- Risk queue `arr_at_risk`: sum current ARR for `critical` and `high` rows.94- Action board `arr_at_risk`: sum current ARR for all non-low rows.95- `collections_count`: count rows whose primary action is `collections_followup`.96- `technical_recovery_count`: count rows whose primary action is `technical_recovery`.97- `open_expansion_pipeline`: sum open expansion pipeline for all included board accounts.98- `net_revenue_exposure`: `arr_at_risk - open_expansion_pipeline`.99100Risk policy codes:101102- `risk_model_code`: `RS-6`103- `arr_source_code`: `REV-4`104- `support_hygiene_code`: `SUP-8`105- `action_priority_code`: `ACT-5`106- Board-specific: `board_sort_code` = `BORD-4`, `exposure_formula_code` = `EXP-6`, `calendar_policy_code` = `CAL-5`107108## QBR Metric Packets109110For each requested month:111112- `revenue`: monthly `recognized_revenue` from account metrics.113- `support_tickets`: clean tickets created in that month.114- `sla_compliance_pct`: clean-ticket SLA compliance for that month.115- `nps_score`: latest non-retracted NPS response in that month, or `null`.116117Highlights:118119- Average revenue is the arithmetic mean of monthly revenue.120- Peak revenue/NPS/SLA months use the earliest month on ties.121- `ticket_trend` is `improving` if final-month clean ticket count is lower than first-month count, `worsening` if higher, else `flat`.122123Metric source enums:124125- revenue: `crm_closed_won`126- support_tickets: `support_export`127- sla_compliance: `sla_report`128- nps: `nps_survey`129130Review plan and agenda:131132- Default `review_owner` to `customer_success`.133- Set `needs_technical_signoff` true only when sustained technical health is poor, such as average SLA below 90.0 or repeated severe SLA misses.134- Use four agenda topics. A reliable order is `partnership_overview`, metrics topic for the period, one focus topic (`technical_recovery` if ticket/SLA health needs discussion, `commercial_expansion` if expansion dominates, otherwise `performance_highlights`), then next-period initiatives.135136## Receivables And Pipeline Reviews137138Receivable trigger:139140- Include A/R rows whose `61_90 + 90_plus` is greater than zero.141- `overdue_total` is the sum of those older buckets only.142- Match A/R customer names to CRM accounts by exact `legal_name`; do not link aliases, subsidiaries, similarly named noise records, or fuzzy matches.143- `link_status` is `linked` only on exact legal-name match; otherwise `unlinked` and `account_id: null`.144- Sort `overdue_followups` by `customer_name` ascending.145- Use `collections_followup` for receivables followup actions.146147Pipeline summary:148149- Filter opportunities by requested close-date window and requested region scope.150- `won_count`/`won_revenue`: closed opportunities with `stage == "Closed Won"`.151- `lost_count`: closed opportunities with `stage == "Closed Lost"`.152- `open_count`/`open_pipeline`: opportunities with `state == "open"`.153- `win_rate_pct`: `won_count / (won_count + lost_count) * 100`.154- `top_open_product_line`: product line with the largest summed open amount; break ties alphabetically.155156Ops context:157158- Sum HR `headcount` and `unpaid_claims_amount` across requested regions.159- Use event `event_orders` and `event_revenue` directly for the requested event/quarter.160161Receivables policy codes:162163- `receivable_trigger_code`: `RCP-7`164- `crm_match_code`: `CM-5`165- `pipeline_window_code`: `PW-6`166- `followup_scope_code`: `FS-4`167168## Churn Validation And Candidate Ranking169170Use the churn CSV exports as a modeling task, not as account operational metrics.171172Validation fields:173174- `training_rows`: count rows in `train.csv`.175- `validation_rows`: count rows in `validation.csv`.176- `feature_count`: count input columns excluding `customer_id` and `Churn`.177- `accuracy_pct`: train a binary churn classifier on `train.csv`, predict `validation.csv`, and compute accuracy at threshold 0.5.178- `accuracy_band`: `below_70`, `70_to_79`, `80_to_89`, or `90_plus`.179- `tenure_coefficient_direction`: direction of the fitted tenure coefficient.180181Modeling procedure:1821831. Treat `Churn == "Yes"` as 1 and `"No"` as 0.1842. Use all 19 features. Standardize numeric features and one-hot encode categoricals.1853. Prefer deterministic logistic regression with L2 regularization and a fixed solver. If no ML library exists, implement ridge logistic regression with Newton or batch gradient descent in standard Python.1864. Rank only the candidate IDs requested in the prompt by unrounded predicted probability, then output the top N requested by the template/prompt.1875. Round displayed `predicted_churn_probability` to 3 decimals after sorting.188189Churn cohort checks:190191- `past_due_shortlist_count`: top-ranked output rows whose candidate CSV `InvoicePastDue` is `Yes`.192- `low_tenure_shortlist_count`: top-ranked output rows whose tenure is 18 or less.193- `average_probability_top5`: arithmetic mean of displayed or equivalently rounded top-5 probabilities, to 3 decimals.194195Outreach mapping:196197- Invoice past due or operational overdue evidence: `collections_followup`, reason `overdue_receivable`.198- Tenure <= 18 or month-to-month high-risk profile: `renewal_save`, reason `low_tenure_high_churn`.199- SLA/support/usage technical weakness: `technical_recovery`, reason `sla_degradation`, `nps_drop`, or `usage_decline`, whichever is strongest.200- Otherwise: `nurture_monitor`, reason `clean_billings`.201202Churn policy codes:203204- `model_protocol_code`: `MOD-7`205- `probability_scale_code`: `PRB-4`206- `deployment_rule_code`: `DEP-5`207- `outreach_mapping_code`: `OUT-2`