Project

uml-viewer

0.0
The project is in a healthy, maintained state
uml-viewer scans a Ruby or Rails project with Prism and shows it as a UML diagram in the browser. Red arrows show dependencies that break the Dependency Rule between Rails layers. Box colors show CRAP from a SimpleCov run. A right-click sends a command to a Claude Code session, which explains the code, changes the policy or writes a proposal. Nothing is written into the viewed project. Based on the ideas of unclebob/uml-viewer by Robert C. Martin (Uncle Bob), a Clojure tool. No code is copied.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 1.9
~> 1.9
 Project Readme

uml-viewer

A live UML diagram of a Ruby or Rails project in the browser. Red arrows break the Dependency Rule. A Claude Code session handles your clicks.

Based on the ideas of unclebob/uml-viewer by Robert C. Martin (Uncle Bob), a Clojure tool. This gem reuses its ideas and its observed behavior for Ruby and Rails. No code is copied.

Install

gem install uml-viewer
uml-viewer install-skill
uml-viewer path/to/project

install-skill installs the Claude Code skill that handles the clicks from the diagram. Nothing is written into the viewed project. State lives in ~/.uml-viewer/projects/.

Navigate

  • Double-click a box to open it. Press Esc to go back.
  • Click a class to open its card. Click an operation to see its source.
  • Press Esc or click empty space to close the source panel and the class card.
  • Hover an arrow to see the class pairs behind it.
  • Right-click a box or a class to send Explain or Omit to Claude.

Test quality

Box colors show test quality: green is a good grade, red is a poor grade, and grey dots mean no data. The class card says why.

  • Coverage and CRAP: run your tests with SimpleCov. The viewer reads coverage/.resultset.json in the project.
  • Mutation grades: put a mutation snapshot as mutation.json in the state folder. uml-viewer path prints that folder.

Proposals

Proposals regroup the code without a change to the code.

  1. Press New proposal, or ask Claude for one. Claude writes it into policy.yml.
  2. A proposal lists components in rank order. The first component is level 0.
  3. A member is a class id, a namespace, or a folder box such as folder:models.
  4. Choose the proposal in the diagram list. The diagram shows the code in its components, with red arrows by the ranks of the proposal.

Classes in no component wait in Unassigned.

Declutter

Press d or the declutter button to cycle through five modes: one arrow per pair, triangles, hide members, hide classes, none.

Check the skill

bundle exec rake eval:skill

This runs the skill with claude -p on a copy of the fixture project and checks what it changed. It needs a logged-in claude and costs a few cents per run. EVAL_MODEL, EVAL_BUDGET and EVAL_TIMEOUT tune it.

Credits and licence

  • The ideas come from unclebob/uml-viewer by Robert C. Martin. No code is copied.
  • elkjs (EPL-2.0) does the layout. It is vendored in lib/uml/viewer/web/.
  • uml-viewer is released under the MIT licence.