# bzwh321/data-analysis-report-agent architecture

> Architecture diagram of the GitHub repository bzwh321/data-analysis-report-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bzwh321/data-analysis-report-agent
- Repository: https://github.com/bzwh321/data-analysis-report-agent

## Overview

这是一个以 Skills 工作流驱动的 AI 数据分析报告产品：用户提供数据、业务口径和问题，分析阶段形成经验证的证据材料，再由图表与文字 Agent 产出内容，经过对抗审查和组装仲裁后交给 HTML 渲染。README 明确描述了验证发现问题后退回分析补数的回流机制，以及样式、配色和合同校验能力。未采样的 Agent 实现仅按 README 所述建模；相关连线依据 README，而非假定源码调用。

Main entry points: [`SKILL.md`](https://github.com/bzwh321/data-analysis-report-agent/blob/main/SKILL.md) (分析工作流), [`agents/chart-spec-agent/SKILL.md`](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/chart-spec-agent/SKILL.md) (图表设计 Agent), [`agents/report-text-adversarial-reviewer/SKILL.md`](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-text-adversarial-reviewer/SKILL.md) (对抗审查 Agent), [`harness/output_validator.py`](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/output_validator.py) (分析证据材料)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["分析与证据"]
  node_analysis_workflow["分析工作流<br/>[SKILL.md]"]
  node_plan_validation["计划校验<br/>[plan_validator.py]"]
  node_data_validation["数据校验<br/>[data_validator.py]"]
  node_evidence_material["分析证据材料"]
end

subgraph group_content["内容协作"]
  node_chart_agent["图表设计 Agent<br/>[SKILL.md]"]
  node_text_controller["文字控制 Agent<br/>[SKILL.md]"]
  node_text_editor["文字撰写 Agent<br/>[SKILL.md]"]
  node_text_review["对抗审查 Agent<br/>[SKILL.md]"]
end

subgraph group_render["组装与呈现"]
  node_assembler["报告组装仲裁<br/>[SKILL.md]"]
  node_renderer["HTML 渲染<br/>[SKILL.md]"]
end

subgraph group_contracts["合同校验"]
  node_chart_validation["图表合同校验"]
  node_text_validation["文字合同校验"]
  node_assembly_validation["组装合同校验"]
  node_final_validation["最终报告校验"]
  node_runtime_validation["Agent 运行配置校验"]
  node_run_observability["分析运行记录校验"]
end

subgraph group_resources["风格与案例"]
  node_styles["报告风格与配色<br/>[manifest.yaml]"]
  node_case_rules["案例与分析规则"]
end

node_user(("用户"))

node_user -->|"提供数据与问题"| node_analysis_workflow
node_analysis_workflow -.->|"校验计划"| node_plan_validation
node_analysis_workflow -.->|"校验取数"| node_data_validation
node_analysis_workflow -->|"形成证据"| node_evidence_material
node_evidence_material -->|"提供证据材料"| node_chart_agent
node_evidence_material -->|"提供证据材料"| node_text_controller
node_text_controller -.->|"协调撰写"| node_text_editor
node_text_editor -->|"提交审查"| node_text_review
node_chart_agent -->|"提交审查"| node_text_review
node_chart_agent -.->|"校验图表合同"| node_chart_validation
node_text_editor -.->|"校验文字合同"| node_text_validation
node_text_review -->|"问题退回补数"| node_analysis_workflow
node_text_review -->|"提交审查结果"| node_assembler
node_assembler -.->|"校验组装合同"| node_assembly_validation
node_assembler -->|"移交渲染"| node_renderer
node_renderer -->|"检查渲染结果"| node_final_validation
node_analysis_workflow -.->|"校验运行记录"| node_run_observability
node_analysis_workflow -.->|"校验 Agent 配置"| node_runtime_validation
node_chart_agent -->|"遵循配色风格"| node_styles
node_renderer -->|"采用报告风格"| node_styles
node_analysis_workflow -.->|"应用案例口径"| node_case_rules

click node_analysis_workflow "https://github.com/bzwh321/data-analysis-report-agent/blob/main/SKILL.md"
click node_plan_validation "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/plan_validator.py"
click node_data_validation "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/data_validator.py"
click node_evidence_material "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/output_validator.py"
click node_chart_agent "https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/chart-spec-agent/SKILL.md"
click node_text_controller "https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-text-controller/SKILL.md"
click node_text_editor "https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-text-editor/SKILL.md"
click node_text_review "https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-text-adversarial-reviewer/SKILL.md"
click node_chart_validation "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/chart_spec_validator.py"
click node_text_validation "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/report_text_validator.py"
click node_assembler "https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-assembler/SKILL.md"
click node_assembly_validation "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/report_assembly_validator.py"
click node_renderer "https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/html-report-renderer/SKILL.md"
click node_final_validation "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/output_validator.py"
click node_runtime_validation "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/agent_runtime_validator.py"
click node_run_observability "https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/run_observability_validator.py"
click node_styles "https://github.com/bzwh321/data-analysis-report-agent/blob/main/styles/manifest.yaml"
click node_case_rules "https://github.com/bzwh321/data-analysis-report-agent/blob/main/cases/retail-profitability/semantic_layer.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_analysis_workflow,node_plan_validation,node_data_validation,node_evidence_material toneBlue
class node_chart_agent,node_text_controller,node_text_editor,node_text_review toneAmber
class node_assembler,node_renderer toneMint
class node_chart_validation,node_text_validation,node_assembly_validation,node_final_validation,node_runtime_validation,node_run_observability toneRose
class node_styles,node_case_rules,node_user toneIndigo
```

## Components

### 分析与证据

- [分析工作流](https://github.com/bzwh321/data-analysis-report-agent/blob/main/SKILL.md): `SKILL.md`
- [计划校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/plan_validator.py): `harness/plan_validator.py`
- [数据校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/data_validator.py): `harness/data_validator.py`
- [分析证据材料](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/output_validator.py): `harness/output_validator.py`

### 内容协作

- [图表设计 Agent](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/chart-spec-agent/SKILL.md): `agents/chart-spec-agent/SKILL.md`
- [文字控制 Agent](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-text-controller/SKILL.md): `agents/report-text-controller/SKILL.md`
- [文字撰写 Agent](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-text-editor/SKILL.md): `agents/report-text-editor/SKILL.md`
- [对抗审查 Agent](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-text-adversarial-reviewer/SKILL.md): `agents/report-text-adversarial-reviewer/SKILL.md`

### 组装与呈现

- [报告组装仲裁](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/report-assembler/SKILL.md): `agents/report-assembler/SKILL.md`
- [HTML 渲染](https://github.com/bzwh321/data-analysis-report-agent/blob/main/agents/html-report-renderer/SKILL.md): `agents/html-report-renderer/SKILL.md`

### 合同校验

- [图表合同校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/chart_spec_validator.py): `harness/chart_spec_validator.py`
- [文字合同校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/report_text_validator.py): `harness/report_text_validator.py`
- [组装合同校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/report_assembly_validator.py): `harness/report_assembly_validator.py`
- [最终报告校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/output_validator.py): `harness/output_validator.py`
- [Agent 运行配置校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/agent_runtime_validator.py): `harness/agent_runtime_validator.py`
- [分析运行记录校验](https://github.com/bzwh321/data-analysis-report-agent/blob/main/harness/run_observability_validator.py): `harness/run_observability_validator.py`

### 风格与案例

- [报告风格与配色](https://github.com/bzwh321/data-analysis-report-agent/blob/main/styles/manifest.yaml): `styles/manifest.yaml`
- [案例与分析规则](https://github.com/bzwh321/data-analysis-report-agent/blob/main/cases/retail-profitability/semantic_layer.yaml): `cases/retail-profitability/semantic_layer.yaml`

### Other components

- **用户**

## Connections

- 用户 → 分析工作流: 提供数据与问题 (evidence: `README.md`)
- 分析工作流 → 计划校验: 校验计划
- 分析工作流 → 数据校验: 校验取数
- 分析工作流 → 分析证据材料: 形成证据 (evidence: `README.md`)
- 分析证据材料 → 图表设计 Agent: 提供证据材料 (evidence: `README.md`)
- 分析证据材料 → 文字控制 Agent: 提供证据材料 (evidence: `README.md`)
- 文字控制 Agent → 文字撰写 Agent: 协调撰写
- 文字撰写 Agent → 对抗审查 Agent: 提交审查 (evidence: `README.md`)
- 图表设计 Agent → 对抗审查 Agent: 提交审查 (evidence: `README.md`)
- 图表设计 Agent → 图表合同校验: 校验图表合同
- 文字撰写 Agent → 文字合同校验: 校验文字合同
- 对抗审查 Agent → 分析工作流: 问题退回补数 (evidence: `README.md`)
- 对抗审查 Agent → 报告组装仲裁: 提交审查结果 (evidence: `README.md`)
- 报告组装仲裁 → 组装合同校验: 校验组装合同
- 报告组装仲裁 → HTML 渲染: 移交渲染 (evidence: `README.md`)
- HTML 渲染 → 最终报告校验: 检查渲染结果 (evidence: `README.md`)
- 分析工作流 → 分析运行记录校验: 校验运行记录
- 分析工作流 → Agent 运行配置校验: 校验 Agent 配置
- 图表设计 Agent → 报告风格与配色: 遵循配色风格 (evidence: `README.md`)
- HTML 渲染 → 报告风格与配色: 采用报告风格 (evidence: `README.md`)
- 分析工作流 → 案例与分析规则: 应用案例口径
