# How reverse-skill Facilitates Report and Diagram Generation: A Technical Deep Dive

> Explore how reverse-skill streamlines report and diagram generation. Learn how diagram-generator and docs-generator work together via a unified routing system for efficient technical documentation.

- Repository: [ZhaoXu/reverse-skill](https://github.com/zhaoxuya520/reverse-skill)
- Tags: deep-dive
- Published: 2026-08-30

---

**reverse-skill automates the conversion of raw technical findings into professional documentation by orchestrating two specialized skills—`diagram-generator` for visual assets and `docs-generator` for structured reports—through a unified routing system defined in [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json).**

The `reverse-skill` repository provides an integrated pipeline that transforms reverse-engineering outputs and security analysis into publication-ready deliverables. By coupling diagram generation with automated report assembly, the system eliminates manual formatting overhead while ensuring visual consistency across pentest reports, CTF write-ups, and technical documentation.

## The Dual-Skill Architecture

The platform operates through two tightly-coupled core skills that handle distinct phases of documentation production. This separation of concerns allows the system to generate complex visualizations independently before embedding them into final reports.

### Diagram Generation Engine

The **`diagram-generator`** skill converts natural-language descriptions, code snippets, schemas, or existing diagram source into multiple output formats. According to [`skills/diagram-generator/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/diagram-generator/SKILL.md), the skill supports **Mermaid**, **Graphviz DOT**, **PlantUML**, and plain **SVG** syntax.

The rendering pipeline relies on [`skills/diagram-generator/scripts/render_diagram.py`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/diagram-generator/scripts/render_diagram.py), a CLI utility that processes textual diagram source files and converts them to image or document formats. This script accepts input specifications and renders outputs to PNG, SVG, or PDF based on command-line arguments.

### Report Assembly System

The **`docs-generator`** skill constructs structured technical reports for pentest operations, reverse-engineering projects, and CTF competitions. As defined in [`skills/docs-generator/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/docs-generator/SKILL.md), this skill pulls evidence and findings from previous analysis steps and embeds diagrams produced by the diagram-generator.

Report templates reside in `skills/docs-generator/references/`, including specialized templates for security reports that standardize sections for findings, risk ratings, and remediation guidance.

## Routing and Orchestration

The system employs a centralized routing mechanism to map user intents to the appropriate skill execution sequence. This ensures that diagram generation precedes report assembly when visual content is required.

### Intent Mapping in routing.json

The **[`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json)** file defines the mapping between natural-language commands and skill invocations. Lines 150-162 of this configuration specify routes for intents such as "draw diagram", "write report", and "attack-path diagram".

When a user requests report generation that includes visualizations, the routing table automatically invokes the diagram skill first, then passes the resulting file paths to the docs skill for final assembly.

### Case Initialization Workflow

New investigations begin through [`skills/scripts/case-init.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/case-init.sh), which initializes case directories and configuration flags. When executed with the `diagrams: true` parameter (lines 271-275), the script enables the diagram-generator for that specific case.

Following analysis completion, the **[`skills/case-review/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/case-review/SKILL.md)** step collects all artifacts and invokes `docs-generator` to produce the formal final report. This creates a seamless handoff from technical analysis to documentation delivery.

## End-to-End Implementation

Practical implementation follows a predictable pipeline from raw input to finished document. The workflow demonstrates how reverse-skill facilitates report and diagram generation through concrete command execution and file embedding.

### Rendering Diagrams from Code

Generate visual assets by executing the render script with the appropriate format specification:

```bash
python "<SKILL_ROOT>/diagram-generator/scripts/render_diagram.py" input.mmd --format svg --out diagram.svg

```

This command processes a Mermaid source file (`input.mmd`) and outputs a scalable vector graphic suitable for inclusion in technical documentation. The script supports additional formats including `--format png` for raster images and `--format pdf` for print-ready documents.

### Embedding Visuals in Reports

Once rendered, diagrams integrate into reports through standard markdown syntax. The **`docs-generator`** automatically creates references such as:

```markdown
![Attack-path diagram](diagram.svg)

```

This embedding occurs during the report assembly phase, ensuring that all visual assets referenced in the routing pipeline appear in their designated template sections without manual path resolution.

## Key Source Files and Configuration

Understanding the following files is essential for customizing the documentation pipeline:

- **[`skills/diagram-generator/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/diagram-generator/SKILL.md)** — Defines supported diagram languages and rendering workflows
- **[`skills/diagram-generator/scripts/render_diagram.py`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/diagram-generator/scripts/render_diagram.py)** — CLI utility for converting diagram source to images
- **[`skills/docs-generator/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/docs-generator/SKILL.md)** — Documents report templates and embedding rules
- **[`skills/docs-generator/references/security-report-templates.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/docs-generator/references/security-report-templates.md)** — Standardized markdown templates for security assessments
- **[`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json)** — Routes intents to skills (lines 150-162)
- **[`skills/scripts/case-init.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/case-init.sh)** — Initializes cases with diagram enablement flags (lines 271-275)
- **[`skills/case-review/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/case-review/SKILL.md)** — Connects review workflows to report generation
- **[`docs/ARCHITECTURE.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/docs/ARCHITECTURE.md)** — High-level overview of the diagram-to-docs pipeline

## Summary

- **reverse-skill** combines **`diagram-generator`** and **`docs-generator`** skills to automate documentation workflows
- The **[`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json)** configuration orchestrates execution order, ensuring diagrams render before report assembly
- **[`render_diagram.py`](https://github.com/zhaoxuya520/reverse-skill/blob/main/render_diagram.py)** supports Mermaid, Graphviz, PlantUML, and SVG inputs with PNG, SVG, and PDF outputs
- Case initialization via **[`case-init.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/case-init.sh)** enables diagram generation through the `diagrams: true` flag
- Report templates in **`skills/docs-generator/references/`** standardize output formatting for security and reverse-engineering deliverables

## Frequently Asked Questions

### How does reverse-skill determine when to generate diagrams versus text-only reports?

The routing system in [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json) inspects user intents for keywords like "draw diagram" or "attack-path diagram". When detected, the router triggers the diagram-generator skill first, then passes results to the docs-generator. For text-only requests, the router skips directly to report assembly.

### What diagram formats does the diagram-generator skill support?

According to [`skills/diagram-generator/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/diagram-generator/SKILL.md), the skill accepts **Mermaid**, **Graphviz DOT**, **PlantUML**, and plain **SVG** source files. The [`render_diagram.py`](https://github.com/zhaoxuya520/reverse-skill/blob/main/render_diagram.py) script converts these to **PNG**, **SVG**, or **PDF** output formats based on command-line arguments.

### Can I customize the report templates used by docs-generator?

Yes. The `skills/docs-generator/references/` directory contains markdown templates including [`security-report-templates.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/security-report-templates.md). Modify these files to adjust section ordering, risk rating scales, or organizational branding before the `docs-generator` skill executes.

### How is the diagram-generator enabled during a new case setup?

Execute [`skills/scripts/case-init.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/case-init.sh) with the configuration flag `diagrams: true` (specified at lines 271-275). This flag tells the orchestrator to include diagram generation steps in the case workflow, ensuring visual assets are produced during the analysis phase and available for the final report.