MCPInstall

roi-calculator

Calculate ROI for marketing campaigns, investments, and business decisions. Includes break-even analysis, payback period, and comparative ROI.

Installs
196
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill roi-calculator
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads roi-calculator automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

ROI Calculator

Comprehensive ROI calculations for marketing, investments, and business decisions.

Features

  • Simple ROI: Basic return on investment calculation
  • Marketing ROI: Campaign performance with attribution
  • Investment ROI: Time-adjusted returns with CAGR
  • Break-Even Analysis: Find profit threshold
  • Payback Period: Time to recover investment
  • Comparative Analysis: Compare multiple options
  • What-If Scenarios: Sensitivity analysis

Quick Start

from roi_calculator import ROICalculator

calc = ROICalculator()

# Simple ROI
roi = calc.simple_roi(investment=10000, return_value=15000)
print(f"ROI: {roi['roi_percent']}%")

# Marketing ROI
marketing = calc.marketing_roi(
    ad_spend=5000,
    revenue_generated=25000,
    cost_of_goods=10000
)
print(f"Marketing ROI: {marketing['roi_percent']}%")

# Break-even analysis
breakeven = calc.break_even(
    fixed_costs=50000,
    price_per_unit=100,
    variable_cost_per_unit=60
)
print(f"Break-even units: {breakeven['units']}")

CLI Usage

# Simple ROI
python roi_calculator.py --investment 10000 --return 15000

# Marketing campaign ROI
python roi_calculator.py --marketing --spend 5000 --revenue 25000 --cogs 10000

# Break-even analysis
python roi_calculator.py --breakeven --fixed 50000 --price 100 --variable 60

# Investment with time (CAGR)
python roi_calculator.py --investment 10000 --return 20000 --years 5

# Payback period
python roi_calculator.py --payback --investment 100000 --annual-return 25000

# Compare multiple investments
python roi_calculator.py --compare investments.csv

API Reference

ROICalculator Class

class ROICalculator:
    def __init__(self)

    # Basic ROI
    def simple_roi(self, investment: float, return_value: float) -> Dict
    def net_roi(self, investment: float, gain: float, costs: float = 0) -> Dict

    # Marketing ROI
    def marketing_roi(self, ad_spend: float, revenue_generated: float,
                      cost_of_goods: float = 0) -> Dict
    def campaign_roi(self, campaigns: List[Dict]) -> pd.DataFrame
    def roas(self, ad_spend: float, revenue: float) -> Dict  # Return on Ad Spend

    # Investment ROI
    def investment_roi(self, initial: float, final: float, years: float) -> Dict
    def cagr(self, initial: float, final: float, years: float) -> float
    def total_return(self, initial: float, final: float, dividends: float = 0) -> Dict

    # Break-Even Analysis
    def break_even(self, fixed_costs: float, price_per_unit: float,
                   variable_cost_per_unit: float) -> Dict
    def break_even_revenue(self, fixed_costs: float, contribution_margin_ratio: float) -> Dict

    # Payback Period
    def payback_period(self, investment: float, annual_cash_flow: float) -> Dict
    def payback_period_uneven(self, investment: float, cash_flows: List[float]) -> Dict

    # Comparative Analysis
    def compare_investments(self, investments: List[Dict]) -> pd.DataFrame
    def rank_by_roi(self, investments: List[Dict]) -> List[Dict]

    # Sensitivity Analysis
    def sensitivity_analysis(self, base_case: Dict, variables: Dict) -> pd.DataFrame
    def scenario_analysis(self, scenarios: List[Dict]) -> pd.DataFrame

    # Reporting
    def generate_report(self, analysis: Dict, output: str) -> str

ROI Calculations

Simple ROI

result = calc.simple_roi(investment=10000, return_value=15000)
# Returns:
# {
#     "investment": 10000,
#     "return_value": 15000,
#     "gain": 5000,
#     "roi_percent": 50.0,
#     "roi_ratio": 0.5
# }

Net ROI (with additional costs)

result = calc.net_roi(
    investment=10000,
    gain=8000,
    costs=2000  # Additional costs
)
# Returns:
# {
#     "investment": 10000,
#     "gross_gain": 8000,
#     "costs": 2000,
#     "net_gain": 6000,
#     "roi_percent": 60.0
# }

Marketing ROI

Campaign ROI

result = calc.marketing_roi(
    ad_spend=5000,
    revenue_generated=25000,
    cost_of_goods=10000
)
# Returns:
# {
#     "ad_spend": 5000,
#     "revenue": 25000,
#     "cost_of_goods": 10000,
#     "gross_profit": 15000,
#     "net_profit": 10000,  # After ad spend
#     "roi_percent": 200.0,
#     "roas": 5.0  # $5 revenue per $1 ad spend
# }

Return on Ad Spend (ROAS)

