@zenuml/core 3.47.9 → 3.48.1

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 (205) hide show
  1. package/dist/cli/zenuml.mjs +13529 -0
  2. package/dist/cli/zenuml.mjs.map +1 -0
  3. package/dist/cloud-icons-eHuugVSv.js.map +1 -0
  4. package/dist/zenuml.esm.mjs +2153 -2156
  5. package/dist/zenuml.esm.mjs.map +1 -0
  6. package/dist/zenuml.js +82 -82
  7. package/dist/zenuml.js.map +1 -0
  8. package/package.json +18 -5
  9. package/.agents/skills/babysit-pr/SKILL.md +0 -223
  10. package/.agents/skills/babysit-pr/agents/openai.yaml +0 -7
  11. package/.agents/skills/dia-scoring/SKILL.md +0 -139
  12. package/.agents/skills/dia-scoring/agents/openai.yaml +0 -7
  13. package/.agents/skills/dia-scoring/references/selectors-and-keys.md +0 -253
  14. package/.agents/skills/land-pr/SKILL.md +0 -120
  15. package/.agents/skills/propagate-core-release/SKILL.md +0 -205
  16. package/.agents/skills/propagate-core-release/agents/openai.yaml +0 -7
  17. package/.agents/skills/propagate-core-release/references/downstreams.md +0 -42
  18. package/.agents/skills/ship-branch/SKILL.md +0 -105
  19. package/.agents/skills/submit-branch/SKILL.md +0 -76
  20. package/.agents/skills/validate-branch/SKILL.md +0 -72
  21. package/.claude/commands/README.md +0 -162
  22. package/.claude/commands/analyze.md +0 -101
  23. package/.claude/commands/clarify.md +0 -158
  24. package/.claude/commands/code-review.md +0 -322
  25. package/.claude/commands/constitution.md +0 -73
  26. package/.claude/commands/create-docs.md +0 -309
  27. package/.claude/commands/full-context.md +0 -121
  28. package/.claude/commands/gemini-consult.md +0 -164
  29. package/.claude/commands/handoff.md +0 -146
  30. package/.claude/commands/implement.md +0 -56
  31. package/.claude/commands/plan.md +0 -43
  32. package/.claude/commands/refactor.md +0 -188
  33. package/.claude/commands/specify.md +0 -21
  34. package/.claude/commands/tasks.md +0 -62
  35. package/.claude/commands/update-docs.md +0 -314
  36. package/.claude/hooks/README.md +0 -270
  37. package/.claude/hooks/config/sensitive-patterns.json +0 -86
  38. package/.claude/hooks/gemini-context-injector.sh +0 -129
  39. package/.claude/hooks/mcp-security-scan.sh +0 -147
  40. package/.claude/hooks/notify.sh +0 -103
  41. package/.claude/hooks/setup/hook-setup.md +0 -96
  42. package/.claude/hooks/setup/settings.json.template +0 -63
  43. package/.claude/hooks/sounds/complete.wav +0 -0
  44. package/.claude/hooks/sounds/input-needed.wav +0 -0
  45. package/.claude/hooks/subagent-context-injector.sh +0 -65
  46. package/.claude/skills/babysit-pr/SKILL.md +0 -223
  47. package/.claude/skills/babysit-pr/agents/openai.yaml +0 -7
  48. package/.claude/skills/dia-scoring/SKILL.md +0 -139
  49. package/.claude/skills/dia-scoring/agents/openai.yaml +0 -7
  50. package/.claude/skills/dia-scoring/references/selectors-and-keys.md +0 -253
  51. package/.claude/skills/emoji-eval/SKILL.md +0 -187
  52. package/.claude/skills/land-pr/SKILL.md +0 -120
  53. package/.claude/skills/propagate-core-release/SKILL.md +0 -205
  54. package/.claude/skills/propagate-core-release/agents/openai.yaml +0 -7
  55. package/.claude/skills/propagate-core-release/references/downstreams.md +0 -42
  56. package/.claude/skills/ship-branch/SKILL.md +0 -105
  57. package/.claude/skills/submit-branch/SKILL.md +0 -76
  58. package/.claude/skills/validate-branch/SKILL.md +0 -72
  59. package/.claude/skills/zenuml-ux-research/SKILL.md +0 -183
  60. package/.claude/skills/zenuml-ux-research/references/assertion-catalog.md +0 -261
  61. package/.claude/skills/zenuml-ux-research/references/best-practices-overview.md +0 -56
  62. package/.claude/skills/zenuml-ux-research/references/report-template.md +0 -89
  63. package/.claude/skills/zenuml-ux-research/references/scenarios/edit-message-label.md +0 -37
  64. package/.claude/skills/zenuml-ux-research/references/scenarios/insert-message.md +0 -36
  65. package/.claude/skills/zenuml-ux-research/references/scenarios/insert-participant.md +0 -31
  66. package/.claude/skills/zenuml-ux-research/references/scenarios/rename-participant.md +0 -33
  67. package/.claude/skills/zenuml-ux-research/references/scenarios/undo-insert.md +0 -35
  68. package/.devcontainer/devcontainer.json +0 -21
  69. package/.dockerignore +0 -19
  70. package/.eslintrc.js +0 -39
  71. package/.git-blame-ignore-revs +0 -6
  72. package/.kiro/hooks/README.md +0 -38
  73. package/.kiro/hooks/session-sound-notification.js +0 -44
  74. package/.kiro/hooks/session-sound-notification.json +0 -23
  75. package/.mcp.json.example +0 -17
  76. package/.nvmrc +0 -1
  77. package/.prettierignore +0 -4
  78. package/.prettierrc +0 -1
  79. package/.specify/memory/constitution.md +0 -33
  80. package/.specify/scripts/bash/check-prerequisites.sh +0 -166
  81. package/.specify/scripts/bash/common.sh +0 -113
  82. package/.specify/scripts/bash/create-new-feature.sh +0 -97
  83. package/.specify/scripts/bash/setup-plan.sh +0 -60
  84. package/.specify/scripts/bash/update-agent-context.sh +0 -728
  85. package/.specify/templates/agent-file-template.md +0 -23
  86. package/.specify/templates/plan-template.md +0 -219
  87. package/.specify/templates/spec-template.md +0 -116
  88. package/.specify/templates/tasks-template.md +0 -127
  89. package/.storybook/main.ts +0 -25
  90. package/.storybook/preview.ts +0 -29
  91. package/.watchmanconfig +0 -3
  92. package/AGENTS.md +0 -26
  93. package/CLAUDE.md +0 -124
  94. package/DEPLOYMENT.md +0 -62
  95. package/Dockerfile +0 -36
  96. package/IMPLEMENTATION_PLAN.md +0 -163
  97. package/Integration/vanilla-js/index.html +0 -42
  98. package/MCP-ASSISTANT-RULES.md +0 -85
  99. package/README_CN.md +0 -15
  100. package/TUTORIAL.md +0 -116
  101. package/antlr/antlr-4.11.1-complete.jar +0 -0
  102. package/bun.lock +0 -1544
  103. package/bunfig.toml +0 -52
  104. package/docs/UNICODE_SUPPORT.md +0 -179
  105. package/docs/ai-context/deployment-infrastructure.md +0 -21
  106. package/docs/ai-context/docs-overview.md +0 -89
  107. package/docs/ai-context/handoff.md +0 -174
  108. package/docs/ai-context/project-structure.md +0 -160
  109. package/docs/ai-context/system-integration.md +0 -21
  110. package/docs/asciidoc/contributor.adoc +0 -54
  111. package/docs/asciidoc/create-my-own-theme.adoc +0 -149
  112. package/docs/asciidoc/images/creation-component.png +0 -0
  113. package/docs/asciidoc/images/creation-rtl.png +0 -0
  114. package/docs/asciidoc/images/message-arrow-rtl.png +0 -0
  115. package/docs/asciidoc/images/occurrence.png +0 -0
  116. package/docs/asciidoc/images/return-message-conflict.png +0 -0
  117. package/docs/asciidoc/images/shift-up-half-the-height.png +0 -0
  118. package/docs/asciidoc/images/three-layer-info-arch.png +0 -0
  119. package/docs/asciidoc/images/vertical-alignment.svg +0 -1
  120. package/docs/asciidoc/images/vertically-aligning.png +0 -0
  121. package/docs/asciidoc/index.adoc +0 -277
  122. package/docs/asciidoc/theme-debug-web-app.png +0 -0
  123. package/docs/asciidoc/tutorial.adoc +0 -22
  124. package/docs/asciidoc/user-css.png +0 -0
  125. package/docs/async-vs-sync-parser-rules.md +0 -81
  126. package/docs/divider-parser-allow-spaces.md +0 -38
  127. package/docs/highlighting-messages.md +0 -52
  128. package/docs/images/editor-sample.png +0 -0
  129. package/docs/inherited-vs-provided-from.md +0 -64
  130. package/docs/parser/Assignment.md +0 -8
  131. package/docs/parser/PARSER_IMPROVEMENTS_CC.md +0 -425
  132. package/docs/parser/grammar_review_gemini.md +0 -116
  133. package/docs/participants-function.md +0 -25
  134. package/docs/responsive-participant-margin.md +0 -52
  135. package/docs/starter.md +0 -9
  136. package/docs/superpowers/plans/2026-03-27-e2e-test-reorg.md +0 -698
  137. package/docs/superpowers/plans/2026-03-30-emoji-support.md +0 -1220
  138. package/docs/superpowers/plans/2026-03-30-self-correcting-scoring.md +0 -206
  139. package/docs/superpowers/plans/2026-04-15-keyboard-editing-on-diagram.md +0 -1992
  140. package/docs/superpowers/plans/2026-04-15-zenuml-ux-research-skill.md +0 -1452
  141. package/docs/ux-research/.gitkeep +0 -0
  142. package/docs/ux-research/2026-04-15-rename-participant.md +0 -156
  143. package/docs/ux-research/2026-04-18-insert-participant.md +0 -151
  144. package/docs/width-translate-and-offsets.md +0 -62
  145. package/docs/xss.md +0 -59
  146. package/e2e/data/compare-cases.js +0 -1090
  147. package/e2e/data/diff-algorithm.js +0 -199
  148. package/e2e/fixtures/create-message.html +0 -26
  149. package/e2e/fixtures/editable-label.html +0 -35
  150. package/e2e/fixtures/editable-span.html +0 -122
  151. package/e2e/fixtures/empty-diagram.html +0 -23
  152. package/e2e/fixtures/fixture.html +0 -31
  153. package/e2e/fixtures/insert-participant.html +0 -23
  154. package/e2e/fixtures/reorder-cross-fragment.html +0 -31
  155. package/e2e/fixtures/reorder-fragment.html +0 -29
  156. package/e2e/fixtures/reorder-message.html +0 -27
  157. package/e2e/fixtures/svg-test.html +0 -21
  158. package/e2e/fixtures/type-switch.html +0 -29
  159. package/e2e/tools/canonical-history.html +0 -908
  160. package/e2e/tools/compare-case.html +0 -371
  161. package/e2e/tools/compare.html +0 -35
  162. package/e2e/tools/native-diff-ext/background.js +0 -60
  163. package/e2e/tools/native-diff-ext/bridge.js +0 -26
  164. package/e2e/tools/native-diff-ext/content.js +0 -194
  165. package/e2e/tools/svg-preview.html +0 -56
  166. package/embed.html +0 -193
  167. package/eslint.config.mjs +0 -35
  168. package/firebase-debug.log +0 -108
  169. package/iframe-container-demo/diagram.html +0 -124
  170. package/iframe-container-demo/host.html +0 -817
  171. package/index.html +0 -771
  172. package/mermaid-zenuml-async-spa-auth.png +0 -0
  173. package/mermaid-zenuml-async-spa-auth.snapshot.md +0 -96
  174. package/newsletter/unicode-support-announcement.md +0 -134
  175. package/playground/creation.html +0 -53
  176. package/playground/message.html +0 -63
  177. package/playwright.config.ts +0 -40
  178. package/renderer.html +0 -366
  179. package/scripts/analyze-compare-case/collect-data.mjs +0 -1134
  180. package/scripts/analyze-compare-case/config.mjs +0 -102
  181. package/scripts/analyze-compare-case/geometry.mjs +0 -101
  182. package/scripts/analyze-compare-case/native-diff.mjs +0 -224
  183. package/scripts/analyze-compare-case/output.mjs +0 -74
  184. package/scripts/analyze-compare-case/panel-diff.mjs +0 -114
  185. package/scripts/analyze-compare-case/report.mjs +0 -162
  186. package/scripts/analyze-compare-case/residual-scopes.mjs +0 -347
  187. package/scripts/analyze-compare-case/scoring.mjs +0 -829
  188. package/scripts/analyze-compare-case.mjs +0 -149
  189. package/scripts/bump-version.js +0 -117
  190. package/scripts/snapshot-dual.js +0 -173
  191. package/scripts/update-snapshots.js +0 -70
  192. package/skills/dia-scoring/SKILL.md +0 -129
  193. package/skills/dia-scoring/agents/openai.yaml +0 -7
  194. package/skills/dia-scoring/references/selectors-and-keys.md +0 -253
  195. package/tailwind.config.js +0 -126
  196. package/test-compression.html +0 -274
  197. package/test-mermaid-zenuml.html +0 -57
  198. package/test-setup.ts +0 -124
  199. package/test-url-params.html +0 -192
  200. package/tsconfig.app.json +0 -31
  201. package/tsconfig.node.json +0 -24
  202. package/tsconfig.test.json +0 -9
  203. package/vite.config.lib.ts +0 -93
  204. package/vite.config.ts +0 -84
  205. package/wrangler.toml +0 -18
