agentic-mermaid 0.1.1 → 0.1.2

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 (336) hide show
  1. package/CHANGELOG.md +144 -4
  2. package/LICENSES/Apache-2.0.txt +202 -0
  3. package/README.md +25 -32
  4. package/THIRD_PARTY_NOTICES.md +29 -0
  5. package/dist/agent-core.d.ts +463 -0
  6. package/dist/agent-core.js +397 -0
  7. package/dist/agent.d.ts +73 -1868
  8. package/dist/agent.js +336 -37325
  9. package/dist/agentic-mermaid-mcp.js +7 -38399
  10. package/dist/am.js +33632 -40445
  11. package/dist/chunk-4QECACIA.js +4702 -0
  12. package/dist/chunk-CDPKJ2BQ.js +37 -0
  13. package/dist/chunk-QKDLMOJJ.js +3487 -0
  14. package/dist/chunk-WI35L7IR.js +615 -0
  15. package/dist/chunk-WN3YDOBG.js +149 -0
  16. package/dist/chunk-ZYMMKQ3I.js +62637 -0
  17. package/dist/index-D54dqSdC.d.ts +6777 -0
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +310 -33014
  20. package/dist/mcp-cli-SBQSTJFC.js +17 -0
  21. package/docs/README.md +14 -6
  22. package/docs/schemas/style-spec.schema.json +1221 -30
  23. package/examples/styles/catalog.json +54 -0
  24. package/examples/styles/cloudflare-workers-inspired-prototype.mmd +9 -0
  25. package/examples/styles/cloudflare-workers-inspired-prototype.style.json +110 -0
  26. package/examples/styles/cupertino-prototype.mmd +10 -0
  27. package/examples/styles/cupertino-prototype.style.json +63 -0
  28. package/examples/styles/mid-century-report.style.json +2 -2
  29. package/examples/styles/star-chart-atlas.style.json +2 -1
  30. package/examples/styles/transit-route-map.style.json +2 -2
  31. package/examples/styles/vercel-inspired-prototype.mmd +6 -0
  32. package/examples/styles/vercel-inspired-prototype.style.json +87 -0
  33. package/package.json +68 -43
  34. package/server.json +2 -2
  35. package/skills/agentic-mermaid-diagram-workflow/SKILL.md +17 -36
  36. package/skills/agentic-mermaid-diagram-workflow/references/cli.md +4 -5
  37. package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +15 -31
  38. package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +10 -14
  39. package/skills/agentic-mermaid-live-editor/SKILL.md +100 -206
  40. package/AGENT_NATIVE.md +0 -607
  41. package/Instructions_for_agents.md +0 -89
  42. package/TODO.md +0 -684
  43. package/assets/hero.png +0 -0
  44. package/dist/index-wjRjbsP-.d.ts +0 -1102
  45. package/docs/agent-api-cookbook.md +0 -308
  46. package/docs/agent-mutation-policy.md +0 -104
  47. package/docs/agent-workflow-examples.md +0 -46
  48. package/docs/api.md +0 -211
  49. package/docs/ascii.md +0 -103
  50. package/docs/assets/improvements/box-start-connector.png +0 -0
  51. package/docs/assets/improvements/comment-dropped-lint.png +0 -0
  52. package/docs/assets/improvements/er-content-loss.png +0 -0
  53. package/docs/assets/improvements/fan-in-trunks.png +0 -0
  54. package/docs/assets/improvements/gantt-family.png +0 -0
  55. package/docs/assets/improvements/gantt-milestone-clamp.png +0 -0
  56. package/docs/assets/improvements/gantt-verify-seam.png +0 -0
  57. package/docs/assets/improvements/subgraph-container-edges.png +0 -0
  58. package/docs/assets/improvements/wrapper-frontmatter.png +0 -0
  59. package/docs/assets/improvements/wrapper-init-directive.png +0 -0
  60. package/docs/assets/improvements/wrapper-leading-comment.png +0 -0
  61. package/docs/assets/style-cookbook/mid-century-report.png +0 -0
  62. package/docs/assets/style-cookbook/star-chart-atlas.png +0 -0
  63. package/docs/assets/style-cookbook/transit-route-map.png +0 -0
  64. package/docs/comparison.md +0 -94
  65. package/docs/config.md +0 -105
  66. package/docs/contributing/adding-diagram-types.md +0 -144
  67. package/docs/contributing/diagram-family-citizenship.matrix.json +0 -2127
  68. package/docs/contributing/diagram-family-citizenship.md +0 -82
  69. package/docs/contributing/harvesting-upstream-tests.md +0 -126
  70. package/docs/contributing/lessons-learned.md +0 -276
  71. package/docs/contributing/releasing.md +0 -82
  72. package/docs/contributing/visual-review-evidence.md +0 -53
  73. package/docs/custom-style-cookbook.md +0 -154
  74. package/docs/design/families/README.md +0 -26
  75. package/docs/design/families/architecture-beta.md +0 -48
  76. package/docs/design/families/flowchart-parser-conformance.md +0 -22
  77. package/docs/design/families/gantt-research.md +0 -137
  78. package/docs/design/families/gantt.md +0 -329
  79. package/docs/design/families/journey-agentic-cards-before.png +0 -0
  80. package/docs/design/families/journey-experience-curve-implementation.png +0 -0
  81. package/docs/design/families/journey-mermaid-classic-implementation.png +0 -0
  82. package/docs/design/families/journey-mermaid-classic-prototype.png +0 -0
  83. package/docs/design/families/journey-mermaid-classic-prototype.svg +0 -163
  84. package/docs/design/families/journey-mermaid-classic-prototype.svg.png +0 -0
  85. package/docs/design/families/journey-migration-parity.md +0 -439
  86. package/docs/design/families/journey-section-overlap-after.png +0 -0
  87. package/docs/design/families/journey-section-overlap-before.png +0 -0
  88. package/docs/design/families/journey-usage-research.md +0 -423
  89. package/docs/design/families/journey.md +0 -153
  90. package/docs/design/families/xychart.md +0 -85
  91. package/docs/design/system/README.md +0 -45
  92. package/docs/design/system/abstraction-audit.md +0 -224
  93. package/docs/design/system/abstraction-recommendations.md +0 -655
  94. package/docs/design/system/architecture.mmd +0 -29
  95. package/docs/design/system/architecture.svg +0 -137
  96. package/docs/design/system/layout-guarantees-and-robustness.md +0 -351
  97. package/docs/design/system/layout-rubric.md +0 -138
  98. package/docs/design/system/route-contracts.md +0 -848
  99. package/docs/design/system/source-preservation-ladder.md +0 -52
  100. package/docs/design/system/styles-rollout.md +0 -216
  101. package/docs/design/system/ugly-layouts.md +0 -119
  102. package/docs/diagram-families.md +0 -193
  103. package/docs/features.md +0 -147
  104. package/docs/fork-differences.md +0 -130
  105. package/docs/getting-started.md +0 -175
  106. package/docs/issue-derived-test-cases.md +0 -156
  107. package/docs/layout-characterization/README.md +0 -245
  108. package/docs/layout-characterization/contact-sheet-families.md +0 -498
  109. package/docs/layout-characterization/contact-sheet.md +0 -638
  110. package/docs/layout-characterization/properties.md +0 -281
  111. package/docs/layout-characterization/visual-quality.md +0 -160
  112. package/docs/layout-characterization/visual-snapshots/architecture.svg +0 -79
  113. package/docs/layout-characterization/visual-snapshots/class.svg +0 -60
  114. package/docs/layout-characterization/visual-snapshots/er.svg +0 -61
  115. package/docs/layout-characterization/visual-snapshots/flowchart.svg +0 -58
  116. package/docs/layout-characterization/visual-snapshots/gantt.svg +0 -52
  117. package/docs/layout-characterization/visual-snapshots/journey.svg +0 -98
  118. package/docs/layout-characterization/visual-snapshots/pie.svg +0 -36
  119. package/docs/layout-characterization/visual-snapshots/quadrant.svg +0 -47
  120. package/docs/layout-characterization/visual-snapshots/sequence.svg +0 -59
  121. package/docs/layout-characterization/visual-snapshots/state.svg +0 -52
  122. package/docs/layout-characterization/visual-snapshots/timeline.svg +0 -64
  123. package/docs/layout-characterization/visual-snapshots/xychart.svg +0 -97
  124. package/docs/mcp-code-mode-rationale.md +0 -101
  125. package/docs/mcp-http-transport.md +0 -223
  126. package/docs/mermaid-layout-complaints.md +0 -837
  127. package/docs/mutation-testing.md +0 -206
  128. package/docs/project/divergences.md +0 -98
  129. package/docs/project/dogfooding-docs-strategy.md +0 -66
  130. package/docs/project/hosted-mcp-cloudflare-plan.md +0 -338
  131. package/docs/project/lessons-learned.md +0 -1019
  132. package/docs/project/remove-role-styling-plan.md +0 -176
  133. package/docs/quality.md +0 -215
  134. package/docs/react.md +0 -97
  135. package/docs/style-authoring.md +0 -133
  136. package/docs/testing-strategy.md +0 -335
  137. package/docs/theming.md +0 -162
  138. package/examples/agent-improve-auth-flow.ts +0 -206
  139. package/examples/agent-loop.ts +0 -53
  140. package/examples/mcp-vs-cli-complex-diagrams.ts +0 -133
  141. package/llms.txt +0 -104
  142. package/skill-evals/README.md +0 -77
  143. package/skill-evals/fixtures/architecture-cache/input.mmd +0 -5
  144. package/skill-evals/fixtures/class-payment/input.mmd +0 -4
  145. package/skill-evals/fixtures/er-orders/input.mmd +0 -10
  146. package/skill-evals/fixtures/flowchart-cache/input.mmd +0 -3
  147. package/skill-evals/fixtures/gantt-release/input.mmd +0 -7
  148. package/skill-evals/fixtures/journey-checkout/input.mmd +0 -6
  149. package/skill-evals/fixtures/pie-exports/input.mmd +0 -5
  150. package/skill-evals/fixtures/quadrant-priorities/input.mmd +0 -11
  151. package/skill-evals/fixtures/sequence-retry/input.mmd +0 -8
  152. package/skill-evals/fixtures/state-lifecycle/input.mmd +0 -5
  153. package/skill-evals/fixtures/timeline-release/input.mmd +0 -6
  154. package/skill-evals/fixtures/xychart-growth/input.mmd +0 -5
  155. package/skill-evals/shared-benchmark.json +0 -510
  156. package/src/agent/analyze.ts +0 -157
  157. package/src/agent/apply.ts +0 -146
  158. package/src/agent/architecture-body.ts +0 -458
  159. package/src/agent/certificates.ts +0 -110
  160. package/src/agent/class-body.ts +0 -319
  161. package/src/agent/core.ts +0 -207
  162. package/src/agent/create.ts +0 -106
  163. package/src/agent/describe.ts +0 -368
  164. package/src/agent/er-body.ts +0 -224
  165. package/src/agent/facts.ts +0 -360
  166. package/src/agent/families-builtin.ts +0 -920
  167. package/src/agent/families.ts +0 -232
  168. package/src/agent/family-layouts.ts +0 -832
  169. package/src/agent/flowchart-body.ts +0 -372
  170. package/src/agent/flowchart-unsupported.ts +0 -243
  171. package/src/agent/font-coverage.ts +0 -288
  172. package/src/agent/gantt-body.ts +0 -495
  173. package/src/agent/index.ts +0 -10
  174. package/src/agent/journey-body.ts +0 -374
  175. package/src/agent/label-metrics.ts +0 -28
  176. package/src/agent/layout-to-rendered.ts +0 -63
  177. package/src/agent/mutate.ts +0 -97
  178. package/src/agent/mutation-ops.ts +0 -51
  179. package/src/agent/op-schema.ts +0 -443
  180. package/src/agent/parse.ts +0 -223
  181. package/src/agent/pie-body.ts +0 -270
  182. package/src/agent/png.ts +0 -171
  183. package/src/agent/quadrant-body.ts +0 -336
  184. package/src/agent/quality.ts +0 -363
  185. package/src/agent/readability-audit.ts +0 -92
  186. package/src/agent/rendered-route-audit.ts +0 -61
  187. package/src/agent/sequence-body.ts +0 -345
  188. package/src/agent/serialize.ts +0 -214
  189. package/src/agent/state-body.ts +0 -589
  190. package/src/agent/structural-count.ts +0 -150
  191. package/src/agent/timeline-body.ts +0 -280
  192. package/src/agent/trace-log.ts +0 -43
  193. package/src/agent/types.ts +0 -995
  194. package/src/agent/verify.ts +0 -603
  195. package/src/agent/xychart-body.ts +0 -472
  196. package/src/architecture/config.ts +0 -282
  197. package/src/architecture/layout.ts +0 -496
  198. package/src/architecture/parser.ts +0 -375
  199. package/src/architecture/renderer.ts +0 -611
  200. package/src/architecture/types.ts +0 -113
  201. package/src/ascii/ansi.ts +0 -423
  202. package/src/ascii/architecture.ts +0 -210
  203. package/src/ascii/canvas.ts +0 -443
  204. package/src/ascii/class-diagram.ts +0 -697
  205. package/src/ascii/converter.ts +0 -475
  206. package/src/ascii/draw.ts +0 -1693
  207. package/src/ascii/edge-bundling.ts +0 -328
  208. package/src/ascii/edge-routing.ts +0 -330
  209. package/src/ascii/er-diagram.ts +0 -439
  210. package/src/ascii/gantt.ts +0 -276
  211. package/src/ascii/grid.ts +0 -747
  212. package/src/ascii/index.ts +0 -196
  213. package/src/ascii/journey.ts +0 -169
  214. package/src/ascii/meta.ts +0 -244
  215. package/src/ascii/multiline-utils.ts +0 -80
  216. package/src/ascii/pathfinder.ts +0 -301
  217. package/src/ascii/pie.ts +0 -67
  218. package/src/ascii/quadrant.ts +0 -158
  219. package/src/ascii/reverse.ts +0 -216
  220. package/src/ascii/sequence.ts +0 -499
  221. package/src/ascii/shapes/circle.ts +0 -27
  222. package/src/ascii/shapes/corners.ts +0 -143
  223. package/src/ascii/shapes/diamond.ts +0 -27
  224. package/src/ascii/shapes/hexagon.ts +0 -27
  225. package/src/ascii/shapes/index.ts +0 -106
  226. package/src/ascii/shapes/rectangle.ts +0 -168
  227. package/src/ascii/shapes/rounded.ts +0 -27
  228. package/src/ascii/shapes/special.ts +0 -332
  229. package/src/ascii/shapes/stadium.ts +0 -110
  230. package/src/ascii/shapes/state.ts +0 -192
  231. package/src/ascii/shapes/types.ts +0 -73
  232. package/src/ascii/timeline.ts +0 -141
  233. package/src/ascii/types.ts +0 -312
  234. package/src/ascii/validate.ts +0 -120
  235. package/src/ascii/width.ts +0 -81
  236. package/src/ascii/wrap.ts +0 -131
  237. package/src/ascii/xychart.ts +0 -919
  238. package/src/browser.ts +0 -29
  239. package/src/class/layout.ts +0 -240
  240. package/src/class/parser.ts +0 -332
  241. package/src/class/renderer.ts +0 -638
  242. package/src/class/types.ts +0 -129
  243. package/src/cli/agent-instructions.ts +0 -1
  244. package/src/cli/am-bin.ts +0 -6
  245. package/src/cli/exit-codes.ts +0 -18
  246. package/src/cli/index.ts +0 -1132
  247. package/src/cli/init-agent.ts +0 -147
  248. package/src/cli/run-entrypoint.ts +0 -10
  249. package/src/color-resolver.ts +0 -152
  250. package/src/elk-instance.ts +0 -114
  251. package/src/er/layout.ts +0 -187
  252. package/src/er/parser.ts +0 -226
  253. package/src/er/renderer.ts +0 -792
  254. package/src/er/types.ts +0 -99
  255. package/src/family-rubric.ts +0 -425
  256. package/src/font-manifest.ts +0 -31
  257. package/src/gantt/layout.ts +0 -365
  258. package/src/gantt/parser.ts +0 -282
  259. package/src/gantt/pipeline.ts +0 -27
  260. package/src/gantt/renderer.ts +0 -414
  261. package/src/gantt/schedule.ts +0 -513
  262. package/src/gantt/types.ts +0 -255
  263. package/src/index.ts +0 -368
  264. package/src/journey/layout.ts +0 -554
  265. package/src/journey/parse-core.ts +0 -251
  266. package/src/journey/parser.ts +0 -101
  267. package/src/journey/renderer.ts +0 -917
  268. package/src/journey/types.ts +0 -144
  269. package/src/layout/geometry.ts +0 -182
  270. package/src/layout/pass.ts +0 -142
  271. package/src/layout/passes/index.ts +0 -3916
  272. package/src/layout-engine.ts +0 -1565
  273. package/src/layout-rubric.ts +0 -659
  274. package/src/mcp/artifacts.ts +0 -137
  275. package/src/mcp/dynamic-harness.ts +0 -31
  276. package/src/mcp/dynamic-modules.d.ts +0 -7
  277. package/src/mcp/facade.ts +0 -608
  278. package/src/mcp/harness-runtime.ts +0 -203
  279. package/src/mcp/hosted-server.ts +0 -468
  280. package/src/mcp/mcp-bin.ts +0 -3
  281. package/src/mcp/mcp-cli.ts +0 -82
  282. package/src/mcp/protocol.ts +0 -13
  283. package/src/mcp/sandbox.ts +0 -195
  284. package/src/mcp/sdk-decl.ts +0 -391
  285. package/src/mcp/server.ts +0 -362
  286. package/src/mcp/tool-surface.ts +0 -146
  287. package/src/mermaid-source.ts +0 -655
  288. package/src/multiline-utils.ts +0 -228
  289. package/src/parser.ts +0 -1031
  290. package/src/pie/layout.ts +0 -168
  291. package/src/pie/parser.ts +0 -136
  292. package/src/pie/renderer.ts +0 -234
  293. package/src/pie/types.ts +0 -82
  294. package/src/quadrant/layout.ts +0 -191
  295. package/src/quadrant/parser.ts +0 -183
  296. package/src/quadrant/renderer.ts +0 -322
  297. package/src/quadrant/types.ts +0 -113
  298. package/src/render-family-hooks.ts +0 -244
  299. package/src/renderer.ts +0 -1099
  300. package/src/route-contracts.ts +0 -2723
  301. package/src/scene/backend.ts +0 -76
  302. package/src/scene/fidelity.ts +0 -183
  303. package/src/scene/hybrid-backend.ts +0 -174
  304. package/src/scene/ir.ts +0 -181
  305. package/src/scene/marks.ts +0 -127
  306. package/src/scene/rough-backend.ts +0 -378
  307. package/src/scene/seed.ts +0 -46
  308. package/src/scene/style-registry.ts +0 -556
  309. package/src/sequence/layout.ts +0 -456
  310. package/src/sequence/parser.ts +0 -255
  311. package/src/sequence/renderer.ts +0 -604
  312. package/src/sequence/types.ts +0 -154
  313. package/src/shape-clipping.ts +0 -351
  314. package/src/shared/accessibility-directives.ts +0 -22
  315. package/src/shared/batched.ts +0 -61
  316. package/src/shared/color-math.ts +0 -93
  317. package/src/shared/svg-a11y.ts +0 -29
  318. package/src/shared/syntax-error.ts +0 -17
  319. package/src/shared/unicode-ranges.ts +0 -135
  320. package/src/styles.ts +0 -318
  321. package/src/svg-paths.ts +0 -28
  322. package/src/text-metrics.ts +0 -248
  323. package/src/theme.ts +0 -710
  324. package/src/timeline/layout.ts +0 -381
  325. package/src/timeline/parser.ts +0 -215
  326. package/src/timeline/renderer.ts +0 -538
  327. package/src/timeline/types.ts +0 -105
  328. package/src/types.ts +0 -462
  329. package/src/website-worker-modules.d.ts +0 -18
  330. package/src/xychart/axis-utils.ts +0 -109
  331. package/src/xychart/colors.ts +0 -124
  332. package/src/xychart/config.ts +0 -88
  333. package/src/xychart/layout.ts +0 -656
  334. package/src/xychart/parser.ts +0 -504
  335. package/src/xychart/renderer.ts +0 -640
  336. package/src/xychart/types.ts +0 -282
