/install nm-cartograph-class-diagram
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
classDiagramdiagram type - Show only public methods and key attributes
- Use Mermaid relationship notation:
\x3C|--for inheritance*--for compositiono--for aggregation..>for dependency/usage
- Add stereotypes for special types:
\x3C\x3Cprotocol>>for Python protocols/interfaces\x3C\x3Cdataclass>>for dataclasses\x3C\x3Cenum>>for enums\x3C\x3Cabstract>>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 {
\x3C\x3Cabstract>>
+str message
+str context
}
class ValidationError {
+list~str~ fields
}
class RenderError {
+str template
}
ResumeError \x3C|-- ValidationError
ResumeError \x3C|-- 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
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install nm-cartograph-class-diagram - After installation, invoke the skill by name or use
/nm-cartograph-class-diagram - Provide required inputs per the skill's parameter spec and get structured output
What is Nm Cartograph Class Diagram?
Generate class diagrams showing classes, interfaces, inheritance, and composition. It is an AI Agent Skill for Claude Code / OpenClaw, with 84 downloads so far.
How do I install Nm Cartograph Class Diagram?
Run "/install nm-cartograph-class-diagram" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Nm Cartograph Class Diagram free?
Yes, Nm Cartograph Class Diagram is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Nm Cartograph Class Diagram support?
Nm Cartograph Class Diagram is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Nm Cartograph Class Diagram?
It is built and maintained by athola (@athola); the current version is v1.0.0.