package/package.json CHANGED
@@ -1,19 +1,26 @@
1
1
  {
2
2
  "name": "@zenuml/core",
3
- "version": "3.47.9",
3
+ "version": "3.48.1",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "url": "https://github.com/mermaid-js/zenuml-core"
8
8
  },
9
+ "files": [
10
+ "dist/",
11
+ "types/"
12
+ ],
9
13
  "scripts": {
10
14
  "dev": "vite dev --port 4000 --host 0.0.0.0",
15
+ "cli": "bun src/cli/zenuml.ts",
11
16
  "preview": "bun run --bun vite preview --port 4000 --host",
12
17
  "build:site": "bun run --bun vite build",
13
18
  "build:gh-pages": "bun run --bun vite build --mode gh-pages",
14
- "build": "bun run --bun vite build -c vite.config.lib.ts",
15
- "build:release": "RELEASE=1 bun run --bun vite build -c vite.config.lib.ts",
16
- "build:analyze": "RELEASE=1 ANALYZE=1 bun run --bun vite build -c vite.config.lib.ts",
19
+ "build:lib": "bun run --bun vite build -c vite.config.lib.ts",
20
+ "build:cli": "bun run --bun vite build -c vite.config.cli.ts",
21
+ "build": "bun run build:lib && bun run build:cli",
22
+ "build:release": "RELEASE=1 bun run build:lib && RELEASE=1 bun run build:cli",
23
+ "build:analyze": "RELEASE=1 ANALYZE=1 bun run build:lib && RELEASE=1 bun run build:cli",
17
24
  "test": "bun test src test/unit",
18
25
  "pw": "playwright test --reporter=list",
19
26
  "pw:ci": "playwright test",
@@ -46,6 +53,9 @@
46
53
  "worker:deploy": "bun run build:site && bun run --bun wrangler deploy -e production",
47
54
  "worker:deploy:staging": "bun run build:site && bun run --bun wrangler deploy --env staging"
48
55
  },
