| name | insert-financials |
| description | Generate a SQL file containing a REPLACE INTO statement for the BusMgmtBenchmarks Dolt database, based on reconciled values from /analyze-financials. Does NOT connect to or write to any database — output is a .sql file only, which the user applies manually to their local Dolt clone. Always run AFTER /analyze-financials in the same session. Triggered by "/insert-financials TICKER YEAR" or after analyze-financials signals readiness. |
insert-financials
Generate a SQL file for inserting reconciled financial data into the BusMgmtBenchmarks Dolt database. No database connection is made — this skill writes a file only.
Always run /analyze-financials TICKER YEAR first in the same session.
Inputs
/insert-financials TICKER YEAR
Step 1 — Confirm analysis is in context
Check that /analyze-financials was run earlier this session and produced a reconciled recommendation.
If not, stop and tell the user: "Please run /analyze-financials TICKER YEAR first."
Step 2 — Collect the 13 fields + metadata
From the analyze-financials reconciled output, collect:
| Field | Notes |
|---|
| company_name | Exact string as stored in Dolt DB |
| year | Integer (e.g. 2024) |
| reportDate | Fiscal year-end date string (e.g. '2024-12-31') |
| Net Revenue | Thousands |
| Cost of Goods | Thousands, positive |
| Gross Margin | Net Revenue − Cost of Goods |
| SGA | Thousands |
| Operating Profit | Thousands, can be negative |
| Net Profit | Thousands, can be negative |
| Inventory | Thousands, or NULL for marketplace companies |
| Current Assets | Thousands |
| Total Assets | Thousands |
| Current Liabilities | Thousands |
| Liabilities | Total Assets − Total SE |
| Total Shareholder Equity | Thousands, can be negative |
| Total Liabilities and Shareholder Equity | Thousands, must equal Total Assets |
If any raw values from the filing were in full dollars (not thousands), divide by 1,000 before writing.
Step 3 — Build the SQL statement
Use REPLACE INTO so the statement works for both new rows and corrections to existing rows.
REPLACE INTO financials (
company_name, year, reportDate,
`Net Revenue`, `Cost of Goods`, `Gross Margin`, `SGA`,
`Operating Profit`, `Net Profit`, `Inventory`,
`Current Assets`, `Total Assets`, `Current Liabilities`,
`Liabilities`, `Total Shareholder Equity`,
`Total Liabilities and Shareholder Equity`
) VALUES (
'Company Name', YEAR, 'YYYY-MM-DD',
NNNN, NNNN, NNNN, NNNN,
NNNN, NNNN, NNNN_OR_NULL,
NNNN, NNNN, NNNN,
NNNN, NNNN, NNNN
);
Include a comment header with: ticker, year, generation date, and primary source used.
Step 4 — Write the SQL file
Create extract/2026/inserts/ directory if it does not exist.
Write to: extract/2026/inserts/{TICKER}_{YEAR}_insert.sql
Show the full file contents to the user.
Step 5 — Print manual apply instructions
After writing the file, print:
SQL file written to: extract/2026/inserts/{TICKER}_{YEAR}_insert.sql
To apply this to your local Dolt database clone:
cd /path/to/your/dolt/BusMgmtBenchmarks
dolt sql < /path/to/BusMgmtBenchmarks/extract/2026/inserts/{TICKER}_{YEAR}_insert.sql
dolt diff
dolt commit -am "Add {company_name} FY{YEAR} financials"
dolt push
That's it. The skill's job is done once the file is written.