← Back to Skills Marketplace
ckchzh

Investment Portfolio

by BytesAgain2 · GitHub ↗ · v4.0.0 · MIT-0
cross-platform ✓ Security Clean
1369
Downloads
0
Stars
6
Active Installs
20
Versions
Install in OpenClaw
/install investment-portfolio
Description
Track investments with buy/sell records, allocation charts, and P/L analysis. Use when managing a stock or crypto portfolio, rebalancing, or comparing assets.
README (SKILL.md)

investment-portfolio

Investment portfolio tracker — record holdings with buy prices, track performance and P/L, view allocation charts, analyze risk, calculate DCA, manage dividends, rebalance to targets, compare assets, and view sector breakdown. All data stored locally in JSONL format.

Commands

add

Add a holding — specify ticker, number of shares, and purchase price.

scripts/script.sh add AAPL 10 175.50
scripts/script.sh add BTC 0.5 42000

remove

Remove a holding by ticker symbol.

scripts/script.sh remove TSLA

update

Update the current market price of a holding.

scripts/script.sh update AAPL 195.00

list

Show all holdings with shares, buy price, and current price.

scripts/script.sh list

summary

Portfolio summary — total value, total cost, overall P/L.

scripts/script.sh summary

allocation

ASCII bar chart showing portfolio allocation by ticker as percentage.

scripts/script.sh allocation

performance

Detailed gain/loss analysis per holding with percentage returns.

scripts/script.sh performance

risk

Risk metrics — standard deviation of returns and diversification score.

scripts/script.sh risk

rebalance

Generate buy/sell suggestions to match target allocation percentages.

scripts/script.sh rebalance '{"AAPL":40,"GOOGL":30,"BTC":30}'

dca

Dollar-cost averaging calculator — monthly investment table over 12 months.

scripts/script.sh dca AAPL 500

dividend

Calculate dividend yield from annual dividend and current price.

scripts/script.sh dividend AAPL 3.76 195.00

compare

Compare two holdings side by side — shares, prices, and P/L.

scripts/script.sh compare AAPL GOOGL

sectors

Sector breakdown with allocation chart. Uses built-in ticker-to-sector mapping.

scripts/script.sh sectors

export

Export portfolio data as CSV.

scripts/script.sh export csv

history

Show transaction history from the log file.

scripts/script.sh history

help

scripts/script.sh help

version

scripts/script.sh version

Examples

# Build a portfolio
scripts/script.sh add AAPL 10 175
scripts/script.sh add GOOGL 5 140
scripts/script.sh add BTC 0.1 42000
scripts/script.sh update AAPL 195

# Analyze
scripts/script.sh summary
scripts/script.sh allocation
scripts/script.sh performance
scripts/script.sh risk

# Rebalance
scripts/script.sh rebalance '{"AAPL":50,"GOOGL":30,"BTC":20}'
scripts/script.sh compare AAPL GOOGL
scripts/script.sh sectors

Configuration

Variable Required Description
PORTFOLIO_DIR No Data directory (default: ~/.local/share/investment-portfolio/)

Data Storage

All data saved in ~/.local/share/investment-portfolio/:

  • holdings.jsonl — Portfolio holdings (one JSON object per line)
  • history.log — Transaction log

Requirements

  • bash 4.0+
  • python3 (for JSONL processing and calculations)

All prices are manually entered — no external API calls.


Powered by BytesAgain | bytesagain.com | [email protected]