56
+ "bin": {
57
+ "zenuml": "./dist/cli/zenuml.mjs"
58
+ },
49
59
  "main": "./dist/zenuml.js",
50
60
  "module": "./dist/zenuml.esm.mjs",
51
61
  "types": "./types/index.d.ts",
@@ -87,6 +97,7 @@
87
97
  "marked": "^4.3.0",
88
98
  "pako": "^2.1.0",
89
99
  "pino": "^8.21.0",
100
+ "playwright-core": "^1.59.1",
90
101
  "react": "^19.2.3",
91
102
  "react-dom": "^19.2.3",
92
103
  "tailwind-merge": "^3.4.0",
@@ -95,7 +106,6 @@
95
106
  "devDependencies": {
96
107
  "@eslint/js": "^9.39.2",
97
108
  "@happy-dom/global-registrator": "^18.0.1",
98
- "@napi-rs/canvas": "^0.1.97",
99
109
  "@playwright/test": "^1.57.0",
100
110
  "@storybook/addon-docs": "^9.1.17",
101
111
  "@storybook/addon-onboarding": "^9.1.17",
@@ -134,5 +144,8 @@
134
144
  "vite-plugin-svgr": "^4.5.0",
135
145
  "vitest": "^3.2.4",
136
146
  "wrangler": "^4.88"
147
+ },
148
+ "optionalDependencies": {
149
+ "@napi-rs/canvas": "^0.1.97"
137
150
  }
