技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
Highest_Cost_Scenario_Identification【数据与研究】Identifies the highest-cost scenario in payment processing fee analysis for the dabstep dataset. Use this skill when asked to find the most expensive MCC (Merchant Category Code) for a given transaction amount, or the most expensive ACI (Authorization Characteristics Indicator) for a given card scheme and transaction amount. Triggers on questions lik…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
The dabstep dataset models payment processing fees with these key files:
fees.json: 1000 fee rules, each specifying conditions and fee parametersmerchant_category_codes.csv: MCC descriptions (not exhaustive — fee rules may reference MCCs not in this file)manual.md: Domain definitions including ACI codes (A–G) and fee formulaFee formula: fee = fixed_amount + rate * transaction_amount / 10000
"What is the most expensive MCC for a transaction of X euros, in general?"
Find which MCC(s) can incur the highest fee across all fee rules.
import json
with open('fees.json') as f:
fees = json.load(f)
amount = 50 # transaction amount in euros
mcc_max_fee = {}
for rule in fees:
mcc_list = rule['merchant_category_code']
if not mcc_list: # empty list means rule applies to all MCCs, skip for MCC ranking
continue
fee = rule['fixed_amount'] + rule['rate'] * amount / 10000
for mcc in mcc_list:
mcc_max_fee[mcc] = max(mcc_max_fee.get(mcc, 0), fee)
max_fee = max(mcc_max_fee.values())
result_mccs = sorted([mcc for mcc, f in mcc_max_fee.items() if f == max_fee])
# Output as comma-separated sorted list
print(', '.join(str(m) for m in result_mccs))
Critical: Do NOT filter MCCs against merchant_category_codes.csv. Some MCCs in fee rules (e.g., 3003, 7231) are absent from the description file but are valid and must be included in results.
"For a credit transaction of X euros on [CardScheme], what would be the most expensive ACI?"
Find which ACI letter leads to the highest possible fee for the specified card scheme and credit type. Only filter by the explicitly given conditions (card_scheme, is_credit); take the maximum fee across all other conditions.
import json
with open('fees.json') as f:
fees = json.load(f)
card_scheme = 'GlobalCard' # exact match required
is_credit = True # set False for debit
amount = 1 # transaction amount in euros
ALL_ACIS = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
aci_max_fee = {}
for rule in fees:
# Filter by card scheme
if rule['card_scheme'] != card_scheme:
continue
# Filter by credit status: null means applies to both credit and debit
if rule['is_credit'] is not None and rule['is_credit'] != is_credit:
continue
fee = rule['fixed_amount'] + rule['rate'] * amount / 10000
# Empty aci list means rule applies to ALL ACI values
acis = rule['aci'] if rule['aci'] else ALL_ACIS
for aci in acis:
aci_max_fee[aci] = max(aci_max_fee.get(aci, 0), fee)
max_fee = max(aci_max_fee.values())
best_acis = sorted([a for a, f in aci_max_fee.items() if f == max_fee])
result = [best_acis[0]] # wrap in list — required output format
print(result) # prints e.g. ['C']
The final <answer> must look like: <answer>['C']</answer> — a Python list containing the single ACI letter.
| Field | Null/Empty means |
|---|---|
is_credit: null | Applies to both credit and debit |
aci: [] | Applies to all ACI values (A–G) |
merchant_category_code: [] | Applies to all MCCs (skip for MCC ranking) |
account_type: [] | Applies to all account types |
| Other null fields | Apply to all values of that field |
C, B, etc.) wrapped in a list (['C']), never a fee value like 0.23 or 0.1494. The example <answer>0.23</answer> in task instructions is a generic format example only.['C'] not just C, even if the question says "Answer must be just one letter". The question also says "Provide the response in a list even if there is only one value" — the list format takes precedence.fees.json directly.is_credit: null apply to credit transactions and must be included.aci list in a rule means it covers ALL ACIs; don't skip these rules."Most expensive in general" means the worst-case maximum fee across all possible rule configurations. Only apply the filters explicitly given in the question (card_scheme, is_credit, transaction amount). All other rule fields (capture_delay, monthly_fraud_level, monthly_volume, etc.) are ignored — take the maximum fee achievable under any applicable rule.
When multiple ACIs or MCCs share the same maximum fee, return the one with the lowest alphabetical/numerical order. For ACI questions, sort the tied ACIs alphabetically and take the first: sorted(tied_list)[0].
3000, 3001, 3002['C'] — the answer is the LETTER, not the fee amountACI answer examples:
<answer>['C']</answer> ✓<answer>['B']</answer> ✓<answer>C</answer> ✗ (missing list)<answer>0.23</answer> ✗ (fee value, not letter)| ACI | Description |
|---|---|
| A | Card Present - Non-authenticated |
| B | Card Present - Authenticated |
| C | Tokenized card with mobile device |
| D | Card Not Present - Card On File |
| E | Card Not Present - Recurring Bill Payment |
| F | Card Not Present - 3-D Secure |
| G | Card Not Present - Non-3-D Secure |
GlobalCard, NexPay, SwiftCharge, TransactPlus