.NET 8.0 72 tests passing MIT License v0.1.0-preview

Transform Diagrams.
Generate Code. Ship Faster.

DocFlow is an intelligent documentation and modeling toolkit. Snap a whiteboard photo, map OpenAPI specs to your domain model, and keep your diagrams in sync with your code — automatically.

bash — DocFlow CLI
$

Everything you need to keep docs and code in sync

Four core capabilities, one unified toolkit.

📷

Whiteboard → Code

Snap a photo of your whiteboard sketch. Claude Vision extracts the diagram structure, and DocFlow's code generator produces idiomatic C# — records, entities, and all.

Bidirectional Transform

Parse C# to Mermaid class diagrams, or generate C# from Mermaid. Full DDD semantic preservation — aggregates, value objects, and relationships survive the round-trip.

🔌

API Integration

Parse OpenAPI 3.x specifications, map fields to your Canonical Domain Model with confidence scoring, and generate typed DTOs, AutoMapper profiles, and HTTP clients.

SLA Validation

Validate data freshness against SLA thresholds. Sample live endpoints, compare timestamps against expected durations, and get clear compliance verdicts.

See it in action

Real terminal output from DocFlow commands.

Demo 01
Whiteboard → C# Code

Point DocFlow at a whiteboard photo. Claude Vision reads the sketch, extracts entities and relationships, and generates a full C# domain model.

[ whiteboard.jpg — input photo ]
┌──────────────────┐ │ <<AggregateRoot>> │ │ Order │ ├──────────────────┤ │ + Id : Guid │ │ + CustomerId │ │ + Items[] │ │ + TotalAmount │ └────────┬─────────┘ │ contains ▼ ┌──────────────────┐ │ <<Entity>> │ │ OrderItem │ ├──────────────────┤ │ + ProductId │ │ + Quantity │ │ + UnitPrice │ └──────────────────┘
bash
$ docflow scan whiteboard.jpg -o domain.mmd -v

◆ DocFlow Whiteboard Scanner
Analyzing image with Claude Vision...

✓ Diagram type detected: Class Diagram ✓ Confidence: 94% ✓ Entities found: 2 ✓ Relationships: 1 (Composition)

Entities ───────────────────────────────────── Order <<AggregateRoot>> 4 props OrderItem <<Entity>> 3 props

Generated Mermaid (domain.mmd) classDiagram class Order { +Guid Id +Guid CustomerId +OrderItem[] Items +decimal TotalAmount } Order *-- OrderItem

✓ Saved to domain.mmd
Demo 02
C# ↔ Mermaid Bidirectional Transform

Parse existing C# source into Mermaid, or generate C# records and entities from a diagram — with full DDD pattern preservation.

Domain.cs — input C#
public class Order
{
    public Guid Id { get; init; }
    public Guid CustomerId { get; set; }
    public List<OrderItem> Items { get; } = [];
    public decimal TotalAmount { get; set; }
}

public record OrderItem(
    Guid ProductId,
    int Quantity,
    decimal UnitPrice
);
domain.mmd — output Mermaid
classDiagram
  class Order {
    +Guid Id
    +Guid CustomerId
    +List~OrderItem~ Items
    +decimal TotalAmount
  }
  class OrderItem {
    +Guid ProductId
    +int Quantity
    +decimal UnitPrice
  }
  Order *-- OrderItem
design.mmd — input Mermaid
classDiagram
  class Customer {
    <<AggregateRoot>>
    +Guid Id
    +string Name
    +Email EmailAddress
  }
  class Email {
    <<ValueObject>>
    +string Value
  }
  Customer *-- Email
Customer.cs — generated C#
/// <summary>Customer aggregate root.</summary>
public class Customer
{
    public required Guid Id { get; init; }
    public required string Name { get; set; }
    public required Email EmailAddress
        { get; set; }
}

/// <summary>Email value object.</summary>
public record Email(
    string Value
);
Demo 03
OpenAPI → CDM Integration

Parse an OpenAPI spec, map its fields to your Canonical Domain Model, and generate production-ready integration code — all in two commands.

bash — Integration Module
$ docflow integrate analyze petstore.json --cdm Models/ --threshold 70

◆ CDM Mapping Analysis Spec: petstore.json (Petstore API v1.0.0) CDM: Models/ (8 entities) Found: 3 external entities → 3 CDM matches

Entity Mappings ───────────────────────────────────────────────────────────────────── External Entity CDM Entity Confidence Fields ───────────────────────────────────────────────────────────────────── Pet → Animal 97% 5/5 matched Order → PurchaseOrder 88% 4/5 matched User → Customer 71% 3/5 matched ⚠ review ─────────────────────────────────────────────────────────────────────
$ docflow integrate generate petstore.json --cdm Models/ -o Generated/ -n Petstore.Integration

◆ Code Generation
Generated/Dtos/PetDto.cs (external DTO) Generated/Dtos/OrderDto.cs (external DTO) Generated/Dtos/UserDto.cs (external DTO) Generated/Mapping/PetstoreProfile.cs (AutoMapper profile) Generated/Clients/IPetstoreClient.cs (typed HTTP client) Generated/Validators/PetValidator.cs (FluentValidation)
Generated/Mapping/PetstoreProfile.cs:42 // TODO: verify User→Customer mapping (71%)
✓ 6 files generated in 340ms

How it works

Everything flows through a Canonical Semantic Model.

Source Formats ┌────────┬────────┬────────┐ │ C# │Mermaid │OpenAPI │ └───┬────┴───┬────┴───┬────┘ │ │ │ ▼ ▼ ▼ ┌──────────────────────────┐ │ IModelParser │ │ (format-specific) │ └────────────┬─────────────┘ │ ▼ ┌──────────────────────────┐ │ SemanticModel │ │ entities · relations │ │ DDD stereotypes │ └────────────┬─────────────┘ │ ┌────────────▼─────────────┐ │ IModelGenerator │ │ (format-specific) │ └───┬────┬────┬────┬───────┘ │ │ │ │ ▼ ▼ ▼ ▼ C# Mmd DTO Client Target Formats
  • 01

    Parse to Semantic Model

    Format-specific parsers (Roslyn for C#, custom for Mermaid, OpenAPI spec reader) convert source into a language-neutral semantic model capturing entities, relationships, and DDD patterns.

  • 02

    Enrich with Intelligence

    The IMS layer applies pattern recognition, CDM mapping, and confidence scoring. Claude Vision adds AI-powered diagram extraction from photos.

  • 03

    Generate to Target

    Generators produce idiomatic output: nullable-enabled C# 12, valid Mermaid syntax, AutoMapper profiles, FluentValidation validators, or typed HTTP clients.

Install DocFlow

One command to get started on any platform.

bash
curl -sSL https://raw.githubusercontent.com/infinyte/docflow/main/install.sh | bash

Requires .NET 8 SDK. The script installs to ~/.dotnet/tools and adds it to your PATH.

powershell
irm https://raw.githubusercontent.com/infinyte/docflow/main/install.ps1 | iex

Run in an Administrator PowerShell session. Requires .NET 8 SDK.

bash
git clone https://github.com/infinyte/docflow.git
cd docflow
dotnet build
dotnet run --project src/DocFlow.CLI -- --help

Set ANTHROPIC_API_KEY in your environment to enable whiteboard scanning.

Documentation

Everything you need to go deeper.