138
151
  }
@@ -1,223 +0,0 @@
1
- ---
2
- name: babysit-pr
3
- description: Monitor and fix failing GitHub Actions CI checks on PRs for mermaid-js/zenuml-core. Use when the user says "babysit PR", "check PR status", "fix CI", "PR is failing", "watch this PR", "why is CI red", or when used with /loop to continuously monitor a PR. Also use when Playwright snapshot failures occur in CI, lint/format issues block merging, or unit tests fail on a PR. Triggers on any PR monitoring, CI failure diagnosis, or automated fix-and-retry workflow.
4
- ---
5
-
6
- # Babysit PR
7
-
8
- Monitor a GitHub Actions PR, diagnose failures, attempt fixes, and retry — up to 3 times total.
9
-
10
- ## Scope
11
-
12
- This skill targets **mermaid-js/zenuml-core** only. All commands run from the zenuml-core directory.
13
-
14
- ## Step 1: Find the PR
15
-
16
- Resolve which PR to babysit, in this priority order:
17
-
18
- 1. **Explicit PR number** — if the user provided one (e.g., `#341`), use it
19
- 2. **Current branch PR** — run `gh pr view --json number,title,headRefName,state,statusCheckRollup` from the zenuml-core directory
20
- 3. **Recently failed PR** — if no PR on current branch, find the most recent failed PR in the last 10 minutes:
21
- ```bash
22
- gh run list --repo mermaid-js/zenuml-core --status failure --limit 5 --json databaseId,headBranch,event,createdAt,conclusion,name
23
- ```
24
- Filter to runs created within the last 10 minutes. If multiple, pick the most recent.
25
-
26
- If no PR is found, tell the user and stop.
27
-
28
- ## Step 2: Check CI Status
29
-
30
- ```bash
31
- gh pr checks <PR_NUMBER> --repo mermaid-js/zenuml-core
32
- ```
33
-
34
- **If all checks pass**: Report success and stop. Nothing to babysit.
35
-
36
- **If checks are still running**: Report status and wait. Use `gh run watch <RUN_ID> --repo mermaid-js/zenuml-core` to wait for completion (with a 10-minute timeout). Then re-evaluate.
37
-
38
- **If checks failed**: Proceed to Step 3.
39
-
40
- ## Step 3: Diagnose Failures
41
-
42
- For each failed check, pull the logs:
43
-
44
- ```bash
45
- gh run view <RUN_ID> --repo mermaid-js/zenuml-core --log-failed
46
- ```
47
-
48
- Categorize the failure:
49
-
50
- | Category | Indicators |
51
- |----------|-----------|
52
- | **Playwright snapshot mismatch** | `Error: A]snapshot.*doesn't match`, `Screenshot comparison failed`, pixel diff errors, `-linux.png` referenced |
53
- | **Playwright test logic failure** | Assertion errors, timeouts, element not found — but NOT snapshot diffs |
54
- | **Unit test failure** | Failures in `bun run test`, vitest output |
55
- | **Lint/format failure** | ESLint errors, Prettier diffs |
56
- | **Build failure** | Vite build errors, TypeScript compilation errors |
57
- | **Merge conflict** | `CONFLICT`, `merge conflict`, cannot rebase cleanly |
58
- | **Infra/flaky** | Network timeouts, runner issues, cache failures |
59
-
60
- ## Step 4: Attempt Fix
61
-
62
- **Important**: Before fixing, make sure the local branch is up to date with the PR branch:
63
- ```bash
64
- git fetch origin && git checkout <PR_BRANCH> && git pull origin <PR_BRANCH>
65
- ```
66
-
67
- Before any local `bun pw` run in this workflow, verify that port `8080` is either free or already owned by a dev server started from this repo. `playwright.config.ts` reuses existing servers outside CI, so a Vite server from another repo will produce invalid local results.
68
-
69
- ```bash
70
- PORT="${PORT:-8080}"
71
- THIS_REPO="$(pwd -P)"
72
- LISTENER_PID="$(lsof -tiTCP:${PORT} -sTCP:LISTEN 2>/dev/null | head -n1 || true)"
73
-
74
- if [ -n "$LISTENER_PID" ]; then
75
- LISTENER_CMD="$(ps -p "$LISTENER_PID" -o command=)"
76
- if [[ "$LISTENER_CMD" != *"$THIS_REPO"* ]]; then
77
- echo "Port ${PORT} is owned by another repo; killing PID ${LISTENER_PID}"
78
- kill "$LISTENER_PID"
79
- fi
80
- fi
81
- ```
82
-
83
- If you killed a different repo's server, do **not** start Vite manually. Let `bun pw` launch the correct dev server from this folder.
84
-
85
- ### Fix by Category
86
-
87
- #### Playwright Snapshot Mismatch (Linux)
88
-
89
- This is the most common CI-only failure because snapshots are platform-specific.
90
-
91
- 1. **Verify it's a snapshot diff** (not a logic error) by reading the failure log
92
- 2. **Check if the change is intentional** — look at recent commits on the branch. If they modified rendering code, SVG output, or CSS, snapshot updates are expected
93
- 3. **Trigger the Linux snapshot update workflow**:
94
- ```bash
95
- gh workflow run update-snapshots.yml --repo mermaid-js/zenuml-core --ref <PR_BRANCH>
96
- ```
97
- 4. **Wait for the workflow to complete**:
98
- ```bash
99
- # Find the run ID (most recent on that branch)
100
- gh run list --repo mermaid-js/zenuml-core --workflow update-snapshots.yml --branch <PR_BRANCH> --limit 1 --json databaseId,status
101
- # Watch it
102
- gh run watch <RUN_ID> --repo mermaid-js/zenuml-core
103
- ```
104
- 5. **Pull the auto-committed snapshots** locally:
105
- ```bash
106
- git pull origin <PR_BRANCH>
107
- ```
108
- 6. The update-snapshots workflow commits and verifies automatically. If it passes, CI should go green on next run.
109
-
110
- #### Playwright Test Logic Failure
111
-
112
- 1. **Reproduce locally first**:
113
- ```bash
114
- # Run the 8080 ownership preflight above first.
115
- bun pw --grep "<test name pattern>"
116
- ```
117
- 2. **Read the failing test** to understand what it expects
118
- 3. **Fix the code** (not the test, unless the test expectation is wrong)
119
- 4. **Verify locally**: `bun pw --grep "<test name pattern>"`
120
- 5. **Commit and push**
121
-
122
- #### Unit Test Failure
123
-
124
- 1. **Reproduce locally**:
125
- ```bash
126
- bun run test --run
127
- ```
128
- 2. **Fix the code or test**
129
- 3. **Verify**: `bun run test --run`
130
- 4. **Commit and push**
131
-
132
- #### Lint/Format Failure
133
-
134
- 1. **Auto-fix**:
135
- ```bash
136
- bun eslint
137
- bun prettier
138
- ```
139
- 2. **Verify no remaining issues**:
140
- ```bash
141
- bun eslint 2>&1 | tail -5
142
- ```
143
- 3. **Commit and push** the formatting fixes
144
-
145
- #### Build Failure
146
-
147
- 1. **Reproduce locally**:
148
- ```bash
149
- bun build
150
- ```
151
- 2. **Read the error** — usually TypeScript errors or missing imports
152
- 3. **Fix, verify locally, commit and push**
153
-
154
- #### Merge Conflict
155
-
156
- 1. **Report to user** — do NOT auto-resolve merge conflicts. Show what's conflicting and ask for guidance.
157
-
158
- #### Infra/Flaky
159
-
160
- 1. **Re-run the failed job**:
161
- ```bash
162
- gh run rerun <RUN_ID> --repo mermaid-js/zenuml-core --failed
163
- ```
164
- 2. If it fails again with the same infra error, report to user.
165
-
166
- ## Step 5: Push and Monitor
167
-
168
- After applying a fix:
169
-
170
- 1. **Run the full local test suite** before pushing (when the failure category allows local reproduction):
171
- ```bash
172
- bun run test --run # unit tests
173
- # Run the 8080 ownership preflight above first.
174
- bun pw # playwright (local, macOS — won't catch Linux snapshot diffs)
175
- bun eslint # lint
176
- ```
177
- 2. **Commit with a clear message**:
178
- ```bash
179
- git add <specific files>
180
- git commit -m "fix: <what was fixed> to pass CI"
181
- ```
182
- 3. **Push**:
183
- ```bash
184
- git push origin <PR_BRANCH>
185
- ```
186
- 4. **Wait for CI** — use `gh run watch` on the new run
187
- 5. **Evaluate result** — go back to Step 2
188
-
189
- ## Step 6: Retry Budget
190
-
191
- Track attempts. Each "attempt" is one push-and-wait cycle (or one workflow trigger-and-wait for snapshot updates).
192
-
193
- - **Maximum 3 attempts total**
194
- - After each failed attempt, re-diagnose from scratch (Step 3) — the failure mode may have changed
195
- - **If a test passes on retry without code changes**, flag it as potentially flaky:
196
- > "Test `<name>` passed on retry without changes — likely flaky. Consider investigating stability."
197
- - **After 3 failed attempts**, stop and report:
198
- - What was tried
199
- - What the current failure is
200
- - Your best theory for root cause
201
- - Suggested next steps for the user
202
-
203
- ## Step 7: Summary Report
204
-
205
- After babysitting completes (success or exhausted retries), produce a brief report:
206
-
207
- ```
208
- ## PR #<number> Babysit Report
209
- - **Status**: [PASSED | FAILED after N attempts]
210
- - **Failures found**: <list of categories>
211
- - **Fixes applied**: <list of commits pushed>
212
- - **Flaky tests**: <any tests that passed on retry without changes>
213
- - **Manual attention needed**: <anything unresolved>
214
- ```
215
-
216
- ## Safety Rules
217
-
218
- - **Never force-push** — always regular `git push`
219
- - **Never resolve merge conflicts automatically** — report and ask
220
- - **Never push while CI is still running** from a previous attempt — wait for it to finish first
221
- - **Never modify the snapshot update workflow itself** — only trigger it
222
- - **Always verify fixes locally** before pushing (except Linux snapshot updates which can only be verified in CI)
223
- - **Check for in-progress CI** before pushing — avoid wasting CI minutes on runs that will be superseded
@@ -1,7 +0,0 @@
1
- interface:
2
- display_name: "Babysit PR"
3
- short_description: "Monitor and fix failing PR CI checks"
4
- default_prompt: "Use $babysit-pr to diagnose failing GitHub Actions checks on a zenuml-core PR, fix what is actionable, push updates, and watch CI until it is green."
5
-
6
- policy:
7
- allow_implicit_invocation: true
@@ -1,139 +0,0 @@
1
- ---
2
- name: dia-scoring
3
- description: Score HTML-vs-SVG diagram parity in compare-case pages, including message labels, fragment labels, sequence numbers, arrows, participant headers, icons, stereotypes, participant colors, participant groups, comments, and residual diff scopes. Use Playwright for page inspection and semantic attribution.
4
- ---
5
-
6
- # Dia Scoring
7
-
8
- Use this skill when the task is to measure **message labels, fragment labels, sequence numbers, message arrows, participant labels, participant boxes, participant icons, stereotypes, participant colors, participant groups, inline comments, and residual diff hotspots** between the HTML renderer and the native SVG renderer on `compare-case.html`.
9
-
10
- ## Diff Source of Truth
11
-
12
- The `native-diff-ext` Chrome extension is the absolute source of truth for pixel diff. The analyzer script (`scripts/analyze-compare-case.mjs`) uses the same CDP screenshot capture method and the same diff algorithm (`cy/diff-algorithm.js`), producing identical results when run against the same viewport.
13
-
14
- - Use the **analyzer script** as the primary scoring tool (automated, reproducible, CLI-driven)
15
- - Use the **extension** for live interactive inspection in the browser
16
- - Both use CDP `Page.captureScreenshot` with `DOM.getBoxModel` border-box clip
17
- - When calibrating the skill, verify against the extension's live `#diff-panel canvas`
18
-
19
- The workflow:
20
-
21
- 1. Run `node scripts/analyze-compare-case.mjs --case <name> --json` for structured data.
22
- 2. Use `--output-dir <dir>` when you need saved `html.png`, `svg.png`, `diff.png`, and `report.json`.
23
- 3. For live browser inspection, navigate to `http://localhost:8080/e2e/tools/compare-case.html?case=<name>` and use the extension's `#diff-panel canvas`.
24
- 4. Use Playwright page inspection for semantic attribution (element positions, font metrics, DOM structure).
25
-
26
- ## Offset Anchor
27
-
28
- All reported offsets must use the **outermost frame's top-left corner** as the anchor.
29
-
30
- - HTML anchor: the compare-case HTML frame root
31
- - SVG anchor: the compare-case SVG root / outer frame root
32
- - Do not report alternate offset systems
33
- - Do not anchor offsets to participant boxes, label boxes, stereotype boxes, or local containers
34
- - If a local-container-relative reading differs from the frame-anchor reading, prefer the frame-anchor reading in all reporting
35
-
36
- ## Browser Requirement
37
-
38
- Use **Playwright browser tools only** for browser interaction in this workflow.
39
-
40
- - Preferred tools: `browser_navigate`, `browser_snapshot`, `browser_evaluate`, `browser_take_screenshot`, `browser_click`, `browser_wait_for`
41
- - Do not use Chrome DevTools browser tools for scoring, DOM inspection, screenshot capture, or residual validation
42
- - Do not build your own pixel diff from HTML/SVG screenshots. For pixel comparison, use only the extension-rendered `#diff-panel canvas`
43
-
44
- ## Rules
45
-
46
- - Do not use `html-to-image` for capture.
47
- - Use browser-native screenshots only.
48
- - Use Playwright for browser-native screenshots and page inspection.
49
- - All offset calculations must be anchored to the outermost frame's top-left corner.
50
- - When recalibrating the skill itself, verify against the extension's live `#diff-panel canvas`.
51
- - Do not use Chrome DevTools browser tools for this workflow.
52
- - Scope:
53
- - normal messages
54
- - self messages
55
- - returns
56
- - creation messages (e.g., `«payload»`, `new Order()`)
57
- - fragment conditions such as `[cond]`, `[else]`
58
- - fragment section labels such as `catch`, `finally`
59
- - participant label text and participant box geometry
60
- - participant icons (actor, database, ec2, lambda, azurefunction, sqs, sns, iam, boundary, control, entity)
61
- - participant stereotypes such as `«BFF»`, `«Interface»`
62
- - participant background colors (`#FFEBE6`, `#0747A6`, etc.) and computed text contrast
63
- - participant groups (dashed outline containers with title bar)
64
- - inline comments (`// text`) above messages and fragments, including styled comments (`// [red] text`)
65
- - residual `html-only` and `svg-only` diff clusters scoped back to nearby elements
66
- - For each supported message, include:
67
- - label text
68
- - fragment condition / section label text when present
69
- - sequence number text, including fragment sequence numbers when present
70
- - arrow geometry keyed by sequence number
71
- - normal/return arrow endpoint deltas: `left_dx`, `right_dx`, `width_dx`
72
- - self-arrow loop geometry from the painted loop path plus arrowhead, not the outer `svg` viewport
73
- - self-arrow vertical deltas: `top_dy`, `bottom_dy`, `height_dy`
74
- - For participant icons, include:
75
- - icon presence (HTML vs SVG)
76
- - participant label text when the participant has an icon
77
- - icon position relative to participant label
78
- - icon visual match confirmation from diff image
79
- - For participant stereotypes, include:
80
- - stereotype text presence (HTML vs SVG), e.g. `«BFF»`
81
- - stereotype position relative to participant label (above label, smaller font)
82
- - stereotype offset must be measured with per-letter glyph-box comparison relative to the outermost frame anchor
83
- - do not use participant-box-relative or other local-container-relative deltas in final reporting
84
- - do not mark a stereotype as clean from glyph boxes alone; also check the live `#diff-panel canvas` in the stereotype row
85
- - if glyph-box deltas are `0/0` but the panel still shows localized red/blue pixels overlapping the stereotype glyph union, report the stereotype as `ambiguous` or `paint-level residual`, not clean
86
- - stereotype text color matching participant background contrast
87
- - For participant colors, include:
88
- - background fill color (hex value) on participant rect
89
- - text color contrast (dark text on light bg, white text on dark bg)
90
- - color application to both top and bottom participant boxes
91
- - For participant groups, include:
92
- - group name text presence and position (centered title bar)
93
- - dashed outline rect enclosing grouped participants
94
- - group bounds: leftmost to rightmost participant with margin
95
- - group height extending to diagram bottom
96
- - For inline comments, include:
97
- - comment text presence and position (above the associated statement)
98
- - comment Y offset from the message/fragment it belongs to
99
- - fragment-level comments (e.g. `// comment 4` before `if(...)`) positioned above fragment header
100
- - when all letters are `ambiguous` due to large positional offset (e.g. fragment comments at wrong X), the analyzer reports `box_dx` / `box_dy` from the bounding boxes instead of suppressing the measurement
101
- - styled comment color application (e.g. `// [red] text`)
102
- - For participant boxes, use the analyzer script output directly:
103
- - Report `html_box`, `svg_box`, `dx`, `dy`, `dw`, `dh` from the script's `participant_boxes` section
104
- - The script already applies stroke correction (`strokedElementOuterRect`) — do not re-measure with `browser_evaluate`
105
- - For residual scopes, include:
106
- - connected `html-only` and `svg-only` diff clusters from `#diff-panel canvas`
107
- - cluster `size`, `bbox`, and `centroid`
108
- - nearest scoped HTML and SVG targets at that position
109
- - summaries that explain which element a remaining positional diff most likely belongs to
110
- - live native diff panel confirmation before claiming a hotspot is real
111
- - the largest confirmed live-panel `html-only` and `svg-only` clusters with approximate positions
112
- - grouped summaries of where the panel's red and blue pixels are concentrated
113
- - Do not report a residual hotspot as real if it is absent from the live `#diff-panel canvas`.
114
- - Do not stop at totals like `HTML-only (44)` or `SVG-only (55)` when residuals matter; report where those pixels are.
115
- - Each reported letter must be backed by:
116
- - direct HTML-vs-SVG browser layout positions
117
- - pixel-panel confirmation from `#diff-panel canvas`
118
- - Participant stereotypes are first-class targets, not just part of `participant-box` or `participant-label`.
119
- - If the evidence is weak or contradictory, keep the letter `ambiguous`.
120
-
121
- ## Known Analyzer Internals
122
-
123
- ### Arrow pairing by sequence number
124
-
125
- The analyzer pairs arrows by sequence number (`text` field), not by label text (`pairText`). Calibrated on `repro-creation-return-arrow` (2026-03-24).
126
-
127
- ## Commands
128
-
129
- Run from [../..](../..):
130
-
131
- ```bash
132
- node scripts/analyze-compare-case.mjs --case async-2a
133
- node scripts/analyze-compare-case.mjs --case async-2a --json
134
- node scripts/analyze-compare-case.mjs --case async-2a --output-dir tmp/message-elements/async-2a
135
- ```
136
-
137
- ## References
138
-
139
- - Selector and pairing details: [references/selectors-and-keys.md](references/selectors-and-keys.md)
@@ -1,7 +0,0 @@
1
- interface:
2
- display_name: "Dia Scoring"
3
- short_description: "Diagram label, number, and arrow offsets"
4
- default_prompt: "Use $dia-scoring to measure message label, sequence-number, and arrow parity for a compare-case page."
5
-
6
- policy:
7
- allow_implicit_invocation: true