Agent skill

Polar Testing

by chmonitor in chmonitor/chmonitor

Guide for testing Polar payment integrations using the sandbox environment.

GPL-3.0Auto-check: warningsData & Analytics

Install Polar Testing

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add chmonitor/chmonitor --skill polar-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install chmonitor/chmonitor polar-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/chmonitor/chmonitor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/polar-testing .claude/skills/polar-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
polar-testing
GitHub stars
299
Token cost
~2.8k tokens
SKILL.md length
469 words
Files
1
Skills in repo
53
Repo updated
First seen
Licence
GPL-3.0

At a glance

Guide for testing Polar payment integrations using the sandbox environment.

  • Works in 4 steps: Go to https://sandbox.polar.sh/start → Create a new account (or use "Go to… → Create a test organization → …
  • Setting up the Polar sandbox for development
  • SKILL.md covers Sandbox Environment, Test Cards, Local Webhook Testing and Integration Testing, plus 4 more sections
  • Calls npm and ngrok; reaches sandbox.polar.sh and abc123.ngrok.io; needs POLAR_ACCESS_TOKEN and POLAR_WEBHOOK_SECRET

What it does

Polar Testing is an agent skill from chmonitor/chmonitor. Guide for testing Polar payment integrations using the sandbox environment. Use this skill when: (1) Setting up the Polar sandbox for development; (2) Testing checkout flows without real payments; (3) Using Stripe test cards with Polar; (4) Writing integration tests for payment flows; (5) Testing webhooks locally with ngrok; (6) Mocking Polar in unit tests; (7) Setting up CI/CD pipelines with Polar sandbox; (8) Debugging payment issues in sandbox.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering DataFrames, Webhooks and Unit testing. It works with Stripe. The repository describes itself as: Open-source operational advisor for ClickHouse — real-time monitoring plus AI-driven index/partition/materialized-view recommendations. The licence is GPL-3.0.

When your agent uses it

  • Setting up the Polar sandbox for development
  • Testing checkout flows without real payments
  • Using Stripe test cards with Polar
  • Writing integration tests for payment flows

Example prompts

  • “/polar-testing”

Requirements

  • Python 3
  • A credential in POLAR_ACCESS_TOKEN
  • A credential in POLAR_WEBHOOK_SECRET

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Go to https://sandbox.polar.sh/start
  2. Create a new account (or use "Go to sandbox" from org switcher)
  3. Create a test organization
  4. Generate an access token in Settings → Developers

What it can do on your machine

Read from SKILL.md and the folder at commit fc39ef0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • ngrok

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • sandbox.polar.sh
    • abc123.ngrok.io

    Also links to:

    • sandbox-api.polar.sh

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • POLAR_ACCESS_TOKEN
    • POLAR_WEBHOOK_SECRET
    • POLAR_SANDBOX_TOKEN
    • POLAR_SANDBOX_WEBHOOK_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Polar Testing loads about 2.8k tokens when it runs. Until then it costs about 116 tokens; SKILL.md has 469 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~116
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningMentions a paste, webhook or tunnelling service often used to send data outSKILL.md:110
    py the ngrok URL (e.g., `https://abc123.ngrok.io`) and configure it in Polar:
  • WarningMentions a paste, webhook or tunnelling service often used to send data outSKILL.md:113
    2. Add endpoint: `https://abc123.ngrok.io/api/webhooks/polar`
  • NoteMentions a .env fileSKILL.md:120
    # .env.local

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from chmonitor/chmonitor at commit fc39ef0, republished under its GPL-3.0 licence (© chmonitor). 469 words, ~2,751 tokens.

