Token导航 LogoToken导航

Agent Skill · 研究检索

polar-billing(极地计费)

polar-billing 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

polar-billing 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 68,166。

总安装 235周安装 10GitHub Stars 653下载 82核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:polar-billing(极地计费)
来源仓库:https://github.com/fcakyon/claude-codex-settings
仓库路径:skills/polar-billing
安装命令:
npx skills add https://github.com/fcakyon/claude-codex-settings --skill polar-billing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/fcakyon/claude-codex-settings --skill polar-billing

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息。polar-billing 属于研究检索类 Skill,可作为该场景下的辅助能力补充。适合根据关键词或任务场景快速定位候选结果。可结合来源仓库和原始 README 核验具体用法。安装前建议确认权限范围和维护状态。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。注意是否会触发联网或文件读写操作。

来源仓库内路径:skills/polar-billing

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/fcakyon/claude-codex-settings --skill polar-bi…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

polar-billing 怎么安装?

在终端执行 npx skills add https://github.com/fcakyon/claude-codex-settings --skill polar-billing。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

polar-billing 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

polar-billing 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

polar-billing 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

polar-billing 用的人多吗?

公开数据是累计安装 235 次,近一周安装 10 次,下载 82 次,GitHub 653 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

polar-billing 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
polar-billing

极地计费 · 本页

235653只读未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Polar Billing System

Comprehensive guide to Polar's billing infrastructure, covering entities, flows, Stripe integration, and benefit provisioning.

Quick Reference

Checkout → Payment → Order → Transaction → Benefits
                         ↓
                   Subscription (if recurring)
                         ↓
                   Subscription Cycle → Order → ...

Table of Contents

  1. Core Entities
  2. Entity Relationships
  3. Main Services
  4. Dramatiq Background Tasks
  5. Stripe Integration
  6. Subscription Lifecycle
  7. Proration System
  8. Benefits & Credits
  9. Dunning & Payment Retry
  10. Transaction Ledger
  11. Key File Locations

1. Core Entities

Checkout

File: server/polar/models/checkout.py

Shopping cart/payment session before order confirmation.

FieldTypeDescription
statusCheckoutStatusopen, expired, confirmed, succeeded, failed
payment_processorPaymentProcessorstripe, manual
client_secretstrUnique identifier for frontend
amount, currencyint, strPrice in cents
tax_amount, discount_amountintCalculated amounts
allow_trial, trial_endbool, datetimeTrial configuration
seatsintFor seat-based products

Relationships: organization, customer, product, product_price, discount, subscription (for upgrades)


Order

File: server/polar/models/order.py

Represents a billing event (one-time purchase or subscription cycle).

FieldTypeDescription
statusOrderStatuspending, paid, refunded, partially_refunded
billing_reasonOrderBillingReasonpurchase, subscription_create, subscription_cycle, subscription_update
subtotal_amountintAmount before discount/tax
discount_amountintDiscount applied
tax_amountintTax collected
applied_balance_amountintAccount balance applied
platform_fee_amountintPolar's fee
refunded_amountintAlready refunded
next_payment_attempt_atdatetimeDunning retry time

Computed Properties:

  • net_amount = subtotal - discount
  • total_amount = net + tax
  • due_amount = max(0, total + applied_balance)
  • payout_amount = net - platform_fee - refunded

Subscription

File: server/polar/models/subscription.py

Recurring billing relationship.

FieldTypeDescription
statusSubscriptionStatusincomplete, trialing, active, past_due, canceled, unpaid
amount, currencyint, strSubscription price
recurring_intervalIntervalmonth, year
current_period_start/enddatetimeBilling period
trial_start/enddatetimeTrial period
cancel_at_period_endboolScheduled cancellation
canceled_at, ended_atdatetimeLifecycle timestamps
past_due_atdatetimeWhen payment failed
seatsintFor seat-based pricing

Relationships: customer, product, payment_method, discount, meters, grants (benefits)


