quantflow-tutorial-instructions

A set of project instructions for writing and publishing tutorials in the Quantflow documentation. It defines where tutorial pages, example Python scripts, generated images, and captured output belong, along with the required page structure.

In plain words
What is it for?
Use it when adding a Quantflow tutorial, creating its example script, updating the documentation index and navigation, building examples, or previewing the docs locally.
Why use it?
Without shared documentation rules, tutorials can be stored inconsistently, miss navigation links, or become difficult to build and review. These instructions make each new tutorial follow the project's expected process.

Instructions file for GitHub Copilot

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/quantmind/quantflow/tutorial
Clone the repo
git clone --depth 1 https://github.com/quantmind/quantflow

Made for: GitHub Copilot.

Per session 1,024 This file is loaded in full into every session.
When invoked 1,024 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 $0.01024 $0.01024
Opus 5 $0.00512 $0.00512
Sonnet 5 $0.00205 $0.00205
Haiku 4.5 $0.00102 $0.00102

Measured yesterday against content hash 3dee76d2207c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

quantflow-tutorial-instructions 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/tutorial.instructions.md · 97 lines

How it starts

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

Tutorial Instructions

File locations

  • Tutorial pages: docs/tutorials/<name>.md
  • Example scripts: docs/examples/<name>.py
  • Generated images: docs/assets/examples/<name>.png
  • Script stdout captured to: docs/examples/output/<name>.out
  • Every new tutorial must be added to the nav section of mkdocs.yml under Tutorials.
  • Update docs/tutorials/index.md with a row in the summary table.

Building

  • Build a single example: uv run python docs/examples/<name>.py
  • Build all examples and capture output: make docs-examples
  • Preview the docs locally: uv run mkdocs serve

Tutorial page structure

Each tutorial markdown file should follow this order:

  1. H1 title — the subject, not "Tutorial on X".
  2. One-paragraph introduction — what the tutorial demonstrates and why it is useful. Link to the relevant API classes using [ClassName][fully.qualified.path].
  3. Sections (H2) — cover the concept first, then show usage, then show results. Use H3 subsections for variants (different parameter regimes, maturities, etc.).
  4. Code section — always the last H2. Embed the full example script with:
    ```python
    --8<-- "docs/examples/<name>.py"
    ```
    
    If the script prints structured output, embed it too:
    ```
    --8<-- "docs/examples/output/<name>.out"
    ```
    

Example scripts

  • Each script must be self-contained and runnable with uv run python docs/examples/<name>.py.
  • Place shared helpers in docs/examples/_utils.py — do not duplicate utility code.
  • Use assets_path(filename) from _utils.py to get the correct path when saving images.
  • Use plotly for all charts. Save to PNG with fig.write_image(assets_path(...), width=900, height=500). Use width=1600, height=800 for side-by-side subplot layouts.
  • When overlaying an analytical curve with a numerical result (e.g. PDF from characteristic function), plot the analytical result as a solid line and the numerical result as circle markers (mode="markers", marker=dict(symbol="circle")). This makes the discretization points visible and the two series easy to distinguish.
  • Do not print raw numbers — emit only what belongs in the captured .out file.
  • Scripts must produce no warnings when run cleanly (fix the root cause, e.g. avoid x=0 in domains where the PDF is singular).
  • The build_examples helper in _utils.py runs every non-underscore script and captures stdout; keep scripts idempotent and deterministic.

Read the full file on GitHub · 97 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 · 97 lines · 1,024 tokens per session scan A 3dee76d2207c

Subscribe to this mod's changes

quantflow-tutorial-instructions is an instructions file published in the GitHub repository quantmind/quantflow (52 stars, last pushed 15d ago), licensed BSD-3-Clause. It adds 1,024 tokens to every session, about $0.0051 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-08-30.