revenue-optimizer
npx skills add https://github.com/acaprino/alfio-claude-plugins --skill revenue-optimizer
Agent 安装分布
Skill 文档
Revenue Optimizer
Build revenue features and monetization systems. Analyze existing codebases to understand features, calculate costs, and create data-driven pricing strategies.
Workflow
- Discover – Scan codebase for features, services, and integrations
- Cost Analysis – Calculate per-user and per-feature costs from services
- Design – Create pricing tiers based on value + cost data
- Implement – Build payment integration, pricing logic, and checkout flows
- Optimize – Add conversion optimization and revenue tracking
Feature Discovery
Scan codebase to build feature inventory:
Feature Discovery Process:
1. Scan routes/endpoints â identify user-facing features
2. Scan components/pages â map UI features
3. Scan service integrations â identify cost-generating features
4. Scan database models â understand data entities
5. Cross-reference â map features to their cost drivers
Look for these patterns:
- Routes/Controllers: Each endpoint = potential feature
- React/Vue components: Feature-specific UI modules
- Service clients: AWS SDK, OpenAI, Stripe, Twilio, etc.
- Background jobs: Compute-intensive operations
- Storage operations: S3, database writes, file uploads
Example feature inventory output:
Features Discovered:
âââ Core Features (low cost)
â âââ User authentication (Cognito/Auth0)
â âââ Dashboard views (read-only)
â âââ Basic CRUD operations
âââ Premium Features (medium cost)
â âââ PDF export (uses Puppeteer/Lambda)
â âââ Email notifications (SendGrid)
â âââ File storage (S3)
âââ High-Value Features (high cost)
âââ AI analysis (OpenAI API)
âââ Video processing (FFmpeg/Lambda)
âââ Real-time sync (WebSockets)
Cost Analysis
Analyze services to calculate true costs per user/feature. See references/cost-analysis.md for detailed patterns.
Service Detection
Scan for these cost sources:
- Config files:
.env,config/, secrets - Package.json/requirements.txt: SDK dependencies
- Infrastructure:
terraform/,cloudformation/,docker-compose - Code imports:
aws-sdk,openai,stripe,twilio, etc.
Cost Mapping
Cost Analysis Output:
âââ Fixed Costs (monthly)
â âââ Hosting: $50 (Vercel Pro)
â âââ Database: $25 (PlanetScale)
â âââ Monitoring: $20 (Datadog)
â âââ Total Fixed: $95/month
âââ Variable Costs (per user/month)
â âââ Auth: $0.05/MAU (Auth0)
â âââ Storage: $0.023/GB (S3)
â âââ Email: $0.001/email (SendGrid)
âââ Feature Costs (per use)
â âââ AI Analysis: $0.03/request (GPT-4)
â âââ PDF Export: $0.01/export (Lambda)
â âââ SMS: $0.0075/message (Twilio)
âââ Recommended Minimums:
âââ Break-even at 100 users: $0.95/user
âââ With 70% margin: $3.17/user
âââ AI feature: charge $0.10/use or limit free tier
Pricing Strategy Design
Combine feature value + cost data:
Pricing Strategy Framework:
1. Calculate cost floor (break-even)
2. Assess feature value (what users pay for alternatives)
3. Set price = max(cost + margin, perceived value)
4. Group features into tiers by cost similarity
Cost-Informed Tier Design
Tier Design Process:
âââ Free Tier
â âââ Include: Low-cost features only
â âââ Limit: Usage caps on variable costs
â âââ Goal: < $0.50 cost/user/month
âââ Pro Tier
â âââ Include: Medium-cost features
â âââ Price: 3-5x your cost (healthy margin)
â âââ Goal: Primary revenue driver
âââ Enterprise
âââ Include: High-cost features (AI, video, etc.)
âââ Price: Value-based (10x+ cost acceptable)
âââ Goal: High-margin, lower volume
See references/pricing-patterns.md for implementation examples.
Complete Analysis Example
When asked to create a pricing strategy, produce a full analysis:
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
PRICING STRATEGY REPORT
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
ð CODEBASE ANALYSIS
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Services Detected:
⢠AWS S3 (file storage)
⢠OpenAI GPT-4 (AI features)
⢠SendGrid (email)
⢠Auth0 (authentication)
⢠Vercel (hosting)
⢠PlanetScale (database)
Features Discovered:
âââ Core (6 features)
â âââ User dashboard
â âââ Project management
â âââ Team collaboration
â âââ Basic reporting
âââ Premium (3 features)
â âââ PDF export â uses Lambda
â âââ Advanced analytics â uses Postgres aggregations
â âââ API access â rate-limited endpoints
âââ AI-Powered (2 features)
âââ AI writing assistant â uses GPT-4
âââ Smart suggestions â uses GPT-4
ð° COST BREAKDOWN
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Fixed Costs (Monthly):
Vercel Pro .............. $20
PlanetScale Scaler ...... $29
Auth0 (base) ............ $0
âââââââââââââââââââââââââââââ
Total Fixed $49/month
Variable Costs (Per Active User):
Auth0 MAU ............... $0.02
Storage (avg 500MB) ..... $0.01
Email (avg 10/month) .... $0.01
âââââââââââââââââââââââââââââ
Total Variable $0.04/user/month
Feature Costs (Per Use):
AI Writing (1K tokens) .. $0.03/use
PDF Export .............. $0.01/use
API Call ................ $0.001/call
ð USAGE PATTERN ANALYSIS
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Feature Usage Distribution:
API Calls/month:
âââ Casual (50%): ~50 calls ââââââââââââ
âââ Regular (40%): ~500 calls ââââââââââââ
âââ Power (10%): ~5,000 calls ââââââââââââ
AI Generations/month:
âââ Casual (50%): ~5 uses ââââââââââââ
âââ Regular (40%): ~50 uses ââââââââââââ
âââ Power (10%): ~300 uses ââââââââââââ
Tier Limit Strategy:
âââ Free: 100 API, 10 AI (80% casual under)
âââ Pro: 5,000 API, 100 AI (95% regular under)
âââ Business: Unlimited
ð REVENUE MODEL
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
User Distribution: Free 80% â Pro 15% â Business 5%
ARPU: (80%Ã$0) + (15%Ã$19) + (5%Ã$49) = $5.30/user
LTV = (ARPU Ã Margin) / Churn
= ($5.30 Ã 0.87) / 0.04 = $115
Cost to Serve:
Free: $0.10 â Pro: $2.50 â Business: $12
Break-Even: 62 users
12-Month Projection (15% growth):
M1: 100 users â $530 MRR
M6: 266 users â $1,410 MRR
M12: 814 users â $4,314 MRR â $51,768 ARR
ð·ï¸ RECOMMENDED TIERS
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
FREE ($0)
â 3 projects â 100 API â 10 AI â 500MB
Cost: $0.10 â Purpose: Lead generation
PRO ($19/mo · $190/yr save 17%)
â Unlimited â 5K API â 100 AI â 10GB â Email support
Cost: $2.50 â Margin: 87%
BUSINESS ($49/mo · $490/yr) â RECOMMENDED
â All Pro + 50K API â 500 AI â 50GB â 5 seats â Priority
Cost: $12 â Margin: 76%
ENTERPRISE (Custom · $200+)
â Unlimited â SSO â SLA â Dedicated support
â ï¸ OVERAGE: AI $0.10/use â API $0.005/call
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Payment Provider Selection
| Provider | Best For | Integration Complexity |
|---|---|---|
| Stripe | SaaS, subscriptions, global | Low |
| Paddle | SaaS with tax compliance | Low |
| LemonSqueezy | Digital products, simple | Very Low |
| PayPal | Marketplaces, existing users | Medium |
For detailed integration patterns, see:
- Stripe: references/stripe.md
Pricing Tier Design
Common patterns:
- Good-Better-Best: 3 tiers with clear value escalation
- Freemium: Free tier with premium upsell
- Usage-Based: Pay per API call, storage, or compute
- Per-Seat: Charge per team member
For tier structure examples and implementation, see references/pricing-patterns.md.
Subscription Implementation
Key components:
- Subscription state management – Track active, canceled, past_due
- Webhook handling – Process payment events reliably
- Entitlement system – Gate features based on plan
- Billing portal – Self-service plan management
For subscription system patterns, see references/subscription-patterns.md.
Usage Pattern Analysis
Analyze how users consume features to set optimal tier limits:
Usage Analysis Output:
âââ Feature Usage Distribution
â âââ API Calls
â â âââ Casual users (50%): ~50/month
â â âââ Regular users (40%): ~500/month
â â âââ Power users (10%): ~5,000/month
â âââ AI Generations
â âââ Casual: ~5/month
â âââ Regular: ~50/month
â âââ Power: ~500/month
âââ Consumption Patterns
â âââ Peak usage: Mon-Fri, 9am-6pm
â âââ Seasonal spikes: Q4 (+30%)
â âââ Growth trend: +15%/month
âââ Tier Limit Recommendations
âââ Free: 100 API calls (covers 80% of casual)
âââ Pro: 5,000 API calls (covers 95% of regular)
âââ Enterprise: Unlimited
Set limits so users naturally upgrade:
- Free tier: Limit at 80th percentile of casual users
- Pro tier: Limit at 95th percentile of regular users
- Enterprise: Unlimited or custom
See references/usage-revenue-modeling.md for detailed patterns.
Revenue Modeling
Calculate key SaaS metrics for pricing decisions:
Revenue Model:
âââ ARPU (Average Revenue Per User)
â âââ Free (80%): $0
â âââ Pro (15%): $29
â âââ Enterprise (5%): $99
â âââ Blended ARPU: $9.30
âââ LTV Calculation
â âââ ARPU: $9.30
â âââ Gross Margin: 85%
â âââ Monthly Churn: 3%
â âââ LTV = ($9.30 Ã 0.85) / 0.03 = $263
âââ Break-Even Analysis
â âââ Fixed costs: $500/month
â âââ Variable cost/user: $0.50
â âââ ARPU: $9.30
â âââ Break-even: 57 users
âââ 12-Month Projection
âââ Month 1: 100 users, $930 MRR
âââ Month 6: 400 users, $3,720 MRR
âââ Month 12: 1,200 users, $11,160 MRR
Optimal Tier Pricing Formula
Optimal Price = (Cost Floor à 0.3) + (Value Ceiling à 0.7)
Where:
- Cost Floor = Cost to Serve / (1 - Target Margin)
- Value Ceiling = min(Perceived Value, Competitor Price à 1.2)
Example:
- Cost to serve Pro user: $3/month
- Target margin: 80%
- Cost floor: $3 / 0.20 = $15
- Competitor price: $25
- Value ceiling: $30
- Optimal: ($15 Ã 0.3) + ($30 Ã 0.7) = $25.50 â $25/month
See references/usage-revenue-modeling.md for full revenue modeling.
Checkout Optimization
Conversion-focused checkout implementation:
- Minimize form fields (email â payment in 2 steps max)
- Show trust signals (security badges, money-back guarantee)
- Display social proof near purchase button
- Offer annual discount prominently (20-40% standard)
- Pre-select recommended plan
For checkout implementation details, see references/checkout-optimization.md.
Feature Gating Pattern
// Entitlement check pattern
async function checkFeatureAccess(userId: string, feature: string): Promise<boolean> {
const subscription = await getSubscription(userId);
const plan = PLANS[subscription.planId];
return plan.features.includes(feature);
}
// Usage in route/component
if (!await checkFeatureAccess(user.id, 'advanced_export')) {
return showUpgradePrompt('advanced_export');
}
Revenue Tracking
Essential metrics to implement:
- MRR (Monthly Recurring Revenue)
- Churn Rate (cancellations / total subscribers)
- LTV (Lifetime Value = ARPU / churn rate)
- Conversion Rate (paid / total signups)
Implementation: Send events to analytics (Mixpanel, Amplitude, or custom) on:
subscription.createdsubscription.upgradedsubscription.canceledpayment.succeededpayment.failed
Quick Implementation Checklist
- Payment provider account and API keys configured
- Webhook endpoint receiving and verifying events
- Subscription state synced to database
- Feature entitlement checks on protected routes
- Billing portal or plan management UI
- Upgrade prompts at key user moments
- Revenue events tracked in analytics
- Failed payment retry and dunning emails