{"id":"f5c55c63-12b3-4f47-8d6b-b5b2983364e0","shortId":"yrBQ5A","kind":"skill","title":"btp-diagram-generator","tagline":"Generate SAP BTP (Business Technology Platform) solution architecture diagrams as native draw.io (.drawio) files following the official SAP BTP Solution Diagram guidelines (Fiori Horizon design system) and open them via a configured draw.io MCP server. USE WHEN: user asks to crea","description":"# BTP Solution Diagram Generator\n\nProduces a `.drawio` file in the workspace that conforms to the [SAP BTP Solution Diagram guidelines](https://sap.github.io/btp-solution-diagrams/) and opens it through whichever [draw.io MCP server](https://www.drawio.com/doc/faq/ai-drawio-generation) is configured.\n\n## ⚡ Quick Path (use this first)\n\nFor the vast majority of diagrams, **do not hand-write XML**. Use the `btp_builder` Python package — it owns icon lookup, SAP palette, port pinning, label HTML, A4 sizing, SVG upscaling, and validation. A typical L1 diagram is ~20 lines.\n\n```python\n# scripts/examples/task_center_arch.py — runnable end-to-end\nimport sys\nfrom pathlib import Path\n# Add the skill's scripts/ dir to sys.path so `btp_builder` imports work\n# regardless of where the skill is installed (repo, ~/.claude/skills/, etc.)\nsys.path.insert(0, str(Path(__file__).resolve().parent.parent))\n\nfrom btp_builder import BtpDiagram\n\nd = BtpDiagram(level=\"L1\", title=\"Task Center Reference Architecture\")\n\nbtp = d.btp_container(x=260, y=80, w=560, h=440)\nsub = d.subaccount(parent=btp, label=\"Subaccount\",\n                   x=btp.x + 24, y=btp.y + 110, w=520, h=170)\n\nwz = d.service(\"work zone\",   in_=sub, x=sub.x + 60, y=sub.y + 60)\ntc = d.service(\"task center\", right_of=wz)\nci = d.service(\"cloud identity\", below=tc)\n\neu = d.user(\"End User\", x=60, y=btp.y + 100)\nac = d.app_client(\"Application Clients\\n(Mobile or Desktop)\", below=eu)\n\ns4    = d.external(\"SAP S/4HANA\\nOn-Premise Solutions\",\n                   x=btp.right_edge() + 40, y=btp.y + 70, kind=\"sap\")\nthird = d.external(\"3rd Party\\nApplications\", below=s4, kind=\"non-sap\")\ncloud = d.external(\"SAP Cloud\\nApplications\", below=third, kind=\"sap\")\nidp   = d.idp(\"3rd-party Identity Provider\",\n              x=ci.center_x() - 140, y=btp.bottom_edge() + 60)\n\nd.connect(eu, ac, direction=\"down\")\nd.connect(ac, wz, direction=\"right\")\nd.connect(wz, tc, kind=\"dblhd\")\nd.connect(tc, ci, kind=\"dblhd\", direction=\"down\")\nd.connect(tc, s4); d.connect(tc, third); d.connect(tc, cloud)\nd.connect(idp, ci, kind=\"dashed\", direction=\"up\")\n\nd.save(\"btp-task-center-architecture.drawio\")  # validates → raises on errors\n```\n\nRun via `uv run python <script>.py` (per [AGENTS.md](../../../AGENTS.md)). `save()` validates first and raises `ValueError` with the full error list if anything is off; warnings are printed.\n\n### Quick-Path API surface\n\n| Call                                                        | Returns   | Notes                                                                                                                                                       |\n| ----------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `BtpDiagram(level, title)`                                  | builder   | level ∈ `L0`/`L1`/`L2`. Drives icon size + label weight.                                                                                                    |\n| `.btp_container(x,y,w,h, sub_label, env_label, with_logo)`  | `NodeRef` | Light-blue outer frame + SAP corner logo + Subaccount/Multi-Cloud labels.                                                                                   |\n| `.subaccount(parent, label, ...)`                           | `NodeRef` | White card inside the BTP container.                                                                                                                        |\n| `.inner_card(parent, label, ...)`                           | `NodeRef` | Generic white sub-card (e.g. CIS service group).                                                                                                            |\n| `.service(name, in_=, right_of=, left_of=, below=, above=)` | `NodeRef` | `name` is fuzzy-matched via [reference/icon-aliases.json](reference/icon-aliases.json) (e.g. `\"task center\"`, `\"cpi\"`, `\"hana cloud\"`).                     |\n| `.user(label, kind=\"sap\")`                                  | `NodeRef` | kind ∈ `sap` / `non-sap` / `highlight`.                                                                                                                     |\n| `.app_client(label, ...)`                                   | `NodeRef` | Generic mobile/desktop tile.                                                                                                                                |\n| `.external(label, kind=\"sap\"/\"non-sap\", ...)`               | `NodeRef` | Right-side external system tile.                                                                                                                            |\n| `.idp(label, ...)`                                          | `NodeRef` | 3rd-party Identity Provider tile.                                                                                                                           |\n| `.connect(src, tgt, kind, direction)`                       | edge id   | `kind` ∈ `std`/`dblhd`/`dashed`/`optional`/`auth`/`scim`/`trust`/`neutral`. `direction` auto-pins ports — override with `\"right\"`/`\"left\"`/`\"up\"`/`\"down\"`. |\n| `.save(path, validate=True)`                                | `Path`    | Writes XML. Validates inline (raises on errors).                                                                                                            |\n\nPositional kwargs (`right_of`, `left_of`, `below`, `above`, `in_`) auto-place nodes — only set explicit `x,y` for the first anchor in each row/column.\n\n### Icon name discovery\n\n```python\nfrom btp_builder import list_aliases, list_icons, lookup_icon\nprint(list(list_aliases())[:30])     # short names → canonical keys\nprint(lookup_icon(\"integration suite\", \"L1\")[\"key\"])\n```\n\nIf `lookup_icon` raises `IconNotFound`, fall back to a styled tile (`external(label, kind=\"sap\")`) and call it out in the final response.\n\n### Open the diagram\n\n```sh\nuv run python skills/btp-diagram-generator/scripts/open_diagram.py btp-task-center-architecture.drawio\n```\n\nFalls back to printing a `https://app.diagrams.net/?…#create=...` URL if no system opener is found. If a draw.io MCP tool is available in the runtime, prefer that — only call MCP tools that actually appear in the tool list.\n\n---\n\n## Manual XML path (advanced / niche cases only)\n\nUse this only when the Quick Path doesn't cover what you need (e.g. exotic legend variants, custom flow-protocol pills, novel layouts not yet supported by the builder). Everything below documents the underlying XML primitives the builder generates for you.\n\n## When to use\n\nTrigger on requests like:\n\n- \"Draw a BTP architecture for …\"\n- \"Generate a BTP solution diagram showing CAP + HANA Cloud + Build Workzone\"\n- \"Create a draw.io of our SAP BTP integration landscape\"\n- \"L0 / L1 / L2 BTP diagram for <use case>\"\n\nIf the request is a generic flowchart, sequence diagram, or non-SAP architecture, do not use this skill — generate Mermaid or use a plain draw.io workflow instead.\n\n## Inputs to gather (ask once, concisely)\n\nBefore generating, confirm what is missing. Default to L1 if unspecified.\n\n| Input                    | Default              | Notes                                                                                                                                                                  |\n| ------------------------ | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Audience level           | L1                   | L0 = business overview (no legend, neutral connectors); L1 = technical (services + main flows); L2 = detailed (data flows, protocols, components)                      |\n| BTP services / SaaS apps | (must ask)           | e.g. CAP, Build Code, Integration Suite (CPI/Event Mesh/API Mgmt), HANA Cloud, SAC, AI Core, Joule, Build Workzone, Identity Authentication, Destination, Connectivity |\n| Non-BTP systems          | (optional)           | e.g. S/4HANA Cloud, SuccessFactors, Ariba, third-party SaaS, on-prem systems, end users                                                                                |\n| Environment / runtime    | Cloud Foundry        | Cloud Foundry, Kyma, ABAP Environment                                                                                                                                  |\n| Region / multi-region?   | single               | Affects grouping containers                                                                                                                                            |\n| Primary flows            | (must ask)           | What connects to what, direction, purpose                                                                                                                              |\n| Output filename          | `btp-diagram.drawio` | Saved to workspace root unless user specifies                                                                                                                          |\n\nIf the user gives a one-line prompt with enough services and a clear flow, proceed without asking — surface assumptions in the final response.\n\n## Workflow\n\n### 1. Map requirements to BTP icons\n\n> **There is no `mxgraph.sap.*` stencil family.** SAP BTP icons in draw.io are SVGs embedded as base64 inside `shape=image;image=data:image/svg+xml,<base64>;…` style strings, distributed via the [SAP draw.io shape library XML files](https://github.com/SAP/btp-solution-diagrams/tree/main/assets/shape-libraries-and-editable-presets/draw.io). Generating `shape=mxgraph.sap.foo` produces an empty square in the canvas — you have seen this fail.\n\nFor every requested service, obtain its real `style` string by looking it up in [reference/icon-index.json](reference/icon-index.json):\n\n1. **Preferred:** Load [reference/icon-index.json](reference/icon-index.json) (~660 KB, 100 icons). It maps each icon title (e.g. `31068-sap-build-work-zone_sd`) to its `style` string and library cell `width`/`height`. Match by substring against the requested service name.\n2. **Source XML libraries** (if you need a non-default size or a metadata field the index doesn't carry) live in [reference/libraries/](reference/libraries/) — one size-M `mxlibrary` per icon set (foundational, integration suite, app-dev, AI, data-analytics, BTP-SaaS, all-in-one).\n3. **Style donors:** for compound patterns (subaccount cards, NETWORK boundaries, pill labels, legend cards), consult the curated [reference/examples/](reference/examples/) — 11 official editable diagrams (Task Center L0/L1/L2, Build Work Zone L2, Process Automation L2, Cloud Identity Services L1/L2, Private Link L2, SAP Start L2). Open any of them and copy the exact style string.\n4. If a service is genuinely missing from the library, use the styled fallback tile (see §3 below) and **list it in the final response** so the user can replace it.\n\nDefault icon geometry by audience level (matches the official examples — see [reference/example-patterns.md §5](reference/example-patterns.md)):\n\n> **SVG intrinsic size warning:** Every icon in the SAP shape library has `width=\"16\" height=\"16\"` on its root `<svg>` element, even in the size-M set. draw.io rasterizes at that intrinsic size then upscales, producing a blurry icon. After extracting a base64 SVG, patch the root `<svg width>` and `<svg height>` to match the target cell size (e.g. 48 for L1) before re-encoding. Keep `viewBox` unchanged. See [reference/example-patterns.md §11](reference/example-patterns.md) for the Python helper.\n\n| Level | Icon size | Label            |\n| ----- | --------- | ---------------- |\n| L0    | 50×50     | Arial 14 bold    |\n| L1    | 48×48     | Arial 14 bold    |\n| L2    | 32×32     | Arial 12 regular |\n\nThe label goes in the cell's `value=` attribute and renders below the icon (the library style already sets `verticalLabelPosition=bottom`). Always keep the `points=[[0,0,0,0,0],…]` 12-anchor array from the library style so connectors snap cleanly.\n\n### 2. Apply the SAP Fiori Horizon palette\n\nAlways use these colors only (never pick arbitrary fills). Source: SAP BTP Solution Diagram guideline — _Foundation (Atoms)_ and _Areas_:\n\n| Token                      | Hex                      | Use                                                           |\n| -------------------------- | ------------------------ | ------------------------------------------------------------- |\n| SAP/BTP border (Primary)   | `#0070F2`                | BTP container stroke, accent fills, sub-card stroke           |\n| SAP/BTP fill               | `#EBF8FF`                | BTP container background                                      |\n| Non-SAP border             | `#475E75`                | Non-SAP / external area strokes, generic data-flow connectors |\n| Non-SAP fill / Subtle bg   | `#F5F6F7`                | Non-SAP areas, page background, generic pill fill             |\n| Title text                 | `#1D2D3E`                | Headings, primary labels                                      |\n| Secondary text             | `#556B82`                | Sub-labels, descriptions, footnotes                           |\n| Positive (Auth, green)     | `#188918` / bg `#F5FAE5` | Authentication flows (SAML, OIDC) — per guideline             |\n| Critical (Warning, orange) | `#C35500` / bg `#FFF8D6` | Warnings                                                      |\n| Negative (Error, red)      | `#D20A0A` / bg `#FFEAF4` | Errors                                                        |\n| Teal accent                | `#07838F` / bg `#DAFDF5` | Highlight areas                                               |\n| Indigo (Authorization)     | `#5D36FF` / bg `#F1ECFF` | Authorization / provisioning (SCIM) flows — per guideline     |\n| Pink (Trust)               | `#CC00DC` / bg `#FFF0FA` | Trust flows (mutual trust, federation) — per guideline        |\n\nFont: `Arial` (or `Arial Black` for headings), size 12 for body labels, 14 for service labels, 16 for group titles.\n\n### 3. Apply the atomic structure\n\nPer the SAP atomic design system (Atoms → Molecules → Organisms). The exact style strings, sizes and HTML label patterns to copy live in [reference/example-patterns.md](reference/example-patterns.md) — match those rather than inventing variants.\n\n- **Document title** (every diagram): a floating text cell above the BTP container, blue `#0070F2` bold Arial 16, format `\"{Scenario} - SAP BTP Solution Diagram\"`.\n- **Outer container** (Subaccount / Multi-Cloud): `rounded=1;strokeColor=#0070F2;fillColor=#EBF8FF;arcSize=32;absoluteArcSize=1;strokeWidth=1.5;`. Carries the SAP-logo image tile in the top-left and two stacked labels: bold `Subaccount` (Arial 16) + smaller `Multi-Cloud` (Arial 12).\n- **Sub-containers** (white cards inside the BTP boundary — e.g. Cloud Identity Services group): same `#0070F2` stroke, `#FFFFFF` fill, `arcSize=16`. **Always blue stroke, never slate**, when the card sits inside the BTP container. Per the guideline _Areas / Nesting_: alternate fill vs. no-fill between parent and child to keep visual contrast (BTP container has fill `#EBF8FF`, so inner cards use white).\n- **Service nodes**: BTP icons (§1) wrapped in a `style=\"group\" connectable=\"0\"` cell whenever they need a separate text label or are co-positioned with another shape. Children use coordinates relative to the group origin.\n- **External-system tiles** (e.g. `SAP S/4HANA On-Premise`): a group of (white card `arcSize=14` + ~28×28 icon top-left + bold `font-size:16px` label on the right). Sit outside the BTP container.\n- **Users / actors**: a `group` containing the user SVG image and a centered `End User` text label below.\n- **Connectors** — copy the right variant from the example patterns reference. Per the guideline _Connectors_ section, line _style_ encodes flow nature and line _color_ encodes flow semantic:\n  - **Line style:** solid = direct synchronous request/response · `dashed=1` = indirect / asynchronous · `dashed=1;dashPattern=1 4;` (dotted) = optional · `strokeWidth=3` = **firewalls / network barriers only**.\n  - **Semantic color:** Authentication = green `#188918` · Authorization / Provisioning (SCIM) = indigo `#5D36FF` · Mutual trust / federation = pink `#CC00DC` · Generic data = slate `#475E75`.\n  - Standard data flow: `endArrow=blockThin;strokeColor=#475E75;endFill=1;endSize=4;startSize=4;strokeWidth=1.5;`\n  - Orthogonal: prefix with `edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;`\n  - Authentication (SAML/OIDC): same shape, `strokeColor=#188918`\n  - Authorization / Provisioning (SCIM): same shape, `strokeColor=#5D36FF`\n  - Mutual trust: add `startArrow=blockThin;startFill=1` and `strokeColor=#CC00DC`\n  - Async / indirect: add `dashed=1`\n  - Optional: add `dashed=1;dashPattern=1 4;` (dotted)\n  - Network / firewall boundary line: thick grey vertical separator `strokeColor=#475E75;strokeWidth=3;jumpStyle=gap;` with a small uppercase `NETWORK` label (`#475E75`) beside it. **Reserve `strokeWidth=3` for firewalls/network barriers only** — do not use it for normal data flows.\n  - **Always pin exit/entry ports** to avoid diagonal auto-routing: add `exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;` (adjust X/Y for the direction). For vertical connectors use `exitY=1` / `entryY=0`. **Remove manual `<mxPoint>` waypoints** unless a deliberate detour is needed — leave `<Array as=\"points\"/>` empty. See [reference/example-patterns.md §8](reference/example-patterns.md) for the full port-pinning reference.\n- **Edge labels** are _separate vertex pills_, not inline edge text — small rounded rectangles `arcSize=50`, ~16 px tall, color-matched to the connector (generic `#475E75`/`#F5F6F7`, auth `#188918`/`#F5FAE5`, authz/SCIM `#5D36FF`/`#F1ECFF`, trust `#CC00DC`/`#FFF0FA`).\n- **L0**: no legend, no protocol pills, neutral `endArrow=block` or `endArrow=none` connectors.\n- **L1**: directional `endArrow=blockThin` connectors, optionally a few colored auth/provisioning flows and pill labels.\n- **L2**: add a description block + `Diagram Level: L2` under the title, pill tags on every meaningful edge, and a **legend card** in the top-right (white card, `strokeColor=#eaecee`, with colored 16×16 ellipse swatches for each flow type and a sample arrow per arrow style).\n\n### 4. Generate the draw.io XML\n\nFollow the [draw.io AI generation rules](https://www.drawio.com/doc/faq/ai-drawio-generation):\n\n- Use **uncompressed** XML, full `<mxfile>` wrapper (so file-level vars are usable).\n- Always include `<mxCell id=\"0\"/>` and `<mxCell id=\"1\" parent=\"0\"/>`.\n- Vertices: `vertex=\"1\"`. Edges: `edge=\"1\"` with `source`/`target`. Mutually exclusive.\n- Unique IDs across the diagram.\n- Coordinates: top-left `(0,0)`, x→right, y→down. Children inside a group use coordinates _relative_ to the group.\n- Match perimeter to shape (e.g. `perimeter=ellipsePerimeter` for ellipses).\n- XML-escape labels (`&amp;`, `&lt;`, `&gt;`, `&quot;`). HTML markup inside `value=` is allowed and is the standard way to bold/size text — see the official examples.\n- Keep grid spacing on multiples of 10 px (`gridSize=\"10\"`); leave ≥20 px gaps between siblings; sub-containers padded by ~18–24 px.\n- It is normal and expected for diagrams to be authored in **negative** coordinate space (e.g. `x=\"-2200\"`); draw.io centers on content.\n\nPage size: **always A4 landscape** — `pageWidth=\"1169\" pageHeight=\"827\"`, even for dense L2. Larger virtual canvas comes from spreading groups across negative coordinates, not from changing the page size. L2 additionally sets `background=\"none\"` on `<mxGraphModel>`.\n\n### 5. Write the file\n\nSave to the path the user requested (default: workspace root, `btp-diagram.drawio`). Do not overwrite an existing file without confirming.\n\n### 6. Open via the MCP server\n\nDetect which draw.io MCP integration is available, in this order — use the first that is configured:\n\n1. **MCP Tool Server** (`@drawio/mcp` / `npx @drawio/mcp`): call its \"open diagram\" tool with the generated XML to launch the editor in the browser.\n2. **MCP App Server** (`mcp.draw.io/mcp` remote): call its render tool to embed the interactive viewer inline in chat.\n3. **Neither configured**: skip silently and instead print a `https://app.diagrams.net/?pv=0&grid=0#create=...` URL built per the FAQ (URI-encode JSON `{\"type\":\"xml\",\"compressed\":true,\"data\":\"<base64-deflate-raw>\"}`). If you cannot compress in-context, print the file path and instruct the user to open it in their installed draw.io.\n\nNever invent an MCP tool name — only call tools that actually appear in the available tool list.\n\n### 7. Validate before delivering\n\nRun the bundled validator script first — it codifies most of the checklist:\n\n```sh\npython3 skills/btp-diagram-generator/scripts/validate_diagram.py <file.drawio>\n```\n\nIf it warns about blurry icons (SVG intrinsic size smaller than cell), fix in place:\n\n```sh\npython3 skills/btp-diagram-generator/scripts/upscale_svg_icons.py <file.drawio> --size 48 --in-place\n```\n\nThen verify these remaining items by eye:\n\n- [ ] All labels XML-escaped.\n- [ ] No overlapping shapes (≥20px gap).\n- [ ] BTP container visually encloses all BTP services; external systems sit outside it.\n- [ ] L0 diagrams have no legend and neutral connectors; L2 includes a legend card top-right and a description block under the title.\n- [ ] Edge labels are pill _vertex_ cells, not inline `value=` text on the `edge=\"1\"` cell.\n\nThe validator covers everything else: root cells, unique IDs, vertex/edge exclusivity, no `mxgraph.sap.*`, edge source/target validity, port pinning, manual waypoints, SVG intrinsic size vs cell geometry, palette colors, and A4 landscape page size.\n\nFor deeper validation, reference [`mxfile.xsd`](https://github.com/jgraph/drawio-mcp/blob/main/shared/mxfile.xsd) and the [style reference checklist](https://github.com/jgraph/drawio-mcp/blob/main/shared/style-reference.md#15-validation-checklist-for-ai-generated-files).\n\n## Final response template\n\nWhen done, respond with:\n\n1. The saved file path as a workspace-relative markdown link.\n2. Whether the diagram was opened in the MCP editor (and how), or the fallback URL/instructions.\n3. A short bullet list of **assumptions made** and any **icons that fell back** to generic tiles, so the user can correct them.\n4. If the diagram opened in a draw.io workspace using **dark theme**, mention that SAP labels (`#1D2D3E`) are intentionally dark per the Fiori Horizon spec and will appear faint on dark canvas — switch draw.io to light theme or export to PNG/SVG to verify.\n5. One sentence on how to iterate (e.g. \"ask me to add X service or change the audience level to L2\").\n\n## Bundled assets\n\n- [reference/icon-index.json](reference/icon-index.json) — flat `{title → {style, width, height}}` map of all 100 BTP service icons + 3 generic user icons (`generic:user-sap` / `-non-sap` / `-highlight`). **Primary lookup source for icon styles.** The Quick-Path builder reads this for you.\n- [reference/icon-aliases.json](reference/icon-aliases.json) — short-name → canonical-key map (132 aliases like `\"task center\"`, `\"cpi\"`, `\"hana cloud\"`, `\"end user\"`). Drives the fuzzy lookup in `BtpDiagram.service()`.\n- [reference/styles.json](reference/styles.json) — named SAP style strings (`container_btp`, `card_subaccount`, `tile_external_sap`, `arrow_dblhd`, `pill_auth`, …) + port-pin fragments + per-level icon sizes. Loaded by the builder; useful as a copy-paste reference when hand-authoring XML.\n- [reference/templates/](reference/templates/) — empty L0/L1/L2 mxfile skeletons, ready to fill in.\n- [reference/sap-logo.b64.txt](reference/sap-logo.b64.txt) — base64 of the SAP corner logo SVG, embedded by `btp_container(with_logo=True)`.\n- [reference/libraries/](reference/libraries/) — the 7 official SAP draw.io `mxlibrary` XML files (foundational, integration-suite, app-dev-automation, data-analytics, AI, BTP-SaaS, and the all-in-one size-M set). Use when you need raw library data the index doesn't expose.\n- [reference/svg/](reference/svg/) — 129 raw `.svg` source files for every BTP service icon. Use when you need to edit/recolor an icon, export to non-draw.io targets, or embed an icon outside a draw.io style string.\n- [reference/examples/](reference/examples/) — the 11 official editable example diagrams (Task Center L0/L1/L2, Build Work Zone L2, Process Automation L2, Cloud Identity Services L1/L2, Private Link L2, SAP Start L2). **Primary source for compound style patterns** (subaccount card, network boundary, pill labels, legend card).\n- [reference/sap-btp-palette.json](reference/sap-btp-palette.json) — the exact color tokens above, ready to paste into draw.io `Extras → Configuration` `customColorSchemes`.\n- [reference/example-patterns.md](reference/example-patterns.md) — ready-to-copy style strings, sizes, label HTML and connector/pill recipes extracted from the example diagrams. **Consult this whenever you need the exact style of a container, icon, edge or pill — do not improvise.**\n\n## Bundled scripts\n\nIn `scripts/`, runnable with `uv run python` (no third-party dependencies):\n\n- [scripts/btp_builder/](scripts/btp_builder/) — **the Quick-Path package**. `BtpDiagram` DSL, icon lookup with alias resolution, palette constants, port-pin helpers, SVG upscaling, named styles. Import as `from btp_builder import BtpDiagram`.\n- [scripts/examples/task_center_arch.py](scripts/examples/task_center_arch.py) — runnable canonical example reproducing the Task Center reference architecture end-to-end.\n- [scripts/open_diagram.py](scripts/open_diagram.py) — opens a `.drawio` file via the OS opener (macOS `open`, Linux `xdg-open`, Windows `start`); falls back to printing an `app.diagrams.net` URL.\n- [scripts/validate_diagram.py](scripts/validate_diagram.py) — enforces the §7 checklist. Catches `mxgraph.sap.*` typos, duplicate IDs, edges with broken source/target, missing port pins, manual waypoints, off-palette colors, and SVG intrinsic-size blur. Use `--strict-palette` and `--strict-waypoints` to fail on warnings. Also exposes `validate_xml(xml)` / `validate_path(path)` for reuse from Python.\n- [scripts/upscale_svg_icons.py](scripts/upscale_svg_icons.py) — fixes blurry icons by patching the root `<svg>` `width`/`height` to match the cell geometry (keeps `viewBox` unchanged). Default target 48 px; pass `--size 32` for L2, `--size 50` for L0. Use `--in-place` to overwrite. (The Quick-Path builder applies this automatically; only run manually on hand-authored XML.)","tags":["btp","diagram","generator","abap","skills","likweitan","agent-skills","sap"],"capabilities":["skill","source-likweitan","skill-btp-diagram-generator","topic-abap","topic-agent-skills","topic-sap"],"categories":["abap-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/likweitan/abap-skills/btp-diagram-generator","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add likweitan/abap-skills","source_repo":"https://github.com/likweitan/abap-skills","install_from":"skills.sh"}},"qualityScore":"0.458","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 17 github stars · SKILL.md body (26,626 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:06:04.342Z","embedding":null,"createdAt":"2026-04-25T13:01:31.634Z","updatedAt":"2026-05-18T19:06:04.342Z","lastSeenAt":"2026-05-18T19:06:04.342Z","tsv":"'/.claude/skills':162 '/btp-solution-diagrams/)':68 '/doc/faq/ai-drawio-generation)':79 '0':165 '100':245 '110':207 '140':304 '170':211 '20':126 '24':204 '260':189 '3rd':276,297 '3rd-party':296 '40':268 '440':195 '520':209 '560':193 '60':220,223,242,308 '70':271 '80':191 'a4':115 'ac':246,311,315 'add':141 'applic':249 'architectur':12,184 'ask':43 'btp':2,7,23,46,62,101,150,172,185,199 'btp-diagram-gener':1 'btp-task-center-architecture.drawio':348 'btp.bottom':306 'btp.right':266 'btp.x':203 'btp.y':206,244,270 'btpdiagram':175,177 'builder':102,151,173 'busi':8 'center':182,227 'ci':231,326,342 'ci.center':302 'client':248,250 'cloud':233,285,288,339 'configur':36,81 'conform':58 'contain':187 'crea':45 'd':176 'd.app':247 'd.btp':186 'd.connect':309,314,319,324,331,334,337,340 'd.external':258,275,286 'd.idp':295 'd.save':347 'd.service':213,225,232 'd.subaccount':197 'd.user':238 'dash':344 'dblhd':323,328 'design':29 'desktop':254 'diagram':3,13,25,48,64,92,124 'dir':146 'direct':312,317,329,345 'draw.io':16,37,74 'drawio':17,52 'edg':267,307 'end':132,134,239 'end-to-end':131 'error':352 'etc':163 'eu':237,256,310 'file':18,53,168 'fiori':27 'first':86 'follow':19 'generat':4,5,49 'guidelin':26,65 'h':194,210 'hand':96 'hand-writ':95 'horizon':28 'html':114 'icon':107 'ident':234,299 'idp':294,341 'import':135,139,152,174 'instal':160 'kind':272,281,292,322,327,343 'l1':123,179 'label':113,200 'level':178 'line':127 'lookup':108 'major':90 'mcp':38,75 'mobil':252 'n':251 'napplic':278,289 'nativ':15 'non':262,283 'non-premis':261 'non-sap':282 'offici':21 'open':32,70 'own':106 'packag':104 'palett':110 'parent':198 'parent.parent':170 'parti':277,298 'path':83,140,167 'pathlib':138 'pin':112 'platform':10 'port':111 'premis':263 'produc':50 'provid':300 'python':103,128,357 'quick':82 'rais':350 'refer':183 'regardless':154 'repo':161 'resolv':169 'right':228,318 'run':353,356 'runnabl':130 's/4hana':260 's4':257,280,333 'sap':6,22,61,109,259,273,284,287,293 'sap.github.io':67 'sap.github.io/btp-solution-diagrams/)':66 'script':145 'scripts/examples/task_center_arch.py':129 'server':39,76 'size':116 'skill':143,158 'skill-btp-diagram-generator' 'solut':11,24,47,63,264 'source-likweitan' 'str':166 'sub':196,217 'sub.x':219 'sub.y':222 'subaccount':201 'svg':117 'sys':136 'sys.path':148 'sys.path.insert':164 'system':30 'task':181,226 'tc':224,236,321,325,332,335,338 'technolog':9 'third':274,291,336 'titl':180 'topic-abap' 'topic-agent-skills' 'topic-sap' 'typic':122 'upscal':118 'use':40,84,99 'user':42,240 'uv':355 'valid':120,349 'vast':89 'via':34,354 'w':192,208 'whichev':73 'work':153,214 'workspac':56 'write':97 'www.drawio.com':78 'www.drawio.com/doc/faq/ai-drawio-generation)':77 'wz':212,230,316,320 'x':188,202,218,241,265,301,303 'xml':98 'y':190,205,221,243,269,305 'zone':215","prices":[{"id":"da44eb4e-e969-43bf-a7d3-2620d813465b","listingId":"f5c55c63-12b3-4f47-8d6b-b5b2983364e0","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"likweitan","category":"abap-skills","install_from":"skills.sh"},"createdAt":"2026-04-25T13:01:31.634Z"}],"sources":[{"listingId":"f5c55c63-12b3-4f47-8d6b-b5b2983364e0","source":"github","sourceId":"likweitan/abap-skills/btp-diagram-generator","sourceUrl":"https://github.com/likweitan/abap-skills/tree/main/skills/btp-diagram-generator","isPrimary":false,"firstSeenAt":"2026-04-25T13:01:31.634Z","lastSeenAt":"2026-05-18T19:06:04.342Z"}],"details":{"listingId":"f5c55c63-12b3-4f47-8d6b-b5b2983364e0","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"likweitan","slug":"btp-diagram-generator","github":{"repo":"likweitan/abap-skills","stars":17,"topics":["abap","agent-skills","sap"],"license":"mit","html_url":"https://github.com/likweitan/abap-skills","pushed_at":"2026-04-25T12:38:23Z","description":"Agent Skills for ABAP Developers","skill_md_sha":"40c04f3a305ec034691461f48021096ef6f06379","skill_md_path":"skills/btp-diagram-generator/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/likweitan/abap-skills/tree/main/skills/btp-diagram-generator"},"layout":"multi","source":"github","category":"abap-skills","frontmatter":{"name":"btp-diagram-generator","description":"Generate SAP BTP (Business Technology Platform) solution architecture diagrams as native draw.io (.drawio) files following the official SAP BTP Solution Diagram guidelines (Fiori Horizon design system) and open them via a configured draw.io MCP server. USE WHEN: user asks to create/draw/design/sketch a BTP diagram, BTP architecture, BTP landscape, BTP solution diagram, BTP reference architecture, SAP Business Technology Platform diagram, or wants to visualize SAP BTP services (CAP, Build, Integration Suite, SAC, AI Core, HANA Cloud, Cloud Foundry, Kyma, Workzone, etc.) and their interdependencies in draw.io / drawio / diagrams.net. DO NOT USE FOR: non-BTP architecture diagrams, generic flowcharts, sequence/UML diagrams, or diagrams that should remain in Mermaid/PlantUML."},"skills_sh_url":"https://skills.sh/likweitan/abap-skills/btp-diagram-generator"},"updatedAt":"2026-05-18T19:06:04.342Z"}}