result = calc.roas(ad_spend=1000, revenue=4000)
# Returns:
# {
#     "ad_spend": 1000,
#     "revenue": 4000,
#     "roas": 4.0,
#     "roas_percent": 400.0
# }

Multi-Campaign Comparison

campaigns = [
    {"name": "Facebook", "spend": 2000, "revenue": 8000, "cogs": 3000},
    {"name": "Google", "spend": 3000, "revenue": 15000, "cogs": 6000},
    {"name": "Email", "spend": 500, "revenue": 3000, "cogs": 1000}
]
results = calc.campaign_roi(campaigns)
# Returns DataFrame with ROI for each campaign

Investment ROI

Time-Adjusted ROI with CAGR

result = calc.investment_roi(
    initial=10000,
    final=20000,
    years=5
)
# Returns:
# {
#     "initial": 10000,
#     "final": 20000,
#     "total_gain": 10000,
#     "total_roi_percent": 100.0,
#     "cagr_percent": 14.87,  # Compound Annual Growth Rate
#     "years": 5
# }

Total Return with Dividends

result = calc.total_return(
    initial=10000,
    final=12000,
    dividends=1500
)
# Returns:
# {
#     "initial": 10000,
#     "final": 12000,
#     "capital_gain": 2000,
#     "dividends": 1500,
#     "total_return": 3500,
#     "total_return_percent": 35.0
# }

Break-Even Analysis

Unit Break-Even

result = calc.break_even(
    fixed_costs=50000,
    price_per_unit=100,
    variable_cost_per_unit=60
)
# Returns:
# {
#     "fixed_costs": 50000,
#     "price_per_unit": 100,
#     "variable_cost_per_unit": 60,
#     "contribution_margin": 40,
#     "contribution_margin_ratio": 0.4,
#     "break_even_units": 1250,
#     "break_even_revenue": 125000
# }

Revenue Break-Even

result = calc.break_even_revenue(
    fixed_costs=50000,
    contribution_margin_ratio=0.4  # 40% margin
)
# Returns:
# {
#     "fixed_costs": 50000,
#     "contribution_margin_ratio": 0.4,
#     "break_even_revenue": 125000
# }

Payback Period

Simple Payback

result = calc.payback_period(
    investment=100000,
    annual_cash_flow=25000
)
# Returns:
# {
#     "investment": 100000,
#     "annual_cash_flow": 25000,
#     "payback_years": 4.0,
#     "payback_months": 48
# }

Uneven Cash Flows

result = calc.payback_period_uneven(
    investment=100000,
    cash_flows=[20000, 30000, 40000, 35000, 25000]  # Per year
)
# Returns:
# {
#     "investment": 100000,
#     "payback_years": 2.75,  # Recovered in year 3
#     "cumulative_flows": [20000, 50000, 90000, 125000, 150000]
# }

Comparative Analysis

Compare Multiple Investments

investments = [
    {"name": "Project A", "investment": 50000, "return": 75000, "years": 2},
    {"name": "Project B", "investment": 30000, "return": 48000, "years": 3},
    {"name": "Project C", "investment": 100000, "return": 180000, "years": 5}
]
comparison = calc.compare_investments(investments)
# Returns DataFrame:
#   name      | investment | return  | roi%   | cagr%  | payback
#   Project A | 50000      | 75000   | 50.0   | 22.5   | 1.33
#   Project B | 30000      | 48000   | 60.0   | 17.0   | 1.88
#   Project C | 100000     | 180000  | 80.0   | 12.5   | 2.78

Rank by ROI

ranked = calc.rank_by_roi(investments)
# Returns investments sorted by ROI percentage

Sensitivity Analysis

Variable Sensitivity

base_case = {
    "fixed_costs": 50000,
    "price_per_unit": 100,
    "variable_cost_per_unit": 60,
    "units_sold": 2000
}

# Test impact of price changes
sensitivity = calc.sensitivity_analysis(
    base_case=base_case,
    variables={
        "price_per_unit": [80, 90, 100, 110, 120],
        "units_sold": [1500, 1750, 2000, 2250, 2500]
    }
)
# Returns DataFrame showing profit at each combination

Scenario Analysis

scenarios = [
    {"name": "Pessimistic", "units": 1500, "price": 90},
    {"name": "Base", "units": 2000, "price": 100},
    {"name": "Optimistic", "units": 2500, "price": 110}
]
results = calc.scenario_analysis(scenarios)

Example Workflows

Marketing Campaign Analysis

calc = ROICalculator()

# Analyze Q4 campaigns
campaigns = [
    {"name": "Black Friday Email", "spend": 2000, "revenue": 45000, "cogs": 20000},
    {"name": "Holiday Facebook", "spend": 8000, "revenue": 35000, "cogs": 14000},
    {"name": "Google Shopping", "spend": 5000, "revenue": 28000, "cogs": 12000}
]

results = calc.campaign_roi(campaigns)
print(results.sort_values("roi_percent", ascending=False))

