Produce formatted .xlsx financial statement workbooks from XBRL statement data. Uses Bash + openpyxl (Python) following Anthropic FSI xlsx-author conventions for professional Excel output with calculation arc cross-validation.
npx skills add https://github.com/agentii-ai/agentii-investment-intelligence --skill xlsx-financials
Shared skill for producing formatted Excel workbooks from XBRL financial statement data. Invoked as a sub-skill by financial modeling and analysis skills. Centralizes formatting, formula auditing, and calculation arc cross-validation in one place.
| Parameter | Default | Notes |
|-----------|---------|-------|
| statement_type | income_statement | income_statement, balance_sheet, cash_flow, equity, oci |
| fiscal_year | (latest available) | Integer year |
| include_calculations | true | Include calculation arc weights for cross-validation |
structured_only — this skill wraps the XBRL get_statement endpoint and does not perform document search. It is purely a data-to-Excel rendering pipeline.
See contracts/retrieval.md for the canonical decision tree; skill-specific retrieval detail is in references/methodology.md.
Default: latest fiscal year (max 12). Users can request specific fiscal years for multi-year comparison.
get_statement: fetches rendered financial statement data with period columnsget_statement_structure: fetches hierarchical concept tree with order_in_parentsearch_xbrl_facts: fallback for individual concept valueslist_xbrl_concepts: concept discovery when structure tree is unavailableBash to execute a Python script with openpyxl (following Anthropic FSI xlsx-author conventions)Step-by-step execution detail is in references/methodology.md.
Inputs → Build → Validate → Output → Next
search_xbrl_facts, get_company_financials) and any filing pages from the three-layer protocol.openpyxl that creates the workbook per ## Output Structure; execute via Bash: python3 script.py; verify the .xlsx exists at the output path. If import openpyxl fails, fall back to the .md summary with data_availability: degraded (see contracts/office-tooling.md).## Validation Gates below.## Output File.agentii.md; hand off to a downstream pitch/review skill if requested.Primary deliverable: {ticker}/{YYYY-MM-DD_HHMM}_statement-{type}.xlsx — the formatted Excel workbook (the primary artifact).
Companion summary: {ticker}/{YYYY-MM-DD_HHMM}_xlsx-financials_summary.md — validation report with calculation-arc results, coverage gaps, and key citations. The .md summary is a companion, NOT a substitute for the .xlsx.
The deliverable is a structured markdown report written to the path in ## Output File. Full section-by-section template (headings, tables, and field definitions) lives in references/output-structure.md. Required elements:
[FACT] / [DEDUCTED] / [VIEW] per contracts/snapshot-synthesis.md./v/ citations are PRIMARY (immediately after each fact); the bottom Citations section is a non-duplicative roll-up index.contracts/output-frontmatter-schema.md.Citations & memory: follow contracts/citation-and-memory.md — ≥1 citation per 200 words; every material fact, table row, and metric is immediately followed by its inline clickable https://agentii.ai/v/{ticker}/{citation_id}/{N} link; a bottom Citations section provides a non-duplicative roll-up index; the closing TUI reply includes a compact Key Citations list (headline 5–10 facts) of clickable /v/ URLs; and append the run to agentii.md per contracts/agentii-md-schema.md.
Excel formatting conventions are in references/methodology.md and contracts/office-tooling.md.
gold.xbrl_calculations. Discrepancies ≥1% flagged in Checks tab. *If failed*: If ≥5% discrepancy: mark Checks tab cell red, add comment with the XBRL-expected value.gold.xbrl_presentation). Missing concepts flagged. *If failed*: list missing concepts in a "Coverage Notes" sheet.Per-tool failure modes and fallback actions are tabulated in references/tool-fallbacks.md.
Run the canonical pre-flight sequence — MCP health probe, ticker resolution, workspace style.md override, memory load, and coverage check. See contracts/preflight.md.
Include the X-Agentii-Trace header on every tool call per contracts/x-agentii-trace-header.md.
contracts/memory-load.md.key_metrics, conclusions, facts_count, deducted_count, views_count, citation_count) per contracts/output-frontmatter-schema.md.[FACT]/[DEDUCTED]/[VIEW] — see contracts/snapshot-synthesis.md.sessions/{YYYY-MM-DD}/ and update sessions/INDEX.md per contracts/session-format.md.End the closing chat reply with a compact Key Citations list (headline 5–10 facts), each a clickable https://agentii.ai/v/{ticker}/{citation_id}/{N} link, so the user can cmd+click straight to the exact SEC page. See contracts/citation-and-memory.md.
| Failure Mode | Detection | Action | User-Facing Message |
|-------------|-----------|--------|---------------------|
| No XBRL data for ticker | get_statement returns empty | Halt; suggest checking coverage | "No XBRL statement data for {ticker} in fiscal year {year}." |
| Statement type not available | get_statement_structure returns empty tree | Try alternative statement types | "{type} not available; available types: {available_types}." |
| Non-USD currency | unit field is not USD | Annotate with ISO 4217 code; apply currency label to all values | "⚠ {ticker} reports in {currency}. Values NOT converted to USD." |
| Calculation arc mismatch | Checks tab shows ≥5% discrepancy | Flag in Checks tab with red cell; note in output | "Calculation arc validation found {n} discrepancies ≥5%." |
Take agentii-ai/xlsx-financials from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.