Code-To-UML is a zero-dependency, browser-first PlantUML rendering tool for converting code into interactive UML reports. No building tools needed, pure HTML/CSS/JS implementation, service provided through lightweight Node.js development servers.
SaferSkills independently audited code-to-uml (Agent Skill) and scored it 45/100 (orange). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 42 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 42 flagged
A base64 string of 128+ characters appears in a documentation file. Encoded prompt injection hides the hostile instruction in base64 — invisible to keyword filters — and relies on the agent's ability to decode it at runtime. There is no normal authoring reason to embed a multi-hundred-byte base64 blob in skill docs.
*.sig, SIGNATURES) outside the documentation.Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<p align="center"> <img src="logo.png" alt="Code-To-UML logo" width="180"> </p>
Transform code into interactive UML reports and explore 100+ diagram examples with English/Chinese coverage — browser-first, zero build tools.
[中文文档](README_zh.md)
<!-- Badges --> <p align="center"> <a href="https://github.com/pingwurth/code-to-uml/stargazers"><img src="https://img.shields.io/github/stars/pingwurth/code-to-uml?style=social" alt="GitHub Stars"></a> <a href="https://github.com/pingwurth/code-to-uml/network/members"><img src="https://img.shields.io/github/forks/pingwurth/code-to-uml?style=social" alt="GitHub Forks"></a> <a href="https://github.com/pingwurth/code-to-uml/issues"><img src="https://img.shields.io/github/issues/pingwurth/code-to-uml" alt="GitHub Issues"></a> <a href="https://github.com/pingwurth/code-to-uml/pulls"><img src="https://img.shields.io/github/issues-pr/pingwurth/code-to-uml" alt="GitHub Pull Requests"></a> <a href="https://github.com/pingwurth/code-to-uml/graphs/contributors"><img src="https://img.shields.io/github/contributors/pingwurth/code-to-uml" alt="GitHub Contributors"></a> <a href="https://github.com/pingwurth/code-to-uml/blob/main/LICENSE"><img src="https://img.shields.io/github/license/pingwurth/code-to-uml" alt="License"></a> </p>
<p align="center"> <a href="https://twitter.com/intent/tweet?text=Check%20out%20Code-To-UML%20-%20AI-powered%20code%20analysis%20that%20generates%20interactive%20UML%20reports!&url=https://github.com/pingwurth/code-to-uml"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter"></a> <a href="https://github.com/pingwurth/code-to-uml/discussions"><img src="https://img.shields.io/badge/GitHub-Discussions-blue" alt="GitHub Discussions"></a> <a href="https://github.com/pingwurth/code-to-uml/blob/main/CONTRIBUTING.md"><img src="https://img.shields.io/badge/Contributions-Welcome-brightgreen" alt="Contributions Welcome"></a> </p>
<p align="center"> <a href="#why-code-to-uml"><strong>Why Code-To-UML?</strong></a> · <a href="#demo"><strong>Demo</strong></a> · <a href="#getting-started"><strong>Getting Started</strong></a> · <a href="#contributing"><strong>Contributing</strong></a> · <a href="#links"><strong>Links</strong></a> </p>
"In the AI era, the ability to read code is scarcer than the ability to write it."
Code-To-UML is the embodiment of this philosophy. It's not just another PlantUML online editor — it's a complete toolchain that lets AI understand your code, draw architecture diagrams, and generate bilingual reports.
| Pain Point | Problem Description | Code-To-UML Solution |
|---|---|---|
| 🔍 System Analysis Difficulty | Complex codebases make it hard to quickly understand overall architecture and module relationships | One-click generation of project/module/file-level architecture diagrams with interactive navigation |
| 📝 Design Documentation Burden | Organizing existing code logic requires reading hundreds of lines method by method | Auto-generated 13-dimension analysis reports with intelligent code snippet extraction (< 30 lines) |
| 🐛 Inefficient Debugging | Line-by-line code reading for troubleshooting is extremely inefficient | Call relationship diagrams to quickly locate problem paths, data flow diagrams to track state changes |
| 🤖 AI Code Review | In the Vibe Coding era, AI-generated code needs more efficient review tools | Quickly understand AI-generated code structure, identify potential architecture issues and risks |
| 📚 Rapid Framework Learning | Learning new tech stacks and participating in open-source maintenance requires quick code comprehension | Auto-generated developer onboarding guides, core principles and design decision visualization |
| 🎯 Reading Code > Writing Code | Code comprehension ability becomes a core competitive advantage | AI skill integration, supporting mainstream AI tools like Cursor, Claude Code, and more |
Core Value: Transform code into interactive UML reports, improving code comprehension efficiency by 10x
<p align="center"> <img src="docs/images/demo_en.gif" alt="Code-To-UML Demo" width="800"> </p>
.ctu data filesMost UML documentation workflows rely on heavyweight IDEs, fragile build pipelines, or opaque SaaS tools. Code-To-UML takes a different approach:
SKILL.md) lets Cursor, Claude Code, Qwen, Codex, and other AI assistants generate reports autonomously.No frameworks. No transpilers. No node_modules. Start the lightweight server and go.
| Category | Types |
|---|---|
| UML | Sequence, Use Case, Class, Object, Activity, Component, Deployment, State, Timing |
| Non-UML | Gantt, MindMap, WBS, EBNF, Regex, Network (nwdiag), JSON, YAML, Archimate, Salt (Wireframe) |
| Layer | Technology |
|---|---|
| Server | Node.js lightweight dev server (serve.js, ~600 lines) |
| Runtime | Vanilla ES6+ JavaScript — no frameworks, no npm dependencies |
| Client Rendering | PlantUML WASM via plantuml.js |
| Server Rendering | plantuml.jar (Java) — automatic fallback |
| Graph Layout | Graphviz via Viz.js |
| Data Format | .ctu structured text files |
| Internationalization | Custom JS system, localStorage persistence, docs:langchange event |
| Styling | Pure CSS with custom properties for theming |
git clone https://github.com/pingwurth/code-to-uml.git
cd code-to-umlCTU_HOME and install the bundled AI skill:node install.js
# Install for one tool only
node install.js codex
# Print the current-shell CTU_HOME command without writing profile files
node install.js --printinstall.js writes CTU_HOME for AI report generation and copies the bundled skill into supported agent directories. It is not required for browsing demos.
./serve.sh
# or specify a custom port
./serve.sh 5401
# or directly with Node
node serve.js 5401# Visit the following URL to view analysis examples
http://localhost:5401
# Or browse the diagram showcase
http://localhost:5401/demo.html
# Or view UML syntax examples
http://localhost:5401/plantuml-official-demo/en/sequence-diagram_en.htmlNo npm install. No build step. That's it.
Use the /code-to-uml slash command in your AI agent to generate UML-backed HTML reports at any scope:
File-level analysis
/code-to-uml Please analyze the file component/render-failure-common.js and generate a UML-backed, consistently formatted HTML report.Function-level analysis
/code-to-uml Please analyze the renderWithFailureHandling function and generate a UML-backed, consistently formatted HTML report.Project-level analysis
/code-to-uml Please analyze the entire code-to-uml project and generate a UML-backed, consistently formatted HTML report.Module-level analysis
/code-to-uml Please analyze the component/ module and generate a UML-backed, consistently formatted HTML report.All four commands produce the same 13-section report structure — scope changes the depth and examples, not the section contract. Reports are saved to cache/ and accessible via index.html.
Open http://localhost:5401/demo.html after starting the server to browse all diagram examples. Use the tab bar to switch diagram types and the language toggle to switch between English and Chinese.
.ctu data files in data/claude-code-demo-analysis/ (or another data/<report-slug>/ directory).cache/_TEMPLATE.html.cache/ and are accessible from index.html.Each .ctu file defines a file-level Title and Describe, followed by one or more repeated [Example], [Description], [UML], and [Detail] groups:
Title: Section Title
Describe: Description
------------------------------------------------------------
[Example]
Example title
[Description]
Markdown description of what this diagram demonstrates
[UML]
@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi there
@enduml
[Detail]
Explanation of diagram elements and syntax
------------------------------------------------------------Naming convention: {diagram-type}--{number}_{language}.ctu
Examples: sequence--1_en.ctu, class--3_zh.ctu, activity--2_en.ctu
code-to-uml/
├── serve.js # Dev server + API endpoints
├── demo.html # Main diagram viewer SPA
├── demo.js # Page controller
├── index.html # Home / cache index
├── main.css # All styles
├── i18n-config.js # i18n runtime
├── i18n/
│ ├── zh.js # Chinese strings
│ └── en.js # English strings
├── component/ # Reusable UI components
│ ├── docs-page-core.js # Core page logic
│ ├── render-failure-common.js # Error handling
│ ├── demo-example-component.js # Example card renderer
│ └── toc-component.js # Table of contents
├── data/
│ ├── demo/ # Built-in examples (.ctu files)
│ ├── _TEMPLATE.ctu # Template for new reports
│ └── claude-code-demo-analysis/ # Example: analysis report data
├── cache/
│ ├── _TEMPLATE.html # Reusable report HTML template
│ └── (generated reports)
├── docs/images/ # README demo GIFs
├── js/ # PlantUML + theme libraries
├── plantuml-official-demo/ # Official PlantUML reference docs
├── skills/code-to-uml/
│ └── SKILL.md # AI agent skill definition
├── test/ # Node-based tests
├── package.json # npm scripts and package metadata
├── serve.sh / serve.bat # Platform launchers
├── CLAUDE.md # Claude Code guidance
├── AGENTS.md # Agent documentation
└── install.js # CTU_HOME and AI skill installerGET /api/demo-examplesReturns parsed .ctu examples for the diagram viewer.
| Parameter | Type | Description | |
|---|---|---|---|
lang | en \ | zh | Language filter (default: zh) |
dir | string | Data subdirectory under data/ (default: demo) |
Response: JSON object keyed by diagram/category name. Each value is an array of parsed example objects.
POST /api/plantuml-svgServer-side PlantUML rendering fallback.
| Field | Description |
|---|---|
| Body | JSON object with a source string |
| Content-Type | application/json |
| Response | JSON object with an svg string, or an error string |
GET /api/cache-htmlReturns generated HTML reports from cache/ for the home page index.
DELETE /api/cache-htmlDeletes one generated report and its matching data/<report-slug>/ directory.
| Field | Description |
|---|---|
| Body | JSON object with a path field, such as cache/example.html |
DELETE /api/cache-html/allDeletes generated cache reports and matching generated data directories while preserving templates.
| Setting | Mechanism | Default |
|---|---|---|
| Server port | PORT env var or CLI argument | 5401 |
| Server root | Current working directory when running serve.js | CWD |
| AI report root | CTU_HOME env var (set by install.js) | Project root at install time |
| UI language | localStorage key plantuml-docs-lang | en |
| Theme | CSS custom properties in main.css | Light |
The rendering pipeline uses a two-tier strategy for maximum reliability:
User opens http://localhost:5401/demo.html
│
▼
[Render Queue]
│
▼
Try browser rendering (plantuml.js WASM)
│
▼
Rendered? ── Yes ──▶ Display SVG
│
No
│
▼
Detect error type
│
▼
Retry server-side (POST /api/plantuml-svg)
│
▼
Success? ── Yes ──▶ Display SVG
│
No
│
▼
Show error message + recovery actionKey design decisions:
Code-To-UML ships with a skill definition at skills/code-to-uml/SKILL.md that enables AI coding assistants to generate analysis reports.
node install.js to register the project path.skills/code-to-uml/SKILL.md..ctu data files and an HTML report.We welcome contributions from the community! Please read our Contributing Guide before submitting a Pull Request.
Areas where contributions are welcome:
.ctu files for under-represented diagram typestest/~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.