trader-portfolio-cg
Skill by ruvnet
Solves mean-variance portfolio optimization with Conjugate Gradient instead of the legacy Neumann series. Aimed at traders and developers who compute portfolio weights with the neural-trader package.
Install trader-portfolio-cg
Built from the published package, never by AI.
git clone --depth 1 https://github.com/ruvnet/ruflo /tmp/ruflo && mkdir -p ~/.claude/skills && cp -r /tmp/ruflo/plugins/ruflo-neural-trader/skills/trader-portfolio-cg ~/.claude/skills/trader-portfolio-cgRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/ruvnet/ruflo /tmp/ruflo && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/ruflo/plugins/ruflo-neural-trader/skills/trader-portfolio-cg ~/.gemini/antigravity-cli/skills/trader-portfolio-cgAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install trader-portfolio-cg in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
The trader-portfolio-cg skill solves the mean-variance optimization equation Σ · x = μ using Conjugate Gradient (CG) instead of the legacy Neumann series. The source reports about 816 ns for CG against about 50 µs for Neumann at n=256, a 40 to 60 times speedup, with parity within 1e-4 on a fixed seed.
The skill reads a covariance matrix and expected-return vector, then calls a SublinearAdapter. The adapter uses the native mcp__ruflo-sublinear__solve tool when reachable and a local JavaScript CG otherwise. If the input is not symmetric positive-definite or the adapter fails, it falls back to npx neural-trader --portfolio optimize and records the method in the stored artifact. It is aimed at traders and developers who manage portfolio weights with the neural-trader package.
Written from the project's SKILL.md and checked against it.
What it can do
- Solve covariance systemSolves Σ · x = μ with Conjugate Gradient and returns weights, iterations and residual.
- Native solver dispatchCalls mcp__ruflo-sublinear__solve when reachable, otherwise a local JavaScript CG.
- Legacy fallbackFalls back to npx neural-trader --portfolio optimize when the CG path cannot run.
- mcp__plugin_ruflo-core_ruflo__memory_storeSaves weights and method metadata to the trading-risk namespace.
- mcp__plugin_ruflo-core_ruflo__memory_searchLooks up a stored covariance matrix and expected returns from prior runs.
- mcp__plugin_ruflo-core_ruflo__agentdb_pattern-searchCompares new weights with historical patterns as an optional cross-check.
What you need
- npm
- neural-trader package (installed with npm if missing)
- Covariance matrix and expected-return vector from the user or a prior AgentDB run
- ruflo memory tools for the trading-risk namespace
Try asking
- Optimize my portfolio weights using my covariance matrix and expected returns
- Solve the mean-variance problem with CG and show which method was used
- Check my new portfolio weights against historical patterns in trading-risk
Good to know
- neural-trader 2.8.11 does not return a covariance matrix or expected returns, so inputs must come from the user or AgentDB.
- The source says the returns matrix is not wired in neural-trader 2.8.11.
- If weights differ by more than 30% in any one asset from the historical median, the skill flags them for human review.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: plugins/ruflo-neural-trader/skills/trader-portfolio-cg/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: Bash Read mcp__ruflo-sublinear__solve mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_retrieve mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search
-
SKILL.md7 KB
Alternatives to trader-portfolio-cg
All alternatives →Lists live launchpad token feeds and AI-detected hot topics for meme tokens on BSC, Solana and Base. Covers new, finalizing and just-migrated tokens on launchpads such as Pump.fun and Four.meme.
The okx-market skill lets an AI assistant retrieve cryptocurrency market data from the OKX V5 REST API. It is aimed at users who want spot, derivatives and index data in Python without an account.
Calculates key SaaS health metrics such as ARR, churn, LTV and CAC from raw business numbers, then gives prioritized advice. Built for founders and finance leads who share revenue or customer figures.
Fetches U.S. SEC EDGAR data for research. It resolves a ticker to its CIK, lists recent filings with primary-document URLs, and pulls XBRL financial series. Built for analysts who need free, U.S.-only filing data.
Provides free, no-auth access to Eastmoney market data for A-shares, Hong Kong stocks and US stocks. It covers fund flows, dragon-tiger lists, financial statements and stock screening.
Reads and manages a user's QuickBooks business through Intuit's official MCP server. It answers finance questions from reports, invoices, customers, products and benchmarks, and completes approved actions.
Compare with meme-rush, okx-market or saas-metrics-coach
trader-portfolio-cg: common questions
Why use Conjugate Gradient instead of Neumann?
The source says CG takes about 816 ns at n=256 versus about 50 µs for the legacy Neumann series, a 40 to 60 times speedup.
What happens if the native solver is unavailable?
The adapter falls back to a local JavaScript CG and records method as cg-local in the artifact metadata.
How do I turn off the CG path?
Set RUFLO_NEURAL_TRADER_DISABLE_CG=1 to skip CG and use the legacy Neumann route.
How do I install trader-portfolio-cg?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is trader-portfolio-cg free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is trader-portfolio-cg safe to use?
It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to trader-portfolio-cg?
Similar skills: meme-rush, okx-market, saas-metrics-coach, sec-edgar.
