| name | create-verified-dolt-db-financials-sql |
| version | 0.1 |
| description | Generate a SQL file containing REPLACE INTO statements for the BusMgmtBenchmarks Dolt database, based on reconciled values from /verify-dolt-db-financials report files saved in reports/. 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. Run /verify-dolt-db-financials first to produce the report file. Triggered by "/create-verified-dolt-db-financials-sql TICKER YEAR" (single year) or "/create-verified-dolt-db-financials-sql TICKER" (all years from a multi-year analysis). |
create-verified-dolt-db-financials-sql
Generate a SQL file for inserting or correcting reconciled financial data into the BusMgmtBenchmarks Dolt database. No database connection is made — this skill writes a file only.
Run /verify-dolt-db-financials first to produce the report file that this skill reads from.
Inputs
- Single-year mode:
/create-verified-dolt-db-financials-sql TICKER YEAR
- Multi-year mode:
/create-verified-dolt-db-financials-sql TICKER (no year — reads all years from the saved report file)
Step 0 — Determine mode and locate report file
Single-year mode (YEAR provided):
- Look for
reports/{TICKER}-{YEAR}.md.
- If not found, stop and tell the user: "Please run
/verify-dolt-db-financials {TICKER} {YEAR} first to generate the report."
- Skip to Step 1.
Multi-year mode (YEAR omitted):
-
Look for reports/{TICKER}-all-years.md.
-
If not found, stop and tell the user: "Please run /verify-dolt-db-financials {TICKER} first to generate the report."
-
Read the per-year summary table from the report (columns: Year | reportDate | Action).
-
Collect every year whose Action is NOT "No change" (i.e., any year marked as new insert, correction, or update).
-
If all years are "No change", tell the user: "No changes needed — all years in Dolt already match the reconciled values."
-
Display the list of years to be processed:
Processing {N} year(s) for {TICKER}: {year1}, {year2}, …
Then run Steps 1–3 once per year (oldest first), accumulating all statements into a single SQL file.
Step 1 — Read reconciled values from report file
Open the report file located in Step 0. Find the reconciled recommendations section for the target year. Extract the Recommended column values for all 13 fields + metadata.
Do not use session memory or prior conversation output — use only what is in the report file.
Step 2 — Collect the 13 fields + metadata (per year)
From the report file's reconciled output for this year, 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 (per year)
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 per-statement comment header with: ticker, year, action description, generation date, and primary source.
In multi-year mode, concatenate all per-year statements into one file separated by blank lines.
Step 4 — Write the SQL file
Create extract/2026/inserts/ directory if it does not exist.
Single-year mode: write to extract/2026/inserts/{TICKER}_{YEAR}_insert.sql
Multi-year mode: write to extract/2026/inserts/{TICKER}_multi_insert.sql
Show the full file contents to the user.
Step 5 — Print summary
After writing the file, print:
SQL file written to: extract/2026/inserts/{FILENAME}
That's it. The skill's job is done once the file is written.