Skip to content

puml-validator

by official

Utility

Validates PlantUML syntax and fixes errors if possible

utility plantuml validation orchestrated-discussions
# puml-validator

Validates PlantUML syntax and fixes errors if possible.

## Installation

This is a CmdForge tool. Install it from the CmdForge registry:

```bash
cmdforge install puml-validator
```

## Usage

Pipe PlantUML content into the tool:

```bash
# Validate and fix PlantUML from a file
cat diagram.puml | puml-validator

# Validate inline PlantUML
echo "@startuml
Alice -> Bob: Hello
@enduml" | puml-validator

# Validate and save fixed output
cat broken-diagram.puml | puml-validator > fixed-diagram.puml
```

## Arguments

This tool takes no arguments.

## How it Works

1. **Syntax Check (Code)**: Attempts to validate the PlantUML syntax using PlantUML's parser and captures any error messages
2. **Early Exit (Code)**: If validation passes, returns the original input; otherwise, prepares error details for fixing
3. **AI Fix (Prompt)**: Uses Claude Haiku to analyze the error and generate corrected PlantUML syntax
4. **Verification (Code)**: Validates the AI-fixed output and returns either the corrected diagram or an error message

## Dependencies

- PlantUML (for syntax validation)

No reviews yet.

Issues

No issues reported for this tool.