@@ -1,329 +0,0 @@
1
- # Gantt support specification
2
-
3
- Status: design spec. Target implementation branch: after [PR #22](https://github.com/adewale/agentic-mermaid/pull/22) or any equivalent merge of the family-plugin/quality-adapter work. This document is a contract for the first Gantt implementation and for follow-up work. It is not a backlog.
4
-
5
- ## Scope
6
-
7
- Agentic Mermaid should render Mermaid-compatible `gantt` diagrams to SVG, PNG, ASCII, Unicode text, and layout JSON without breaking the agent safety contract:
8
-
9
- - existing Mermaid Gantt source should parse or fail with a named, structured error;
10
- - source that parses but uses syntax outside the first render subset should round-trip byte-for-byte through the agent API;
11
- - renderers must be deterministic unless the caller explicitly supplies a clock value;
12
- - unsupported Mermaid proposals must be called out rather than approximated.
13
-
14
- The first implementation ships **typed mutation via `asGantt`**, using the segment-preserving structured body pattern established for sequence diagrams (`src/agent/sequence-body.ts`): typed ops cover the modeled statements (title, sections, tasks), while calendar directives, comments, click/link statements, and markers ride along verbatim as opaque segments — never dropped, never requiring a full-fidelity IR. Typed mutation is the enforced default for every registered family (`every registered renderable family ships typed mutation (default-by-default enforcement)` in `src/__tests__/agent-doc-sync.test.ts`; see `docs/contributing/adding-diagram-types.md` §7), so a source-level-only registration does not pass CI.
15
-
16
- ## Evidence base
17
-
18
- ### Mermaid core discussions
19
-
20
- Mermaid core has the syntax authority. The current docs and grammar define the accepted language:
21
-
22
- - [Mermaid Gantt syntax docs](https://mermaid.js.org/syntax/gantt.html)
23
- - [`gantt.md` docs source](https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/docs/syntax/gantt.md)
24
- - [`gantt.jison` grammar](https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/diagrams/gantt/parser/gantt.jison)
25
- - Gantt implementation directory: [`packages/mermaid/src/diagrams/gantt`](https://github.com/mermaid-js/mermaid/tree/develop/packages/mermaid/src/diagrams/gantt)
26
-
27
- Recurring user pressure in Mermaid core:
28
-
29
- | Theme | Discussions | Requirement pulled into this spec |
30
- |---|---|---|
31
- | Task dependency math | [#818](https://github.com/mermaid-js/mermaid/issues/818), [#7407](https://github.com/mermaid-js/mermaid/issues/7407), [#7714](https://github.com/mermaid-js/mermaid/issues/7714), [PR #5224](https://github.com/mermaid-js/mermaid/pull/5224), [PR #6376](https://github.com/mermaid-js/mermaid/pull/6376), [PR #7409](https://github.com/mermaid-js/mermaid/pull/7409) | Parse `after` and `until` as first-class dependency expressions. Resolve them in a scheduler layer, not inside the renderer. |
32
- | Calendars, weekends, excludes | [#2424](https://github.com/mermaid-js/mermaid/issues/2424), [#5867](https://github.com/mermaid-js/mermaid/issues/5867), [#6884](https://github.com/mermaid-js/mermaid/issues/6884), [#7062](https://github.com/mermaid-js/mermaid/issues/7062), [#6421](https://github.com/mermaid-js/mermaid/issues/6421), [PR #5358](https://github.com/mermaid-js/mermaid/pull/5358), [PR #6734](https://github.com/mermaid-js/mermaid/pull/6734), [PR #7038](https://github.com/mermaid-js/mermaid/pull/7038), [PR #7772](https://github.com/mermaid-js/mermaid/pull/7772) | Calendar rules are semantic input. Multiple `excludes`/`includes`, `weekend`, and `weekday` must be parsed before durations are resolved. |
33
- | Working-day hours | [#4060](https://github.com/mermaid-js/mermaid/issues/4060), [PR #7733](https://github.com/mermaid-js/mermaid/pull/7733), closed attempts [PR #5403](https://github.com/mermaid-js/mermaid/pull/5403) and [PR #6149](https://github.com/mermaid-js/mermaid/pull/6149) | Do not invent work-hour syntax. Support only after Mermaid core stabilizes it. Keep the calendar engine injectable enough to add it later. |
34
- | Layout/readability | [#3794](https://github.com/mermaid-js/mermaid/issues/3794), [#5140](https://github.com/mermaid-js/mermaid/issues/5140), [#7602](https://github.com/mermaid-js/mermaid/issues/7602), [#7603](https://github.com/mermaid-js/mermaid/issues/7603), [#6260](https://github.com/mermaid-js/mermaid/issues/6260), [PR #7284](https://github.com/mermaid-js/mermaid/pull/7284) | Labels, ticks, compact rows, top axis, and `vert` markers need explicit layout tests. `vert` markers must not allocate a task row. |
35
- | Styling and theme scaling | [#3020](https://github.com/mermaid-js/mermaid/issues/3020), [#5915](https://github.com/mermaid-js/mermaid/issues/5915), [#7471](https://github.com/mermaid-js/mermaid/issues/7471), [#5710](https://github.com/mermaid-js/mermaid/issues/5710), [PR #7432](https://github.com/mermaid-js/mermaid/pull/7432), [PR #7456](https://github.com/mermaid-js/mermaid/pull/7456), [PR #7498](https://github.com/mermaid-js/mermaid/pull/7498), [PR #7537](https://github.com/mermaid-js/mermaid/pull/7537) | Bar colors, task text contrast, and font-size scaling are part of renderer behavior. Role-style options must resize rows and bars, not only text. |
36
- | Syntax/documentation drift | [#2848](https://github.com/mermaid-js/mermaid/issues/2848), [#5655](https://github.com/mermaid-js/mermaid/issues/5655), [PR #5194](https://github.com/mermaid-js/mermaid/pull/5194), [PR #5192](https://github.com/mermaid-js/mermaid/pull/5192), [PR #7443](https://github.com/mermaid-js/mermaid/pull/7443), [PR #5095](https://github.com/mermaid-js/mermaid/pull/5095) | Treat docs examples as fixtures. Document duration tokens. Allow `#` and `;` where Mermaid now allows them. |
37
- | Interactivity and security | [#771](https://github.com/mermaid-js/mermaid/issues/771), [#2152](https://github.com/mermaid-js/mermaid/issues/2152), [#2077](https://github.com/mermaid-js/mermaid/issues/2077) | Parse click/link lines. Never execute callbacks. Sanitize links under the existing strict-security model. |
38
-
39
- ### Beautiful Mermaid and Agentic Mermaid forks
40
-
41
- - [`lukilabs/beautiful-mermaid#59`](https://github.com/lukilabs/beautiful-mermaid/issues/59) requests “All Mermaid v11 diagrams” and includes a concrete Gantt sample with `interactive: true`.
42
- - [`lukilabs/beautiful-mermaid` `phase1-charts`](https://github.com/lukilabs/beautiful-mermaid/tree/phase1-charts) contains branch-only Gantt code: `src/gantt/parser.ts`, `src/gantt/layout.ts`, `src/gantt/renderer.ts`, `src/ascii/gantt.ts`, and `src/__tests__/gantt.test.ts`. It is useful prior art, but it predates Agentic Mermaid’s current source normalization, strict-security pass, agent surface, golden fixtures, and deterministic-output requirements.
43
- - Agentic Mermaid’s current [`TODO.md`](../../../TODO.md) lists Gantt under BUILD-5 alongside pie, mindmap, and gitgraph. [PR #22](https://github.com/adewale/agentic-mermaid/pull/22) adds the family-plugin consolidation, opaque fallback pattern, layout-quality adapters, and family-usage counter that Gantt should build on.
44
-
45
- ### Mermaid ASCII and terminal-renderer forks
46
-
47
- - `AlexanderGrooff/mermaid-ascii` has no native Gantt support found in upstream issues, PRs, or code.
48
- - [`pgavlin/mermaid-ascii`](https://github.com/pgavlin/mermaid-ascii) adds Gantt in Go under `pkg/gantt/`. Its README claims support for 22 diagram types and lists `gantt`; the implementation renders fixed-width horizontal bars, section headers, date markers, status glyphs, `after`, and durations.
49
- - [`Chronostasys/mermaid-ascii`](https://github.com/Chronostasys/mermaid-ascii) inherits the pgavlin Gantt code and layers CJK/Unicode alignment fixes elsewhere.
50
- - [`kais-radwan/ascii-mermaid`](https://github.com/kais-radwan/ascii-mermaid) and [`razor-ai/ascii-mermaid`](https://github.com/razor-ai/ascii-mermaid) implement a TypeScript Gantt ASCII renderer for Neovim virtual text. They support sections, bars, `after`, `done`/`active`/`crit`/`milestone`, and tests. They parse `excludes` but do not apply it to date arithmetic.
51
-
52
- These terminal renderers converge on the same useful display shape: a left label column, section rows, a fixed-width timeline plot, and status-specific glyphs. Agentic Mermaid should keep that shape but use the current ASCII infrastructure: Unicode-width handling, `useAscii`, color modes, golden fixtures, and deterministic wrapping.
53
-
54
- ### Libraries already in this repo
55
-
56
- `mermaid-ast@0.8.2` exposes `parseGantt`, `GanttAST`, and `renderGantt`. It models title, `dateFormat`, `axisFormat`, `tickInterval`, `inclusiveEndDates`, `topAxis`, `excludes`, `includes`, `todayMarker`, `weekday`, `weekend`, sections, tasks, click events, and accessibility. It is not a layout engine and keeps task data shallow, but it is a useful compatibility oracle and source-preservation aid.
57
-
58
- ## Compatibility target
59
-
60
- Target Mermaid Gantt syntax as documented on Mermaid `develop` on 2026-06-11. Host renderers such as GitHub, GitLab, Obsidian, and Markdown plugins pin different Mermaid versions; Agentic Mermaid should not claim host parity. It should claim a pinned Mermaid-core syntax target and expose syntax support in `am capabilities --json` once Gantt lands.
61
-
62
- The renderer must accept Mermaid source wrappers already supported by Agentic Mermaid:
63
-
64
- - YAML frontmatter;
65
- - `%%{init: ...}%%` and `%%{initialize: ...}%%` directives;
66
- - Mermaid comments before the header;
67
- - `accTitle:` and `accDescr:` inline or block directives.
68
-
69
- ## First-release syntax matrix
70
-
71
- Legend: “parse” means recognized and preserved by the family parser. “render” means it affects SVG/ASCII output in the first Gantt release. “preserve” means source-level round-trip keeps the text even when the renderer ignores the semantic effect.
72
-
73
- | Syntax / behavior | First release | Notes |
74
- |---|---|---|
75
- | `gantt` header | parse + render | Add `gantt` to `RoutedDiagramType`, loose detection, CLI/MCP capabilities, docs, gallery, and editor examples. |
76
- | `title ...` | parse + render | Also included in label extraction and accessibility summary. |
77
- | `accTitle`, `accDescr` | parse + render | Use existing SVG accessibility injection. Do not duplicate family-owned ARIA. |
78
- | `dateFormat ...` | parse + render | Required for date parsing. Default is `YYYY-MM-DD`; test the docs claim behind [#5655](https://github.com/mermaid-js/mermaid/issues/5655). |
79
- | `axisFormat ...` | parse + render | SVG and ASCII may format differently when terminal space is constrained; both must use the same resolved tick instants. |
80
- | `tickInterval ...` | parse + render, bounded | Must validate interval count before generating ticks. Regression source: [PR #7197](https://github.com/mermaid-js/mermaid/pull/7197). |
81
- | `inclusiveEndDates` | parse + render | Apply at scheduling boundary, not by stretching bars in renderer code. |
82
- | `topAxis` | parse + render in SVG; parse + preserve in ASCII | SVG should draw top axis. ASCII may choose a single top/bottom axis according to width, but must document the choice. |
83
- | `excludes ...` | parse + render | Support multiple lines per [PR #7772](https://github.com/mermaid-js/mermaid/pull/7772). Accept weekdays, `weekends`, and explicit dates. Do not support date ranges until Mermaid core does. |
84
- | `includes ...` | parse + render | Multiple lines. Includes override excludes for explicitly listed dates. |
85
- | `weekend friday|saturday` | parse + render | Mirrors [PR #5358](https://github.com/mermaid-js/mermaid/pull/5358). |
86
- | `weekday <day>` | parse + render for weekly tick alignment | Do not let tick alignment affect task duration. |
87
- | `todayMarker ...` / `todayMarker off` | parse + render only with supplied clock | Agentic Mermaid must not read wall-clock time by default. Draw the marker only when the caller passes `options.gantt.today` or equivalent; `off` always disables it. |
88
- | `section ...` | parse + render | Section labels get their own row/band. Multiline HTML section labels are preserved; first release may render them as plain text with `<br>` normalized to a line break only if the renderer can size the row. See [#7602](https://github.com/mermaid-js/mermaid/issues/7602). |
89
- | Task row: `Label : metadata` | parse + render | Preserve label text exactly enough for round-trip; render plain text after sanitization. |
90
- | Task ids | parse + render | IDs are used by `after`, `until`, and `click`. Duplicate IDs are a structured parse error. |
91
- | Status tags `done`, `active`, `crit` | parse + render | SVG classes and ASCII glyphs must distinguish states. Text contrast is tested in light/dark themes. |
92
- | `milestone` | parse + render | Render as diamond/marker, zero-width task. |
93
- | `vert` marker | parse + render | Render vertical marker without consuming a task row, per [PR #7284](https://github.com/mermaid-js/mermaid/pull/7284). |
94
- | `after <id...>` | parse + render | Multiple IDs resolve to the latest referenced end date, matching Mermaid docs. Unknown IDs are structured errors, not silent fallbacks. |
95
- | `until <date|id...>` | parse + render | Match Mermaid’s current semantics with differential fixtures. Duration + `until` backward scheduling is accepted only after Mermaid core merges stable syntax; track [#7407](https://github.com/mermaid-js/mermaid/issues/7407), [#7714](https://github.com/mermaid-js/mermaid/issues/7714), [PR #7409](https://github.com/mermaid-js/mermaid/pull/7409). |
96
- | Duration tokens | parse + render | Support the documented Mermaid token set from [PR #7443](https://github.com/mermaid-js/mermaid/pull/7443): `ms`, `s`, `m`, `h`, `d`, `w`, `M`, `y`, including decimals where Mermaid accepts them. Invalid duration tokens are parse errors; see [#6586](https://github.com/mermaid-js/mermaid/issues/6586). |
97
- | `click <id> href ...` | parse + sanitized render | Strict mode strips unsafe external refs as today. Loose mode may emit safe links if the existing renderer policy allows it. |
98
- | `click <id> call ...` | parse + preserve only | Never execute JavaScript callbacks in Agentic Mermaid. No callback output in strict mode. |
99
- | Frontmatter `config.gantt` / top-level Gantt config | parse + render where supported | `displayMode`, `barHeight`, padding, `topAxis`, `axisFormat`, `tickInterval`, and `todayMarker` should flow through the same normalized config path as xychart/timeline. |
100
- | `displayMode: compact` | parse + SVG render; ASCII best effort | Compact layout uses deterministic interval packing inside each section. It must not overlap labels, bars, or ticks. See [#7603](https://github.com/mermaid-js/mermaid/issues/7603). |
101
- | Comments and `#`/`;` in titles/task text | parse + preserve + render text | Mermaid changed parser behavior in [PR #5095](https://github.com/mermaid-js/mermaid/pull/5095). Fixtures must cover this. |
102
-
103
- ## Not supported in the first release
104
-
105
- These are deliberate boundaries, not hidden gaps:
106
-
107
- - **No typed ops for directives, click events, markers, or comments.** `asGantt` exposes ops on sections and tasks only (`set_title`, `add_section`/`rename_section`/`remove_section`, `add_task`/`remove_task`/`rename_task`, `set_task_status`, `set_task_dates`; exact list finalized against the other families' conventions). `dateFormat`, `excludes`/`includes`, `weekend`/`weekday`, `todayMarker`, `click`, and comment lines are preserved verbatim as opaque segments and are edited at the source level. Promoting any of them to typed ops is future work gated on the scheduler being able to re-resolve them.
108
- - **No JavaScript callback execution.** `click id call fn(args)` is parsed and preserved; it is not executed or emitted as executable script.
109
- - **No non-Mermaid proposed syntax.** This excludes date ranges in `excludes` ([#2424](https://github.com/mermaid-js/mermaid/issues/2424)), custom task states ([#3539](https://github.com/mermaid-js/mermaid/issues/3539)), relative symbolic dates such as `m1` ([#2850](https://github.com/mermaid-js/mermaid/issues/2850)), dynamic `now` / `getdate` task values ([#3532](https://github.com/mermaid-js/mermaid/issues/3532)), and vertical Gantt charts ([#6773](https://github.com/mermaid-js/mermaid/issues/6773)).
110
- - **No dependency arrows beyond Mermaid syntax.** Users have asked for arrows in [#7300](https://github.com/mermaid-js/mermaid/issues/7300) and vertical dependency lines in [#3290](https://github.com/mermaid-js/mermaid/issues/3290). First release may compute dependency data for scheduling and accessibility, but the visual arrows are future work.
111
- - **No WBS/subtask syntax.** Subtasks and work-breakdown hierarchies are requested in [#3295](https://github.com/mermaid-js/mermaid/issues/3295) and [#6449](https://github.com/mermaid-js/mermaid/issues/6449). Do not invent syntax.
112
- - **No work-hour calendar syntax until Mermaid stabilizes it.** Track [#4060](https://github.com/mermaid-js/mermaid/issues/4060) and [PR #7733](https://github.com/mermaid-js/mermaid/pull/7733).
113
- - **No BC/inverted time axis in first release.** Track [#4437](https://github.com/mermaid-js/mermaid/issues/4437).
114
- - **No host-specific fallback behavior.** If GitHub’s pinned Mermaid version lacks a feature, Agentic Mermaid may still support it if the pinned syntax target does.
115
-
116
- ## Architecture
117
-
118
- Build Gantt as a five-stage family pipeline.
119
-
120
- ### 1. Routing and family registration
121
-
122
- Files to touch after PR #22:
123
-
124
- - `src/mermaid-source.ts`: add `gantt` to strict and loose detection.
125
- - `src/index.ts`: route SVG rendering to `src/gantt/*`.
126
- - `src/ascii/index.ts`: route ASCII/Unicode rendering to `src/ascii/gantt.ts`.
127
- - `src/agent/types.ts`: add `DiagramKind = 'gantt'`.
128
- - `src/agent/families-builtin.ts`: register `id: 'gantt'`, detect `gantt`, and implement `extractGanttLabels`.
129
- - `src/agent/family-layouts.ts`: add `ganttToRendered` so `measureQuality`, `checkQuality`, `verify.layout`, and layout-compare see Gantt geometry.
130
- - `src/mcp/sdk-decl.ts`, `src/mcp/server.ts`, `src/cli/index.ts`, `Instructions_for_agents.md`, `llms.txt`, and skills: sync capability docs through the existing doc-sync tests.
131
-
132
- The `FamilyPlugin` registers with `mutate` and `serialize` hooks from the start (the enforcement test fails CI otherwise): detect, label extraction, and a segment-preserving structured body whose serialization re-emits opaque segments verbatim. Unmodeled or unparseable bodies fall back whole-opaque, preserving source byte-for-byte.
133
-
134
- ### 2. Syntax parser
135
-
136
- Create `src/gantt/parser.ts` and `src/gantt/types.ts`.
137
-
138
- The parser should produce two related values:
139
-
140
- - `GanttAst`: source-faithful syntax representation with raw text spans for directives, sections, tasks, markers, click events, and unknown-but-preserved lines where Mermaid accepts them.
141
- - `GanttSemanticModel`: normalized values needed for scheduling and rendering: task IDs, status tags, dependency expressions, date/duration expressions, calendar directives, display options, accessibility text.
142
-
143
- Use `mermaid-ast` as an oracle, not as the only implementation boundary. It can help detect syntax drift and preserve source, but Agentic Mermaid still needs its own resolver, validation, layout, SVG, ASCII, and security behavior.
144
-
145
- Parser rules:
146
-
147
- - never silently drop a line;
148
- - duplicate task IDs are errors;
149
- - references to unknown task IDs are errors in render mode;
150
- - invalid dates/durations are errors with line/column where possible;
151
- - labels are text, not HTML execution targets;
152
- - task labels may contain words such as `gantt`, `section`, `title`, `#`, and `;` when Mermaid grammar allows them.
153
-
154
- ### 3. Calendar and dependency resolver
155
-
156
- Create `src/gantt/schedule.ts`.
157
-
158
- Do not let renderers compute dates. Renderers receive resolved task intervals and markers.
159
-
160
- Core types:
161
-
162
- ```ts
163
- interface GanttCalendar {
164
- dateFormat: string
165
- inclusiveEndDates: boolean
166
- excludes: CalendarExclusion[]
167
- includes: CalendarInclusion[]
168
- weekendStart: 'friday' | 'saturday'
169
- weekStart: 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday'
170
- }
171
-
172
- interface GanttClock {
173
- today?: PlainDateLike
174
- }
175
- ```
176
-
177
- The resolver should avoid JavaScript wall-clock APIs. Use date-only values for date-only diagrams and explicit time values for time-bearing diagrams. This avoids DST and timezone bugs like [#7026](https://github.com/mermaid-js/mermaid/issues/7026). If a future implementation uses `Date`, the zone must be fixed and tested.
178
-
179
- Scheduling rules:
180
-
181
- - source order remains the tie-breaker;
182
- - `after id1 id2` starts after the latest resolved end among references;
183
- - `until id` ends at the referenced task’s start;
184
- - fixed end dates are respected unless a calendar directive says working-duration tasks should extend over excluded dates;
185
- - `includes` overrides `excludes` for explicit dates;
186
- - the resolver enforces a bounded tick count and bounded scheduling iteration count;
187
- - any cycle in dependency expressions returns a structured error naming the cycle.
188
-
189
- ### 4. SVG layout and renderer
190
-
191
- Create:
192
-
193
- - `src/gantt/layout.ts`
194
- - `src/gantt/renderer.ts`
195
- - `src/gantt/colors.ts` if status colors need family-local helpers
196
-
197
- The `phase1-charts` branch is a starting point for the visual shape: left section/task columns, plot area, row lines, grid lines, bars, milestones, and optional hover overlays. Port the idea, not the code wholesale.
198
-
199
- SVG requirements:
200
-
201
- - deterministic output for the same source/options;
202
- - no default wall-clock `todayMarker`;
203
- - stable IDs namespaced through the existing `idPrefix` pass;
204
- - strict security removes executable callbacks, unsafe hrefs, scripts, images, and external refs;
205
- - Style + Palette rendering routes Gantt marks through the internal style face:
206
- task labels, bars, grid lines, markers, and section bands should respond to named styles and palette stacks;
207
- - status classes: `gantt-bar`, `gantt-bar-done`, `gantt-bar-active`, `gantt-bar-crit`, `gantt-milestone`, `gantt-vert-marker`;
208
- - text contrast tests for status bars in light and dark themes;
209
- - `displayMode: compact` uses deterministic interval packing and has a fixture where dense rows would overlap under naive spacing.
210
-
211
- ### 5. ASCII and Unicode renderer
212
-
213
- Create `src/ascii/gantt.ts` using current Agentic Mermaid ASCII infrastructure.
214
-
215
- The terminal shape should combine the pgavlin and kais-radwan patterns:
216
-
217
- ```text
218
- Project Plan
219
- Planning
220
- Requirements ███████────────────── 01-01 → 01-14
221
- Design ───────████████────── 01-15 → 02-04
222
- Development
223
- Backend ─────────────████████ 02-05 → 03-06
224
- ─────────────────────────
225
- Jan 1 Jan 15 Feb 1
226
- ```
227
-
228
- ASCII/Unicode requirements:
229
-
230
- - respect `useAscii`;
231
- - preserve CJK/emoji display width when sizing the label column;
232
- - use deterministic axis ticks from the same layout model as SVG;
233
- - distinguish `done`, `active`, `crit`, `milestone`, and `vert` with glyphs that degrade in 7-bit ASCII;
234
- - keep labels outside bars by default; terminal bars should not hide task names;
235
- - support `maxWidth` by shrinking plot width before truncating labels;
236
- - produce golden files under `src/__tests__/testdata/{ascii,unicode}/`.
237
-
238
- ## Verification and accessibility
239
-
240
- Gantt verification should start source-level and structural:
241
-
242
- - `EMPTY_DIAGRAM`: no renderable tasks or markers;
243
- - `LABEL_OVERFLOW`: title, section names, task labels, axis labels, marker labels;
244
- - `EDGE_MISANCHORED`: dependency/click reference points at an unknown task ID;
245
- - `OFF_CANVAS`: resolved bars or markers outside plot bounds;
246
- - `GROUP_BREACH`: section-owned rows outside the section band;
247
- - `DUPLICATE_EDGE` is not relevant unless visual dependency edges are added later;
248
- - `UNREACHABLE_NODE` is not relevant to Gantt.
249
-
250
- `describeMermaid(..., {format:'json'})` should expose an AX tree with:
251
-
252
- - chart title and date range;
253
- - sections as groups;
254
- - tasks with label, status, start, end, duration, dependencies;
255
- - milestones and vertical markers;
256
- - entry tasks with no dependencies;
257
- - sinks/tasks that no later task depends on.
258
-
259
- This AX tree is the non-visual fallback for terminal users and agent review.
260
-
261
- ## Testing strategy
262
-
263
- Use the `testing-best-practices` approach: public contracts first, real parser/layout objects over mocks, golden fixtures for complex text/SVG output, property tests for scheduler invariants, and targeted mutation runs for the date resolver.
264
-
265
- ### Test tiers
266
-
267
- | Tier | Files | Required coverage |
268
- |---|---|---|
269
- | Parser unit tests | `src/__tests__/gantt-parser.test.ts` | Mermaid docs examples; malformed headers; duplicate IDs; task labels with `#`, `;`, `gantt`; click/href/call; multiple excludes/includes; unsupported proposed syntax errors. |
270
- | Scheduler property tests | `src/__tests__/property-gantt-schedule.test.ts` | No crashes for generated valid task DAGs; `after` starts after refs; cycle detection; excludes extend working-duration tasks but never shrink them; includes override excludes; tick generation bounded. |
271
- | Layout tests | `src/__tests__/gantt-layout.test.ts` | Bars stay in plot area; labels stay in label column; compact rows do not overlap; `vert` consumes no row; `topAxis` geometry. |
272
- | SVG integration/snapshots | `src/__tests__/gantt-svg-snapshot.test.ts` | Deterministic SVG; accessibility IDs; strict security; status classes; theme contrast; supplied-clock today marker. |
273
- | ASCII/Unicode golden tests | existing `ascii.test.ts` fixture flow | Basic project, sections, dependencies, excludes, milestone, vert marker, compact dense chart, CJK labels, 7-bit ASCII. |
274
- | Agent surface tests | `src/__tests__/agent-gantt.test.ts` | `parseMermaid` detects `kind:'gantt'`; serialize preserves opaque segments verbatim and is serialize-idempotent for structured bodies; `capabilities` reports structured mutation with the `asGantt` op list; each op round-trips through `am mutate`; fast-check round-trip property; label overflow works. |
275
- | Corpus/differential tests | Mermaid docs corpus + `mermaid-ast`/Mermaid-core oracle | Docs examples parse; supported examples render; parse/render decisions match the pinned compatibility target. |
276
- | E2E/editor tests | browser/editor suite | Gallery/editor can load a Gantt example, export SVG/PNG, and show ASCII. |
277
-
278
- ### Golden fixture policy
279
-
280
- Use the existing promote/check workflow from `scripts/update-ascii-goldens.ts`:
281
-
282
- - add the Mermaid source and expected output in the same fixture file;
283
- - regenerate with `bun run goldens:ascii`;
284
- - review the diff before commit;
285
- - gate with `bun run goldens:ascii:check`.
286
-
287
- Snapshot/golden files must not contain wall-clock dates. Fixtures that test `todayMarker` pass an explicit date through render options.
288
-
289
- ### Property invariants
290
-
291
- Scheduler properties should use finite generated DAGs, not arbitrary line strings only:
292
-
293
- - every resolved task has finite start/end;
294
- - non-milestone tasks have positive visual width after layout;
295
- - a task with `after refs` starts at or after the latest referenced end;
296
- - a task with fixed duration has the same working-duration count after excludes/includes are applied;
297
- - adding an excluded non-working day inside a working-duration task cannot make the task end earlier;
298
- - changing `axisFormat` cannot change task geometry;
299
- - increasing font size changes row metrics but not resolved dates;
300
- - generated tick count stays under a fixed cap.
301
-
302
- ### Mutation testing
303
-
304
- Add a targeted Stryker config once Gantt lands:
305
-
306
- - include `src/gantt/parser.ts`, `src/gantt/schedule.ts`, `src/gantt/layout.ts`, `src/ascii/gantt.ts`;
307
- - run manually or on a scheduled workflow, not in normal PR CI;
308
- - treat surviving mutants in `schedule.ts` dependency resolution, exclusions, and duration parsing as release blockers.
309
-
310
- ## Rollout plan
311
-
312
- 1. **Gantt detection and agent surface.** Add `gantt` kind, plugin registration with mutate/serialize hooks, label extractor, docs, and tests. The body parser lands here with its segmentation (typed ops on sections/tasks, opaque segments for everything else), since the parser is where segmentation lives anyway. `am render` may still error until the renderer lands, but parse/mutate/serialize work from this step.
313
- 2. **Parser + scheduler with docs fixtures.** Implement syntax parser and deterministic resolver for supported Mermaid syntax. Differential-check against `mermaid-ast` and Mermaid docs examples.
314
- 3. **ASCII renderer + goldens.** Land terminal output first because it makes date/layout regressions easy to review in diffs.
315
- 4. **SVG renderer + PNG path.** Add role styling, accessibility, strict-security handling, status classes, and snapshots.
316
- 5. **Quality/layout adapter.** Add `ganttToRendered` through PR #22’s `family-layouts.ts` and include Gantt in layout-compare fixtures.
317
- 6. **Editor/showcase/docs.** Add one minimal example, one dense/compact example, and one milestone/vert example.
318
- 7. **Release notes and capability sync.** Update `README`, `docs/features.md`, `docs/diagram-families.md`, `CHANGELOG.md`, `llms.txt`, skills, and MCP SDK declarations. Let doc-sync tests catch drift.
319
-
320
- ## Research-driven improvements beyond parity
321
-
322
- The wider literature and commercial-product survey lives in [`gantt-research.md`](./gantt-research.md). It adds four implementation requirements without changing the first-release syntax target:
323
-
324
- - Keep scheduling pure: `src/gantt/schedule.ts` should own date, dependency, calendar, critical-path, and slack computation, with no DOM/SVG/canvas or wall-clock calls.
325
- - Expose analysis without inventing syntax: critical path, slack, schedule range, dependency cycles, and entry/sink tasks belong in `describe`, `verify`, optional overlays, or future editor UI.
326
- - Leave resource, baseline, owner, workload, and uncertainty syntax out of v1: commercial Gantt tools use those features heavily, but Mermaid does not define portable source syntax for them.
327
- - Design for large schedules: overview/detail, zoom/filter, top axis, compact layout, bounded tick generation, and stable task regions should be planned from the first implementation even when only static SVG/ASCII is shipped.
328
-
329
- The strongest improvement is not more syntax. It is a clean internal dependency/calendar model that can later power `describe`, critical-path overlays, row compaction, and editor details without changing Mermaid source.
@@ -1,163 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="1120" height="640" viewBox="0 0 1120 640" role="img" aria-labelledby="title desc">
2
- <title id="title">Mermaid-style Journey diagram prototype</title>
3
- <desc id="desc">A prototype Journey diagram using Mermaid's visual metaphor: actor legend at left, horizontal section spans, task boxes in source order, score-positioned sentiment marks, and a forward baseline.</desc>
4
- <defs>
5
- <marker id="arrowhead" markerWidth="10" markerHeight="8" refX="9" refY="4" orient="auto">
6
- <path d="M0,0 L10,4 L0,8 Z" fill="#4b5563" />
7
- </marker>
8
- <filter id="softShadow" x="-10%" y="-10%" width="120%" height="130%">
9
- <feDropShadow dx="0" dy="2" stdDeviation="2" flood-color="#111827" flood-opacity="0.12" />
10
- </filter>
11
- <style>
12
- .bg { fill: #fffdfb; }
13
- .title { fill: #1f2937; font: 700 24px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
14
- .subtitle { fill: #6b7280; font: 500 12px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
15
- .legend-title { fill: #374151; font: 700 13px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
16
- .legend-label { fill: #374151; font: 500 13px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
17
- .section-label { fill: #1f2937; font: 700 14px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
18
- .task { fill: #ffffff; stroke: #cbd5e1; stroke-width: 1.2; filter: url(#softShadow); }
19
- .task-label { fill: #1f2937; font: 650 13px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
20
- .task-meta { fill: #6b7280; font: 500 11px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
21
- .track { stroke: #cbd5e1; stroke-width: 1.2; stroke-dasharray: 4 6; }
22
- .guide { stroke: #e5e7eb; stroke-width: 1; }
23
- .score-label { fill: #9ca3af; font: 600 10px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
24
- .baseline { stroke: #4b5563; stroke-width: 2.2; marker-end: url(#arrowhead); }
25
- .face { fill: #facc15; stroke: #8a6d1d; stroke-width: 1.2; }
26
- .face-eye { fill: #3f3f46; }
27
- .face-mouth { fill: none; stroke: #3f3f46; stroke-width: 1.6; stroke-linecap: round; }
28
- .section-discover { fill: #e8f3ff; stroke: #93c5fd; }
29
- .section-try { fill: #eaf7ee; stroke: #86efac; }
30
- .section-recover { fill: #fff0dd; stroke: #fdba74; }
31
- .actor-user { fill: #2563eb; }
32
- .actor-support { fill: #16a34a; }
33
- .actor-ops { fill: #d97706; }
34
- </style>
35
- </defs>
36
-
37
- <rect class="bg" x="0" y="0" width="1120" height="640" />
38
- <text class="title" x="220" y="42">Checkout support journey</text>
39
- <text class="subtitle" x="220" y="64">Mermaid-style score curve, not task cards</text>
40
-
41
- <g aria-label="Actor legend">
42
- <text class="legend-title" x="40" y="122">Actors</text>
43
- <circle class="actor-user" cx="48" cy="148" r="6" />
44
- <text class="legend-label" x="66" y="153">User</text>
45
- <circle class="actor-support" cx="48" cy="176" r="6" />
46
- <text class="legend-label" x="66" y="181">Support</text>
47
- <circle class="actor-ops" cx="48" cy="204" r="6" />
48
- <text class="legend-label" x="66" y="209">Ops</text>
49
- </g>
50
-
51
- <g aria-label="Section spans">
52
- <rect class="section-discover" x="210" y="84" width="294" height="52" rx="6" />
53
- <text class="section-label" x="357" y="116" text-anchor="middle">Discover</text>
54
- <rect class="section-try" x="510" y="84" width="294" height="52" rx="6" />
55
- <text class="section-label" x="657" y="116" text-anchor="middle">Try</text>
56
- <rect class="section-recover" x="810" y="84" width="294" height="52" rx="6" />
57
- <text class="section-label" x="957" y="116" text-anchor="middle">Recover</text>
58
- </g>
59
-
60
- <g aria-label="Score guide">
61
- <line class="guide" x1="198" y1="294" x2="1084" y2="294" />
62
- <line class="guide" x1="198" y1="334" x2="1084" y2="334" />
63
- <line class="guide" x1="198" y1="374" x2="1084" y2="374" />
64
- <line class="guide" x1="198" y1="414" x2="1084" y2="414" />
65
- <line class="guide" x1="198" y1="454" x2="1084" y2="454" />
66
- <text class="score-label" x="176" y="298">5</text>
67
- <text class="score-label" x="176" y="338">4</text>
68
- <text class="score-label" x="176" y="378">3</text>
69
- <text class="score-label" x="176" y="418">2</text>
70
- <text class="score-label" x="176" y="458">1</text>
71
- </g>
72
-
73
- <line class="baseline" x1="200" y1="512" x2="1084" y2="512" />
74
-
75
- <g aria-label="Tasks">
76
- <g transform="translate(220 166)">
77
- <rect class="task" x="0" y="0" width="124" height="72" rx="5" />
78
- <text class="task-label" x="62" y="27" text-anchor="middle">Find docs</text>
79
- <text class="task-meta" x="62" y="49" text-anchor="middle">score 4</text>
80
- <circle class="actor-user" cx="54" cy="61" r="4" />
81
- <line class="track" x1="62" y1="74" x2="62" y2="346" />
82
- </g>
83
- <g transform="translate(370 166)">
84
- <rect class="task" x="0" y="0" width="124" height="72" rx="5" />
85
- <text class="task-label" x="62" y="27" text-anchor="middle">Choose setup</text>
86
- <text class="task-meta" x="62" y="49" text-anchor="middle">score 3</text>
87
- <circle class="actor-user" cx="47" cy="61" r="4" />
88
- <circle class="actor-support" cx="62" cy="61" r="4" />
89
- <line class="track" x1="62" y1="74" x2="62" y2="346" />
90
- </g>
91
- <g transform="translate(520 166)">
92
- <rect class="task" x="0" y="0" width="124" height="72" rx="5" />
93
- <text class="task-label" x="62" y="27" text-anchor="middle">Run install</text>
94
- <text class="task-meta" x="62" y="49" text-anchor="middle">score 2</text>
95
- <circle class="actor-user" cx="47" cy="61" r="4" />
96
- <circle class="actor-ops" cx="62" cy="61" r="4" />
97
- <line class="track" x1="62" y1="74" x2="62" y2="346" />
98
- </g>
99
- <g transform="translate(670 166)">
100
- <rect class="task" x="0" y="0" width="124" height="72" rx="5" />
101
- <text class="task-label" x="62" y="27" text-anchor="middle">First render</text>
102
- <text class="task-meta" x="62" y="49" text-anchor="middle">score 5</text>
103
- <circle class="actor-user" cx="54" cy="61" r="4" />
104
- <line class="track" x1="62" y1="74" x2="62" y2="346" />
105
- </g>
106
- <g transform="translate(820 166)">
107
- <rect class="task" x="0" y="0" width="124" height="72" rx="5" />
108
- <text class="task-label" x="62" y="27" text-anchor="middle">Hit error</text>
109
- <text class="task-meta" x="62" y="49" text-anchor="middle">score 1</text>
110
- <circle class="actor-user" cx="47" cy="61" r="4" />
111
- <circle class="actor-support" cx="62" cy="61" r="4" />
112
- <line class="track" x1="62" y1="74" x2="62" y2="346" />
113
- </g>
114
- <g transform="translate(970 166)">
115
- <rect class="task" x="0" y="0" width="124" height="72" rx="5" />
116
- <text class="task-label" x="62" y="27" text-anchor="middle">Recover flow</text>
117
- <text class="task-meta" x="62" y="49" text-anchor="middle">score 4</text>
118
- <circle class="actor-user" cx="39" cy="61" r="4" />
119
- <circle class="actor-support" cx="54" cy="61" r="4" />
120
- <circle class="actor-ops" cx="69" cy="61" r="4" />
121
- <line class="track" x1="62" y1="74" x2="62" y2="346" />
122
- </g>
123
- </g>
124
-
125
- <g aria-label="Score markers">
126
- <g transform="translate(282 334)">
127
- <circle class="face" cx="0" cy="0" r="18" />
128
- <circle class="face-eye" cx="-6" cy="-5" r="2" />
129
- <circle class="face-eye" cx="6" cy="-5" r="2" />
130
- <path class="face-mouth" d="M-8,5 Q0,12 8,5" />
131
- </g>
132
- <g transform="translate(432 374)">
133
- <circle class="face" cx="0" cy="0" r="18" />
134
- <circle class="face-eye" cx="-6" cy="-5" r="2" />
135
- <circle class="face-eye" cx="6" cy="-5" r="2" />
136
- <path class="face-mouth" d="M-8,6 L8,6" />
137
- </g>
138
- <g transform="translate(582 414)">
139
- <circle class="face" cx="0" cy="0" r="18" />
140
- <circle class="face-eye" cx="-6" cy="-5" r="2" />
141
- <circle class="face-eye" cx="6" cy="-5" r="2" />
142
- <path class="face-mouth" d="M-8,10 Q0,2 8,10" />
143
- </g>
144
- <g transform="translate(732 294)">
145
- <circle class="face" cx="0" cy="0" r="18" />
146
- <circle class="face-eye" cx="-6" cy="-5" r="2" />
147
- <circle class="face-eye" cx="6" cy="-5" r="2" />
148
- <path class="face-mouth" d="M-9,4 Q0,14 9,4" />
149
- </g>
150
- <g transform="translate(882 454)">
151
- <circle class="face" cx="0" cy="0" r="18" />
152
- <circle class="face-eye" cx="-6" cy="-5" r="2" />
153
- <circle class="face-eye" cx="6" cy="-5" r="2" />
154
- <path class="face-mouth" d="M-9,11 Q0,0 9,11" />
155
- </g>
156
- <g transform="translate(1032 334)">
157
- <circle class="face" cx="0" cy="0" r="18" />
158
- <circle class="face-eye" cx="-6" cy="-5" r="2" />
159
- <circle class="face-eye" cx="6" cy="-5" r="2" />
160
- <path class="face-mouth" d="M-8,5 Q0,12 8,5" />
161
- </g>
162
- </g>
163
- </svg>