npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@specverse/engine-generators

v4.0.4

Published

SpecVerse generators — AI view optimization, UML, documentation, diagrams

Readme

@specverse/engine-generators

Generate diagrams, documentation, and UML from SpecVerse specifications.

Purpose

The generators engine produces visual and textual documentation from parsed ASTs. It includes a plugin-based diagram engine that renders Mermaid diagrams (ER, class, event flow, lifecycle, deployment, architecture, manifest), a UML generator, a documentation generator, and an AI view optimizer. Entity modules can register their own diagram plugins, so new entity types automatically contribute diagram types.

Installation

npm install @specverse/engine-generators

Dependencies

| Package | Why | |---------|-----| | @specverse/types | Shared type definitions (SpecVerseEngine, EngineInfo, etc.) | | @specverse/engine-entities | Entity registry for auto-discovering diagram plugins | | @specverse/engine-parser | Parsed AST structures used as generator input |

Key Exports

| Export | Type | Description | |--------|------|-------------| | UnifiedDiagramGenerator | class | Plugin-based diagram generator supporting all diagram types | | createPluginsFromRegistry | function | Creates diagram plugins from entity module declarations | | createAllPlugins | function | Creates all available diagram plugins | | AIViewGenerator | class | Optimizes specs into AI-friendly view structures | | UMLGenerator | class | Generates UML diagrams from specs | | DocumentationGenerator | class | Generates Markdown documentation from specs | | BaseDiagramPlugin | class | Base class for implementing custom diagram plugins | | DiagramContext | class | Shared context passed to diagram plugins during rendering | | StyleManager | class | Manages themes and visual styles for diagrams | | MermaidRenderer | class | Renders diagram models to Mermaid syntax | | ERDiagramPlugin | class | Entity-relationship diagram plugin | | ClassDiagramPlugin | class | Class diagram plugin | | EventFlowPlugin | class | Event flow diagram plugin | | LifecyclePlugin | class | State machine lifecycle diagram plugin | | DeploymentPlugin | class | Deployment topology diagram plugin | | ArchitecturePlugin | class | System architecture diagram plugin | | ManifestPlugin | class | Manifest dependency diagram plugin | | engine | instance | Pre-configured engine adapter for EngineRegistry discovery |

Usage

import { UnifiedDiagramGenerator, createPluginsFromRegistry } from '@specverse/engine-generators';

const generator = new UnifiedDiagramGenerator({
  plugins: createPluginsFromRegistry(),
  theme: 'default',
});

// Generate a single diagram type
const erDiagram = generator.generate(ast, 'er');

// Generate all registered diagram types
const allDiagrams = generator.generateAll(ast); // Map<string, string>

Architecture

src/
├── ai-view-generator.ts        # AI-optimized spec view transformation
├── UML-generator.ts             # UML diagram generation
├── documentation-generator.ts   # Markdown documentation generation
└── diagram-engine/              # Plugin-based diagram system
    ├── core/
    │   ├── UnifiedDiagramGenerator.ts  # Orchestrator
    │   ├── BaseDiagramPlugin.ts        # Plugin base class
    │   ├── DiagramContext.ts           # Shared rendering context
    │   └── StyleManager.ts            # Theme management
    ├── plugins/                        # Built-in diagram plugins
    │   ├── er-diagram/
    │   ├── class-diagram/
    │   ├── event-flow/
    │   ├── lifecycle/
    │   ├── architecture/
    │   ├── deployment/
    │   └── manifest/
    ├── renderers/
    │   └── MermaidRenderer.ts         # Mermaid syntax output
    └── types/
        └── index.ts                   # Diagram type definitions

Extension

To add a new diagram type:

  1. Create a plugin class extending BaseDiagramPlugin in plugins/your-type/
  2. Register the plugin type in the PLUGIN_FACTORIES map in diagram-engine/index.ts
  3. Add diagram type declarations in your entity module so createPluginsFromRegistry() picks them up

Entity modules declare diagram support via getEntityRegistry().getAllDiagramPlugins(), allowing new entity types to contribute diagram plugins without modifying this package.

See Also