Download SKILL.mdSave it as .claude/skills/polar-testing/SKILL.md (or your agent's skills folder).
name
polar-testing
description
Guide for testing Polar payment integrations using the sandbox environment. Use this skill when: (1) Setting up the Polar sandbox for development; (2) Testing checkout flows without real payments; (3) Using Stripe test cards with Polar; (4) Writing integration tests for payment flows; (5) Testing webhooks locally with ngrok; (6) Mocking Polar in unit tests; (7) Setting up CI/CD pipelines with Polar sandbox; (8) Debugging payment issues in sandbox.

Polar Testing Guide

Test Polar integrations safely using the sandbox environment - a fully isolated server where you can experiment without affecting production data or processing real payments.

Sandbox Environment

Access

The sandbox is completely isolated from production. You need separate:

  • User account
  • Organization
  • Access tokens
  • Webhook endpoints
Setup Steps
  1. Go to https://sandbox.polar.sh/start
  2. Create a new account (or use "Go to sandbox" from org switcher)
  3. Create a test organization
  4. Generate an access token in Settings → Developers
SDK Configuration
typescript
// TypeScript
import { Polar } from "@polar-sh/sdk";

const polar = new Polar({
  accessToken: process.env.POLAR_ACCESS_TOKEN,
  server: "sandbox", // Switch to "production" for live
});
python
# Python
from polar_sdk import Polar

polar = Polar(
    access_token=os.environ["POLAR_ACCESS_TOKEN"],
    server="sandbox",
)
go
// Go
s := polargo.New(
    polargo.WithServer("sandbox"),
    polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
)
Sandbox Limitations
  • Subscriptions auto-cancel after 90 days
  • No real money is processed
  • Data is isolated from production

Test Cards

Polar uses Stripe for payment processing. Use these test card numbers:

Successful Payments
Card NumberBrandCVCExpiry
4242 4242 4242 4242VisaAny 3 digitsAny future date
5555 5555 5555 4444MastercardAny 3 digitsAny future date
3782 822463 10005AmexAny 4 digitsAny future date
6011 1111 1111 1117DiscoverAny 3 digitsAny future date
Declined Payments
Card NumberDecline Reason
4000 0000 0000 0002Generic decline
4000 0000 0000 9995Insufficient funds
4000 0000 0000 9987Lost card
4000 0000 0000 9979Stolen card
4000 0000 0000 0069Expired card
4000 0000 0000 0127Incorrect CVC
3D Secure Testing
Card NumberBehavior
4000 0027 6000 3184Requires 3DS authentication
4000 0000 0000 3220Requires 3DS authentication

Local Webhook Testing

Using ngrok
bash
# Start your app
npm run dev

# In another terminal, start ngrok
ngrok http 3000

Copy the ngrok URL (e.g., https://abc123.ngrok.io) and configure it in Polar:

  1. Go to sandbox.polar.sh → Settings → Webhooks
  2. Add endpoint: https://abc123.ngrok.io/api/webhooks/polar
  3. Select events to receive
  4. Copy the webhook secret
Environment Variables
bash
# .env.local
POLAR_ACCESS_TOKEN=pat_sandbox_xxx
POLAR_WEBHOOK_SECRET=whsec_sandbox_xxx
POLAR_SERVER=sandbox

Integration Testing

Test Checkout Flow
typescript
import { describe, it, expect, beforeAll } from "vitest";
import { Polar } from "@polar-sh/sdk";

describe("Polar Checkout", () => {
  const polar = new Polar({
    accessToken: process.env.POLAR_SANDBOX_TOKEN!,
    server: "sandbox",
  });

  let testProductId: string;

  beforeAll(async () => {
    // Create test product
    const product = await polar.products.create({
      name: "Test Product",
      organizationId: process.env.POLAR_ORG_ID!,
      prices: [{
        type: "one_time",
        amountType: "fixed",
        priceAmount: 1000,
        priceCurrency: "usd",
      }],
    });
    testProductId = product.id;
  });

  it("should create checkout session", async () => {
    const checkout = await polar.checkouts.create({
      products: [testProductId],
      successUrl: "http://localhost:3000/success",
      customerEmail: "test@example.com",
    });

    expect(checkout.status).toBe("open");
    expect(checkout.url).toBeDefined();
    expect(checkout.url).toContain("sandbox");
  });

  it("should retrieve checkout", async () => {
    const checkout = await polar.checkouts.create({
      products: [testProductId],
      successUrl: "http://localhost:3000/success",
    });

    const retrieved = await polar.checkouts.get({ id: checkout.id });
    expect(retrieved.id).toBe(checkout.id);
  });
});
Test Webhook Handler
typescript
import { describe, it, expect } from "vitest";
import { createHmac } from "crypto";

describe("Webhook Handler", () => {
  const webhookSecret = "whsec_test_secret";

  function signPayload(payload: string, timestamp: number): string {
    const signedPayload = `${timestamp}.${payload}`;
    return createHmac("sha256", webhookSecret)
      .update(signedPayload)
      .digest("hex");
  }

  it("should verify valid webhook signature", async () => {
    const payload = JSON.stringify({
      type: "order.paid",
      data: { id: "order_123" },
    });
    const timestamp = Math.floor(Date.now() / 1000);
    const signature = signPayload(payload, timestamp);

    const response = await fetch("/api/webhooks/polar", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "webhook-id": "evt_123",
        "webhook-timestamp": timestamp.toString(),
        "webhook-signature": `v1,${signature}`,
      },
      body: payload,
    });

    expect(response.status).toBe(200);
  });

  it("should reject invalid signature", async () => {
    const response = await fetch("/api/webhooks/polar", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "webhook-id": "evt_123",
        "webhook-timestamp": "1234567890",
        "webhook-signature": "v1,invalid",
      },
      body: JSON.stringify({ type: "order.paid" }),
    });

    expect(response.status).toBe(400);
  });
});
Test License Key Validation
typescript
describe("License Keys", () => {
  it("should validate license key", async () => {
    // First create a customer with a license key benefit
    // Then validate the key
    const result = await polar.licenseKeys.validate({
      key: "TEST-XXXX-XXXX-XXXX",
      organizationId: process.env.POLAR_ORG_ID!,
    });

    expect(result.valid).toBe(true);
    expect(result.customer).toBeDefined();
  });

  it("should reject invalid license key", async () => {
    const result = await polar.licenseKeys.validate({
      key: "INVALID-KEY",
      organizationId: process.env.POLAR_ORG_ID!,
    });

    expect(result.valid).toBe(false);
  });
});

