Agent skill · Documentation

trader-portfolio-cg

Mean-variance portfolio optimization via Conjugate Gradient — 40-60× faster than the legacy Neumann path (ADR-126 Phase 3, ADR-123 Wedge 8)

rUv71,307★ · +1,002/wk · 3 repos on radarProfile →
claude-codecodexcan modify filesMIT
Install
npx skills add ruvnet/ruflo --skill trader-portfolio-cg --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 7 KB
Bundled scripts: none
Allowed tools: BashReadmcp__ruflo-sublinear__solvemcp__plugin_ruflo-core_ruflo__memory_storemcp__plugin_ruflo-core_ruflo__memory_retrievemcp__plugin_ruflo-core_ruflo__memory_searchmcp__plugin_ruflo-core_ruflo__agentdb_pattern-search
Path: plugins/ruflo-neural-trader/skills/trader-portfolio-cg/SKILL.md
Open the folder on GitHub →
Where it comes from
Source: ruvnet/ruflo
Stars: 67,015 · +629 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

Solve the mean-variance optimization `Σ · x = μ` via Conjugate Gradient instead of the legacy Neumann series. **Why CG instead of Neumann (ADR-123 Wedge 8):** - Neumann series: ~50 µs at n=256 (legacy `npx neural-trader --portfolio optimize`) - Conjugate Gradient: ~816 ns at n=256 (this skill) - Measured speedup: 40-60×; parity within 1e-4 on a fixed seed. The covariance matrix Σ is symmetric positive-definite by construction (it's a Gram matrix on real returns), so CG is provably optimal — it converges in at most n iterations with no preconditioning, and typically far fewer when eigenvalues cluster. **Disable flag**: set `RUFLO_NEURAL_TRADER_DISABLE_CG=1` to skip the CG path entirely and fall through to step 4's legacy Neumann route. Useful for A/B validation or when an upstream covariance regression breaks SPD. **Native dispatch flag**: set `RUFLO_SUBLINEAR_NATIVE=1` to force the adapter to attempt the native `mcp__ruflo-sublinear__solve` path even when `globalThis` doesn't expose the tool (e.g. when the harness mounts it via a different transport). On any native-dispatch failure the adapter cleanly falls back to the local JS CG and records `method: 'cg-local'` in the artifact me

What's inside
Commands it runs
npm ls neural-trader 2>/dev/null || npm install --ignore-scripts neural-trader
npx neural-trader --portfolio current --json
npx neural-trader --portfolio current  # parse the text output
npx neural-trader --portfolio optimize
More from ruflo
All skills →
About this skill
What does the trader-portfolio-cg skill do?

Mean-variance portfolio optimization via Conjugate Gradient — 40-60× faster than the legacy Neumann path (ADR-126 Phase 3, ADR-123 Wedge 8)

How do I install it?

Run `npx skills add ruvnet/ruflo --skill trader-portfolio-cg --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ruvnet/ruflo, a repository with 67,015 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going