Usage Guidance
This skill appears to do what it claims: a local portfolio tracker implemented as a bash script that runs python snippets. Before installing or running: (1) review the full scripts/script.sh yourself (you already have it) to confirm there are no hidden network calls in the truncated portion; (2) note that data is stored unencrypted in your home directory (script defaults to ~/.investment-portfolio unless you set PORTFOLIO_DIR), so do not store sensitive credentials or private data there; (3) if you prefer the SKILL.md path (~/.local/share/...) update PORTFOLIO_DIR or the docs to avoid confusion; (4) ensure you are comfortable executing a shell script that writes files — consider running it in a limited account or container if you want extra isolation.
Capability Analysis
Type: OpenClaw Skill Name: investment-portfolio Version: 4.0.0 The investment-portfolio skill is a local tool for tracking financial holdings, calculating performance metrics, and generating rebalancing suggestions. The logic is implemented in a bash script (scripts/script.sh) that uses Python heredocs for data processing, storing all information locally in a JSONL file within the user's home directory. There are no network requests, no attempts to access sensitive system files (like SSH keys or environment variables), and no evidence of malicious intent or prompt injection in the documentation (SKILL.md).
Capability Assessment
Purpose & Capability
Name/description align with the included scripts: add/remove/update/list/analysis features are implemented in scripts/script.sh. The declared runtime requirements (bash, python3) are appropriate. Minor mismatch: SKILL.md documents a default data directory of ~/.local/share/investment-portfolio/ while the script defaults to $HOME/.investment-portfolio (PORTFOLIO_DIR override is supported). This is likely a documentation/config inconsistency rather than malicious.
Instruction Scope
SKILL.md and the script operate entirely on local files (holdings.jsonl, history.log) and prompt the user to input prices manually; the script invokes embedded python snippets but they only read/write the DB file and history. No external API/network calls are present in the visible code. The script will create and write files in the user's home directory (un-encrypted JSONL and logs), which is expected for this tool but worth noting for privacy.
Install Mechanism
There is no install spec; this is an instruction-only skill with an included bash script. That is low-risk compared to arbitrary network downloads or package installs.
Credentials
The skill requests no credentials and only an optional PORTFOLIO_DIR environment variable to override the data directory. It uses HOME to locate the default directory. No unrelated secrets or config paths are requested.
Persistence & Privilege
always is false and the skill does not modify other skills or system-wide agent settings. It writes files to its own data directory under the user's home, which is normal for this kind of utility.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install investment-portfolio
  3. After installation, invoke the skill by name or use /investment-portfolio
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v4.0.0
v4.0.0: Complete rewrite — clean heredocs, all 16 commands with real calculations.
v3.0.1
v3.0.1: SKILL.md aligned with new rebalance/compare/sectors commands.
v3.0.0
v3.0.0: Implemented rebalance, compare, sectors commands with real calculations.
v2.4.2
v2.4.2: SKILL.md accurately describes offline portfolio tracker with placeholder commands noted.
v2.4.1
v2.4.1: SKILL.md from script help output
v2.4.0
v2.4.0: SKILL.md rewritten to match script.sh commands exactly.
v2.3.8
update
v2.3.7
Fix VT: remove old skeleton scripts, align SKILL.md
v2.3.6
SKILL.md aligned with script.sh for moderation fix
v2.3.5
v2.5 standard: Use-when desc, homepage, source, security fix
v2.3.4
yaml-fix+quality
v2.3.3
yaml-fix+quality
v2.3.2
Quality upgrade
v2.3.1
Standards compliance: unique content, no template text
v2.3.0
Quality fixes: removed third-party references, aligned docs with implementation
v2.2.0
Enhanced descriptions for better AI triggering
v1.0.2
Runtime fix
v2.0.0
Rewritten: full functional tool replacing prompt shell
v1.0.1
- Removed the "tips.md" file. - No changes to core functionality or documentation.
v1.0.0
Initial release of Investment Portfolio skill: - Provides portfolio analysis features: asset allocation, risk assessment, rebalancing, return analysis, diversification, and backtesting. - Includes six core commands: allocate, risk, rebalance, return, diversify, and backtest. - Supports both English and Chinese descriptions and workflows.
Metadata
Slug investment-portfolio
Version 4.0.0
License MIT-0
All-time Installs 6
Active Installs 6
Total Versions 20
Frequently Asked Questions

What is Investment Portfolio?

Track investments with buy/sell records, allocation charts, and P/L analysis. Use when managing a stock or crypto portfolio, rebalancing, or comparing assets. It is an AI Agent Skill for Claude Code / OpenClaw, with 1369 downloads so far.

How do I install Investment Portfolio?

Run "/install investment-portfolio" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Investment Portfolio free?

Yes, Investment Portfolio is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Investment Portfolio support?

Investment Portfolio is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Investment Portfolio?

It is built and maintained by BytesAgain2 (@ckchzh); the current version is v4.0.0.

💬 Comments