Skip to main content
ClaudeWave
Skill210 repo starsupdated 2d ago

python-diagrams

**UTILITY SKILL** — Python diagram generation: WAF/cost/compliance charts (matplotlib), architecture diagrams (diagrams lib), ERDs, swimlanes, timelines, wireframes (graphviz). WHEN: 'WAF bar chart', 'cost donut chart', 'compliance gap chart', 'Python architecture diagram', 'ERD diagram', 'swimlane', 'UI wireframe'. DO NOT USE FOR: Draw.io architecture diagrams (drawio), inline Mermaid (mermaid).

Install in Claude Code
Copy
git clone --depth 1 https://github.com/jonathan-vella/apex /tmp/python-diagrams && cp -r /tmp/python-diagrams/.github/skills/python-diagrams ~/.claude/skills/python-diagrams
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Python Diagrams & Charts

Skill for generating diagrams and charts using Python libraries: `matplotlib`
for WAF/cost/compliance visualizations, `diagrams` for architecture diagrams,
and `graphviz` for ERDs, swimlanes, timelines, and wireframes.

## Prerequisites

```bash
pip install diagrams matplotlib pillow && apt-get install -y graphviz
```

## Routing Guide

Every Python diagram emits **both PNG and SVG** siblings via the shared
[`scripts/diagram_io.py`](scripts/diagram_io.py) helper — PNG for raster
preview, SVG for scalable / accessible / diff-friendly review.

| Diagram type                        | Library    | Output                |
| ----------------------------------- | ---------- | --------------------- |
| WAF bar charts                      | matplotlib | `.py` + `.png` + `.svg` |
| Cost donut / projection charts      | matplotlib | `.py` + `.png` + `.svg` |
| Compliance gap charts               | matplotlib | `.py` + `.png` + `.svg` |
| Architecture diagrams (non-Draw.io) | diagrams   | `.py` + `.png` + `.svg` |
| Swimlane / business process         | graphviz   | `.py` + `.png` + `.svg` |
| Entity-relationship diagrams        | graphviz   | `.py` + `.png` + `.svg` |
| Timeline / Gantt charts             | matplotlib | `.py` + `.png` + `.svg` |
| UI wireframes                       | graphviz   | `.py` + `.png` + `.svg` |

## Required Outputs (Workflow Integration)

| Step | Python chart files                                                                  |
| ---- | ----------------------------------------------------------------------------------- |
| 2    | `02-waf-scores.py/.png/.svg`                                                        |
| 3    | `03-des-cost-distribution.py/.png/.svg`, `03-des-cost-projection.py/.png/.svg`      |
| 4    | `04-dependency-diagram.py/.png/.svg`, `04-runtime-diagram.py/.png/.svg`             |
| 7    | `07-ab-cost-*.py/.png/.svg`, `07-ab-compliance-gaps.py/.png/.svg`                   |

Suffix rules: `-des` for design (Step 3), `-ab` for as-built (Step 7).

## Execution & Output Standards

Save `.py` source in `agent-output/{project}/`, then run with `python3` to
produce the `.png` + `.svg` sibling pair. Every generator must import the
shared helpers from [`scripts/diagram_io.py`](scripts/diagram_io.py)
(`save_figure`, `diagram_kwargs`, `render_graphviz`) — never call
`plt.savefig`, `Diagram(outformat=...)`, or `dot.render()` directly.

For the full conventions — design tokens (Azure blue, WAF pillar colours,
DPI 150), `graph_attr` / `node_attr` / `cluster_style` settings,
`labelloc='t'`, Arial Bold fonts, CIDR labels — read
[`references/python-charts.md`](references/python-charts.md).

For ready-to-use architecture diagram patterns (3-tier web app, hub-spoke, etc.)
including the canonical `with Diagram(... show=False, direction="TB") as d:`
template, read [`references/common-patterns.md`](references/common-patterns.md).

## Rules

**DO:** Import `save_figure` / `diagram_kwargs` / `render_graphviz` from
[`scripts/diagram_io.py`](scripts/diagram_io.py) so every chart emits both
`.png` and `.svg` siblings · Set `show=False` · Use `direction="TB"` ·
Group in `Cluster` blocks · Set explicit `filename` · Use DPI ≥150 ·
Apply design tokens consistently · Generate WAF scores PNG+SVG when WAF
scores are assigned.

