self-driving-portfolio
Skill5 starsChanged 3 months agoMITView on GitHub
This skill should be used when the user asks to "build a strategic asset allocation", "run a self-driving portfolio", "compare portfolio methods", "audit an SAA run", or "produce an IPS-governed policy portfolio".
- Reads credentials
In this repository7 other files it gives its agents.
- self-driving-portfolioSkill
- asset-class-cmaSkill
- cio-ensembleSkill
- covarianceSkill
- macro-regimeSkill
- peer-reviewSkill
- portfolio-constructionSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run a governed six-stage Strategic Asset Allocation (SAA) research workflow.
- Very specific: line 26
Stop when the IPS is ambiguous, contradictory, or mathematically infeasible.
- Distinctive: line 47
Run the stages only through the governed orchestrator for a final recommendation.
- Distinctive: line 56
Run ten deterministic portfolio-construction methods.
- Distinctive: line 69
Run verification before interpreting weights:
- Distinctive: line 87
Treat a failed or incomplete verification as unusable evidence.
- Distinctive: line 92
Read these governed artifacts in order:
- Distinctive: line 112
Facts: run parameters, data cutoffs, weights, metrics, verification state.
- Very specific: line 125
Use FRED_API_KEY when true FRED vintage-as-of retrieval is required.
- Distinctive: line 132
Keep LLM work limited to mandate clarification, interpretation, and narrative.
- Distinctive: line 138
place orders or connect the workflow to a broker.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Self-Driving Portfolio
Run a governed six-stage Strategic Asset Allocation (SAA) research workflow. Translate a human-authored Investment Policy Statement (IPS) into deterministic portfolio proposals, structured review, an ensemble recommendation, and a board memo. Preserve human fiduciary authority; never place trades or present research output as individualized investment advice.
Required Inputs
Collect or confirm:
- An IPS markdown file with a dated asset-universe table and computable minimum/maximum weights, an annualized volatility hard cap, and a minimum feasible-proposal escalation threshold.
- An explicit as-of date, or a valid
As-of daterow in the IPS. - A historical lookback in years.
- A covariance method:
sample,ewma, orledoit_wolf. - A unique run identifier containing only letters, numbers,
.,_, or-.
Stop when the IPS is ambiguous, contradictory, or mathematically infeasible.
Require sum(min_w) <= 1 <= sum(max_w). Refuse future as-of dates and silent
asset-universe shrinkage.
Run the Governed Pipeline
Execute from the plugin root (the directory containing .codex-plugin/ and
.claude-plugin/). In Claude Code, resolve this directory with
${CLAUDE_PLUGIN_ROOT}. In Codex, resolve it from this skill's installed
location.
python pipeline/orchestrator.py \
--ips ips/ips_template.md \
--run-id saa-2026-05-08 \
--as-of 2026-05-08 \
--lookback-years 10 \
--cov-method ledoit_wolf \
--top-k 5Run the stages only through the governed orchestrator for a final recommendation. Use individual stage scripts only for isolated research and clearly label their outputs as ungoverned.
Apply this finite-state order:
- Classify the macro regime.
- Build per-asset Capital Market Assumptions (CMAs).
- Estimate and repair the covariance matrix when necessary.
- Run ten deterministic portfolio-construction methods.
- Filter, score, and rank proposals with a deterministic Borda review.
- Combine survivors, preserve a dissenting view, and render a board memo.
Fetch macro and price data once, snapshot the exact CSV frames, and reuse the same price frame for CMA and covariance stages. Treat every boundary as fail closed. Validate each JSON artifact against its schema and semantic contract before allowing the next stage to read it. Write artifacts atomically. Snapshot the IPS. Record file hashes in the hash-chained audit log.
Verify the Result
Run verification before interpreting weights:
python pipeline/verify.py outputs/<run-id>Require ok: true. Verify:
- the IPS snapshot hash;
- raw macro/price CSV hashes, metadata, columns, row counts, and cutoffs;
- the six-stage finite-state order;
- strict JSON Schemas and semantic invariants;
- cross-artifact lineage, IPS bounds, and reproducible portfolio metrics;
- artifact byte counts and SHA-256 hashes;
- the audit-event hash chain;
- the final board memo attachment; and
- complete run status.
Treat a failed or incomplete verification as unusable evidence. Never repair a run in place. Correct the input or code, then create a new run identifier.
Interpret Outputs
Read these governed artifacts in order:
| Artifact | Purpose |
inputs/ips.md | Immutable mandate snapshot |
inputs/macro.csv | Exact macro frame consumed by the classifier |
inputs/prices.csv | Exact price frame shared by CMA and covariance |
contracts/*.schema.json | Immutable stage-contract snapshots |
regime.json | Regime probabilities, data cutoff, and FRED vintage policy |
cmas.json | Expected return, volatility, confidence, and data-through date |
covariance.json | PSD covariance, shrinkage, conditioning, and missing-data diagnostics |
pc_proposals.json | Method status, weights, metrics, rationale, and feasibility |
peer_review.json | Hard-filter results, Borda ranking, and adversarial challenger |
final_portfolio.json | Ensemble weights, dissent, metrics, and escalation state |
board_memo.md | Human-review summary |
run_manifest.json | Parameters, engine/input/schema/artifact hashes, and status |
audit.jsonl | Ordered hash-chained provenance events |
Separate three classes of information in the response:
- Facts: run parameters, data cutoffs, weights, metrics, verification state.
- Model judgments: regime tilts, expected returns, method ranking, ensemble selection.
- Required decisions: mandate clarification, escalation review, implementation approval.
Surface escalate_to_human and every escalation reason without softening or
omitting them. Present the recommendation as a research starting point, not an
authorization to rebalance.
Point-in-Time Rules
Propagate one as-of date through macro, price, CMA, covariance, proposal, review, and ensemble artifacts. Reject observations after that cutoff.
Use FRED_API_KEY when true FRED vintage-as-of retrieval is required. Without
the key, label macro data latest_revision_cutoff: observation dates are
truncated correctly, but historical values may include later revisions. Do not
describe that fallback as a fully point-in-time macro backtest.
Safety Boundaries
Keep LLM work limited to mandate clarification, interpretation, and narrative. Delegate arithmetic, optimization, validation, hashing, and state transitions to the bundled Python scripts.
Never:
- place orders or connect the workflow to a broker;
- invent missing prices, macro observations, or IPS constraints;
- continue after a schema, hash, stage-order, PSD, or universe check fails;
- overwrite a completed run directory;
- describe the hash chain as an external digital signature; or
- imply guaranteed returns or fiduciary approval.
Additional Resources
Load only the resource needed for the current task:
references/governance.md— artifact contracts, provenance, and threat model.references/limitations.md— data, estimation, optimization, and investment limitations.../macro-regime/SKILL.md— regime methodology.../asset-class-cma/SKILL.md— CMA methodology.../covariance/SKILL.md— covariance methodology.../portfolio-construction/SKILL.md— ten construction methods.../peer-review/SKILL.md— filtering and Borda review.../cio-ensemble/SKILL.md— ensemble selection and board memo.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

