Tushare Data
zillionare/zillionare
面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。
Portfolio theory, optimization algorithms, and asset allocation methods
$ npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install wentorai/research-plugins portfolio-optimization-guide --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/domains/finance/portfolio-optimization-guide .claude/skills/portfolio-optimization-guide && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "portfolio-optimization-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/finance/portfolio-optimization-guide into .claude/skills/portfolio-optimization-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "portfolio-optimization-guide", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/wentorai/research-plugins/tree/main/skills/domains/finance/portfolio-optimization-guideType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install wentorai/research-plugins portfolio-optimization-guide --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/domains/finance/portfolio-optimization-guide .agents/skills/portfolio-optimization-guide && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "portfolio-optimization-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/finance/portfolio-optimization-guide into .agents/skills/portfolio-optimization-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "portfolio-optimization-guide", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install wentorai/research-plugins portfolio-optimization-guide --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/domains/finance/portfolio-optimization-guide .cursor/skills/portfolio-optimization-guide && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "portfolio-optimization-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/finance/portfolio-optimization-guide into .cursor/skills/portfolio-optimization-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "portfolio-optimization-guide", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/wentorai/research-plugins.git --path skills/domains/finance/portfolio-optimization-guide--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install wentorai/research-plugins portfolio-optimization-guide --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/domains/finance/portfolio-optimization-guide .gemini/skills/portfolio-optimization-guide && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "portfolio-optimization-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/finance/portfolio-optimization-guide into .gemini/skills/portfolio-optimization-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "portfolio-optimization-guide", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install wentorai/research-plugins portfolio-optimization-guideInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/domains/finance/portfolio-optimization-guide .github/skills/portfolio-optimization-guide && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "portfolio-optimization-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/finance/portfolio-optimization-guide into .github/skills/portfolio-optimization-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "portfolio-optimization-guide", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install wentorai/research-plugins portfolio-optimization-guide --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/wentorai/research-plugins.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/domains/finance/portfolio-optimization-guide .opencode/skills/portfolio-optimization-guide && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "portfolio-optimization-guide" agent skill from https://github.com/wentorai/research-plugins/tree/main/skills/domains/finance/portfolio-optimization-guide into .opencode/skills/portfolio-optimization-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "portfolio-optimization-guide", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
portfolio-optimization-guidePortfolio theory, optimization algorithms, and asset allocation methods
Portfolio Optimization Guide is an agent skill from wentorai/research-plugins. Portfolio theory, optimization algorithms, and asset allocation methods
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Business, Finance & HR, covering Trading and backtesting. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.
Read from SKILL.md and the folder at commit bf44b3c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Portfolio Optimization Guide loads about 2.5k tokens when it runs. Until then it costs about 25 tokens; SKILL.md has 169 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 169 words, ~2,475 tokens.
.claude/skills/portfolio-optimization-guide/SKILL.md (or your agent's skills folder).A skill for implementing and researching portfolio optimization methods, from classical mean-variance optimization to modern robust and factor-based approaches. Covers Markowitz theory, Black-Litterman, risk parity, and machine learning-enhanced portfolio construction.
import numpy as np
from scipy.optimize import minimize
def mean_variance_optimize(expected_returns: np.ndarray,
cov_matrix: np.ndarray,
target_return: float = None,
risk_free_rate: float = 0.02) -> dict:
"""
Markowitz mean-variance optimization.
expected_returns: array of expected returns for each asset
cov_matrix: covariance matrix of asset returns
target_return: target portfolio return (None for max Sharpe)
"""
n_assets = len(expected_returns)
def portfolio_volatility(weights):
return np.sqrt(weights @ cov_matrix @ weights)
def neg_sharpe(weights):
ret = weights @ expected_returns
vol = portfolio_volatility(weights)
return -(ret - risk_free_rate) / vol
# Constraints
constraints = [
{"type": "eq", "fun": lambda w: np.sum(w) - 1}, # weights sum to 1
]
if target_return is not None:
constraints.append(
{"type": "eq", "fun": lambda w: w @ expected_returns - target_return}
)
# Bounds: no short selling (0 to 1 per asset)
bounds = [(0, 1) for _ in range(n_assets)]
# Initial guess: equal weight
w0 = np.ones(n_assets) / n_assets
if target_return is not None:
# Minimize volatility for given return
result = minimize(portfolio_volatility, w0,
bounds=bounds, constraints=constraints)
else:
# Maximize Sharpe ratio
result = minimize(neg_sharpe, w0,
bounds=bounds, constraints=constraints)
weights = result.x
ret = weights @ expected_returns
vol = portfolio_volatility(weights)
return {
"weights": {f"asset_{i}": round(w, 4) for i, w in enumerate(weights)},
"expected_return": round(ret, 4),
"volatility": round(vol, 4),
"sharpe_ratio": round((ret - risk_free_rate) / vol, 4),
}def compute_efficient_frontier(expected_returns: np.ndarray,
cov_matrix: np.ndarray,
n_points: int = 50) -> list[dict]:
"""
Compute the efficient frontier by solving for minimum variance
portfolios at each target return level.
"""
min_ret = expected_returns.min() * 0.8
max_ret = expected_returns.max() * 1.1
target_returns = np.linspace(min_ret, max_ret, n_points)
frontier = []
for target in target_returns:
try:
result = mean_variance_optimize(
expected_returns, cov_matrix, target_return=target
)
frontier.append({
"return": result["expected_return"],
"volatility": result["volatility"],
"sharpe": result["sharpe_ratio"],
})
except Exception:
continue
return frontierdef black_litterman(market_cap_weights: np.ndarray,
cov_matrix: np.ndarray,
P: np.ndarray,
Q: np.ndarray,
omega: np.ndarray = None,
risk_aversion: float = 2.5,
tau: float = 0.05) -> dict:
"""
Black-Litterman model for combining market equilibrium with
investor views.
market_cap_weights: market-cap weighted portfolio
cov_matrix: covariance matrix
P: pick matrix (k views x n assets), identifies assets in each view
Q: view returns (k x 1), expected returns for each view
omega: view uncertainty (k x k), diagonal matrix
"""
# Step 1: Implied equilibrium returns (reverse optimization)
pi = risk_aversion * cov_matrix @ market_cap_weights
# Step 2: View uncertainty (if not provided, use He-Litterman)
if omega is None:
omega = np.diag(np.diag(tau * P @ cov_matrix @ P.T))
# Step 3: Posterior expected returns
tau_sigma = tau * cov_matrix
inv_tau_sigma = np.linalg.inv(tau_sigma)
inv_omega = np.linalg.inv(omega)
posterior_precision = inv_tau_sigma + P.T @ inv_omega @ P
posterior_cov = np.linalg.inv(posterior_precision)
posterior_mean = posterior_cov @ (inv_tau_sigma @ pi + P.T @ inv_omega @ Q)
return {
"equilibrium_returns": pi.round(4).tolist(),
"posterior_returns": posterior_mean.round(4).tolist(),
"posterior_covariance": posterior_cov.round(6).tolist(),
}def risk_parity(cov_matrix: np.ndarray, budget: np.ndarray = None) -> dict:
"""
Risk parity: each asset contributes equally to total portfolio risk.
budget: risk budget (default: equal, 1/n each)
"""
n = cov_matrix.shape[0]
if budget is None:
budget = np.ones(n) / n
def objective(weights):
portfolio_vol = np.sqrt(weights @ cov_matrix @ weights)
marginal_risk = cov_matrix @ weights
risk_contribution = weights * marginal_risk / portfolio_vol
target_risk = budget * portfolio_vol
return np.sum((risk_contribution - target_risk) ** 2)
constraints = [{"type": "eq", "fun": lambda w: np.sum(w) - 1}]
bounds = [(0.01, 1) for _ in range(n)]
w0 = np.ones(n) / n
result = minimize(objective, w0, bounds=bounds, constraints=constraints)
weights = result.x
# Verify risk contributions
portfolio_vol = np.sqrt(weights @ cov_matrix @ weights)
marginal_risk = cov_matrix @ weights
risk_contrib = weights * marginal_risk / portfolio_vol
risk_pct = risk_contrib / risk_contrib.sum()
return {
"weights": weights.round(4).tolist(),
"portfolio_volatility": round(portfolio_vol, 4),
"risk_contributions": risk_pct.round(4).tolist(),
"max_risk_deviation": round(np.max(np.abs(risk_pct - budget)), 4),
}import statsmodels.api as sm
def estimate_factor_exposures(asset_returns: pd.DataFrame,
factor_returns: pd.DataFrame) -> pd.DataFrame:
"""
Estimate asset exposures to Fama-French factors using regression.
factor_returns columns: Mkt-RF, SMB, HML, RMW, CMA (5-factor model)
"""
results = []
for asset in asset_returns.columns:
y = asset_returns[asset] - factor_returns.get("RF", 0)
X = sm.add_constant(factor_returns[["Mkt-RF", "SMB", "HML", "RMW", "CMA"]])
model = sm.OLS(y, X).fit()
results.append({
"asset": asset,
"alpha": round(model.params["const"], 6),
"beta_market": round(model.params["Mkt-RF"], 4),
"beta_size": round(model.params["SMB"], 4),
"beta_value": round(model.params["HML"], 4),
"beta_profit": round(model.params["RMW"], 4),
"beta_invest": round(model.params["CMA"], 4),
"r_squared": round(model.rsquared, 4),
})
return pd.DataFrame(results)def rebalance_with_costs(current_weights: np.ndarray,
target_weights: np.ndarray,
portfolio_value: float,
cost_per_trade: float = 0.001,
threshold: float = 0.02) -> dict:
"""
Determine rebalancing trades considering transaction costs.
threshold: minimum deviation to trigger rebalancing (2% default)
cost_per_trade: proportional transaction cost (10 bps)
"""
deviations = np.abs(current_weights - target_weights)
needs_rebalance = np.any(deviations > threshold)
if not needs_rebalance:
return {"action": "hold", "reason": "within threshold"}
trades = target_weights - current_weights
trade_value = np.abs(trades) * portfolio_value
total_cost = trade_value.sum() * cost_per_trade
return {
"action": "rebalance",
"trades": trades.round(4).tolist(),
"turnover": np.abs(trades).sum() / 2,
"transaction_cost": round(total_cost, 2),
"cost_as_pct": round(total_cost / portfolio_value * 100, 4),
}© wentorai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/domains/finance/portfolio-optimization-guide of wentorai/research-plugins.
Open the folder on GitHubat commit bf44b3c
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.
Portfolio Optimization Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Portfolio Optimization Guide this skillwentorai/research-plugins | 298 | 1 repos | ~2.5k | Automated safety check: Pass | MIT | |
| Tushare Datazillionare/zillionare | 319 | 2 repos | ~2.3k | Automated safety check: Pass | None | |
| Tradingview MCPatilaahmettaner/tradingview-mcp | 5k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Digital Oraclekomako-workshop/digital-oracle | 870 | — | ~5.9k | Automated safety check: Pass | MIT | |
| Fintoolsecond-state/fintool | 316 | 1 repos | ~5.9k | Automated safety check: Pass | None | |
| Polyclawchainstacklabs/polyclaw | 360 | 1 repos | ~2k | Automated safety check: Pass | Apache-2.0 |
zillionare/zillionare
面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。
atilaahmettaner/tradingview-mcp
AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…
komako-workshop/digital-oracle
Answer prediction questions using market trading data, not opinions.
second-state/fintool
Financial trading CLIs — spot and perp trading on Hyperliquid, Binance, Coinbase, OKX.
chainstacklabs/polyclaw
Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.
facioquo/stock-indicators-dotnet
Format and lint Markdown in this repository against GitHub Flavored Markdown and its markdownlint-cli2 configuration — headers, lists, code fences, callouts (VitePress containers on docs-site pages…
wentorai/research-plugins
Craft structured research abstracts that maximize clarity and journal acceptance
wentorai/research-plugins
Manage academic citations across BibTeX, APA, MLA, and Chicago formats
wentorai/research-plugins
Summarize academic papers with structured extraction of key elements
wentorai/research-plugins
Evidence-based study techniques for academic learning and retention
wentorai/research-plugins
Adjust writing tone and register for academic audiences and venues
wentorai/research-plugins
Academic translation, post-editing, and Chinglish correction guide
Categories
Portfolio theory, optimization algorithms, and asset allocation methods. Portfolio Optimization Guide is an agent skill from wentorai/research-plugins.
Portfolio Optimization Guide fits situations like: tasks that involve Trading and backtesting.
Run `npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a claude-code`. Or copy the skill folder (skills/domains/finance/portfolio-optimization-guide in wentorai/research-plugins) into .claude/skills/portfolio-optimization-guide in your project. Claude Code loads it when a task matches its description.
Run `npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a codex`. Or copy the skill folder (skills/domains/finance/portfolio-optimization-guide in wentorai/research-plugins) into .agents/skills/portfolio-optimization-guide in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wentorai/research-plugins --skill portfolio-optimization-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/portfolio-optimization-guide, .gemini/skills/portfolio-optimization-guide, .github/skills/portfolio-optimization-guide and .opencode/skills/portfolio-optimization-guide in your project.
SKILL.md names no scripts, command-line tools or credentials: Portfolio Optimization Guide is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Portfolio Optimization Guide is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Portfolio Optimization Guide: Tushare Data (zillionare/zillionare, 319 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 870 stars) and Fintool (second-state/fintool, 316 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 405 skills in this directory. The repository was last updated on June 19, 2026.
Source: wentorai/research-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.