PortfolioOptimisers.jl julia-source-code.instructions.md

PortfolioOptimisers.jl julia-source-code.instructions.md is an instructions file for GitHub Copilot from dcelisgarza/PortfolioOptimisers.jl. It costs 2,812 tokens per session, scanned A, original, MIT.

A Julia coding guide for PortfolioOptimisers.jl, a Julia library for building and analysing investment portfolios. It explains how estimators, algorithms, results, types, and constructors should be structured.

In plain words
What is it for?
Use it when adding or changing Julia source code for portfolio estimators, algorithms, results, type definitions, or constructors.
Why use it?
It helps contributors extend the library without mixing user-facing calculations with internal tuning logic or returning inconsistent data types.

Instructions file for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/dcelisgarza/portfoliooptimisers.jl/julia-source-code
Clone the repo
git clone --depth 1 https://github.com/dcelisgarza/PortfolioOptimisers.jl

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for PortfolioOptimisers.jl julia-source-code.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dcelisgarza/portfoliooptimisers.jl/julia-source-code.svg)](https://agentmods.dev/instructions/dcelisgarza/portfoliooptimisers.jl/julia-source-code)
Your own site
<a href="https://agentmods.dev/instructions/dcelisgarza/portfoliooptimisers.jl/julia-source-code"><img src="https://agentmods.dev/badge/instructions/dcelisgarza/portfoliooptimisers.jl/julia-source-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,812 This file is loaded in full into every session.
When invoked 2,812 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02812 $0.02812
Opus 5 $0.01406 $0.01406
Sonnet 5 $0.00562 $0.00562
Haiku 4.5 $0.00281 $0.00281

Measured yesterday against content hash d6631af65fe4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

PortfolioOptimisers.jl julia-source-code.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/julia-source-code.instructions.md · 225 lines

How it starts

The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Julia Source Code Guidelines for PortfolioOptimisers.jl

Estimator, Algorithm, and Result Roles

These three abstract hierarchies form the backbone of the library. Understanding their distinct roles is critical for correct design.

  • Estimators (<: AbstractEstimator):

    • User-facing. Compose algorithms and/or other estimators as fields.
    • Are the entry points for computation — all high-level API functions accept estimators.
    • May consume data (e.g., a returns matrix) and produce results or transformed data.
    • Example: Covariance, EmpiricalPrior, Denoise.
  • Algorithms (<: AbstractAlgorithm):

    • Internal dispatch mechanism. Never called directly from user-facing APIs.
    • Modify or specialise the behaviour of an estimator they are stored in.
    • Must not contain data — only parameters that tune an algorithm's behaviour.
    • Example: FullMoment, SemiMoment, SpectralDenoise, Newton.
  • Results (<: AbstractResult):

    • Returned by functions that consume estimators when the output is complex enough to warrant its own type (e.g., contains multiple arrays, metadata).
    • Can themselves be passed as inputs to further computations — functions must dispatch on both estimator and result types where this makes sense.
    • Example: LowOrderPrior, ClustersResult, OptimisationResult.

Type Definitions

  • Abstract types:

    • Always prefix with Abstract (e.g., AbstractCovarianceEstimator).
    • Include comprehensive docstrings explaining their role in the type hierarchy.
    • List related types in the # Related section.
    • When subtypes must implement specific methods, document this in an # Interfaces section (see the docstring guide).
  • Struct types:

    • Use @concrete from ConcreteStructs.jl — it auto-generates type parameters so struct MyType{T1, T2} boilerplate is not needed.
    • Use DocStringExtensions.TYPEDEF in the docstring header for struct types.
    • All fields must be documented using inline "$(field_dict[:key])" strings and reflected in the # Fields section via $(DocStringExtensions.FIELDS).
    • Call @define_pretty_show(TypeName) immediately after any new struct that should display nicely in the REPL (all estimators, algorithms, and results).
    • Every source file must end with an export statement listing all public symbols defined in that file.

Read the full file on GitHub · 225 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 225 lines · 2,812 tokens per session scan A d6631af65fe4

Subscribe to this mod's changes

PortfolioOptimisers.jl julia-source-code.instructions.md is an instructions file published in the GitHub repository dcelisgarza/PortfolioOptimisers.jl (21 stars, last pushed today), licensed MIT. It adds 2,812 tokens to every session, about $0.0141 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.