# Find best performing campaign
best = results.loc[results["roi_percent"].idxmax()]
print(f"Best ROI: {best['name']} at {best['roi_percent']:.1f}%")

Business Investment Decision

calc = ROICalculator()

# Compare expansion options
options = [
    {"name": "New Location", "investment": 200000, "annual_return": 45000},
    {"name": "Equipment Upgrade", "investment": 75000, "annual_return": 20000},
    {"name": "Digital Marketing", "investment": 30000, "annual_return": 12000}
]

for opt in options:
    payback = calc.payback_period(opt["investment"], opt["annual_return"])
    roi = calc.simple_roi(opt["investment"], opt["investment"] + opt["annual_return"] * 5)
    print(f"{opt['name']}: Payback={payback['payback_years']:.1f}yr, 5yr ROI={roi['roi_percent']:.1f}%")

Pricing Strategy Analysis

calc = ROICalculator()

# Break-even at different price points
fixed_costs = 100000
variable_cost = 25

for price in [40, 50, 60, 75, 100]:
    be = calc.break_even(fixed_costs, price, variable_cost)
    print(f"Price ${price}: Break-even at {be['break_even_units']:,} units (${be['break_even_revenue']:,.0f})")

Dependencies

  • pandas>=2.0.0
  • numpy>=1.24.0

FAQ

What does the roi-calculator skill do?

Calculate ROI for marketing campaigns, investments, and business decisions. Includes break-even analysis, payback period, and comparative ROI.

How do I install roi-calculator?

Run npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill roi-calculator in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/roi-calculator/ (personal) or .claude/skills/roi-calculator/ (project).

Which AI agents can use roi-calculator?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is roi-calculator safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains roi-calculator?

It is published by dkyazzentwatwa in dkyazzentwatwa/chatgpt-skills. It has 196 recorded installs.

More from dkyazzentwatwa/chatgpt-skills

View all →

ocr-document-processor

dkyazzentwatwa/chatgpt-skills

Extract text and structure from scans, images, and scanned PDFs. Use for OCR, searchable PDFs, table extraction, receipt parsing, and business card parsing.

Media & Creative4.8K installs

crypto-ta-analyzer

dkyazzentwatwa/chatgpt-skills

Run multi-indicator technical analysis on crypto or market OHLCV data. Use for deterministic trend, momentum, volume, and divergence analysis.

Business & Finance1.6K installs

text-summarizer

dkyazzentwatwa/chatgpt-skills

Generate extractive summaries from long text documents. Control summary length, extract key sentences, and process multiple documents.

693 installs

financial-calculator

dkyazzentwatwa/chatgpt-skills

Run loan, investment, NPV, retirement, savings, and risk calculations with schedules and charts. Use for deterministic financial modeling tasks.

Business & Finance503 installs

document-converter-suite

dkyazzentwatwa/chatgpt-skills

Convert PDFs, Office docs, markdown, HTML, and tables between editable formats. Use for best-effort document conversion, PDF utilities, form filling, and table extraction.

Docs & Writing483 installs

image-enhancement-suite

dkyazzentwatwa/chatgpt-skills

Open the skill to read its SKILL.md instructions.

Media & Creative293 installs

Popular marketing & seo skills

View category →

reddit-automation

flowkit-labs/skills

Find Reddit threads where people are genuinely asking for what you offer, then draft short, genuinely helpful replies — disclosing your affiliation honestly and naming your product only when it truly answers the question. Two moves: discovery — scan the right subreddits for real needs (recommendation asks, expressed pain, competitor mentions) and rank the few threads where you can actually help; drafting — write from real experience, respect each community's self-promo rules, and keep a human in the loop to review and post. This markets on Reddit the honest way: contribute value, disclose who you are, never astroturf. Distilled from the playbook behind doany.ai's Reddit agent. Triggers on "find reddit opportunities", "reddit marketing", "reddit automation", "reply on reddit for my product", "reddit community engagement", "reddit lead gen", or any ask to turn Reddit threads into genuine, disclosed marketing replies.

Marketing & SEO1.1M installs

twitter-automation

101-skills/superpowers

Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet

Marketing & SEO880K installs

twitter-automation

magentosh/superpowers

Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet

Marketing & SEO771.7K installs

twitter-automation

qu-skills/superpowers

Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet

Marketing & SEO564.3K installs

product-launch-video

heygen-com/hyperframes

Turn a product or marketing URL, pasted script, or brief into a product launch / promo video — SaaS promos, feature reveals, product demos, app and company launches. Use when the user wants to market, launch, promote, or reveal a product; the default for any commercial URL. Site tours / showcases of a website route here too — the brief carries the show-it-as-is intent. Unclear → /hyperframes.

Marketing & SEO538.7K installs

twitter-automation

skills-shell/superpowers

Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet

Marketing & SEO453.7K installs