skilldrop-cli 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/catalogue.json +7 -8
  2. package/model-routing.json +0 -16
  3. package/package.json +1 -1
  4. package/packs/ai-engineering/skills/ai-usage-report/examples/weekly-engineering-team.md +1 -1
  5. package/packs/ai-engineering/skills/ai-usage-report/templates/usage-event-schema.md +2 -2
  6. package/packs/converters/pack.json +3 -14
  7. package/packs/converters/skills/file-to-markdown/SKILL.md +28 -11
  8. package/packs/converters/skills/file-to-markdown/evals/evals.json +30 -0
  9. package/packs/converters/skills/file-to-markdown/evals/files/5/supplier_agreement_v3.docx +0 -0
  10. package/packs/converters/skills/file-to-markdown/evals/files/6/numbers.xlsx +0 -0
  11. package/packs/converters/skills/file-to-markdown/evals/files/6/offsite_q3.pptx +0 -0
  12. package/packs/converters/skills/file-to-markdown/examples/inputs/acme-brief.docx +0 -0
  13. package/packs/converters/skills/file-to-markdown/examples/inputs/northwind-roadmap.pptx +0 -0
  14. package/packs/converters/skills/file-to-markdown/examples/mixed-inputs.md +24 -16
  15. package/packs/converters/skills/file-to-markdown/manifest.json +2 -3
  16. package/packs/converters/skills/file-to-markdown/scripts/to_markdown.py +103 -10
  17. package/packs/converters/skills/md-to-confluence/SKILL.md +2 -2
  18. package/packs/converters/skills/md-to-confluence/manifest.json +2 -9
  19. package/packs/converters/skills/md-to-docx/SKILL.md +3 -4
  20. package/packs/converters/skills/md-to-docx/evals/evals.json +1 -1
  21. package/packs/converters/skills/md-to-docx/evals/files/1/brand/brand.json +1 -1
  22. package/packs/converters/skills/md-to-docx/manifest.json +4 -11
  23. package/packs/converters/skills/md-to-docx/reference.md +1 -1
  24. package/packs/converters/skills/md-to-docx/scripts/md_to_docx.py +1 -1
  25. package/packs/converters/skills/md-to-pptx/SKILL.md +3 -5
  26. package/packs/converters/skills/md-to-pptx/manifest.json +3 -16
  27. package/packs/converters/skills/md-to-pptx/scripts/md_to_pptx.py +1 -1
  28. package/packs/converters/skills/md-to-xlsx/SKILL.md +1 -1
  29. package/packs/converters/skills/md-to-xlsx/manifest.json +2 -2
  30. package/packs/core/skills/brief-intake/SKILL.md +2 -2
  31. package/packs/core/skills/brief-intake/manifest.json +2 -2
  32. package/packs/core/skills/brief-intake/templates/brief-deck.md +3 -3
  33. package/packs/core/skills/doc-critique/rubrics/deck.md +1 -1
  34. package/packs/design/pack.json +11 -21
  35. package/packs/design/skills/brand-kit/SKILL.md +6 -8
  36. package/packs/design/skills/brand-kit/manifest.json +3 -17
  37. package/packs/design/skills/brand-kit/templates/brand.json +1 -1
  38. package/packs/solution-architect/skills/interactive-diagram/SKILL.md +1 -1
  39. package/packs/solution-architect/skills/interactive-diagram/manifest.json +1 -2
  40. package/packs/stakeholder-comms/skills/audience-profile/SKILL.md +3 -3
  41. package/packs/stakeholder-comms/skills/audience-profile/manifest.json +2 -2
  42. package/packs/stakeholder-comms/skills/audience-profile/reference.md +1 -1
  43. package/packs/converters/skills/md-to-html/SKILL.md +0 -108
  44. package/packs/converters/skills/md-to-html/evals/eval_queries.json +0 -34
  45. package/packs/converters/skills/md-to-html/evals/evals.json +0 -44
  46. package/packs/converters/skills/md-to-html/evals/files/1/brand/brand.json +0 -80
  47. package/packs/converters/skills/md-to-html/evals/files/1/brand/logo-white.png +0 -0
  48. package/packs/converters/skills/md-to-html/evals/files/1/brand/logo.png +0 -0
  49. package/packs/converters/skills/md-to-html/evals/files/1/brand/mark.png +0 -0
  50. package/packs/converters/skills/md-to-html/evals/files/1/docs/q3-review.md +0 -35
  51. package/packs/converters/skills/md-to-html/evals/files/1/img/dashboard.png +0 -0
  52. package/packs/converters/skills/md-to-html/evals/files/2/brand.json +0 -13
  53. package/packs/converters/skills/md-to-html/evals/files/2/img/kick-net.png +0 -0
  54. package/packs/converters/skills/md-to-html/evals/files/2/river-survey-guide.md +0 -53
  55. package/packs/converters/skills/md-to-html/evals/files/3/nanas-lentil-soup.md +0 -21
  56. package/packs/converters/skills/md-to-html/evals/files/3/pot.png +0 -0
  57. package/packs/converters/skills/md-to-html/examples/inputs/chart.svg +0 -8
  58. package/packs/converters/skills/md-to-html/examples/inputs/ops-review.md +0 -48
  59. package/packs/converters/skills/md-to-html/examples/ops-review.md +0 -83
  60. package/packs/converters/skills/md-to-html/manifest.json +0 -43
  61. package/packs/converters/skills/md-to-html/reference.md +0 -70
  62. package/packs/converters/skills/md-to-html/scripts/md_to_html.py +0 -662
  63. package/packs/converters/skills/mermaid-render/SKILL.md +0 -117
  64. package/packs/converters/skills/mermaid-render/evals/eval_queries.json +0 -30
  65. package/packs/converters/skills/mermaid-render/evals/evals.json +0 -43
  66. package/packs/converters/skills/mermaid-render/evals/files/1/docs/contoso-orders.md +0 -23
  67. package/packs/converters/skills/mermaid-render/evals/files/2/dispensing-diagrams.md +0 -39
  68. package/packs/converters/skills/mermaid-render/examples/broken-diagrams.md +0 -147
  69. package/packs/converters/skills/mermaid-render/examples/inputs/broken-flowchart.mmd +0 -8
  70. package/packs/converters/skills/mermaid-render/examples/inputs/broken-sequence.mmd +0 -11
  71. package/packs/converters/skills/mermaid-render/examples/inputs/checkout-flow.mmd +0 -9
  72. package/packs/converters/skills/mermaid-render/examples/inputs/design-notes.md +0 -35
  73. package/packs/converters/skills/mermaid-render/examples/inputs/fixed-flowchart.mmd +0 -9
  74. package/packs/converters/skills/mermaid-render/examples/inputs/typo.mmd +0 -2
  75. package/packs/converters/skills/mermaid-render/manifest.json +0 -50
  76. package/packs/converters/skills/mermaid-render/reference.md +0 -70
  77. package/packs/converters/skills/mermaid-render/scripts/render_mermaid.py +0 -487
  78. package/packs/design/skills/deck-builder/SKILL.md +0 -209
  79. package/packs/design/skills/deck-builder/evals/eval_queries.json +0 -14
  80. package/packs/design/skills/deck-builder/evals/evals.json +0 -67
  81. package/packs/design/skills/deck-builder/evals/files/4/ashby-vale-board-notes.md +0 -36
  82. package/packs/design/skills/deck-builder/examples/exec-board-update.md +0 -108
  83. package/packs/design/skills/deck-builder/examples/templated-brand-deck.md +0 -148
  84. package/packs/design/skills/deck-builder/manifest.json +0 -18
  85. package/packs/design/skills/deck-builder/reference.md +0 -180
  86. package/packs/design/skills/deck-builder/requirements.txt +0 -3
  87. package/packs/design/skills/deck-builder/scripts/build_deck.py +0 -1144
  88. package/packs/design/skills/deck-builder/templates/deck-spec.json +0 -168
  89. package/packs/design/skills/deck-builder/templates/palettes.json +0 -59
  90. package/packs/design/skills/marketing-flyer/SKILL.md +0 -113
  91. package/packs/design/skills/marketing-flyer/evals/eval_queries.json +0 -30
  92. package/packs/design/skills/marketing-flyer/evals/evals.json +0 -45
  93. package/packs/design/skills/marketing-flyer/evals/files/1/brand/brand.json +0 -80
  94. package/packs/design/skills/marketing-flyer/evals/files/1/brand/logo-white.png +0 -0
  95. package/packs/design/skills/marketing-flyer/evals/files/1/brand/logo.png +0 -0
  96. package/packs/design/skills/marketing-flyer/evals/files/1/brand/mark.png +0 -0
  97. package/packs/design/skills/marketing-flyer/evals/files/2/brand.json +0 -14
  98. package/packs/design/skills/marketing-flyer/evals/files/2/larchfield-logo.svg +0 -4
  99. package/packs/design/skills/marketing-flyer/evals/files/2/manager-email.txt +0 -6
  100. package/packs/design/skills/marketing-flyer/evals/files/2/open-day-brief.md +0 -15
  101. package/packs/design/skills/marketing-flyer/examples/community-health-fair.md +0 -68
  102. package/packs/design/skills/marketing-flyer/manifest.json +0 -40
  103. package/packs/design/skills/marketing-flyer/reference.md +0 -54
  104. package/packs/design/skills/marketing-flyer/scripts/build_flyer.py +0 -332
  105. package/packs/design/skills/marketing-flyer/templates/flyer-spec.json +0 -26
