Xpersona
C

class-diagram

CLAWHUB · Unverified

Generates a Mermaid class diagram showing types, inheritance, and composition Skill: class-diagram Owner: athola Summary: Generates a Mermaid class diagram showing types, inheritance, and composition Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:08:07.569Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:31:07.100Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:48:01.971Z | user Release v1.9.16 v1.9.15 | 2026-07-04T21:21:43.574Z | user Release v1.9.15 v1.9.14 | 2026-06-30T17:52:23

62
Rank
84
Safety
1.7k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.7K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-cartograph-class-diagram
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-cartograph-class-diagram/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

53,594 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: class-diagram
description: Generates a Mermaid class diagram showing types, inheritance, and composition
version: 1.9.8
triggers:
  - visualizing class hierarchies or documenting a module public API
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/cartograph", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: cartograph
---

> **Night Market Skill** — ported from [claude-night-market/cartograph](https://github.com/athola/claude-night-market/tree/master/plugins/cartograph). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


# Class Diagram

Generate a Mermaid class diagram showing types, their
relationships, and public interfaces from a codebase.

## When To Use

- Understanding class hierarchies and inheritance
- Documenting public APIs of a module
- Analyzing composition vs. inheritance patterns
- Answering "what types exist and how do they relate?"

## Workflow

### Step 1: Explore the Codebase

Dispatch the codebase explorer agent:

```
Agent(cartograph:codebase-explorer)
Prompt: Explore [scope] and return a structural model.
Focus on classes, dataclasses, protocols, type aliases,
inheritance, and composition for a class diagram.
Extract: class names, methods (public only), attributes,
parent classes, and composed types.
```

### Step 2: Generate Mermaid Syntax

Transform the structural model into a Mermaid class
diagram.

**Rules for class diagrams**:

- Use `classDiagram` diagram type
- Show only public methods and key attributes
- Use Mermaid relationship notation:
  - `<|--` for inheritance
  - `*--` for composition
  - `o--` for aggregation
  - `..>` for dependency/usage
- Add stereotypes for special types:
  - `<<protocol>>` for Python protocols/interfaces
  - `<<dataclass>>` for dataclasses
  - `<<enum>>` for enums
  - `<<abstract>>` for abstract classes
- Limit to 12-15 classes maximum
- Group related classes with `namespace`
- Omit private methods and dunder methods
- Show return types for methods

**Example output**:

```mermaid
classDiagram
    class ResumeSession {
        +Path config_path
        +dict data
        +load() ResumeSession
        +to_pdf(Path) Path
        +to_html(Path) Path
    }

    class ResumeError {
        <<abstract>>
        +str message
        +str context
    }

    class ValidationError {
        +list~str~ fields
    }

    class RenderError {
        +str template
    }

    ResumeError <|-- ValidationError
    ResumeError <|-- RenderError
    ResumeSession ..> ResumeError
```

### Step 3: Render via MCP

Call the Mermaid Chart MCP to render:

```
mcp__claude_ai_Mermaid_Chart__validate_and_render_mermaid_diagram
  prompt: "Class diagram of [scope]"
  mermaidCode: [generated syntax]
  diagramType: "classDiagram"
  clientName: "claude-code"
```

If rendering fails, fix syntax and retry (max 2 retries).

### Step 4: Present Results

Show the rendered diagram with analysis notes:

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-cartograph-class-diagram",
  "version": "1.9.19",
  "publishedAt": 1787749687569
}

skill-card.md

## Description:

Generates a Mermaid class diagram showing types, inheritance, and composition.

This skill is ready for commercial/non-commercial use.

## Publisher:

[athola](https://clawhub.ai/user/athola)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and engineers use this skill to inspect a code scope and produce a Mermaid class diagram for understanding type relationships, inheritance, composition, and public APIs.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Class names, public method names, attributes, and generated Mermaid diagram content may be sent to the configured Mermaid rendering MCP.

Mitigation: Use the skill only on code scopes approved for diagramming and review generated diagram content before rendering or sharing it.

Risk: Generated diagrams can omit or simplify relationships because the workflow limits diagrams to 12-15 classes.

Mitigation: Treat the diagram as a documentation aid and verify key relationships against the source code for high-impact decisions.

## Reference(s):

- [Cartograph homepage](https://github.com/athola/claude-night-market/tree/master/plugins/cartograph)
- [ClawHub skill page](https://clawhub.ai/athola/skills/nm-cartograph-class-diagram)

## Skill Output:

**Output Type(s):** [Markdown, Code, Guidance]

**Output Format:** [Markdown with Mermaid classDiagram code and analysis notes]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May call a configured Mermaid rendering MCP to validate and render generated diagram content.]

## Skill Version(s):

1.9.19 (source: ClawHub release metadata; artifact frontmatter lists 1.9.8)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to class-diagram and adjacent AI workflows.