stripe-agent
Manages all Stripe billing operations for Unite-Hub including product/price creation, subscription management, checkout sessions, webhooks, and dual-mode (test/live) billing for staff vs. customer ...
What this skill does
# Stripe Agent Skill
**Agent ID**: `unite-hub.stripe-agent`
**Model**: `claude-sonnet-4-5-20250929`
**MCP Server**: `stripe` (via `@stripe/mcp`)
---
## Role
Manages all Stripe billing operations for Unite-Hub including product/price creation, subscription management, checkout sessions, webhooks, and dual-mode (test/live) billing for staff vs. customer separation.
---
## Capabilities
### 1. Product & Price Management
**Create Products**
```typescript
// Create a product for a pricing tier
mcp__stripe__create_product({
name: "Unite Hub Professional",
description: "Full CRM and AI marketing automation",
metadata: {
tier: "professional",
features: "unlimited_contacts,ai_scoring,drip_campaigns"
}
})
```
**Create Prices**
```typescript
// Monthly price (AUD, GST included)
mcp__stripe__create_price({
product: "prod_xxx",
unit_amount: 89500, // $895.00 AUD in cents
currency: "aud",
recurring: { interval: "month" },
metadata: { tier: "professional", billing: "monthly", gst_included: "true" }
})
// Annual price (AUD, GST included)
mcp__stripe__create_price({
product: "prod_xxx",
unit_amount: 895000, // $8,950.00 AUD (2 months free)
currency: "aud",
recurring: { interval: "year" },
metadata: { tier: "professional", billing: "annual", gst_included: "true" }
})
```
### 2. Checkout Sessions
**Create Checkout Session**
```typescript
mcp__stripe__create_checkout_session({
mode: "subscription",
customer_email: "[email protected]",
line_items: [{
price: "price_xxx",
quantity: 1
}],
success_url: "https://synthex.social/dashboard?success=true",
cancel_url: "https://synthex.social/pricing?cancelled=true",
metadata: {
workspace_id: "uuid",
tier: "professional"
}
})
```
### 3. Subscription Management
**List Subscriptions**
```typescript
mcp__stripe__list_subscriptions({
customer: "cus_xxx",
status: "active"
})
```
**Update Subscription** (upgrade/downgrade)
```typescript
// Via API route, update subscription items
// Switch from starter to professional price
```
**Cancel Subscription**
```typescript
// Via API route with proper handling
// Options: immediate or at_period_end
```
### 4. Customer Management
**Create Customer**
```typescript
mcp__stripe__create_customer({
email: "[email protected]",
name: "John Doe",
metadata: {
user_id: "uuid",
workspace_id: "uuid"
}
})
```
**List Customers**
```typescript
mcp__stripe__list_customers({
email: "[email protected]"
})
```
### 5. Invoice Management
**List Invoices**
```typescript
mcp__stripe__list_invoices({
customer: "cus_xxx",
status: "paid"
})
```
**Create Invoice**
```typescript
mcp__stripe__create_invoice({
customer: "cus_xxx",
auto_advance: true,
metadata: {
workspace_id: "uuid"
}
})
```
---
## Dual-Mode Billing Architecture
Unite-Hub uses a dual-mode billing system to separate staff testing from real customer payments.
### Mode Determination Logic
```typescript
// From src/lib/billing/stripe-router.ts
// TEST Mode triggers:
// 1. Staff roles: founder, staff_admin, internal_team, super_admin
// 2. Registered sandbox emails (SANDBOX_STAFF_REGISTRY)
// 3. Internal domains: unite-group.in, disasterrecoveryqld.au, carsi.com.au
// LIVE Mode:
// All other users (real customers)
```
### Environment Variables Required
```env
# TEST Mode (for staff/internal)
STRIPE_TEST_SECRET_KEY=sk_test_...
STRIPE_TEST_WEBHOOK_SECRET=whsec_test_...
STRIPE_TEST_PRICE_STARTER=price_...
STRIPE_TEST_PRICE_PRO=price_...
STRIPE_TEST_PRICE_ELITE=price_...
NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY=pk_test_...
# LIVE Mode (for customers)
STRIPE_LIVE_SECRET_KEY=sk_live_...
STRIPE_LIVE_WEBHOOK_SECRET=whsec_live_...
STRIPE_LIVE_PRICE_STARTER=price_...
STRIPE_LIVE_PRICE_PRO=price_...
STRIPE_LIVE_PRICE_ELITE=price_...
NEXT_PUBLIC_STRIPE_LIVE_PUBLISHABLE_KEY=pk_live_...
```
---
## Pricing Tiers (AUD, GST Included)
| Tier | Monthly | Annual | Features |
|------|---------|--------|----------|
| **Starter** | $495 | $4,950 | Basic CRM, 500 contacts, Email integration |
| **Professional** | $895 | $8,950 | Full CRM, Unlimited contacts, AI scoring, Drip campaigns |
| **Elite** | $1,295 | $12,950 | Everything + White-label, Priority support, Custom integrations |
**Currency**: Australian Dollars (AUD)
**Tax**: All prices include 10% GST
---
## Tasks This Agent Performs
### Task 1: Setup Complete Stripe Products
**Trigger**: "Setup Stripe products" or first-time billing initialization
**Steps**:
1. Create Starter product and prices (monthly + annual)
2. Create Professional product and prices
3. Create Elite product and prices
4. Store price IDs in environment
5. Configure webhook endpoints
**Output**:
```json
{
"products": {
"starter": "prod_xxx",
"professional": "prod_yyy",
"elite": "prod_zzz"
},
"prices": {
"starter_monthly": "price_xxx",
"starter_annual": "price_xxy",
"professional_monthly": "price_yyy",
"professional_annual": "price_yyz",
"elite_monthly": "price_zzz",
"elite_annual": "price_zza"
}
}
```
### Task 2: Create Checkout for User
**Trigger**: User clicks "Subscribe" on pricing page
**Input**:
```json
{
"email": "[email protected]",
"tier": "professional",
"billing": "monthly",
"workspaceId": "uuid",
"userId": "uuid"
}
```
**Steps**:
1. Determine billing mode (test/live based on email)
2. Get or create Stripe customer
3. Create checkout session with correct price
4. Return checkout URL
### Task 3: Handle Subscription Upgrade
**Trigger**: User clicks "Upgrade" in billing settings
**Input**:
```json
{
"currentTier": "starter",
"targetTier": "professional",
"subscriptionId": "sub_xxx",
"workspaceId": "uuid"
}
```
**Steps**:
1. Get current subscription
2. Calculate proration
3. Update subscription items
4. Handle billing adjustment
5. Update workspace tier in database
### Task 4: Process Webhook Events
**Trigger**: Stripe webhook received
**Events Handled**:
- `checkout.session.completed` → Activate subscription
- `customer.subscription.created` → Create subscription record
- `customer.subscription.updated` → Update tier, sync status
- `customer.subscription.deleted` → Deactivate subscription
- `invoice.paid` → Mark paid, extend access
- `invoice.payment_failed` → Flag account, send notification
### Task 5: Generate Billing Report
**Trigger**: "Generate billing report" or scheduled monthly
**Output**:
```json
{
"period": "2025-11",
"revenue": {
"total": 15890.00,
"byTier": {
"starter": 4850.00,
"professional": 8910.00,
"elite": 2130.00
}
},
"subscriptions": {
"active": 87,
"new": 12,
"churned": 3,
"mrr": 15890.00
},
"trials": {
"active": 23,
"converted": 8,
"expired": 5
}
}
```
### Task 6: Audit Stripe Configuration
**Trigger**: "Audit Stripe setup" or health check
**Checks**:
1. All environment variables present
2. Products exist in Stripe dashboard
3. Prices are correctly configured
4. Webhooks are registered
5. Test mode products match live mode structure
**Output**:
```json
{
"status": "healthy" | "degraded" | "critical",
"checks": {
"env_vars": { "status": "pass", "missing": [] },
"products": { "status": "pass", "count": 3 },
"prices": { "status": "pass", "count": 6 },
"webhooks": { "status": "warn", "message": "Live webhook not configured" }
},
"recommendations": [
"Add STRIPE_LIVE_WEBHOOK_SECRET to production environment"
]
}
```
---
## Webhook Endpoints
### Test Mode
- **URL**: `https://your-domain.com/api/webhooks/stripe/test`
- **Events**: All subscription and invoice events
- **Secret**: `STRIPE_TEST_WEBHOOK_SECRET`
### Live Mode
- **URL**: `https://your-domain.com/api/webhooks/stripe/live`
- **Events**: All subscription and invoice events
- **Secret**: `STRIPE_LIVE_WEBHOOK_SECRET`
---
## Error Handling
### Common Errors
| Error | Cause | Resolution |
|-------|-------|------------|
| `StripeCardError` | Card decRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.