agentsclimarketplace

Lookahead safety

Skill jefrnc/quant-llm-skills/skills/lookahead-safety

Use when working with historical financial data, backtests, point-in-time analysis, SEC filings, XBRL data, or any time-series quant research. Prevents look-ahead bias and survivorship bias by enforcing filing_date / accepted as the known-date, never period_end. Triggers on phrases like "as of", "historical", "backtest", "lookahead", "point-in-time".From its SKILL.md

Install
npx -y skills add jefrnc/quant-llm-skills --skill lookahead-safety

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.5 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

Lookahead Safety

The single most common bug in quant research with LLMs: using data that was not yet known at the moment you claim to have known it. This skill defines the rules to keep historical analysis honest.

The core rule

The known-date is the date a piece of information was PUBLISHED, not the date the information is ABOUT.

  • A 10-K covering fiscal year 2023 may be filed in March 2024. In January 2024, that 10-K did not exist.
  • An S-3 effective on 2024-04-15 was unknown on 2024-04-14.
  • An XBRL SharesOutstanding datapoint with period_end: 2023-12-31 is known only after the filing that contains it is published.

When asked to compute or recommend anything as of a date D, only data where filing_date <= D is admissible.

Field-by-field reference for SEC data

FieldUse as known-date?Notes
filing_date / acceptedDate✅ YESThe publication moment
period_end / periodOfReport❌ NEVERThe accounting period the data covers
effectiveDate (S-3, etc.)✅ YESWhen the registration becomes usable
reportDate on XBRL facts❌ NOPeriod covered, not publication
accepted timestamp✅ YESMost precise — use when intra-day matters

Common traps

  1. The XBRL trap. companyfacts.json returns datapoints keyed by period_end. Naively iterating these as a time series leaks future information — the datapoint with period_end: 2023-12-31 was first published months later. Always join with the originating filing's accepted date and treat THAT as availability.

  2. The amendment trap. A 10-K/A (amendment) supersedes the original 10-K but is filed later. At time D between the original and the amendment, only the original was known. Don't apply restated numbers to dates before the amendment's filing_date.

  3. The "as of today" trap in backtests. When using current data (e.g., current_shares_outstanding), confirm whether the source provides a point-in-time history or only the current snapshot. A snapshot is unsafe for any historical query.

  4. The price-data trap. Adjusted prices are computed using SPLIT factors from splits that may not have happened yet at date D. Use raw OHLC + a split history table where each split has its own ex-date as the cutoff.

  5. The earnings-revision trap. Restated earnings (a later 10-K/A correcting a previous 10-K) were unknown until restatement. Backtests that use the latest version of earnings for old dates are fictional.

Workflow when the user asks "what was X on date D"

  1. Identify the data source (XBRL, filings, prices, derived metrics).
  2. Determine the source's publication semantics (when did this datapoint become observable to a market participant?).
  3. Filter by publication_date <= D. If publication is unknown, stop and tell the user the query is unsafe.
  4. State explicitly which as_of_date was used and which records were excluded for being future-dated.

Workflow when writing backtest code

  • Every read of historical state must take a query_date argument and filter on filing_date <= query_date (or equivalent).
  • Never store "current" values in a structure used for historical lookup.
  • When in doubt, prefer the EARLIEST plausible publication date over the latest — bias toward under-claiming what was knowable.
  • Tests: include a "future-data leak" test that fails if any record with filing_date > query_date is returned by a historical query.

Phrases that should trigger this skill

  • "what was the float of X on [past date]"
  • "backtest this strategy"
  • "shares outstanding at [past date]"
  • "compute [metric] historically"
  • "build a point-in-time database"
  • "as of [date]"
  • "lookahead-safe"
  • "survivorship bias" / "look-ahead bias"

What this skill is NOT

This is not a forecasting or prediction skill. It does not tell you what will happen. It tells you what you were ALLOWED to know at a moment in time. Use it before any historical reasoning. Combine with domain skills (SEC filing types, dilution events) for full coverage.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most research analysis skills give in ~1.0k tokens

Counted across 1,213 of the 2,113 authors here whose files we hold, read 2026-09-06

  • Cite sources for every important claimin 47 of 1213, across 38 files
  • Separate facts from inferences and recommendationsin 21 of 1213, across 12 files
  • Write findings to a markdown filein 19 of 1213
  • Label every insight with a confidence levelin 18 of 1213, across 8 files
  • Read product marketing context before asking questionsin 18 of 1213, across 8 files
  • Rank themes by frequency and intensityin 16 of 1213, across 6 files
  • Establish research mode before proceedingin 16 of 1213, across 6 files
  • Segment survey responses by customer tier or tenurein 16 of 1213, across 6 files
  • Categorize support tickets before analyzingin 16 of 1213, across 6 files
  • Weight research sources from the last twelve monthsin 16 of 1213, across 6 files
  • Use at least five data points per segmentin 15 of 1213, across 5 files
  • Extract verbatim quotes for all research findingsin 15 of 1213, across 5 files

Said here and by no other author read

  • use publication date as the known-date
  • filter data where filing_date is less than or equal to query_date
  • stop if publication date is unknown
  • state the as_of_date used in the analysis
  • exclude records with future filing_dates
  • use raw prices with split history tables

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.