Mocking Polar in Unit Tests

Show full SKILL.md (187 more words)Show less
Mock SDK
typescript
import { vi } from "vitest";

// Mock the entire SDK
vi.mock("@polar-sh/sdk", () => ({
  Polar: vi.fn().mockImplementation(() => ({
    checkouts: {
      create: vi.fn().mockResolvedValue({
        id: "checkout_mock",
        url: "https://sandbox.polar.sh/checkout/mock",
        status: "open",
      }),
      get: vi.fn().mockResolvedValue({
        id: "checkout_mock",
        status: "succeeded",
      }),
    },
    customers: {
      getState: vi.fn().mockResolvedValue({
        activeSubscriptions: [
          { id: "sub_mock", status: "active", productId: "prod_mock" },
        ],
        grantedBenefits: [],
      }),
    },
    subscriptions: {
      list: vi.fn().mockResolvedValue([]),
      cancel: vi.fn().mockResolvedValue({}),
    },
  })),
}));
Mock Webhook Payloads
typescript
export const mockWebhookPayloads = {
  orderPaid: {
    type: "order.paid",
    data: {
      id: "order_123",
      status: "paid",
      customer_id: "cust_123",
      product_id: "prod_123",
      total_amount: 2900,
      currency: "usd",
    },
  },
  subscriptionCreated: {
    type: "subscription.created",
    data: {
      id: "sub_123",
      status: "active",
      customer_id: "cust_123",
      product_id: "prod_123",
      current_period_end: "2025-02-15T00:00:00Z",
    },
  },
  subscriptionCanceled: {
    type: "subscription.canceled",
    data: {
      id: "sub_123",
      status: "active",
      cancel_at_period_end: true,
      ends_at: "2025-02-15T00:00:00Z",
    },
  },
  benefitGrantCreated: {
    type: "benefit_grant.created",
    data: {
      id: "grant_123",
      customer_id: "cust_123",
      benefit_id: "benefit_123",
      is_granted: true,
      properties: {
        license_key: "TEST-XXXX-XXXX-XXXX",
      },
    },
  },
};

CI/CD Integration

GitHub Actions
yaml
name: Test Polar Integration

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest

    env:
      POLAR_ACCESS_TOKEN: ${{ secrets.POLAR_SANDBOX_TOKEN }}
      POLAR_WEBHOOK_SECRET: ${{ secrets.POLAR_SANDBOX_WEBHOOK_SECRET }}
      POLAR_ORG_ID: ${{ secrets.POLAR_SANDBOX_ORG_ID }}
      POLAR_SERVER: sandbox

    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - run: npm ci

      - name: Run unit tests
        run: npm run test:unit

      - name: Run integration tests
        run: npm run test:integration
