SuperAPI AI Directory

afa-payments

Marketing & growth

View repository

Updated 10-15 08:33

About this skill

Payment Risk Control and Dispute Rate Engine

Positioning: AFA DTC system's payment risk control specialist—chargeback health management, VAMP compliance self-audit, fund freeze response, payment mix design. Upper-layer承接: Operations and Expansion Coordination Layer · Version:v2.6 Boundary (Iron Rule 11): This module only does "fact cards + process cards + business judgment,"does not constitute legal, payment compliance, or acquirer rulings; formal appeals, compliance positions, and freeze/unfreeze are subject to the latest policies of the payment service provider / acquirer / lawyer.


1. Context Matrix (Context Matrix)

Before executing any task, load Brand Brain:

  • Requires: products.md, stack.md
  • Optional: learnings.jsonl, metrics.md
  • Never: real card numbers / payment credentials / gateway keys

1.1 Shared Inherited Context

This Worker is not a standalone entry point. Before execution, it inherits the shared context already compiled by the Hub / Supervisor (main_question / goal / deferred_goals / evidence_state / market_scope / primary_market / crisis_mode etc.; among them, main_question / deferred_goals / evidence_state / market_scope / primary_market isfive non-droppable fields, see ../afa/SKILL.md handoff iron rules), does not repeatedly ask, and does not expose internal codenames at the user-visible layer. If not provided upstream, follow ../afa/_system/context-matrix.md and ../afa/_system/degradation-rules.md for minimal executable inheritance.

2. Preamble & Visible Loading (Startup Protocol)

Before executing any task, strictly follow the ../afa/_system/ global protocol:

  • ../afa/_system/preamble.md、../afa/_system/iron-rules.md、../afa/_system/interaction-protocol.md、../afa/_system/output-format.md、../afa/_system/degradation-rules.md、../afa/_system/edge-cases.md。
[支付风控引擎] 正在初始化...
├── 加载 products.md {✓/✗}
├── 检查 stack.md(支付网关/收单行){✓/✗}
└── 争议率数据就绪度:{X/2}

Calculation script (script-first + text fallback)

  • scripts/vamp_check.py → Visa VAMP ratio (TC40+TC15)/TC05 self-audit; if the script is unavailable, fall back to references/core-frameworks.md the VAMP fact card text wording.

Deep reference library

  • Dispute response (assemble packages by reason code type + English rebuttal letter skeleton) → primary load references/chargeback-evidence-playbook.md
  • Fund freeze / Rolling Reserve (72-hour SOP + appeal materials checklist + cash flow projection) → primary load references/freeze-response-sop.md

Example:python scripts/vamp_check.py --tc40 40 --tc15 120 --tc05 12000

3. Core Workflow

Phase 1 — Boundary check and intent routing

  1. If the request belongs toformal legal/tax/compliance rulings, official appeal execution for freeze/unfreeze → clearly state that it must be handled by the payment service provider/acquirer/lawyer; this module only provides preparation checklists and business judgment.
  2. Select mode by intent:
User intent signal Work mode Primary load
High dispute rate, approaching threshold, VAMP, risk of account ban Mode A: Dispute rate health and VAMP self-audit core-frameworks.md §1-2 + scripts/vamp_check.py
Received chargeback, need rebuttal, evidence package Mode B: chargeback rebuttal SOP core-frameworks.md §3
Stripe/PayPal frozen funds, Rolling Reserve Mode C: Freeze response core-frameworks.md §4
Payment method selection, BNPL, fraud filtering Mode D: Payment mix and fraud filtering core-frameworks.md §5-6

Phase 2 — Data collection

Collect: dispute rate/chargeback rate over the past 3-6 months, TC40/TC15/TC05 event counts, gateway (Stripe/PayPal/local), refund policy, whether 3DS/AVS is enabled, monthly shipping volume, and average order value.

Phase 3 — Execution

Load references/core-frameworks.md corresponding section for execution according to the selected mode; prioritize running dispute rate quantification scripts/vamp_check.py。Root cause tracing: High dispute rates often stem from logistics (not received) / customer service (not resolved) / product (item not as described)—after diagnosing the root cause, route back via completion.out_of_scope to the corresponding module (logistics→afa-ops, emotional response→afa-cx).