Transaction

File: server/polar/models/transaction.py

All money flows in the system.

FieldTypeDescription
typeTransactionTypepayment, processor_fee, refund, dispute, balance, payout
processorProcessorstripe, manual
amount, currencyint, strTransaction amount
tax_amountintTax portion

Self-referential relationships: payment_transaction, balance_transactions, incurred_transactions


Payment

File: server/polar/models/payment.py

Individual payment transaction.

FieldTypeDescription
statusPaymentStatuspending, succeeded, failed
processor_idstrStripe charge ID
methodstrcard, bank_transfer, etc.
decline_reasonstrWhy payment failed
risk_level, risk_scorestr, intFraud assessment

Refund

File: server/polar/models/refund.py

FieldTypeDescription
statusRefundStatuspending, succeeded, failed, canceled
reasonRefundReasonduplicate, fraudulent, customer_request, etc.
amount, tax_amountintRefund amounts
revoke_benefitsboolWhether to revoke customer benefits

Customer

File: server/polar/models/customer.py

FieldTypeDescription
email, namestrContact info
stripe_customer_idstrStripe link
billing_addressAddressStored address
tax_idstrFor tax compliance

Product & ProductPrice

Files: server/polar/models/product.py, server/polar/models/product_price.py

ProductPrice TypesDescription
ProductPriceFixedFixed amount
ProductPriceCustomMerchant sets at checkout
ProductPriceFreeZero cost
ProductPriceMeteredUnitPay-per-unit
ProductPriceSeatUnitPer-seat with tiers

BillingEntry

File: server/polar/models/billing_entry.py

Audit log for billing calculations.

FieldTypeDescription
typeBillingEntryTypecycle, proration, metered, seats_increase, seats_decrease
directionDirectiondebit, credit
amountintEntry amount

2. Entity Relationships

Organization
├── Product
│   ├── ProductPrice (multiple per product)
│   └── ProductBenefit → Benefit
├── Customer
│   ├── Subscription → Product, Discount
│   │   ├── SubscriptionProductPrice
│   │   ├── SubscriptionMeter
│   │   └── BenefitGrant
│   ├── Order → Product, Subscription
│   │   └── OrderItem
│   ├── PaymentMethod
│   └── Wallet
├── Checkout → Customer, Product
├── Discount
│   └── DiscountRedemption
└── Account (for payouts)
    └── Payout → Transaction

Transaction (ledger)
├── payment → Order, Customer
├── refund → Refund, Order
├── dispute → Dispute, Order
├── processor_fee → parent payment
└── payout → Account

3. Main Services

SubscriptionService

File: server/polar/subscription/service.py

Core subscription operations:

# Creation
create_or_update_from_checkout(checkout, payment_method) → (Subscription, created)

# Updates
update_product(subscription, product_id, proration_behavior)
update_seats(subscription, seats, proration_behavior)
update_discount(subscription, discount_id)
update_trial(subscription, trial_end)

# Lifecycle
cycle(subscription)  # Period renewal
cancel(subscription)  # At period end
revoke(subscription)  # Immediately
uncancel(subscription)

# Benefits
enqueue_benefits_grants(task="grant"|"revoke", customer, product)

OrderService

File: server/polar/order/service.py

create_from_checkout(checkout)  # One-time purchase
create_subscription_order(subscription, billing_reason)  # Recurring
trigger_payment(order)  # Charge customer
create_order_balance(order)  # Ledger entries

CheckoutService

File: server/polar/checkout/service.py

create(product, customer_data, discount_code)
confirm(checkout)  # Lock checkout for payment
handle_stripe_success(checkout, charge)
handle_free_success(checkout)  # No payment needed

PaymentService

File: server/polar/payment/service.py

upsert_from_stripe_charge(charge, checkout, order)
handle_success(payment)  # Complete order
handle_failure(payment)  # Update order status

RefundService

File: server/polar/refund/service.py