@@ -1,117 +0,0 @@
1
- ---
2
- name: mermaid-render
3
- description: Check Mermaid diagrams for the mistakes that stop them rendering (unknown diagram type, unbalanced brackets or quotes, unquoted parentheses in labels, the word end as a node id, missing arrows, unclosed subgraphs or alt blocks) with line numbers and a fix for each, then render them to SVG, PNG or PDF with mermaid-cli, or to a standalone HTML page when it is not installed. Works on a .mmd file or every mermaid fence in a Markdown doc. Use when a diagram "won't render", the user says "check my mermaid", "export this diagram as SVG/PNG", or needs the diagrams in a doc as image files.
4
- ---
5
-
6
- # mermaid-render
7
-
8
- You make Mermaid diagrams render, then turn them into files. Most Mermaid failures are a
9
- handful of syntax mistakes that the live editor reports as "Parse error on line 2" with no
10
- hint. The lint here names the mistake, the line, and the fix. Then the script renders: with
11
- `mmdc` (mermaid-cli) when it is installed, otherwise to an HTML page that draws the diagrams
12
- in a browser. Diagrams usually come from `architecture-diagrams`; the rendered SVGs go into
13
- `md-to-html` or `md-to-docx` as images.
14
-
15
- ## How to respond
16
-
17
- **Four rules come before the steps and outrank them:**
18
-
19
- - **Answer what was asked, first.** Open with the answer, the decision or the artifact, in plain words. Scores, matrices, frameworks and tags come after it, and anything that doesn't change the answer is cut.
20
- - **Use only what you were given.** Don't add facts, names, numbers, incidents, history, steps or sections the input doesn't contain. What you need and don't have is left out of the artifact and listed once at the end under "To confirm".
21
- - **Deliver from what you have.** When the request gives you something to work on, state your assumptions in a line and produce the result. When it gives you nothing to work on, ask for it in one or two plain sentences and say what you will do once you have it.
22
- - **Write for someone who has never heard of this skill.** No skill names, no paths or scripts from this folder, no internal terms, and nothing about how the run was set up. A next step is one plain sentence at the end that describes the work.
23
- - **For this skill:** When rendering can't run here, leave clean `.mmd` files and the plain `mmdc` commands that produce the files the user asked for. Commands you show must work in the user's own terminal as written. Don't offer an HTML page in place of the SVG or PNG they asked for.
24
-
25
- 1. **Ask once for what is missing.** Usually only the input:
26
-
27
- > Send the diagram (a `.mmd` file, or the Markdown doc it lives in). Optional:
28
- > 1. **Output:** `svg` (sharp at any size, best for docs) · `png` (for slides and chat) ·
29
- > `pdf` · `html`. *Default: lint only, or `svg` if the user asked for a file.*
30
- > 2. **Where to write it.** *Default: next to the input.*
31
-
32
- 2. **Lint first, always.**
33
-
34
- ```bash
35
- # Claude Code
36
- python3 "${CLAUDE_SKILL_DIR}/scripts/render_mermaid.py" diagram.mmd
37
- # Other IDEs (from the skill folder)
38
- python3 scripts/render_mermaid.py diagram.mmd
39
- ```
40
-
41
- For a `.md` file the script finds every ```` ```mermaid ```` fence, and line numbers refer to
42
- the `.md` file. Exit code 1 means at least one error.
43
-
44
- 3. **Fix each error without changing what the diagram says.** Apply the fix the lint names:
45
-
46
- | Lint says | Fix |
47
- |---|---|
48
- | unquoted `(` `)` in a label | ✅ `api["Orders API (v2)"]` · ❌ `api[Orders API (v2)]` |
49
- | arrow label has unquoted brackets | ✅ `-->|"HTTPS (443)"|` · ❌ `-->|HTTPS (443)|` |
50
- | `end` is reserved | ✅ `done([Done])` or `End` · ❌ `queue --> end` |
51
- | `->` is not a flowchart arrow | ✅ `a --> b` · ❌ `a -> b` |
52
- | no arrow between `a` and `b` | Add the arrow the author meant, or put the two nodes on separate lines |
53
- | subgraph / `alt` has no `end` | Add `end` where the block should close, judged from the indentation |
54
- | unknown diagram type | Use the suggested keyword (`flowchart`, `sequenceDiagram`, `stateDiagram-v2` …) |
55
-
56
- Show the user a before/after of each changed line. When the intent is unclear (which node
57
- did `worker cache` mean to connect?), ask rather than guess.
58
-
59
- 4. **Render once lint is clean.**
60
-
61
- ```bash
62
- # Claude Code
63
- python3 "${CLAUDE_SKILL_DIR}/scripts/render_mermaid.py" design.md -o figures/design.svg
64
- # Other IDEs (from the skill folder)
65
- python3 scripts/render_mermaid.py design.md -o figures/design.svg
66
- ```
67
-
68
- - One diagram writes `design.svg`; a doc with several writes `design-1.svg`, `design-2.svg`
69
- … in document order.
70
- - `.png` renders on white at 2× scale for slides.
71
- - Without `mmdc` the script writes `design.html` instead, which draws every diagram with
72
- Mermaid 11.4.1 (pinned) from jsDelivr, and says so. Tell the user that page needs network
73
- when opened, and that `npm install -g @mermaid-js/mermaid-cli` gets real SVG/PNG files.
74
- - `--force` renders despite lint errors. Use it only to show the user Mermaid's own error.
75
-
76
- 5. **Report:** files written, any `mmdc` failure verbatim, and the fixes made.
77
-
78
- **Non-interactive runs** (subagent, CI, headless): lint, apply only the fixes the table above
79
- makes unambiguous, mark each with `[assumption]`, and render. If a fix needs the author's
80
- intent (a missing arrow, where a block ends), emit `BLOCKED: need the intended <connection |
81
- block end> at <file>:<line>` and do not render that diagram.
82
-
83
- ## Useful references in this skill
84
-
85
- - [`reference.md`](reference.md): every lint rule, what it catches and why Mermaid fails on it, how it was checked against Mermaid 11.4.1, and what lint does not cover
86
- - [`scripts/render_mermaid.py`](scripts/render_mermaid.py): lint and render (stdlib; `mmdc` optional)
87
- - [`examples/broken-diagrams.md`](examples/broken-diagrams.md): real lint output on broken and clean diagrams, a fix, and the no-`mmdc` fallback
88
-
89
- ## Quality bar
90
-
91
- - **Every error has a line number and a fix,** in the user's file, not in a temporary copy.
92
- - **Fixes keep the meaning.** Same nodes, same edges, same labels; only syntax changes.
93
- - **Clean diagrams pass.** The `architecture-diagrams` examples and templates lint clean, and lint never blocks a diagram Mermaid itself accepts.
94
- - **The output format matches the use:** SVG for documents, PNG for slides and chat.
95
- - **Network dependence is stated.** The HTML fallback is named as needing network, with the install line for real files.
96
-
97
- ## When to use this skill
98
-
99
- - ✅ A Mermaid diagram shows "Syntax error" or "Parse error" and the user can't see why
100
- - ✅ Exporting diagrams from a design doc as SVG or PNG for slides, Word or Confluence
101
- - ✅ Checking every diagram in a doc before it is shared or merged
102
- - ✅ Embedding diagrams in an HTML or Word export that must work offline
103
-
104
- ## When NOT to use this skill
105
-
106
- - ❌ Drawing a new diagram from a description; use `architecture-diagrams`
107
- - ❌ Converting the whole Markdown doc to a web page; use `md-to-html` (render the diagrams here first if readers are offline)
108
- - ❌ Converting the whole doc to Word; use `md-to-docx`
109
-
110
- ## Anti-patterns to avoid
111
-
112
- - ❌ **"Fixing" a label by deleting the parenthesised part.** Quote the label; keep the words.
113
- - ❌ **Renaming `end` to `End` in a subgraph closer.** Only a node called `end` is the problem; the lone `end` line that closes a subgraph is correct.
114
- - ❌ **Rendering with `--force` and shipping the result.** Mermaid draws an error graphic, not the diagram.
115
- - ❌ **Sending the HTML fallback as if it were an SVG.** It is a web page that needs network.
116
- - ❌ **Linting a copy and reporting line numbers from it.** Run the script on the user's own `.md` so the numbers match their editor.
117
- - ❌ **Showing the machinery.** The reply and the artifact are for the person who asked. Don't mention this skill, its files, templates, caps or internal terms, or that the run is non-interactive. Name another skill once, at the end, as a suggested next step, never inside the artifact.
@@ -1,30 +0,0 @@
1
- [
2
- {
3
- "query": "My mermaid diagram says syntax error, can you find what's wrong?",
4
- "should_trigger": true
5
- },
6
- {
7
- "query": "Export the diagrams in design.md as PNGs for my slides",
8
- "should_trigger": true
9
- },
10
- {
11
- "query": "Check every mermaid block in this doc renders before I open the PR",
12
- "should_trigger": true
13
- },
14
- {
15
- "query": "Convert arch.mmd to an SVG",
16
- "should_trigger": true
17
- },
18
- {
19
- "query": "Draw an architecture diagram of our three-tier AWS app",
20
- "should_trigger": false
21
- },
22
- {
23
- "query": "Turn design.md into an HTML page I can email",
24
- "should_trigger": false
25
- },
26
- {
27
- "query": "Make design.md a Word document with the diagrams in it",
28
- "should_trigger": false
29
- }
30
- ]
@@ -1,43 +0,0 @@
1
- {
2
- "skill_name": "mermaid-render",
3
- "evals": [
4
- {
5
- "id": 1,
6
- "prompt": "My diagram in docs/contoso-orders.md won't render on GitHub, it just says parse error. It's the second mermaid block. Can you fix it and export both diagrams as SVG for the design review deck?",
7
- "assertions": [
8
- "Runs render_mermaid.py on docs/contoso-orders.md (the user's file, not a copy) and reports errors with line numbers from that file",
9
- "Each fix quotes labels or corrects syntax without removing or renaming nodes, edges or label text",
10
- "Shows a before/after for every changed line",
11
- "Asks the user, rather than guessing, when a fix depends on intent (a missing arrow, where a block ends)",
12
- "Renders only after lint is clean, writing contoso-orders-1.svg and contoso-orders-2.svg, or, without mmdc, says it wrote an HTML page that needs network and gives the mermaid-cli install line",
13
- "Does not invent nodes or connections that are not in the original diagram"
14
- ]
15
- },
16
- {
17
- "id": 2,
18
- "held_out": "2026-10-18",
19
- "prompt": "The diagrams in dispensing-diagrams.md won't show up on our pharmacy intranet. Rachel reckons it's only the second one, the sequence diagram, that's broken. Can you fix whatever's wrong and export each diagram as a PNG for the printed induction pack?",
20
- "assertions": [
21
- "It finds the unquoted parentheses in 'Check dose (mg/kg) against chart' in the first diagram, says where it is, and gives a fix (such as quoting the label) that keeps the label text",
22
- "It finds that the first diagram uses 'end' as a node id and gives a fix (such as renaming the id) that keeps the 'Hand to ward runner' label",
23
- "It finds that the alt/else block in the sequence diagram is never closed and fixes it by adding the missing end",
24
- "It tells the user that the first diagram was broken too, not only the second, and does not report the third (returns) diagram as broken",
25
- "It does not claim PNGs were made unless PNG files actually exist in the working directory; if it could not render them, it says so and says what it produced instead",
26
- "The fixed diagrams are given in full or saved to a file, so they can be pasted back",
27
- "The fixes do not add, remove or reword steps, participants or labels beyond what each fix needs"
28
- ]
29
- },
30
- {
31
- "id": 3,
32
- "held_out": "2026-10-18",
33
- "prompt": "my sister's wedding timeline diagram won't show on our planning site?? can you just give me the fixed version, nothing else\n\n```mermaid\ngraph TD\n A[Ceremony 1pm] --> B[Photos on the lawn\n B --> C[\"Drinks reception]\n C D[Dinner 4.30pm]\n D --> E[Speeches]\n E --> F[First dance 8pm]\n```",
34
- "assertions": [
35
- "The corrected diagram fixes all three problems: the unclosed bracket on 'Photos on the lawn', the unclosed quote on 'Drinks reception', and the missing arrow between C and D",
36
- "The corrected diagram is valid Mermaid that would render, with no remaining syntax errors",
37
- "All six steps are kept, in the same order, with the times as written (1pm, 4.30pm, 8pm)",
38
- "It does not invent times or steps that are not in the original",
39
- "The reply is the fixed diagram with at most a line or two besides, and it delivers without asking questions first"
40
- ]
41
- }
42
- ]
43
- }
@@ -1,23 +0,0 @@
1
- # Contoso orders
2
-
3
- ## Order states
4
-
5
- ```mermaid
6
- stateDiagram-v2
7
- [*] --> Placed
8
- Placed --> Paid
9
- Paid --> Shipped
10
- Shipped --> [*]
11
- ```
12
-
13
- ## Order flow
14
-
15
- ```mermaid
16
- flowchart TD
17
- A[Customer places order] --> B{In stock?}
18
- B -->|Yes| C[Reserve stock (warehouse)]
19
- B -->|No| D[Back-order]
20
- C -> E[Take payment]
21
- E --> F[Ship]
22
- D --> F
23
- ```
@@ -1,39 +0,0 @@
1
- # Dispensing workflows: diagrams for the induction pack
2
-
3
- ## 1. Checking a prescription
4
-
5
- ```mermaid
6
- flowchart TD
7
- A[Prescription received] --> B[Check dose (mg/kg) against chart]
8
- B --> C{Dose OK?}
9
- C -->|Yes| D[Label and dispense]
10
- C -->|No| E[Call prescriber]
11
- E --> B
12
- D --> end[Hand to ward runner]
13
- ```
14
-
15
- ## 2. Controlled drug request
16
-
17
- ```mermaid
18
- sequenceDiagram
19
- participant N as Ward nurse
20
- participant P as Pharmacist
21
- participant S as Stock system
22
- N->>P: Request controlled drug
23
- P->>S: Check stock level
24
- alt In stock
25
- S-->>P: Quantity available
26
- P->>N: Two-person check and issue
27
- else Out of stock
28
- S-->>P: Zero on hand
29
- P->>N: Offer alternative
30
- ```
31
-
32
- ## 3. Returns
33
-
34
- ```mermaid
35
- flowchart LR
36
- R[Return unused medicine] --> Q{Sealed and in date?}
37
- Q -->|Yes| K[Back to stock]
38
- Q -->|No| W[Pharmaceutical waste bin]
39
- ```
@@ -1,147 +0,0 @@
1
- # Example: linting broken diagrams, fixing one, and rendering
2
-
3
- Inputs are in [`inputs/`](inputs/). Every output block is what the script printed.
4
-
5
- ## 1. A flowchart with seven mistakes
6
-
7
- [`inputs/broken-flowchart.mmd`](inputs/broken-flowchart.mmd):
8
-
9
- ```text
10
- 1 flowchart LR
11
- 2 start([Customer]) --> api[Orders API (v2)]
12
- 3 api -> db[(Orders DB)]
13
- 4 api --> queue{{Events}
14
- 5 queue --> end
15
- 6 worker[Worker] cache[(Cache)]
16
- 7 subgraph Billing["Billing zone"]
17
- 8 inv[Invoicer] -->|"monthly| api
18
- ```
19
-
20
- ```text
21
- $ python3 scripts/render_mermaid.py examples/inputs/broken-flowchart.mmd
22
- broken-flowchart.mmd:2: error: label of `api` has unquoted `(` `)`; wrap the label in quotes: api["Orders API (v2)"]
23
- broken-flowchart.mmd:3: error: `->` is not a flowchart arrow; use `-->` (or `==>`)
24
- broken-flowchart.mmd:4: error: unbalanced brackets: `queue{{` is never closed with `}}`
25
- broken-flowchart.mmd:5: error: `end` is reserved in flowcharts and breaks the diagram; use `End`, `END` or `done` as the node id
26
- broken-flowchart.mmd:6: error: no arrow between `worker` and `cache`; join them with `-->`
27
- broken-flowchart.mmd:7: error: subgraph opened here has no matching `end`
28
- broken-flowchart.mmd:8: error: unbalanced double quote
29
- lint: 1 diagram(s), 7 error(s), 0 warning(s)
30
- ```
31
-
32
- Mermaid 11.4.1 itself stops at the first one, reporting `Parse error on line 2` and a list of expected tokens, and says nothing about the other six.
33
-
34
- ## 2. The fix
35
-
36
- Each change is the one the lint named; the nodes, edges and labels are the same.
37
-
38
- | Line | Before | After |
39
- |---|---|---|
40
- | 2 | `api[Orders API (v2)]` | `api["Orders API (v2)"]` |
41
- | 3 | `api -> db[(Orders DB)]` | `api --> db[(Orders DB)]` |
42
- | 4 | `queue{{Events}` | `queue{{Events}}` |
43
- | 5 | `queue --> end` | `queue --> done([Done])` *(asked the author: "end" meant the flow finishes)* |
44
- | 6 | `worker[Worker] cache[(Cache)]` | `worker[Worker] --> cache[(Cache)]` *(asked the author which way it points)* |
45
- | 8 | `-->\|"monthly\| api` | `-->\|"monthly"\| api` |
46
- | 9 | *(missing)* | `end` closing the Billing subgraph |
47
-
48
- [`inputs/fixed-flowchart.mmd`](inputs/fixed-flowchart.mmd):
49
-
50
- ```text
51
- $ python3 scripts/render_mermaid.py examples/inputs/fixed-flowchart.mmd
52
- fixed-flowchart.mmd: flowchart: ok
53
- lint: 1 diagram(s), 0 error(s), 0 warning(s)
54
- ```
55
-
56
- ## 3. Other diagram types
57
-
58
- ```text
59
- $ python3 scripts/render_mermaid.py examples/inputs/broken-sequence.mmd
60
- broken-sequence.mmd:5: error: `alt` block opened here has no matching `end`
61
- lint: 1 diagram(s), 1 error(s), 0 warning(s)
62
- ```
63
-
64
- ```text
65
- $ python3 scripts/render_mermaid.py examples/inputs/typo.mmd
66
- typo.mmd:1: error: unknown diagram type `flowchar` on the first line. Did you mean `flowchart`?
67
- lint: 1 diagram(s), 1 error(s), 0 warning(s)
68
- ```
69
-
70
- ## 4. Every diagram in a Markdown doc
71
-
72
- [`inputs/design-notes.md`](inputs/design-notes.md) has three fences. Line numbers point into the `.md` file:
73
-
74
- ```text
75
- $ python3 scripts/render_mermaid.py examples/inputs/design-notes.md
76
- design-notes.md: diagram 1 (flowchart): ok
77
- design-notes.md: diagram 2 (sequenceDiagram): ok
78
- design-notes.md:31: error: `{` opened here is never closed
79
- lint: 3 diagram(s), 1 error(s), 0 warning(s)
80
- ```
81
-
82
- ## 5. The architecture-diagrams examples lint clean
83
-
84
- ```text
85
- $ python3 scripts/render_mermaid.py ../../../solution-architect/skills/architecture-diagrams/examples/aws-three-tier.md
86
- aws-three-tier.md: flowchart: ok
87
- lint: 1 diagram(s), 0 error(s), 0 warning(s)
88
- ```
89
-
90
- ```text
91
- $ python3 scripts/render_mermaid.py ../../../solution-architect/skills/architecture-diagrams/examples/microservices-sequence.md
92
- microservices-sequence.md: sequenceDiagram: ok
93
- lint: 1 diagram(s), 0 error(s), 0 warning(s)
94
- ```
95
-
96
- ## 6. Rendering without mermaid-cli
97
-
98
- On a machine without `mmdc`, asking for an SVG writes an HTML page instead and says so:
99
-
100
- ```text
101
- $ python3 scripts/render_mermaid.py examples/inputs/checkout-flow.mmd -o checkout.svg
102
- checkout-flow.mmd: flowchart: ok
103
- lint: 1 diagram(s), 0 error(s), 0 warning(s)
104
- mmdc (mermaid-cli) is not on PATH, so no .svg was written. Wrote checkout.html instead: it draws the diagram(s) with Mermaid 11.4.1 from cdn.jsdelivr.net and needs network when opened. For .svg output: npm install -g @mermaid-js/mermaid-cli, then rerun.
105
- ```
106
-
107
- Opened in headless Chrome with network, that page drew the flowchart as an SVG. With `mmdc`
108
- installed, the same command writes `checkout.svg`; for `design-notes.md` it would write
109
- `design-notes-1.svg`, `design-notes-2.svg` and `design-notes-3.svg` (after the state diagram's
110
- missing `}` is fixed).
111
-
112
- ## Rendering with mermaid-cli installed
113
-
114
- With `mmdc` (mermaid-cli 12.0.0) on `PATH`, the same script writes real images. Run on
115
- 2026-10-01:
116
-
117
- ```text
118
- $ python3 scripts/render_mermaid.py examples/inputs/checkout-flow.mmd -o checkout-flow.png
119
- checkout-flow.mmd: flowchart: ok
120
- lint: 1 diagram(s), 0 error(s), 0 warning(s)
121
- wrote checkout-flow.png
122
- ```
123
-
124
- The PNG is 1268 × 1442 pixels: `-s 2` doubles the scale so it stays sharp in a document.
125
-
126
- A Markdown file with three diagrams, the third one broken, rendered with `--force`:
127
-
128
- ```text
129
- $ python3 scripts/render_mermaid.py examples/inputs/design-notes.md -o notes.svg --force
130
- mmdc failed on design-notes.md, diagram 3 (line 29):
131
- Error: Parse error on line 6:
132
- ... [*] --> Cancelled
133
- ----------------------^
134
- Expecting 'SPACE', 'NL', 'HIDE_EMPTY', 'scale', 'COMPOSIT_STATE', 'STRUCT_STOP', 'STATE_DESCR', 'ID', 'FORK', 'JOIN', 'CHOICE', 'CONCURRENT', 'note', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'CLICK', 'classDef', 'style', 'class', 'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'EDGE_STATE', got '1'
135
- design-notes.md: diagram 1 (flowchart): ok
136
- design-notes.md: diagram 2 (sequenceDiagram): ok
137
- design-notes.md:31: error: `{` opened here is never closed
138
- lint: 3 diagram(s), 1 error(s), 0 warning(s)
139
- wrote notes-1.svg
140
- wrote notes-2.svg
141
- ```
142
-
143
- `--force` still writes every diagram that renders (`notes-1.svg`, `notes-2.svg`), prints
144
- Mermaid's own parse error for the one that doesn't, and exits 1, so a CI step still fails.
145
- Here Mermaid stopped at line 6 of that diagram, a few lines after the lint's line 31 (the
146
- diagram starts at line 29 of the file). The lint found the cause first.
147
-
@@ -1,8 +0,0 @@
1
- flowchart LR
2
- start([Customer]) --> api[Orders API (v2)]
3
- api -> db[(Orders DB)]
4
- api --> queue{{Events}
5
- queue --> end
6
- worker[Worker] cache[(Cache)]
7
- subgraph Billing["Billing zone"]
8
- inv[Invoicer] -->|"monthly| api
@@ -1,11 +0,0 @@
1
- sequenceDiagram
2
- participant C as Client
3
- participant S as Server
4
- C->>S: GET /report
5
- alt cached
6
- S-->>C: 200 from cache
7
- else stale
8
- S-->>C: 200 rebuilt
9
- loop every 5 min
10
- S->>S: refresh
11
- end
@@ -1,9 +0,0 @@
1
- flowchart TD
2
- Cart([Shopper cart]) --> Pay{"Payment OK? (3-D Secure)"}
3
- Pay -->|yes| Confirm[Order confirmed]
4
- Pay -->|no| Retry[Ask for another card]
5
- Retry -.-> Pay
6
- Confirm --> Done([End])
7
- subgraph Ops["Back office"]
8
- Confirm --> Pick[Pick and pack] & Mail[Send receipt]
9
- end
@@ -1,35 +0,0 @@
1
- # Contoso order service: design notes
2
-
3
- The request path:
4
-
5
- ```mermaid
6
- flowchart LR
7
- Web([Web app]) -->|HTTPS| API[Order API]
8
- API --> DB[(Orders DB)]
9
- API -.publishes.-> Bus{{Event bus}}
10
- ```
11
-
12
- What happens on checkout:
13
-
14
- ```mermaid
15
- sequenceDiagram
16
- participant W as Web
17
- participant A as Order API
18
- W->>A: POST /orders
19
- alt stock reserved
20
- A-->>W: 201 Created
21
- else out of stock
22
- A-->>W: 409 Conflict
23
- end
24
- ```
25
-
26
- The order lifecycle (has a mistake):
27
-
28
- ```mermaid
29
- stateDiagram-v2
30
- [*] --> Placed
31
- state Fulfilment {
32
- Placed --> Packed
33
- Packed --> Shipped
34
- [*] --> Cancelled
35
- ```
@@ -1,9 +0,0 @@
1
- flowchart LR
2
- start([Customer]) --> api["Orders API (v2)"]
3
- api --> db[(Orders DB)]
4
- api --> queue{{Events}}
5
- queue --> done([Done])
6
- worker[Worker] --> cache[(Cache)]
7
- subgraph Billing["Billing zone"]
8
- inv[Invoicer] -->|"monthly"| api
9
- end
@@ -1,2 +0,0 @@
1
- flowchar TD
2
- A --> B
@@ -1,50 +0,0 @@
1
- {
2
- "name": "mermaid-render",
3
- "version": "0.1.4",
4
- "description": "Check Mermaid diagrams for the mistakes that stop them rendering (unknown diagram type, unbalanced brackets or quotes, unquoted parentheses in labels, the word end as a node id, missing arrows, unclosed subgraphs or alt blocks) with line numbers and a fix for each, then render them to SVG, PNG or PDF with mermaid-cli, or to a standalone HTML page when it is not installed. Works on a .mmd file or every mermaid fence in a Markdown doc. Use when a diagram \"won't render\", the user says \"check my mermaid\", \"export this diagram as SVG/PNG\", or needs the diagrams in a doc as image files.",
5
- "entrypoint": "SKILL.md",
6
- "deps": {
7
- "npm": [],
8
- "pip": []
9
- },
10
- "env": {
11
- "required": [],
12
- "optional": []
13
- },
14
- "related": [
15
- "architecture-diagrams",
16
- "md-to-docx",
17
- "md-to-html"
18
- ],
19
- "handoff": [
20
- {
21
- "to": "md-to-html",
22
- "when": "the diagrams are rendered and the doc around them needs sharing",
23
- "purpose": "Embed the SVGs in a self-contained HTML file that works offline.",
24
- "fallback": "If md-to-html is absent, give the user the SVG paths and the Markdown image lines (![…](figures/x-1.svg)) to paste in place of each fence."
25
- }
26
- ],
27
- "tags": [
28
- "mermaid",
29
- "diagram",
30
- "lint",
31
- "svg",
32
- "png",
33
- "render"
34
- ],
35
- "permissions": {
36
- "network": [
37
- "registry.npmjs.org"
38
- ],
39
- "commands": [
40
- "mmdc",
41
- "npm"
42
- ],
43
- "files": "named-paths",
44
- "notes": "mmdc (mermaid-cli) renders SVG, PNG and PDF if it is installed. Without it the script writes an HTML page that loads Mermaid from cdn.jsdelivr.net when opened; the script itself makes no network calls. Its instructions suggest installing mermaid-cli with `npm install -g @mermaid-js/mermaid-cli`, which reaches the npm registry."
45
- },
46
- "model": {
47
- "tier": "standard",
48
- "rationale": "The script lints and renders deterministically, but fixing a broken diagram means reading the author's intent and rewriting syntax without changing nodes, edges or labels, and knowing when to ask instead."
49
- }
50
- }
@@ -1,70 +0,0 @@
1
- # mermaid-render reference
2
-
3
- ## Lint rules
4
-
5
- Each rule exists because Mermaid 11.4.1's parser rejects the pattern. The script reports
6
- `<file>:<line>: error: …`; warnings do not stop rendering.
7
-
8
- | Rule | Applies to | Fails in Mermaid | Passes |
9
- |---|---|---|---|
10
- | Unknown diagram type on the first line (after front matter and `%%` lines), with a closest-match suggestion | all | `flowchar TD` | `flowchart TD` |
11
- | Unknown flowchart direction | flowchart, graph | `flowchart LTR` | `flowchart LR`, `graph` (no direction) |
12
- | Unquoted `(` `)` `[` `]` `{` `}` or `"` inside a node label | flowchart | `api[Orders API (v2)]`, `a{Is it (x)?}`, `A[{agent}]`, `A([Foo (x)])` | `api["Orders API (v2)"]` |
13
- | Unquoted brackets inside a `\|pipe\|` arrow label | flowchart | `a -->\|HTTPS (443)\| b`, `a -->\|{x}\| b` | `a -->\|"HTTPS (443)"\| b`, `a -.reads (cached).-> b` |
14
- | A shape opened and never closed | flowchart | `q{{Events} --> b` | `q{{Events}} --> b` |
15
- | Unbalanced double quote | flowchart | `a -->\|"monthly\| b` | `a -->\|"monthly"\| b` |
16
- | `end` as a node id | flowchart | `q --> end` | `q --> End`, `A[end]` (as a label), `endpoint` |
17
- | Single-dash arrow `->` or `=>` | flowchart | `a -> b` | `a --> b`, `a ==> b` |
18
- | Two nodes with no arrow between them | flowchart | `worker[Worker] cache[(Cache)]` | `worker --> cache`, `LB --> Web1 & Web2` |
19
- | Arrow with no node on one side | flowchart | `A -->` | |
20
- | Subgraph title with unquoted brackets | flowchart | `subgraph Billing zone (EU)` | `subgraph "Billing (EU)"`, `subgraph B["Billing (EU)"]` |
21
- | `subgraph` with no `end`, or `end` with no subgraph | flowchart | | |
22
- | `loop` `alt` `opt` `par` `critical` `break` `rect` `box` with no `end`; `else`/`and`/`option` outside their block | sequenceDiagram | `alt` … (no `end`) | |
23
- | Message with no `: text` | sequenceDiagram | `A->>B` | `A->>B: call(x)` |
24
- | Unbalanced `{` `}` across lines (ER cardinality like `\|\|--o{` is ignored) | classDiagram, stateDiagram, erDiagram | `class Foo {` (no `}`) | |
25
- | Warning: `---oB` is read as a circle arrowhead to `B` | flowchart | | `A --- ops` (with a space) |
26
-
27
- Labels that are fine unquoted: `&`, `:`, `/`, `%`, `<`, `>`, emoji, and the shape pairs
28
- themselves (`[(cylinder)]`, `([stadium])`, `{{hexagon}}`, `>flag]`).
29
-
30
- ## How the rules were checked
31
-
32
- Every rule above was run against Mermaid 11.4.1's own parser (`mermaid.parse`) in headless
33
- Chrome, together with every Mermaid block in this repo: the `architecture-diagrams` examples
34
- and templates, `docs/loops/*.mmd`, and the other skills' templates. The lint result (error or
35
- clean) matched Mermaid's on all 86 cases. Two existing templates fail in Mermaid as well as in
36
- lint, because their placeholders (`A[{agent}]`, `-->|{causal sentence}|`) are unquoted braces.
37
- That is expected for a template with blanks still in it.
38
-
39
- ## What lint does not cover
40
-
41
- Lint checks syntax that stops rendering, not everything Mermaid validates. Not checked:
42
-
43
- - Diagram types other than flowchart, sequence, class, state and ER beyond the first line
44
- (gantt dates, pie values, gitGraph commands, C4 macros, mindmap indentation).
45
- - Style statements (`classDef`, `style`, `linkStyle`): their CSS is not validated.
46
- - Layout problems: a diagram that renders but is unreadable (30+ nodes, crossing edges).
47
-
48
- When lint is clean but Mermaid still fails, run with `-o out.html --force` and open the page:
49
- Mermaid shows its own parse error in place of the diagram.
50
-
51
- ## Rendering
52
-
53
- | Output | With `mmdc` on PATH | Without it |
54
- |---|---|---|
55
- | `.svg` | Vector file, transparent background | `.html` page instead, which says so |
56
- | `.png` | White background, 2× scale | `.html` page instead |
57
- | `.pdf` | One PDF per diagram | `.html` page instead |
58
- | `.html` | Always the HTML page: every diagram in order, captioned with its source line | same |
59
-
60
- The HTML page loads Mermaid 11.4.1 from `cdn.jsdelivr.net`, pinned so the drawing does not
61
- change under the reader, and carries a Content-Security-Policy that allows only that loader.
62
- It needs network when opened. Install mermaid-cli for offline files:
63
-
64
- ```bash
65
- npm install -g @mermaid-js/mermaid-cli
66
- ```
67
-
68
- Installing mermaid-cli also downloads a headless Chrome for Puppeteer, which `mmdc` drives. In a
69
- locked-down environment where that download is blocked, use the HTML page and print it to PDF
70
- from a browser.