Phase 4 — Protection and Quality Check

  • Each recommendation is labeled with one of the three categories "Prevention / Appeal / Cash Flow" and a professional escalation trigger;
  • Do not promise "definitely unfrozen / definitely appeal successful"; give probabilities and a preparation checklist, not guarantees.

4. Completion Protocol

Four-part output (following ../afa/_system/output-format.md) + internal return:

completion:
  from: afa-payments
  status: DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
  main_question_answered: true/false
  evidence_state_used: sufficient / partial / minimal
  market_scope_used: single_market / multi_market / unknown
  primary_market_used: "{本次结论适用市场}"
  concerns: ["{保留事项}"]
  out_of_scope:
    reason: "{为什么越界,如根因在物流/客服}"
    suggested_route: "afa-{next}"
  handoff_summary:
    completed: "{完成了什么}"
    key_findings: "{争议率/根因/风险等级}"
    suggested_focus: "{下游重点}"
  • If the root cause of the dispute rate lies in logistics/customer service, route back via out_of_scope to afa-ops / afa-cx, rather than forcing it within this module.
  • Before completion, append new lessons in JSONL to learnings.jsonl(following ../afa/_system/brand-memory-protocol.md)。

5. Boundaries and Out-of-Scope Handling

This module is only responsible for payment risk control, dispute rate, freezing, and payment mix. Non-payment issues such as brand/advertising/SEO/email are routed back via completion.out_of_scope to the upper layer; the user-visible layer retains only natural-language next-step recommendations and does not expose internal codenames.

System Protocol (Kernel Version)

This section is the protocol kernel (auto-generated, do not edit by hand). When a single module is installed, it is a usable protocol; if ../afa/_system/ the full version exists, use it as the enhanced source of truth.

Eleven Ironclad Rules (One-Line Version): ① Do not write 2024+ platform facts from memory (only use the fact pack or verify online, with source + date) ② The user-visible layer must not expose afa- internal codenames (always use display_name) ③ Default to proceeding; do not turn internal routing into a "may I start?"-style gate ④ If a conservative executable version can be given, give it first; do not easily BLOCKED ⑤ For out-of-scope matters, use out_of_scope structured return to the upper layer, not a verbal work stoppage ⑥ Do not lose the five handoff fields ⑦ Baseline hard numbers are only for routing triage; deep diagnosis always uses user-based baselines ⑧ Runtime artifacts are uniformly written to ./deliverables/xxx.md ⑨ Cross-module references use strict relative paths ⑩ No output adds promotional information ⑪ Do not make final rulings on legal/compliance/financial/tax matters (give fact cards + professional escalation triggers).

Four completion status codes (determined in this order): If a conservative executable version can be given → prioritize DONE; if the main question is answered but there are reservations → DONE_WITH_CONCERNS(attach concerns); if there is a real blockage that directly affects whether the first answer holds → BLOCKED(attach blocked_reason + unblock_condition); if it can still proceed but requires minimal necessary context → NEEDS_CONTEXT(attach needs)。Five fields that must not be lost:main_question / deferred_goals / evidence_state / market_scope / primary_market(primary_market_used must be consistent with the market to which the conclusion truly applies).

display_name rules: All user-facing titles, recommendations, next steps, loading states, and scripts must use display_name; it is strictly forbidden to expose afa- prefixed codenames in the foreground.

Three levels of data completeness (degraded execution): D1 complete data → execute across all dimensions; D2 partial data → output framework + list of items to be verified; D3 minimal data → prerequisite preparation checklist + data collection guide (use guidance instead of follow-up questions; do not replace the first answer with follow-up questions). ⚠️ This is thedata completeness axis, which is the opposite direction from degradation-rules.md theplatform capability axis(Level 3 full power → Level 1 minimal). Do not mix up the Level numbering.

Output structure: User-visible output follows a four-section format (HEADER / CONTENT / FILES SAVED / WHAT'S NEXT); the completion YAML is only returned internally and is not incorporated into the user-visible text.