create(order, amount, reason, revoke_benefits)
upsert_from_stripe(stripe_refund)

BenefitGrantService

File: server/polar/benefit/grant/service.py

enqueue_benefits_grants(task, customer, product, order=None, subscription=None)
grant_benefit(customer, benefit)
revoke_benefit(customer, benefit)

4. Dramatiq Background Tasks

Subscription Tasks

File: server/polar/subscription/tasks.py

TaskTriggerAction
subscription.cycleScheduler at period endRenew subscription, create order
subscription.update_product_benefits_grantsProduct benefits changedUpdate all grants
subscription.cancel_customerCustomer deletedCancel all subscriptions

Order Tasks

File: server/polar/order/tasks.py

TaskTriggerAction
order.create_subscription_orderSubscription cycleCreate billing order
order.trigger_paymentOrder readyCharge payment method
order.balancePayment successCreate ledger entries
order.invoiceOrder createdGenerate PDF invoice
order.process_dunningHourly cronFind orders for retry
order.process_dunning_orderIndividual retryRetry single payment

Stripe Webhook Tasks

File: server/polar/integrations/stripe/tasks.py

TaskStripe EventAction
charge.succeededPayment completeCreate order, provision benefits
charge.failedPayment failedMark order failed
charge.updatedCharge settledCreate ledger transaction
refund.created/updatedRefund processedUpdate refund record
charge.dispute.createdChargebackCreate dispute, revoke benefits
payout.paidPayout completeUpdate payout status

Benefit Tasks

File: server/polar/benefit/tasks.py

TaskTriggerAction
benefit.enqueue_benefits_grantsOrder/subscriptionQueue individual grants
benefit.grantIndividual benefitProvision access (GitHub, Discord, etc.)
benefit.revokeCancellation/refundRemove access
benefit.cycleSubscription renewalReset credits with rollover

Checkout Tasks

File: server/polar/checkout/tasks.py

TaskTriggerAction
checkout.handle_free_successFree productComplete without payment
checkout.expire_open_checkoutsEvery 15 minMark expired checkouts

Payout Tasks

File: server/polar/payout/tasks.py

TaskTriggerAction
payout.trigger_stripe_payoutsDaily 00:15 UTCInitiate pending payouts

5. Stripe Integration

Webhook Endpoints

File: server/polar/integrations/stripe/endpoints.py

  • /v1/integrations/stripe/webhook - Direct webhooks
  • /v1/integrations/stripe/webhook-connect - Connect account webhooks

Implemented Webhooks

Payment Flow:

  • payment_intent.succeeded - Payment complete
  • payment_intent.payment_failed - Payment failed
  • setup_intent.succeeded - Card saved
  • charge.pending/failed/succeeded/updated - Charge lifecycle

Refunds:

  • refund.created/updated/failed

Disputes:

  • charge.dispute.created/updated/closed

Connect:

  • account.updated - Account info changed
  • payout.updated/paid - Payout lifecycle

Webhook Processing Flow

Stripe POST → Verify signature → ExternalEvent.enqueue()
                                        ↓
                               Store in external_events table
                                        ↓
                               Enqueue Dramatiq task
                                        ↓
                               Worker processes async
                                        ↓
                               Mark handled_at on success

StripeService

File: server/polar/integrations/stripe/service.py

Key methods:

  • create_payment_intent(), create_setup_intent()
  • create_refund(), get_refund()
  • create_tax_calculation(), create_tax_transaction()
  • transfer(), create_payout()

6. Subscription Lifecycle

Creation Flow

1. Checkout created (status=open)
2. Customer completes payment
3. Stripe charge.succeeded webhook
4. payment.handle_success() called
5. checkout_service.handle_stripe_success()
6. subscription_service.create_or_update_from_checkout()
   - Creates Subscription (status=active or trialing)
   - Sets billing period
   - Applies discount
   - Resets meters
7. Enqueue benefit grants
8. Send confirmation email