**DON'T:** Call `plt.savefig(...)`, `Diagram(..., outformat=...)`, or
`dot.render(...)` directly — always go through `diagram_io` · Use Mermaid
for charts (use matplotlib) · Use Python `diagrams` for primary architecture
diagrams (use Draw.io skill) · Let `show=True` open a viewer · Omit
`filename` (produces non-deterministic output names) · Use grouped
list-to-list edge operators (`[a, b] >> [c, d]`) — use explicit node-to-node
edges instead (the `diagrams` library may reject grouped expressions with a
`TypeError`) · Use emoji or Unicode glyphs in chart labels — keep labels
ASCII-safe for portability across container fonts.

## Scope Exclusions

Does NOT: generate Draw.io architecture diagrams · produce Mermaid diagrams ·
generate Bicep/Terraform · create ADRs · deploy resources.

## Scripts

`scripts/diagram_io.py` (shared PNG+SVG output helper — import this from every generator) ·
`scripts/generate_diagram.py` (interactive diagram generation) ·
`scripts/multi_diagram_generator.py` (multi-type: process, ERD, timeline, wireframe) ·
`scripts/ascii_to_diagram.py` (ASCII art → diagram conversion) ·
`scripts/verify_installation.py` (prerequisites check)

## Reference Index

| File                                         | Content                                                             |
| -------------------------------------------- | ------------------------------------------------------------------- |
| `references/python-charts.md`                | Chart execution, design tokens, output standards                    |
| `references/waf-cost-charts.md`              | WAF pillar bar, cost donut & projection chart implementations       |
| `references/azure-components.md`             | Complete list of 700+ Azure diagram components                      |
| `references/common-patterns.md`              | Ready-to-use Python architecture patterns (3-tier, hub-spoke, etc.) |
| `references/business-process-flows.md`       | Workflow and swimlane diagram patterns                              |
| `references/entity-relationship-diagrams.md` | Database ERD patterns                                               |
| `references/integration-services.md`         | Integration service diagram patterns                                |
| `references/migration-patterns.md`           | Migration architecture patterns                                     |
| `references/sequence-auth-flows.md`          | Authentication flow sequence patterns                               |
| `references/timeline-gantt-diagrams.md`      | Project timeline and Gantt diagrams                                 |
| `references/ui-wireframe-diagrams.md`        | UI mocku
appinsights-instrumentationSkill

Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.

azure-aiSkill

Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.

azure-aigatewaySkill

Configure Azure API Management as an AI Gateway for AI models, MCP tools, and agents. WHEN: semantic caching, token limit, content safety, load balancing, AI model governance, MCP rate limiting, jailbreak detection, add Azure OpenAI backend, add AI Foundry model, test AI gateway, LLM policies, configure AI backend, token metrics, AI cost control, convert API to MCP, import OpenAPI to gateway.

azure-diagramsSkill

ROUTING SKILL — delegates to specialized diagram skills. USE FOR: any diagram request when the caller does not know which tool to use. Routes to drawio, python-diagrams, or mermaid based on diagram type.

azure-hosted-copilot-sdkSkill

Build and deploy GitHub Copilot SDK apps to Azure. WHEN: build copilot app, create copilot app, copilot SDK, @github/copilot-sdk, scaffold copilot project, copilot-powered app, deploy copilot app, host on azure, azure model, BYOM, bring your own model, use my own model, azure openai model, DefaultAzureCredential, self-hosted model, copilot SDK service, chat app with copilot, copilot-sdk-service template, azd init copilot, CopilotClient, createSession, sendAndWait, GitHub Models API.

azure-messagingSkill

Troubleshoot and resolve issues with Azure Messaging SDKs for Event Hubs and Service Bus. Covers connection failures, authentication errors, message processing issues, and SDK configuration problems. WHEN: event hub SDK error, service bus SDK issue, messaging connection failure, AMQP error, event processor host issue, message lock lost, send timeout, receiver disconnected, SDK troubleshooting, azure messaging SDK, event hub consumer, service bus queue issue, topic subscription error, enable logging event hub, service bus logging, eventhub python, servicebus java, eventhub javascript, servicebus dotnet, event hub checkpoint, event hub not receiving messages, service bus dead letter.

copilot-customizationSkill

Authoritative reference for VS Code Copilot customization mechanisms: instructions, prompt files, custom agents, agent skills, MCP servers, hooks, and plugins. Use when deciding which customization type to use, creating new .instructions.md/.prompt.md/.agent.md/SKILL.md/mcp.json files from scratch, or debugging why a customization is not loading. DO NOT USE FOR: routine file edits where the format is already known.

count-registrySkill

Provides canonical entity counts from count-manifest.json. Use when agents need to reference how many agents, skills, instructions, or validators exist. Prevents hard-coded counts. WHEN: agent count, skill count, how many agents, how many skills, entity inventory, project statistics.