投资回报计算器
roi
by BytesAgain
Calculate and compare return on investment across projects using financial models. Use when evaluating investment decisions.
安装
claude skill add --url github.com/openclaw/skills/tree/main/skills/ckchzh/roi文档
ROI — Return on Investment Calculator
Calculate ROI for investments, compare multiple opportunities side-by-side, forecast returns over time, annualize returns for fair comparison, run scenario analysis (best/worst/expected), and maintain an investment history. Essential for investors, business analysts, product managers evaluating feature ROI, and anyone making data-driven investment decisions.
Prerequisites
- Python 3.8+
bashshell
Data Storage
All investment records and calculations are stored in ~/.roi/data.jsonl as newline-delimited JSON. Each record includes investment details, calculation results, scenarios, and timestamps.
Configuration is stored in ~/.roi/config.json.
Commands
calculate
Calculate ROI from initial investment and final value (or gain). Returns ROI percentage, net gain, and summary.
ROI_INVESTMENT=10000 ROI_RETURN=15000 bash scripts/script.sh calculate
compare
Compare ROI across multiple stored investments. Ranks by ROI percentage, annualized return, or absolute gain. Displays a comparison table.
ROI_SORT_BY=annualized bash scripts/script.sh compare
forecast
Forecast future value of an investment given an expected annual return rate over a specified number of years. Supports simple and compound interest.
ROI_INVESTMENT=10000 ROI_RATE=0.08 ROI_YEARS=10 ROI_MODEL=compound bash scripts/script.sh forecast
annualize
Convert a total ROI over any holding period into an annualized return rate for fair comparison across investments of different durations.
ROI_TOTAL_RETURN=0.45 ROI_YEARS=3.5 bash scripts/script.sh annualize
project
Create or update an investment project record. Tracks name, initial investment, current value, start date, and category.
ROI_NAME="Tech ETF" ROI_INVESTMENT=5000 ROI_CURRENT_VALUE=6200 ROI_START_DATE="2023-06-01" ROI_CATEGORY="stocks" bash scripts/script.sh project
scenario
Run scenario analysis on an investment: best case, worst case, and expected case with configurable parameters.
ROI_INVESTMENT=20000 ROI_BEST_RATE=0.15 ROI_WORST_RATE=-0.05 ROI_EXPECTED_RATE=0.08 ROI_YEARS=5 bash scripts/script.sh scenario
report
Generate a detailed report for a single investment or the entire portfolio, including ROI, annualized returns, and projections.
ROI_PROJECT_ID=<id> ROI_FORMAT=text bash scripts/script.sh report
history
View the calculation and valuation history for an investment or all investments. Shows how values changed over time.
ROI_PROJECT_ID=<id> bash scripts/script.sh history
export
Export investment data, calculations, and reports to JSON or CSV format.
ROI_OUTPUT=/tmp/roi-export.json ROI_FORMAT=json bash scripts/script.sh export
config
View or update configuration (default currency, compound model, report format, tax rate assumptions).
ROI_KEY=currency ROI_VALUE=USD bash scripts/script.sh config
help
Show usage information and available commands.
bash scripts/script.sh help
version
Display the current version of the ROI skill.
bash scripts/script.sh version
Examples
# Quick ROI calculation
ROI_INVESTMENT=10000 ROI_RETURN=13500 bash scripts/script.sh calculate
# Add an investment project
ROI_NAME="Real Estate Fund" ROI_INVESTMENT=50000 ROI_CURRENT_VALUE=58000 ROI_START_DATE="2022-01-15" bash scripts/script.sh project
# Run scenario analysis
ROI_INVESTMENT=50000 ROI_BEST_RATE=0.12 ROI_WORST_RATE=-0.03 ROI_EXPECTED_RATE=0.07 ROI_YEARS=10 bash scripts/script.sh scenario
# Compare all investments
ROI_SORT_BY=roi bash scripts/script.sh compare
# Forecast compound growth
ROI_INVESTMENT=10000 ROI_RATE=0.10 ROI_YEARS=20 ROI_MODEL=compound bash scripts/script.sh forecast
Financial Formulas Used
- ROI = (Net Gain / Investment) × 100
- Annualized ROI = ((1 + Total Return) ^ (1 / Years)) - 1
- Compound Growth = Investment × (1 + Rate) ^ Years
- Simple Growth = Investment × (1 + Rate × Years)
- Net Gain = Final Value - Initial Investment
Notes
- All monetary values are stored with 2 decimal precision.
- Compound growth is the default model; set
ROI_MODEL=simplefor simple interest. - Scenario analysis generates three projections per investment for risk assessment.
- Historical data is immutable — new entries are appended, never overwritten.
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
相关 Skills
资深架构师
by alirezarezvani
适合系统设计评审、ADR记录和扩展性规划,分析依赖与耦合,权衡单体或微服务、数据库与技术栈选型,并输出Mermaid、PlantUML、ASCII架构图。
✎ 搞系统设计、技术选型和扩展规划时,用它能更快理清架构决策与依赖关系,还能直接产出 Mermaid/PlantUML 图,方案讨论效率很高。
技术栈评估
by alirezarezvani
对比框架、数据库和云服务,结合 5 年 TCO、安全风险、生态活力与迁移复杂度做量化评估,适合技术选型、栈升级和替换路线决策。
✎ 帮你系统比较技术栈优劣,不只看功能,还把TCO、安全性和生态健康度一起量化,选型和迁移决策更稳。
资深数据科学家
by alirezarezvani
覆盖实验设计、特征工程、预测建模、因果推断与模型评估,适合用 Python/R/SQL 做 A/B 测试、时序分析和生产级 ML 落地,支撑数据驱动决策。
✎ 从 A/B 测试、因果分析到预测建模一条龙搞定,既有硬核统计方法也懂业务沟通,特别适合把数据结论真正落地。
相关 MCP 服务
PostgreSQL 数据库
编辑精选by Anthropic
PostgreSQL 是让 Claude 直接查询和管理你的数据库的 MCP 服务器。
✎ 这个服务器解决了开发者需要手动编写 SQL 查询的痛点,特别适合数据分析师或后端开发者快速探索数据库结构。不过,由于是参考实现,生产环境使用前务必评估安全风险,别指望它能处理复杂事务。
SQLite 数据库
编辑精选by Anthropic
SQLite 是让 AI 直接查询本地数据库进行数据分析的 MCP 服务器。
✎ 这个服务器解决了 AI 无法直接访问 SQLite 数据库的问题,适合需要快速分析本地数据集的开发者。不过,作为参考实现,它可能缺乏生产级的安全特性,建议在受控环境中使用。
Firecrawl 智能爬虫
编辑精选by Firecrawl
Firecrawl 是让 AI 直接抓取网页并提取结构化数据的 MCP 服务器。
✎ 它解决了手动写爬虫的麻烦,让 Claude 能直接访问动态网页内容。最适合需要实时数据的研究者或开发者,比如监控竞品价格或抓取新闻。但要注意,它依赖第三方 API,可能涉及隐私和成本问题。
相关资讯
Google 的 Android Bench 基准测试平台将 OpenAI 的 GPT 5.5 评为 Android 开发最佳 AI 模型,超越 Gemini。评测基于真实世界问题,但专家提醒公共基准可能受数据污染影响。
Google 在 I/O 大会上宣布 Android Studio 支持 GPT 和 Claude 模型,开发者可选用不同模型构建应用。Android CLI 发布 1.0 稳定版,支持 AI 智能体操作。
Android CLI 1.0 已稳定可用,支持 AI 智能体(如 Claude Code、Codex)通过命令行加速安卓开发。Google 还推出了 Antigravity 可选包,整合了 Android CLI 工具。