Cycle Flow (Renewal)

1. APScheduler triggers at period end
2. subscription.cycle task runs
3. subscription_service.cycle()
   - Check cancel_at_period_end
   - If true: set status=canceled, revoke benefits
   - If false: advance period dates, check discount expiry
4. Create billing entry (type=cycle)
5. Enqueue order.create_subscription_order
6. Order created with billing_reason=subscription_cycle
7. Enqueue order.trigger_payment
8. Stripe charges payment method
9. charge.succeeded → ledger entries → benefits renewed

Cancellation Flow

At Period End:

subscription_service.cancel(subscription)
# Sets cancel_at_period_end=True, ends_at=current_period_end
# Benefits remain until period ends
# On next cycle: status=canceled, benefits revoked

Immediately:

subscription_service.revoke(subscription)
# Sets status=canceled, ended_at=now
# Benefits revoked immediately
# Seats canceled if seat-based

Trial Flow

1. Checkout with trial_end set
2. Subscription created with status=trialing
3. No payment during trial
4. At trial_end, cycle task runs
5. Status transitions to active
6. Order created with billing_reason=subscription_cycle_after_trial
7. First payment charged

7. Proration System

When Prorations Occur

  1. Product change - Upgrade/downgrade to different tier
  2. Seat change - Add/remove seats
  3. Interval change - Monthly to yearly

Proration Calculation

# Calculate time remaining in period
pct_remaining = (period_end - now) / (period_end - period_start)

# Old product credit (what they paid but won't use)
old_credit = old_price * old_pct_remaining

# New product debit (what they owe for remainder)
new_debit = new_price * new_pct_remaining

# Net proration
net = new_debit - old_credit

Proration Behaviors

BehaviorAction
prorateAdd to next invoice
invoiceCreate order immediately

BillingEntry for Prorations

# Credit entry (old product)
BillingEntry(
    type=BillingEntryType.proration,
    direction=BillingEntryDirection.credit,
    amount=prorated_old_amount
)

# Debit entry (new product)
BillingEntry(
    type=BillingEntryType.proration,
    direction=BillingEntryDirection.debit,
    amount=prorated_new_amount
)

Seat Proration

# Adding 2 seats at $10/seat with 50% time remaining
delta_amount = 2 * $10 * 0.5 = $10

BillingEntry(
    type=BillingEntryType.subscription_seats_increase,
    direction=BillingEntryDirection.debit,
    amount=1000  # cents
)

8. Benefits & Credits

Benefit Types

TypeDescriptionGrant Action
meter_creditUsage allowancesCreate meter_credited event
github_repositoryRepo accessAdd to GitHub team
discordServer roleAssign Discord role
license_keysLicense distributionGenerate key
downloadablesFile accessGrant download permission
customWebhook-basedCall external URL

Benefit Grant Flow

1. Order/Subscription created
2. enqueue_benefits_grants(task="grant")
3. For each benefit in product:
   - Skip if already granted
   - Enqueue benefit.grant task
4. benefit.grant task:
   - Get/create BenefitGrant record
   - Call strategy.grant() (type-specific)
   - Set granted_at
   - Store properties
   - Send webhook

Benefit Revocation Flow

1. Subscription canceled or order refunded
2. enqueue_benefits_grants(task="revoke")
3. For each granted benefit:
   - Enqueue benefit.revoke task
4. benefit.revoke task:
   - Call strategy.revoke() (type-specific)
   - Set revoked_at
   - Send webhook

Meter Credits

Grant:

# Create event with units
Event(type="meter_credited", units=100)
# Update CustomerMeter

Cycle (renewal):

# Calculate rollover
rollover = min(remaining_units, rollover_limit)
# Reset meter
Event(type="meter_reset")
# Credit new period + rollover
Event(type="meter_credited", units=base_units + rollover)

Revoke:

# Negative credit event
Event(type="meter_credited", units=-remaining_units)

Grace Period