Environment Setup

Create sandbox credentials specifically for CI:

  1. Create a dedicated sandbox organization for CI
  2. Generate a CI-specific access token
  3. Set up webhook endpoint (or skip webhook tests in CI)
  4. Store credentials in GitHub Secrets

Debugging Tips

Check Webhook Delivery
  1. Go to sandbox.polar.sh → Settings → Webhooks
  2. Click on your endpoint
  3. View delivery history and payloads
  4. Check response codes and errors
Common Issues

Webhook signature mismatch

  • Ensure you're using the sandbox webhook secret
  • Check that the raw body is being passed (not parsed JSON)
  • Verify timestamp is within tolerance (5 minutes)

Checkout not completing

  • Use test cards, not real cards
  • Check browser console for errors
  • Verify successUrl is correct

API returns 401

  • Verify you're using sandbox token with sandbox API
  • Check token hasn't expired
  • Ensure token has required scopes
Enable Debug Logging
typescript
const polar = new Polar({
  accessToken: process.env.POLAR_ACCESS_TOKEN,
  server: "sandbox",
  // Enable debug mode if available
});

// Log all requests
polar.checkouts.create({...}).then(console.log).catch(console.error);

Test Checklist

Before going to production:

  • Checkout flow completes successfully
  • Webhooks received and processed
  • Subscription lifecycle works (create, cancel, revoke)
  • Benefits granted and revoked correctly
  • License key validation works
  • Error handling for declined payments
  • Customer portal accessible
  • Refund flow tested

© chmonitor, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/polar-testing of chmonitor/chmonitor.

Open the folder on GitHubat commit fc39ef0

Compare with similar skills

Polar Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Polar Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Polar Testing this skillchmonitor/chmonitor299—~2.8kAutomated safety check: WarnGPL-3.0
Payment Testingpetrkindlmann/qa-skills165—~4.9kAutomated safety check: PassMIT
Emulate Seedyonatangross/orchestkit289—~4.5kAutomated safety check: PassMIT
Stripe Best Practicesfossasia/eventyay1.7k1 repos~1.7kAutomated safety check: PassApache-2.0
cmux Billing Runbookmanaflow-ai/cmux28k—~2.8kAutomated safety check: PassCustom licence
Verifier Webpolarsource/polar10k—~3kAutomated safety check: NotesMIT

Similar skills

  • Payment Testing

    petrkindlmann/qa-skills

    Test payment and checkout flows end to end against PSP sandboxes — Stripe first, with the general pattern for Adyen/Braintree/PayPal.

    165 GitHub stars~4.9k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Emulate Seed

    yonatangross/orchestkit

    Generate emulate seed configs for stateful API emulation. An agent skill from yonatangross/orchestkit.

    289 GitHub stars~4.5k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Stripe Best Practices

    fossasia/eventyay

    Guides Stripe integration decisions across development and test environment planning (separate sandboxes vs the shared test mode sandbox), API selection (Checkout Sessions vs PaymentIntents)…

    1.7k GitHub starsUsed in 1 repo~1.7k tokens
    Backend & APIsAuto-check passed
  • cmux Billing Runbook

    manaflow-ai/cmux

    Runbook for the cmux billing code: Stripe Checkout, customer portal, subscription changes, webhooks and how Pro plan entitlement is resolved from Stack metadata.

    28k GitHub stars~2.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • Verifier Web

    polarsource/polar

    Evidence-capture protocol for verifying web/dashboard/backoffice/checkout changes in the Polar local stack by driving the real UI with Playwright.

    10k GitHub stars~3k tokensUpdated yesterday
    Data & AnalyticsAuto-check: notes
  • Stripe Patterns

    bybren-llc/safe-agentic-workflow

    Stripe payment integration patterns for checkout flows, webhooks, and subscriptions.

    421 GitHub stars~1.2k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed

More from chmonitor/chmonitor

