xbrl-fallbacks
Skill1 starsChanged 7 months agoMITView on GitHub
Use when SEC XBRL company-facts data returns 404, is empty, or has sparse coverage — typical for recent FPIs (foreign private issuers), recent IPOs, SPACs, or shell companies. Defines the document hierarchy and extraction rules to recover shares-outstanding data from filing text when structured XBRL is unavailable.
In this repository19 other files it gives its agents.
- .cursor/rules/atm-detection.mdcCursor rule
- .cursor/rules/bank-tier-classification.mdcCursor rule
- .cursor/rules/code-review-for-quant.mdcCursor rule
- .cursor/rules/dilution-event-scoring.mdcCursor rule
- .cursor/rules/insider-dedup.mdcCursor rule
- .cursor/rules/lookahead-safety.mdcCursor rule
- .cursor/rules/sec-filing-types.mdcCursor rule
- .cursor/rules/survivorship-bias.mdcCursor rule
- .cursor/rules/transaction-cost-modeling.mdcCursor rule
- .cursor/rules/xbrl-fallbacks.mdcCursor rule
- atm-detectionSkill
- bank-tier-classificationSkill
- code-review-for-quantSkill
- dilution-event-scoringSkill
- insider-dedupSkill
- lookahead-safetySkill
- sec-filing-typesSkill
- survivorship-biasSkill
- transaction-cost-modelingSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
XBRL is one source, not the source: When the structured feed is sparse or missing, the same datapoint is recoverable by reading the …
- Distinctive: line 42
When XBRL is missing or stale, search for shares-outstanding in this order:
- Distinctive: line 62
Always record which source was used.
- Distinctive: line 94
Preferred convertible into common: not currently outstanding as common but creates shadow dilution.
- Distinctive: line 99
When emitting fallback data into a downstream system that expects XBRL shape, use a synthetic tag namespace to preserve provenance:
≈ “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
XBRL Fallbacks
XBRL coverage is incomplete. Many real issuers — especially the small-cap
universe where dilution analysis matters most — return either 404 or
empty datapoints from data.sec.gov/api/xbrl/companyfacts/CIK*.json.
Treating absence of XBRL as absence of data is a quant pipeline bug.
The shares-outstanding number is almost always somewhere; just not
in the structured feed.
Core principle
XBRL is one source, not the source. When the structured feed is sparse or missing, the same datapoint is recoverable by reading the filing's text — typically the cover page or an early section of the prospectus. Build the fallback path explicitly into the pipeline; don't treat XBRL 404 as "no data".
When XBRL fails (the 404 / empty-set universe)
- Recent FPIs (Foreign Private Issuers). They file F-1, 20-F, 6-K
in HTML/PDF. XBRL coverage is often delayed, partial, or absent for
years after IPO. Common in Chinese small-cap IPOs (
-Fsuffix CIKs, recent listings on Nasdaq Capital Market). - Recent US IPOs in the first 2 quarters post-listing — 10-Q XBRL exists but the cover-page share count may be the only reliable datapoint until the second 10-K is filed.
- SPACs pre-business-combination. The shell phase has minimal XBRL; cover-page counts on the most recent 10-Q/10-K govern.
- Shell companies / OTC issuers where XBRL is filed late or only for the most recent period.
- Amended filings (10-K/A, 10-Q/A) — sometimes don't republish XBRL; you have to read the amendment text.
Fallback hierarchy
When XBRL is missing or stale, search for shares-outstanding in this order:
- Most recent 10-Q cover page (US issuer) — "As of [date], the registrant had [N] shares of common stock, $[par] par value, outstanding."
- Most recent 10-K cover page (US issuer) — same pattern, slightly different timing (annual).
- Most recent 6-K cover or text (FPI) — variable format; often reports issuance counts within the body. Look for "ordinary shares" or "common shares" + "issued and outstanding".
- Most recent 20-F cover (FPI annual) — formal cover-page statement near the registrant block.
- Most recent F-1 / F-3 / F-3A cover or first page (FPI registration).
- Most recent 424B prospectus supplement cover — discloses pre-offering share count and post-offering count.
- Most recent DEF 14A (proxy) — record-date count, useful as a sanity check.
- Form 10 / S-1 (if newly registering) — initial count.
The earliest plausible source wins; later sources are sanity checks. Always record which source was used.
Extraction patterns (text-based)
Cover-page share-count language is heavily templated. The common forms:
- "As of [date], [N] shares of [class] common stock were outstanding."
- "[N] shares of common stock, par value $[X] per share, are issued and outstanding as of [date]."
- "[N] ordinary shares" / "[N] American Depositary Shares (ADSs)" representing [M] ordinary shares (FPI ADR structure — keep BOTH numbers and note the ratio).
- "[N] Class A common stock and [M] Class B common stock" (multi-class issuers — sum carefully or track per-class).
- "issued and outstanding": [N] (table format common in proxies).
Numbers may be expressed with commas, no commas, or scaled ("12.3 million" / "12,300,000"). Always normalize to integer share count and record the as-of date.
Multi-class share gotchas
Many small-cap FPIs and biotech reorganizations have multiple share classes. Treating "common stock outstanding" as a single number can be wrong by a factor of 2–10x.
- Class A / Class B: voting/economic asymmetry — sum for total outstanding but track separately for control analysis.
- Ordinary shares + ADSs: FPI structure. ADSs trade on the US exchange but represent ordinary shares at a ratio (often 1:10 or 1:50). Float-rotation math must use the ADS-equivalent count, not the underlying ordinary share count.
- Preferred convertible into common: not currently outstanding as common but creates shadow dilution. Note as a separate line.
Synthetic-tag convention (for pipelines)
When emitting fallback data into a downstream system that expects XBRL shape, use a synthetic tag namespace to preserve provenance:
{
"tag": "text:SharesOutstanding",
"value": 23300000,
"source_form": "424B4",
"source_accession": "0001213900-24-XXXXXX",
"as_of_date": "2024-09-15",
"filed_date": "2024-09-18",
"confidence": "medium"
}text: prefix distinguishes from real XBRL (us-gaap:, dei:,
ifrs-full:). Confidence reflects parsing precision (e.g.,
"high" = direct quote, "medium" = inferred from context, "low" =
calculated from offering deltas).
Validation rules
- The fallback datapoint's
filed_datemust obeylookahead-safety— never useas_of_dateas the known-date. - Cross-check the fallback against ANY available XBRL — even one datapoint can confirm the order of magnitude.
- Sanity-check against the offering history: if the issuer raised N shares between two cover-page disclosures, the difference between the two counts should be approximately N (modulo buybacks, splits, exercises).
- Flag any fallback as
text:and surface the source filing in the final output — don't silently treat it as XBRL-quality.
Workflow when XBRL returns 404 or empty
- Confirm the CIK is correct (most common false-404 cause is a CIK
typo or unmapped ticker — see
cik-resolutionif available). - Pull the issuer's full submissions list:
data.sec.gov/submissions/CIK{padded}.json - Walk filings in REVERSE chronological order through the hierarchy above (10-Q → 10-K → 6-K → 20-F → F-* → 424B → DEF 14A).
- Extract the cover-page count from the FIRST filing that has it.
- For historical analysis, walk forward from the earliest fallback datapoint, applying offering deltas (424B / 8-K item 3.02) between stamps to maintain a continuous timeline.
- Tag every fallback datapoint with source attribution and confidence.
Phrases that should trigger this skill
- "XBRL is empty / missing / 404"
- "no XBRL for ticker X"
- "FPI shares outstanding" / "Chinese small cap shares outstanding"
- "20-F" / "6-K" / "F-1" + share count
- "ADS to ordinary shares ratio"
- "cover page shares"
- "how do I get shares outstanding without XBRL"
- "SPAC shares outstanding"
What this skill is NOT
This is not a regex library or extractor. It defines the source
hierarchy and validation rules so the LLM (or pipeline) can decide
WHERE to look and HOW to attribute the result. Combine with
lookahead-safety for time semantics and sec-filing-types for
form-by-form context.
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.