Organizations can configure benefit_revocation_grace_period (days) to delay benefit revocation for past_due subscriptions.


9. Dunning & Payment Retry

Dunning Process

1. order.process_dunning runs hourly
2. Finds orders where next_payment_attempt_at <= now
3. For each order:
   - Enqueue order.process_dunning_order
4. process_dunning_order:
   - Get customer's payment method
   - Attempt payment via Stripe
   - On success: mark order paid
   - On failure: schedule next attempt

Retry Schedule

Configured in organization settings. Typical pattern:

  • Day 1: First failure
  • Day 3: Retry 1
  • Day 5: Retry 2
  • Day 7: Final retry, then mark unpaid

Subscription Status During Dunning

payment fails → status=past_due, past_due_at=now
               ↓
         benefits may continue (grace period)
               ↓
         retry succeeds → status=active
               ↓
         retry fails → status=unpaid, benefits revoked

10. Transaction Ledger

Transaction Types

TypeDescription
paymentCustomer payment received
processor_feeStripe fees
refundMoney returned to customer
refund_reversalRefund failed/reversed
disputeChargeback loss
dispute_reversalWon dispute
balanceInternal balance transfer
payoutMoney sent to creator

Creating Payment Transactions

1. charge.updated webhook (charge settled)
2. Get balance_transaction from Stripe
3. Extract settlement amount and fees
4. Create Transaction(type=payment)
5. Enqueue processor_fee.create_payment_fees
6. Create Transaction(type=processor_fee)

Payout Flow

1. Creator has balance from transactions
2. payout.trigger_stripe_payouts (daily)
3. Calculate available balance
4. Create Payout record
5. stripe_service.transfer() to Connect account
6. stripe_service.create_payout() to bank
7. payout.paid webhook → update status

11. Key File Locations

Models

server/polar/models/
├── checkout.py
├── order.py
├── order_item.py
├── subscription.py
├── subscription_product_price.py
├── transaction.py
├── payment.py
├── refund.py
├── dispute.py
├── payout.py
├── customer.py
├── product.py
├── product_price.py
├── discount.py
├── benefit.py
├── benefit_grant.py
└── billing_entry.py

Services

server/polar/
├── subscription/service.py
├── order/service.py
├── checkout/service.py
├── payment/service.py
├── refund/service.py
├── dispute/service.py
├── payout/service.py
├── benefit/
│   ├── service.py
│   ├── grant/service.py
│   └── strategies/
│       ├── meter_credit/service.py
│       ├── github_repository/service.py
│       ├── discord/service.py
│       └── ...
└── transaction/service/
    ├── payment.py
    ├── refund.py
    └── dispute.py

Background Tasks

server/polar/
├── subscription/tasks.py
├── order/tasks.py
├── checkout/tasks.py
├── benefit/tasks.py
├── payout/tasks.py
└── integrations/stripe/tasks.py

Stripe Integration

server/polar/integrations/stripe/
├── endpoints.py    # Webhook handlers
├── service.py      # Stripe API wrapper
├── tasks.py        # Webhook processing tasks
└── payment.py      # Payment resolution helpers

Common Debugging Scenarios

Payment Failed

  1. Check Payment record for decline_reason
  2. Check Order.status and next_payment_attempt_at
  3. Look at external_events for Stripe webhook

Benefits Not Granted

  1. Check BenefitGrant record for errors
  2. Look at benefit.grant task in Dramatiq logs
  3. Verify product has benefits attached

Proration Issues

  1. Check BillingEntry records for subscription
  2. Verify billing_reason on Order
  3. Check subscription's current_period dates

Subscription Not Cycling

  1. Check scheduler_locked_at on subscription
  2. Verify APScheduler is running
  3. Check subscription.cycle task logs

平台分布

Codex

35.97%
按下载量换算29

Claude

32.71%
按下载量换算27

Cursor

17.66%
按下载量换算14

Gemini CLI

9.06%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills