← 返回
未分类 中文

Nm Cartograph Class Diagram

Generates a Mermaid class diagram showing types, inheritance, and composition
生成展示类型、继承和组合关系的Mermaid类图
athola athola 来源
未分类 clawhub v1.9.14 6 版本 100000 Key: 无需
★ 0
Stars
📥 476
下载
💾 1
安装
6
版本
#latest

概述

> Night Market Skill — ported from claude-night-market/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:
  • <> for Python protocols/interfaces
  • <> for dataclasses
  • <> for enums
  • <> 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:

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:

  • Total classes and relationship count
  • Key inheritance hierarchies identified
  • Composition patterns noted

版本历史

共 6 个版本

  • v1.9.14 当前
    2026-07-02 08:40
  • v1.9.13
    2026-06-30 16:42 安全 安全
  • v1.9.12
    2026-06-19 19:50
  • v1.0.3
    2026-06-09 17:50 安全 安全
  • v1.0.2
    2026-05-09 16:41 安全 安全
  • v1.0.1
    2026-05-07 16:05 安全 安全

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

it-ops-security

Nm Abstract Hooks Eval

athola
评估钩子安全性、性能和SDK合规性。用于审计
★ 0 📥 776
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 686 📥 330,997
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,104