All 53 skills in this repo
  • Hyperframes Creative

    chmonitor/chmonitor

    Non-animation creative direction for HyperFrames videos. An agent skill from chmonitor/chmonitor.

    299 GitHub starsUsed in 5 repos~1.3k tokens
    Auto-check passed
  • Hyperframes Media

    chmonitor/chmonitor

    Audio and media assets for HyperFrames compositions, produced by one shared audio engine (scripts/audio.mjs) — multi-provider TTS (HeyGen / ElevenLabs / Kokoro local), background music + sound…

    299 GitHub starsUsed in 1 repo~2.8k tokens
    Auto-check: notes
  • Remotion To Hyperframes

    chmonitor/chmonitor

    Port an existing Remotion (React) composition to HyperFrames HTML.

    299 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Music To Video

    chmonitor/chmonitor

    A skill your agent uses when the user has a music track (an audio file, or a video to pull audio from) and wants a beat-synced HyperFrames video, calm to hard-hitting.

    299 GitHub starsUsed in 1 repo~4k tokens
    Auto-check: notes
  • Hyperframes Animation

    chmonitor/chmonitor

    All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus…

    299 GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • Faceless Explainer

    chmonitor/chmonitor

    turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video, up to ~3 min (sweet spot 30-90s), where every visual is invented (typography, abstract graphics…

    299 GitHub stars~4.5k tokensUpdated 3 days ago
    Auto-check: notes

Works with

Questions about Polar Testing

What does Polar Testing do?

Guide for testing Polar payment integrations using the sandbox environment. Polar Testing is an agent skill from chmonitor/chmonitor. Guide for testing Polar payment integrations using the sandbox environment.

When should I use Polar Testing?

Polar Testing fits situations like: setting up the Polar sandbox for development; testing checkout flows without real payments; using Stripe test cards with Polar; writing integration tests for payment flows.

How do I install Polar Testing in Claude Code?

Run `npx skills add chmonitor/chmonitor --skill polar-testing -a claude-code`. Or copy the skill folder (.agents/skills/polar-testing in chmonitor/chmonitor) into .claude/skills/polar-testing in your project. Claude Code loads it when a task matches its description.

How do I install Polar Testing in Codex?

Run `npx skills add chmonitor/chmonitor --skill polar-testing -a codex`. Or copy the skill folder (.agents/skills/polar-testing in chmonitor/chmonitor) into .agents/skills/polar-testing in your project. Codex loads it when a task matches its description.

Can I use Polar Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add chmonitor/chmonitor --skill polar-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/polar-testing, .gemini/skills/polar-testing, .github/skills/polar-testing and .opencode/skills/polar-testing in your project.

What does Polar Testing need to run?

Going by SKILL.md and its folder, Polar Testing needs the command-line tools its instructions call (npm and ngrok) and credentials named POLAR_ACCESS_TOKEN, POLAR_WEBHOOK_SECRET, POLAR_SANDBOX_TOKEN and POLAR_SANDBOX_WEBHOOK_SECRET. Our summary lists: Python 3; A credential in POLAR_ACCESS_TOKEN; A credential in POLAR_WEBHOOK_SECRET.

Does Polar Testing access the network?

SKILL.md names 3 domains. In commands or code: sandbox.polar.sh and abc123.ngrok.io; the agent is likely to contact these when it follows the instructions. As links in the text: sandbox-api.polar.sh. This is read from the text; nothing was executed.

Is Polar Testing safe to install?

Our automated static check of SKILL.md flagged 2 warning(s): mentions a paste, webhook or tunnelling service often used to send data out. Read the flagged lines before installing; the check is not a guarantee either way.

What licence does Polar Testing use?

Polar Testing is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Polar Testing use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Polar Testing?

Skills that share tags, products or a category with Polar Testing: Payment Testing (petrkindlmann/qa-skills, 165 stars), Emulate Seed (yonatangross/orchestkit, 289 stars), Stripe Best Practices (fossasia/eventyay, 1.7k stars) and cmux Billing Runbook (manaflow-ai/cmux, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Polar Testing?

chmonitor (a GitHub organization) maintains it in chmonitor/chmonitor, which has 299 GitHub stars. The repository holds 53 skills in this directory. The repository was last updated on October 5, 2026.

Source: chmonitor/chmonitor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.