Skip to main content

Output Template (Locked)

Deterministic markdown template. Fill sections in order. Never reorder. Two runs on the same data source produce identical files (modulo live-connection row-count variance).

Template​

# Data Model: {datasource_name}

**Data source:** {datasource_name}
**Generated:** {YYYY-MM-DD} by data-model-documenter
**Workbook:** {workbook_filename}

## 1. Data Source Metadata

- **Connection type:** {connector_name}
- **Extract or live:** {extract | live}
- **Extract config (if extract):** {refresh_type}, {aggregation_status}, {filter_at_extract_summary}
- **Table count:** {N}
- **Field count:** {N} ({N_calcs} calculated, {N_raw} raw)

## 2. Table Inventory

| Table | Row Count (est.) | Field Count |
|---|---|---|
| {table_1} | {row_count_1} | {field_count_1} |
| {table_2} | {row_count_2} | {field_count_2} |
| ... | ... | ... |

Row counts are estimates from get-summary-data samples. On live connections, actual source counts may differ.

## 3. Relationship Map

| Left Table | Right Table | Cardinality | Join Condition | RI |
|---|---|---|---|---|
| {left_1} | {right_1} | {cardinality_1 (sampled) or "unverified: sample size below reliable threshold" or "not extractable: no candidate key identified"} | {left_1}.{key} = {right_1}.{key}, or "not applicable" if no key} | {Unknown, unless connector explicitly asserts RI} |
| ... | ... | ... | ... | ... |

Cardinality is sampled via COUNTD/COUNT per candidate key pair, not read from connector metadata. RI defaults to Unknown; this skill does not verify orphan keys. This section reports facts only — for a join-vs-relationship recommendation or fanning-risk diagnosis, see `join-and-relationship-advisor`.

## 4. Calc-Dependency Graph

- **{calc_name_1}** ({role}, {datatype})
- Formula: `{formula_text}`
- References: {referenced_field_1}, {referenced_field_2}
- **{calc_name_2}** ({role}, {datatype})
- Formula: `{formula_text}`
- References: {referenced_field_1}

Calcs with no field references (constants, parameter-only) are listed with "References: none."

## 5. Appendix: Field List by Table

### {table_1}

| Field | Datatype | Role | Notes |
|---|---|---|---|
| {field_1} | {datatype} | {dimension | measure} | {optional_note} |
| ... | ... | ... | ... |

### {table_2}

(same structure)

## 6. Not Extractable

- Sets: {list any sets that surfaced, or "none surfaced via list-available-fields"}.
- Hierarchies: {same}.
- Parameters: {same}.

Sets, hierarchies, and parameters may exist in the workbook but not surface via list-available-fields. Absence here means invisible-to-tool, not absent-from-workbook.

***

*Generated by data-model-documenter. Report change history via workbook-auditor.*

Filling Rules​

  • Every {placeholder} must be filled or replaced with an explicit "unknown" or "not applicable."
  • Row counts must include the caveat line under the table.
  • Relationship map cardinality uses one-to-one, one-to-many, many-to-many. Never abbreviations.
  • Calc formulas are wrapped in backticks. Multi-line formulas preserved with newlines inside the backtick block.
  • Appendix sorts tables by table_1 order in the model, then fields alphabetically within each table.
  • The "Not Extractable" section always renders, even if all three categories are empty.

Refuse to Fabricate​

Never invent a table, field, relationship, or calc that doesn't appear in tool output. If a workbook contains categories the tools don't expose (sets, hierarchies, parameters), name them under "Not Extractable" rather than skipping.