Autonomous validation of Polar.sh billing integration. Checks webhook endpoints, signature verification, subscription middleware, and environment configuration.
View on GitHubhirefrank/hirefrank-marketplace
edge-stack
January 16, 2026
Select agents to install to:
npx add-skill https://github.com/hirefrank/hirefrank-marketplace/blob/main/plugins/edge-stack/skills/polar-integration-validator/SKILL.md -a claude-code --skill polar-integration-validatorInstallation paths:
.claude/skills/polar-integration-validator/# Polar Integration Validator SKILL ## Activation Patterns This SKILL automatically activates when: - Files matching `**/webhooks/polar.*` are created/modified - Files containing "subscription" or "polar" in path are modified - `wrangler.toml` is updated - Environment variable files (`.dev.vars`, `.env`) are modified - Before deployment operations ## Validation Rules ### P1 - Critical (Block Operations) **Webhook Endpoint**: - ✅ Webhook handler exists (`server/api/webhooks/polar.ts` or similar) - ✅ Signature verification implemented (`polar.webhooks.verify`) - ✅ All critical events handled: `checkout.completed`, `subscription.created`, `subscription.updated`, `subscription.canceled` **Environment Variables**: - ✅ `POLAR_ACCESS_TOKEN` configured (check `.dev.vars` or secrets) - ✅ `POLAR_WEBHOOK_SECRET` in wrangler.toml **Database**: - ✅ Users table has `polar_customer_id` column - ✅ Subscriptions table exists - ✅ Foreign key relationship configured ### P2 - Important (Warn) **Event Handling**: - ⚠️ `subscription.past_due` handler exists - ⚠️ Database updates in all event handlers - ⚠️ Error logging implemented **Subscription Middleware**: - ⚠️ Subscription check function exists - ⚠️ Used on protected routes - ⚠️ Checks `subscription_status === 'active'` - ⚠️ Checks `current_period_end` not expired ### P3 - Suggestions (Inform) - ℹ️ Webhook event logging to database - ℹ️ Customer creation helper function - ℹ️ Subscription status caching - ℹ️ Rate limiting on webhook endpoint ## Validation Output ``` 🔍 Polar.sh Integration Validation ✅ P1 Checks (Critical): ✅ Webhook endpoint exists ✅ Signature verification implemented ✅ Environment variables configured ✅ Database schema complete ⚠️ P2 Checks (Important): ⚠️ Missing subscription.past_due handler ✅ Subscription middleware exists ✅ Protected routes check subscription ℹ️ P3 Suggestions: ℹ️ Consider adding webhook event logging ℹ️ Add rate limiting to webhook endpoint 📋 Summar