# Report Generation Agent

> Phase 5 orchestrator - Generates final structured report with evidence

- Skill: `tools-only/report-generation-agent` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds add tools-only/report-generation-agent`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/report-generation-agent/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/tools-only/report-generation-agent

---


# Report Generation Agent

## Purpose

Phase 5 orchestrator responsible for generating the final structured TechStackReport with evidence, citations, and multiple export formats.

## Responsibilities

1. **JSON Report Generation**: Create structured TechStackReport
2. **Evidence Formatting**: Format evidence with sources and citations
3. **Report Export**: Generate JSON, Markdown, HTML outputs

## Skills Orchestrated

Execute in sequence:
1. `json_report_generator` - Generate structured TechStackReport
2. `evidence_formatter` - Format evidence with proper citations
3. `report_exporter` - Export to JSON, Markdown, HTML

## Input

Correlated technologies from Phase 4:
```json
{
  "correlated_technologies": {
    "frontend": [...],
    "backend": [...],
    "infrastructure": [...],
    "security": [...],
    "devops": [...],
    "third_party": [...]
  },
  "conflicts_detected": [...],
  "low_confidence_items": [...]
}
```

## Output

### TechStackReport Schema

```json
{
  "company": "string",
  "domain": "string",
  "analysis_timestamp": "ISO-8601",
  "analysis_depth": "quick|standard|deep",

  "discovered_assets": {
    "domains": ["array of domain strings"],
    "subdomains": ["array of subdomain strings"],
    "ip_addresses": [
      {
        "ip": "string",
        "provider": "string",
        "region": "string"
      }
    ],
    "developer_portals": ["array of URLs"]
  },

  "tech_stack": {
    "frontend": [
      {
        "name": "string",
        "category": "string",
        "version": "string (optional)",
        "evidence": [
          {
            "signal": "string",
            "source": "string",
            "source_type": "string",
            "timestamp": "ISO-8601"
          }
        ],
        "sources": ["array of source URLs/types"],
        "confidence": "High|Medium|Low",
        "confidence_score": "number (0-100)",
        "reasoning": "string"
      }
    ],
    "backend": [...],
    "infrastructure": [...],
    "security": [...],
    "devops": [...],
    "third_party": [...]
  },

  "summary": "string",
  "key_findings": ["array of notable discoveries"],
  "recommendations": ["array of strings (optional)"],

  "metadata": {
    "total_technologies_detected": "number",
    "high_confidence_count": "number",
    "medium_confidence_count": "number",
    "low_confidence_count": "number",
    "sources_consulted": ["array of source types"],
    "analysis_duration_seconds": "number",
    "agent_version": "1.0.0"
  }
}
```

## Output Directory Structure

```
outputs/techstack_reports/<company_name>_<timestamp>/
├── report.json           # Structured report (primary)
├── report.md             # Markdown summary (human-readable)
├── report.html           # Styled HTML report
├── evidence/
│   ├── http_evidence.json
│   ├── dns_evidence.json
│   ├── javascript_evidence.json
│   └── ...
└── logs/
    └── execution.log
```

## Report Format Examples

### JSON (report.json)
Full structured data as per schema above.

### Markdown (report.md)

```markdown
# Tech Stack Report: {Company Name}

**Domain:** {domain}
**Analysis Date:** {timestamp}
**Confidence Summary:** {high}H / {medium}M / {low}L

## Executive Summary

{summary}

## Technology Stack

### Frontend
| Technology | Version | Confidence | Evidence |
|------------|---------|------------|----------|
| React | 18.x | High (85%) | window.React global, data-reactroot |

### Backend
...

### Infrastructure
...

## Key Findings

1. {finding_1}
2. {finding_2}

## Evidence Sources

- HTTP Headers: {count} endpoints analyzed
- DNS Records: {types} queried
- JavaScript Analysis: {count} pages analyzed
...

---
*Generated by Tech Stack Identification Agent v1.0.0*
```

### HTML (report.html)
Styled HTML with tables, collapsible sections, and visual confidence indicators.

## Validation Requirements

Before finalizing report:
- [ ] All required fields present
- [ ] Confidence levels valid (High/Medium/Low)
- [ ] Evidence arrays non-empty for each technology
- [ ] Sources properly formatted
- [ ] No PII or sensitive data in output
- [ ] JSON validates against schema

## Execution Flow

```
INPUT: Correlated Technologies
         │
         ▼
  json_report_generator
    │ - Validate input completeness
    │ - Structure as TechStackReport
    │ - Generate summary
    │ - Calculate metadata statistics
         │
         ▼
  evidence_formatter
    │ - Format evidence with citations
    │ - Sanitize sensitive data
    │ - Archive raw evidence
         │
         ▼
  report_exporter
    │ - Write JSON report
    │ - Generate Markdown
    │ - Generate HTML
    │ - Create output directory structure
         │
         ▼
OUTPUT: Report files in outputs/techstack_reports/
```

## Error Handling

- Validate schema compliance before writing
- Create backup of any existing report before overwrite
- Log all validation errors
- Never write incomplete report - fail with clear error
- Sanitize all output for PII before writing

