/daloopa-investing:port-replicate-model TICKER [instructions]from daloopa-investing
Replicates an existing Excel financial model or template for a new company, linking historical data to the user's data tab. Handles build, in-place, and resume scenarios.
Ships in daloopa-investing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Replicate an existing Excel model or template for the company specified by the user: $ARGUMENTS
Before starting, read ../data-access.md for data access methods, ../modeling-conventions.md for the cardinal rule (conform to the user's style) and the linkage a model should follow, and ../fix-debug-audit/references/model-checks.md for the checks used to verify the port.
The common real ask is not "build from scratch" — it's "make my model for company A work for company B" and "link the historicals to the DATA tab I already pulled." This skill covers both, because they almost always come together. Match the template's structure, formatting and formula logic exactly; swap only the company's data, segments and KPIs.
| Input | Form | Required |
|---|---|---|
TICKER | The new company's ticker, first word of the arguments | Yes — ask if missing |
instructions | Free text after the ticker | No |
Instructions can name tabs ("follow TNL Model, build in HGV", "use Sheet1 as the source data"), set limits ("only change the grey hardcoded cells"), call out incidental references ("update the ticker in B2 and the Thesis tab"), or give a workbook path. Anything named there overrides detection.
Examples: /port-replicate-model HGV · /port-replicate-model USB only change the grey cells · /port-replicate-model SHW the computer crashed, continue the SHW tab
Workbook. A path in the instructions; otherwise the most recently modified .xlsx/.xlsm in reports/, then the working directory — skipping files this toolkit generated (names ending _port_YYYYMMDD, _audit_YYYYMMDD, _model, _comp_sheet). If none is found, ask for the path.
Sheets. python infra/workbook_tools.py tabs WORKBOOK — each sheet's used range, cell mix (input / formula / text), whether it's blank, and which sheets its formulas read from. Carry any warning (charts, pivots, external links) into the announce line.
Detect the roles (instructions override every one):
DATA, Daloopa, Input or Sheet1, or a mostly-input sheet that the model sheet reads_from. May not exist.| Target state | Shape |
|---|---|
| Blank, or doesn't exist yet (created next to the source) | build — replicate into a blank tab |
| Same sheet as the source | in-place — swap data, not structure |
| Partly filled, named for the new ticker | resume — complete only what's missing |
Companies. discover_companies(keywords=["TICKER"]) for the new company → company_id, latest_calendar_quarter, latest_fiscal_quarter. Identify the template's company from its header rows, tab name or Daloopa links (needed to spot leftover references later).
Announce in one line, e.g.:
Workbook
TNL_HGV.xlsx· sourceTNL Model→ targetHGV(blank) · data: link toDATA· mode: build · new company HGV (Hilton Grand Vacations)
Continue to Steps 1–3 (reading only), then wait for approval at Step 4 before writing anything.
python infra/workbook_tools.py read WORKBOOK "Source" (the used range; use --max-cells or sub-ranges for very large sheets) and capture, exhaustively:
refs on the source shows exactly which data-tab cells it reads).INDEX/MATCH or direct refs, or typed); how the statements link; the forecast formulas.../modeling-conventions.md Section 2. If formatting can't be read, say so and use Section 5 defaults; never invent a style.For resume, also read the partial target and diff it against the template row by row: what's done stays as it is — no restyling, no rebuilding.
Map on concept, not wording ("Net sales" = "Revenue"; ../modeling-conventions.md Section 3):
discover_company_series(company_id, keywords=[every template row label that holds data, plus parenthetical and singular/plural variants], calendar_periods=[...]).get_company_fundamentals(company_id, calendar_periods=[the template's historical periods, re-anchored to the new company's latest_calendar_quarter], series_ids=[...]). Keep every datapoint's id for citations and links.Periods: the template's columns are relabelled for the new company's fiscal calendar (map with the fiscal↔calendar offset from discover_companies; the API takes calendar quarters only — ../data-access.md Section 1.5). Units: convert to the unit basis the template states in its header.
Match the template's choice, and honour where the user already staged data:
INDEX/MATCH on row label + period header, matching how the template already does it. In in-place, re-point the existing formulas to the new company's rows (same relative structure).in-place: refresh the data tab itself with the new company's figures.build: the template still needs its own data, so create a new data tab DATA_{TICKER} with the same layout as the existing one and link the target to it.
Write each figure from get_company_fundamentals; if the existing data tab's cells carry Daloopa links, give the new cells links too ("link": "https://daloopa.com/src/{id}"). Never link to data that isn't there yet.Before writing anything, show:
DATA_{TICKER}).Wait for approval. Apply any corrections, then build.
Assemble one change list in reports/.tmp/{workbook_stem}_port_changes.json (schema in the docstring of infra/workbook_tools.py), in this order:
build with a missing target: {"add_sheet": "HGV", "after": "TNL Model"}; then {"sheet": "HGV", "layout_from": "TNL Model"} for column widths, row heights and freeze panes.DATA_{TICKER} or the refreshed one: labels, period headers, figures.copy_format_from the template's ranges onto the target's, block by block so added/removed rows line up (a row added for a new segment copies the format of its sibling row).Write into the target only (plus the data tab from Step 3). In in-place with a limit like "only grey cells", touch nothing else.
Inserting rows in place: the tool doesn't shift existing formulas when rows are inserted. In in-place, put an added row in an empty row inside its section if one exists; otherwise list it as a manual step ("insert a row below row 24 for Rental revenue, then …") rather than shifting the sheet.
Run python infra/workbook_tools.py apply WORKBOOK reports/.tmp/{stem}_port_changes.json --label port → reports/{stem}_port_{YYYYMMDD}.xlsx. The original is never touched; for follow-up passes on the copy, use --in-place.
python infra/workbook_tools.py refs OUTPUT "Target" — no reference to the template company's data rows or tab remains (unless the template linked there on purpose, e.g. a shared assumptions tab).model-checks.md): the template's own check rows (balance check, tie-outs), statement footing, and segment sum vs total revenue. State the expected value of each — e.g. "HGV!F95 (balance check) should read 0.0 in every column."python infra/workbook_tools.py recalc OUTPUT --cells "HGV!F95:Q95" ....
recalculated: true → compare with the expected values; a mismatch means a broken reference from the port — fix it before reporting.recalculated: false → say the values recalculate when the file is opened in Excel, and that the user should confirm the expected values there.Tell the user:
reports/{stem}_port_{YYYYMMDD}.xlsx (the original is unchanged).warning from tabs/apply (charts, pivots, external links that may not have survived).All Daloopa figures cited in the reply use the citation format: $X.XX million
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub daloopa/investing2 --plugin daloopa-investing42 skills in this plugin
/activismActivist vulnerability assessment — performance gaps, likely activist playbook, and defense analysis/bomInteractive product bill-of-materials dashboard with an exploded view, mapping components, suppliers, unit costs, and gross margin sensitivity/build-modelBuild a multi-tab Excel financial model/bull-bearBull/bear/base case scenario framework for a given companyOther plugins' skills for the same job