# Validate-Repo Report Template

The orchestrator fills in this template after consolidating sub-agent findings. Place it directly in the conversation and offer to write it to `<repo>/audit/repo-validation-<YYYY-MM-DD>.md` if the user wants persistence.

```markdown
# dbt Repo Validation Report

**Repo:** `<absolute path>`
**Generated:** `<YYYY-MM-DD HH:MM>`
**Generator:** `gemma-dbt /validate-repo` v<plugin version>

---

## Executive summary

| Dimension | critical | major | minor | info | total |
|---|---:|---:|---:|---:|---:|
| Gemma SQL style | <n> | <n> | <n> | <n> | <n> |
| Naming consistency | <n> | <n> | <n> | <n> | <n> |
| Logic | <n> | <n> | <n> | <n> | <n> |
| Target structure | <n> | <n> | <n> | <n> | <n> |
| CLAUDE.md | <n> | <n> | <n> | <n> | <n> |
| Kimball | <n> | <n> | <n> | <n> | <n> |
| **Total** | **<n>** | **<n>** | **<n>** | **<n>** | **<n>** |

**Top three priorities (highest severity, highest confidence):**
1. <one-line summary> — `<file>:<line>` (<dimension>)
2. <one-line summary> — `<file>:<line>` (<dimension>)
3. <one-line summary> — `<file>:<line>` (<dimension>)

---

## What was checked

- **Files audited:** <count> SQL, <count> YAML, <count> macro
- **Dimensions:** Gemma SQL style, naming consistency, logic, target structure, CLAUDE.md, Kimball
- **References used:**
  - Gemma SQL Style Guide: `${CLAUDE_SKILL_DIR}/references/gemma-sql-style-checklist.md`
  - Target-structure doc: `<path or "user-supplied inline">`
  - CLAUDE.md: `<path or "absent">`
  - Kimball checklist: `${CLAUDE_SKILL_DIR}/references/kimball-validation-checklist.md`
- **dbt parse:** `<succeeded | failed (reason)>`. Logic checks `<used manifest.json | fell back to filename-only>`.

---

## Findings by severity

### Critical

#### <Finding 1 summary>
- **Dimension:** <Gemma SQL style | naming | logic | target structure | CLAUDE.md | Kimball>
- **Rule:** `<rule-id>`
- **Location:** `<file>:<line>`
- **Confidence:** <high | medium | low>

<Details, multi-line if needed.>

**Suggested fix:** <concrete suggestion>

---

#### <Finding 2 summary>
[...repeat...]

### Major

[...same structure...]

### Minor

[...same structure...]

### Info

[...same structure, often more terse...]

---

## Open questions

Items the validators flagged as ambiguous and worth clarifying with the user before any fix:

- <question 1, with the rule and file that prompted it>
- <question 2>

---

## Withdrawn during verification

Findings raised by a sub-agent but withdrawn by the orchestrator's C3b verification because the
claim was contradicted or could not be confirmed. Listed for traceability; **not** counted in the
executive summary. (Omit this section entirely if nothing was withdrawn.)

- `<rule-id>` — `<file>:<line>` — <one-line reason, e.g. "`unique` + `not_null` already present on lines 102-103">

---

## Skipped checks

Checks that could not run, with reason:

- `<rule-id>` — <reason>
- `<rule-id>` — <reason>

---

## Suggested next actions

A concrete short-list, ordered by impact / effort:

1. <action — covers N findings>
2. <action — covers N findings>
3. <action — covers N findings>
```

## Rendering rules

- Sort findings within each severity by `(dimension, file, line)` for stable, scannable output.
- Collapse `info` findings if there are more than 20 — show the first 10 in full, summarise the rest as `<count> more info findings — see <persisted-report-path> for the full list`.
- Quote no more than 3 lines from any source file in `details` — the report is meant to be scanned, not to substitute for opening the file.
- Always include the "Suggested next actions" block. If there are zero findings, say so explicitly: "No findings — the repo is clean against all six dimensions. ✓"
- **Executive-summary counts come from the final rendered findings only** — tally them after C2 de-duplication and after C3b withdrawals. A finding that was collapsed in issue-family dedup or withdrawn in verification must NOT be counted. The per-severity totals MUST equal the number of findings actually shown under "Findings by severity"; reconcile before finalizing.
