@zenuml/core 3.47.1 → 3.47.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 (30) hide show
  1. package/.agents/skills/babysit-pr/SKILL.md +223 -0
  2. package/.agents/skills/babysit-pr/agents/openai.yaml +7 -0
  3. package/.agents/skills/dia-scoring/SKILL.md +139 -0
  4. package/.agents/skills/dia-scoring/agents/openai.yaml +7 -0
  5. package/.agents/skills/dia-scoring/references/selectors-and-keys.md +253 -0
  6. package/.agents/skills/land-pr/SKILL.md +120 -0
  7. package/.agents/skills/propagate-core-release/SKILL.md +205 -0
  8. package/.agents/skills/propagate-core-release/agents/openai.yaml +7 -0
  9. package/.agents/skills/propagate-core-release/references/downstreams.md +42 -0
  10. package/.agents/skills/ship-branch/SKILL.md +105 -0
  11. package/.agents/skills/submit-branch/SKILL.md +76 -0
  12. package/.agents/skills/validate-branch/SKILL.md +72 -0
  13. package/.claude/skills/emoji-eval/SKILL.md +187 -0
  14. package/.claude/skills/propagate-core-release/SKILL.md +81 -76
  15. package/.claude/skills/propagate-core-release/agents/openai.yaml +2 -2
  16. package/AGENTS.md +1 -1
  17. package/dist/stats.html +1 -1
  18. package/dist/zenuml.esm.mjs +16092 -15337
  19. package/dist/zenuml.js +540 -535
  20. package/docs/superpowers/plans/2026-03-30-emoji-support.md +1220 -0
  21. package/docs/superpowers/plans/2026-03-30-self-correcting-scoring.md +206 -0
  22. package/e2e/data/compare-cases.js +233 -0
  23. package/e2e/tools/compare-case.html +16 -2
  24. package/package.json +3 -3
  25. package/playwright.config.ts +1 -1
  26. package/scripts/analyze-compare-case/collect-data.mjs +139 -16
  27. package/scripts/analyze-compare-case/config.mjs +1 -1
  28. package/scripts/analyze-compare-case/report.mjs +3 -0
  29. package/scripts/analyze-compare-case/residual-scopes.mjs +23 -1
  30. package/scripts/analyze-compare-case/scoring.mjs +1 -0
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: land-pr
3
+ description: Merge a green PR and verify the npm release succeeds. Use when the user says "merge", "land", "land PR", "merge this", "ship to npm", "merge and release", or when a PR has passed CI and is ready to merge. This is a high-stakes action — merging to main triggers an automatic npm publish, so this skill verifies everything before and after merge.
4
+ ---
5
+
6
+ # Land PR
7
+
8
+ Merge a green PR to `main` and verify the npm release. In this repo, **merge = release** — every merge to main triggers automatic npm publish via GitHub Actions. Treat this as a production deployment, not a casual merge.
9
+
10
+ ## Preconditions
11
+
12
+ Before merging, verify ALL of these:
13
+
14
+ 1. **All CI checks green** — no pending or failed checks
15
+ 2. **No pending reviews** — no requested changes outstanding
16
+ 3. **Branch is up to date** — no merge conflicts with main
17
+ 4. **PR is the right one** — confirm PR number with the user if ambiguous
18
+
19
+ ```bash
20
+ gh pr view <PR_NUMBER> --json state,mergeable,statusCheckRollup,reviewDecision
21
+ ```
22
+
23
+ If any precondition fails, report which one and stop. Do not attempt to fix — that's `babysit-pr`'s job.
24
+
25
+ ## Steps
26
+
27
+ ### 1. Verify readiness
28
+
29
+ Run the precondition checks above. If anything is not green, stop and report.
30
+
31
+ ### 2. Decide merge strategy
32
+
33
+ Inspect the branch's commit history to decide between squash and merge:
34
+
35
+ ```bash
36
+ git log main..HEAD --oneline
37
+ ```
38
+
39
+ **Auto-squash if ANY of these are true:**
40
+ - Only 1 commit on the branch
41
+ - Commit messages contain noise patterns: "wip", "fixup", "temp", "oops", "try again", "fix lint", "fix test", duplicate messages
42
+ - More than half the commits have the same or very similar messages
43
+
44
+ **Merge (preserve commits) if ALL of these are true:**
45
+ - 2+ commits with distinct, meaningful messages
46
+ - Each commit describes a self-contained step (not just iterations on the same change)
47
+ - Commits follow a logical progression (e.g., "add X" → "refactor Y" → "delete Z")
48
+
49
+ Announce the decision and why: "Squashing — 3 of 5 commits are fixups" or "Merging — 8 clean commits with distinct steps".
50
+
51
+ ### 3. Execute merge
52
+
53
+ ```bash
54
+ # If squash:
55
+ gh pr merge <PR_NUMBER> --squash --auto
56
+
57
+ # If merge:
58
+ gh pr merge <PR_NUMBER> --merge --auto
59
+ ```
60
+
61
+ Using `--auto` arms auto-merge so GitHub merges when all checks pass. If checks are already green, it merges immediately.
62
+
63
+ ### 4. Wait for merge
64
+
65
+ If auto-merge was armed, wait for it:
66
+
67
+ ```bash
68
+ gh pr view <PR_NUMBER> --json state
69
+ ```
70
+
71
+ Poll until state is `MERGED`. Timeout after 5 minutes — if not merged by then, report and stop.
72
+
73
+ ### 5. Monitor npm publish
74
+
75
+ After merge, the `Build, Test, npm Publish, and Deploy` workflow runs on `main`. Watch it:
76
+
77
+ ```bash
78
+ gh run list --repo mermaid-js/zenuml-core --branch main --limit 1 --json databaseId,status,conclusion
79
+ ```
80
+
81
+ Wait for the run to complete:
82
+
83
+ ```bash
84
+ gh run watch <RUN_ID> --repo mermaid-js/zenuml-core
85
+ ```
86
+
87
+ ### 6. Verify npm publish
88
+
89
+ Check that the new version appeared on npm:
90
+
91
+ ```bash
92
+ npm view @zenuml/core version
93
+ ```
94
+
95
+ Compare with the version before merge. If it didn't bump, check the `npm-publish` job logs for errors.
96
+
97
+ ## Output
98
+
99
+ Report one of:
100
+
101
+ - **LANDED** — merged, published to npm as `@zenuml/core@<version>`
102
+ - **MERGE BLOCKED** — which precondition failed
103
+ - **PUBLISH FAILED** — merged but npm publish failed, with error details
104
+
105
+ ## On publish failure
106
+
107
+ **Do NOT auto-rollback.** A failed npm publish after merge is a serious situation that needs human judgment. Report:
108
+
109
+ 1. The merge commit SHA
110
+ 2. The failing workflow run URL
111
+ 3. The npm-publish job error output
112
+ 4. Whether the version was partially published
113
+
114
+ The user decides whether to hotfix, revert, or investigate.
115
+
116
+ ## Does NOT
117
+
118
+ - Fix CI (use `/babysit-pr`)
119
+ - Create PRs (use `/submit-branch`)
120
+ - Run local tests (use `/validate-branch`)
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: propagate-core-release
3
+ description: Propagate a published `@zenuml/core` release by opening or reusing per-repo downstream issues with explicit rollout instructions. Use when the user says "push core to downstreams", "update downstream projects", "propagate release", "open downstream issues", "file rollout issues", or wants the newly published zenuml/core version handed off across mermaid, mermaid live editor, web-sequence, the IntelliJ plugin, confluence-plugin-cloud, and diagramly.ai.
4
+ ---
5
+
6
+ # Propagate Core Release
7
+
8
+ Coordinate downstream consumers after `@zenuml/core` has already been published. This skill creates or reuses per-repo GitHub issues with clear implementation instructions for each downstream team. It does not edit downstream repos or open PRs on their behalf.
9
+
10
+ ## Scope
11
+
12
+ This skill is for the post-publish propagation step only.
13
+
14
+ It should:
15
+
16
+ 1. identify the published `@zenuml/core` version to roll out
17
+ 2. inspect each downstream repo's update conventions from [references/downstreams.md](references/downstreams.md)
18
+ 3. create or reuse one downstream issue per repo for that version
19
+ 4. include explicit repo-specific instructions in each issue body
20
+ 5. summarize which repos succeeded, failed, or were skipped
21
+
22
+ It should not:
23
+
24
+ - publish `@zenuml/core`
25
+ - update downstream code directly
26
+ - create downstream branches or PRs
27
+ - auto-fix unrelated downstream test failures or implementation details
28
+
29
+ Renderer integration rule:
30
+
31
+ - Only `mermaid-js/mermaid` and `mermaid-js/mermaid-live-editor` should be treated as SVG-renderer integration work for `@zenuml/core` API changes.
32
+ - All other downstreams remain HTML-renderer consumers. Do not migrate them to `renderToSvg` or other SVG-renderer APIs during propagation.
33
+
34
+ ## Downstream Repos
35
+
36
+ Read [references/downstreams.md](references/downstreams.md) before starting. It contains the canonical downstream repo list, repo slug assumptions, and repo-specific update commands that must be copied into the issue instructions.
37
+
38
+ ## Preconditions
39
+
40
+ Before starting:
41
+
42
+ - confirm the target `@zenuml/core` version is already published
43
+ - confirm `gh auth status` is healthy for all target orgs and repos where issues will be filed
44
+ - if the user did not specify the target version, discover the latest published one first
45
+
46
+ If the published version is ambiguous, stop and ask.
47
+
48
+ ## Batch Strategy
49
+
50
+ Treat each downstream repo as an independent unit of work.
51
+
52
+ - Continue processing the remaining repos if one repo fails.
53
+ - Keep a per-repo status ledger as you go: `issue-opened`, `issue-reused`, `already-tracked`, `blocked`, `failed`.
54
+ - Prefer deterministic, reusable issue text.
55
+ - Check for same-version issues before creating anything new.
56
+ - Reuse an existing open issue when it already targets the same core version.
57
+ - If the same version already has a closed issue, treat it as `already-tracked` and report it instead of opening a duplicate unless the user explicitly asks to reopen or replace it.
58
+
59
+ ## Issue Rules
60
+
61
+ Each downstream repo should get at most one open issue per core version.
62
+
63
+ Before creating a new issue, search that repo for issues matching the target version in the title or body. Prefer exact matches on `@zenuml/core v<version>`.
64
+
65
+ Use a consistent title pattern:
66
+
67
+ ```text
68
+ chore: roll out @zenuml/core v<version>
69
+ ```
70
+
71
+ Use a clear body with actionable instructions:
72
+
73
+ ```markdown
74
+ ## Summary
75
+ - `@zenuml/core` `v<version>` has been published
76
+ - this repo needs to adopt that release
77
+
78
+ ## Required Work
79
+ 1. Run: `<update-command>`
80
+ 2. Run: `<lockfile-refresh-command>` and include the lockfile in the PR when applicable
81
+ 3. Run: `<verify-command>` when applicable
82
+ 4. Keep the diff scoped to the core upgrade and any required integration fix
83
+ 5. Open a downstream PR that links back to this issue
84
+
85
+ ## Repo-Specific Notes
86
+ - <repo-specific note 1>
87
+ - <repo-specific note 2>
88
+
89
+ ## Acceptance Criteria
90
+ - repo is updated to `@zenuml/core` `v<version>` or the equivalent vendored build output
91
+ - lockfile is refreshed when the repo uses one
92
+ - verification command passes locally, or failure details are documented in the PR
93
+ - no unrelated dependency or renderer migrations are mixed into the change
94
+ ```
95
+
96
+ If an issue already exists for the same target version, do not create a duplicate. Reuse the open one, or report the closed one as already tracked.
97
+
98
+ ## Workflow
99
+
100
+ ### Step 1: Resolve target version
101
+
102
+ Determine the `@zenuml/core` version to propagate.
103
+
104
+ - If the user supplied a version, use it.
105
+ - Otherwise, query npm or the release source of truth and resolve the latest published version.
106
+
107
+ Record:
108
+
109
+ - target version
110
+ - source used to resolve it
111
+
112
+ ### Step 2: Process each downstream repo
113
+
114
+ For each repo in [references/downstreams.md](references/downstreams.md):
115
+
116
+ 1. Read the repo row carefully and extract the update command, verification command, and notes.
117
+ 2. Search for existing issues in that repo for the same core version, checking both open and closed issues.
118
+ 3. If an open match exists, reuse it and record the URL.
119
+ 4. If only a closed match exists, record it as `already-tracked` and do not create a duplicate unless the user explicitly asked for that.
120
+ 5. Otherwise create a new issue using the standard title and a repo-specific body.
121
+ 6. Make sure the issue body includes:
122
+ - the target core version
123
+ - the exact update command from the table
124
+ - the lockfile refresh command when the repo uses pnpm or yarn
125
+ - the exact verify command when one is defined
126
+ - the renderer and API caveats from the repo notes
127
+ - an explicit instruction to open a PR linked to the issue after the work is complete
128
+ - a version marker that makes future deduplication easy, such as `Core version: v<version>`
129
+
130
+ ### Step 3: Handle repo-specific blockers
131
+
132
+ If a repo fails, capture exactly why:
133
+
134
+ - missing issue creation permissions
135
+ - existing issue search is ambiguous
136
+ - existing closed issue should be reopened but the policy is unclear
137
+ - dependency location unclear
138
+ - package manager or package filter is unclear
139
+ - repo notes are insufficient to write a safe instruction
140
+ - issue creation failed
141
+
142
+ Do not let one repo failure stop the rest of the batch.
143
+
144
+ ### Step 4: Summarize the rollout
145
+
146
+ At the end, produce a per-repo summary with:
147
+
148
+ - repo
149
+ - issue URL or matched prior issue URL
150
+ - final status
151
+ - blocker if any
152
+
153
+ ## Repo Issue Guidance
154
+
155
+ Each downstream has specific update and verification commands documented in [references/downstreams.md](references/downstreams.md). Follow the table exactly when drafting instructions. Do not guess package managers, package filters, or update commands.
156
+
157
+ For each repo:
158
+
159
+ 1. Include the **Update Command** from the table verbatim
160
+ 2. Include the lockfile refresh step:
161
+ - `pnpm install` for pnpm repos
162
+ - `yarn install` for yarn repos
163
+ 3. Include the **Verify Command** from the table verbatim when one exists
164
+ 4. Tell the downstream team to keep the change scoped to the core upgrade and any required integration fix
165
+ 5. Tell the downstream team to open a PR after verification and link it back to the issue
166
+
167
+ Special handling for renderer API changes:
168
+
169
+ - `mermaid-js/mermaid` is the direct `@zenuml/core` SVG-renderer integration. When core export APIs change, it may require code updates in `packages/mermaid-zenuml`, not just a dependency bump.
170
+ - `mermaid-js/mermaid-live-editor` is an indirect SVG-renderer consumer through `@mermaid-js/mermaid-zenuml`. Do not add `@zenuml/core` directly there just to follow a core release.
171
+ - `web-sequence`, `confluence-plugin-cloud`, `diagramly.ai`, and similar downstreams stay on the HTML-renderer path unless the user explicitly asks for a renderer migration.
172
+
173
+ Prefer the smallest downstream task description that updates the repo safely:
174
+
175
+ - package dependency bumps
176
+ - lockfile refreshes
177
+ - vendored asset refreshes only when the repo actually vendors core output, such as `jetbrains-zenuml`
178
+
179
+ Do not ask downstream teams to opportunistically clean up unrelated code while doing the upgrade.
180
+
181
+ If a downstream repo needs custom update logic that is not obvious from the table or its notes, stop on that repo and report the ambiguity instead of inventing instructions.
182
+
183
+ ## Safety
184
+
185
+ - Never update downstream repos directly from this skill.
186
+ - Never merge downstream PRs from this skill.
187
+ - Never batch all downstream repos into one issue.
188
+ - Never file duplicate issues for the same repo and core version.
189
+ - Never hide per-repo failures behind a single "batch failed" message.
190
+ - Never ask downstream teams to update unrelated dependencies in the same PR.
191
+
192
+ ## Output
193
+
194
+ Final report format:
195
+
196
+ ```markdown
197
+ ## Downstream Propagation Report
198
+ - Core version: `v<version>`
199
+ - Overall: <N> succeeded, <N> reused, <N> skipped, <N> failed
200
+
201
+ ### Repo Results
202
+ - `<repo>`: issue opened | issue reused | already tracked | failed
203
+ issue: <url or none>
204
+ notes: <short reason or blocker>
205
+ ```
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "Propagate Core Release"
3
+ short_description: "Open downstream rollout issues for a published core version"
4
+ default_prompt: "Use $propagate-core-release after @zenuml/core has been published to open or reuse per-repo downstream issues with explicit rollout instructions. Do not update downstream repos directly and do not open PRs on their behalf."
5
+
6
+ policy:
7
+ allow_implicit_invocation: true
@@ -0,0 +1,42 @@
1
+ # Downstream Repos
2
+
3
+ Canonical downstream targets for filing rollout issues after a published `@zenuml/core` release.
4
+
5
+ ## Repo Table
6
+
7
+ | Repo | Local Path | Pkg Manager | Update Command | Verify Command | Notes |
8
+ |------|-----------|-------------|----------------|----------------|-------|
9
+ | `mermaid-js/mermaid` | `~/workspaces/zenuml/native-svg-renderer/mermaid` | pnpm | `pnpm --filter @mermaid-js/mermaid-zenuml update @zenuml/core` | `pnpm build` | Direct SVG-renderer integration. Only touch `packages/mermaid-zenuml`; export API changes may require source edits in addition to the version bump. |
10
+ | `mermaid-js/mermaid-live-editor` | clone if missing | pnpm | `pnpm update @mermaid-js/mermaid-zenuml` | `pnpm build` | Indirect SVG-renderer consumer via `@mermaid-js/mermaid-zenuml`. Do not add `@zenuml/core` directly here. |
11
+ | `ZenUml/web-sequence` | `~/workspaces/zenuml/web-sequence` | yarn | `yarn upgrade @zenuml/core` | `yarn build` | HTML-renderer consumer. Do not migrate to SVG-renderer APIs during routine propagation. |
12
+ | `ZenUml/confluence-plugin-cloud` | `~/workspaces/zenuml/confluence-plugin-cloud` | pnpm | `pnpm update @zenuml/core` | `pnpm build:full` | HTML-renderer consumer. Do not migrate to SVG-renderer APIs during routine propagation. |
13
+ | `ZenUml/diagramly.ai` | `~/workspaces/diagramly/diagramly.ai` | pnpm | `pnpm update @zenuml/core --filter <pkg>` | `pnpm build` | HTML-renderer consumer. Do not migrate to SVG-renderer APIs during routine propagation. |
14
+ | `ZenUml/codemirror-extensions` | `~/workspaces/zenuml/codemirror-extensions` | pnpm | `pnpm update @zenuml/core` | `pnpm build` | CodeMirror language extensions for ZenUML DSL. HTML-renderer consumer. |
15
+ | `ZenUml/jetbrains-zenuml` | `~/workspaces/zenuml/jetbrains-zenuml` | — | See notes | — | **Not an npm consumer.** Vendors a built JS bundle. Update by copying the new `dist/` output from core's build. Skip if unsure and report. |
16
+
17
+ ## Issue Authoring Guidance
18
+
19
+ When writing a downstream issue for an npm consumer, explicitly include the lockfile refresh step:
20
+
21
+ - **pnpm**: `pnpm install` (updates `pnpm-lock.yaml`)
22
+ - **yarn**: `yarn install` (updates `yarn.lock`)
23
+
24
+ Tell the downstream team to include the updated lockfile in the PR. A PR without an updated lockfile will usually fail CI.
25
+
26
+ ## Local Checkout Usage
27
+
28
+ Local checkouts are optional for this skill. Use them only if you need extra context to clarify the issue body safely. Do not clone repos just to file the issue.
29
+
30
+ If you do need a checkout and the local path does not exist:
31
+
32
+ ```bash
33
+ gh repo clone <repo-slug> <local-path>
34
+ ```
35
+
36
+ ## General Rules
37
+
38
+ - Each repo gets its own rollout issue.
39
+ - Reuse an existing open issue when it already targets the same core version.
40
+ - `mermaid-js/mermaid` and `mermaid-js/mermaid-live-editor` are under the `mermaid-js` GitHub org (not `ZenUml`).
41
+ - Only `mermaid-js/mermaid` and `mermaid-js/mermaid-live-editor` should receive SVG-renderer integration changes tied to core API/export changes.
42
+ - Treat all other downstreams as HTML-renderer consumers unless the user explicitly asks for a renderer migration.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: ship-branch
3
+ description: Ship the current branch from local validation through to npm release. Orchestrates validate-branch, submit-branch, babysit-pr, and land-pr in sequence. Use when the user says "ship", "ship it", "ship this branch", "ship to production", "release this", "get this to npm", or wants to go from local branch to published npm package in one command. Stops at the first failure with a clear report.
4
+ ---
5
+
6
+ # Ship Branch
7
+
8
+ Orchestrate the full path from local branch to npm release. This skill composes four sub-skills in sequence, stopping at the first failure.
9
+
10
+ ## Flow
11
+
12
+ ```
13
+ rebase on origin/main → CONFLICT → stop, report
14
+ | CLEAN
15
+ validate-branch → FAIL → stop, report
16
+ | PASS
17
+ submit-branch → FAIL → stop, report
18
+ | PR ready
19
+ babysit-pr → EXHAUSTED → stop, "CI blocked"
20
+ | GREEN
21
+ land-pr → BLOCKED → stop, report
22
+ | MERGED
23
+ land-pr → PUBLISH FAIL → alert, stop
24
+ | PUBLISHED
25
+ done
26
+ ```
27
+
28
+ ## Steps
29
+
30
+ ### Step 0: Rebase on remote main
31
+
32
+ Fetch and rebase onto `origin/main` to ensure the branch is up to date before validating.
33
+
34
+ ```bash
35
+ git fetch origin main
36
+ git rebase origin/main
37
+ ```
38
+
39
+ If the rebase has conflicts, stop immediately and report. The developer must resolve conflicts manually before shipping.
40
+
41
+ ### Step 1: Validate locally
42
+
43
+ Invoke `/validate-branch`. If it reports FAIL, stop and show the failure. The developer needs to fix locally before shipping.
44
+
45
+ ### Step 2: Submit as PR
46
+
47
+ Invoke `/submit-branch`. If it reports FAILED, stop and show what went wrong (dirty worktree, push conflict, etc.).
48
+
49
+ On success, note the PR number and URL.
50
+
51
+ ### Step 3: Get CI green
52
+
53
+ Invoke `/babysit-pr` with the PR number from Step 2. If it exhausts all 3 retry attempts, stop and report "CI blocked" with the babysit report.
54
+
55
+ On success, the PR is green and ready to merge.
56
+
57
+ ### Step 4: Land and verify release
58
+
59
+ Merging to main triggers an npm publish — this is irreversible. To prevent the orchestrator from skipping the land-pr skill's merge strategy logic (which has happened before), **spawn an Agent** for this step:
60
+
61
+ ```
62
+ Spawn an Agent with this prompt:
63
+ "Use the Skill tool to invoke the land-pr skill, then follow it to land PR #<PR_NUMBER>
64
+ on mermaid-js/zenuml-core. Follow every step including the merge strategy evaluation.
65
+ Report back the merge SHA and npm version, or the reason it was blocked."
66
+ ```
67
+
68
+ Replace `<PR_NUMBER>` with the actual PR number from Step 2.
69
+
70
+ Do NOT run `gh pr merge` directly from the main conversation — the land-pr skill contains merge strategy decision logic that must be evaluated by the Agent.
71
+
72
+ If merge succeeds but npm publish fails, alert immediately with the failure details. Do NOT auto-rollback.
73
+
74
+ On full success, report the new npm version.
75
+
76
+ ## Rules
77
+
78
+ - **Each step is a hard boundary.** No step reaches back to retry a previous step.
79
+ - **No auto-rollback.** Stop and report on any failure. The developer decides next steps.
80
+ - **Only this skill calls babysit-pr.** Sub-skills never cross-call each other.
81
+ - **Confirm before merge.** Since merge = npm release, pause and confirm with the user before Step 4 unless they explicitly said "ship it" (indicating full automation is intended).
82
+
83
+ ## Output
84
+
85
+ Final report:
86
+
87
+ ```
88
+ ## Ship Report: <branch-name>
89
+ - Validation: PASS
90
+ - PR: #<number> (<url>)
91
+ - CI: GREEN (attempt <N>)
92
+ - Merge: <SQUASHED|MERGED> into main (<sha>)
93
+ - npm: @zenuml/core@<version> published
94
+ ```
95
+
96
+ Or on failure:
97
+
98
+ ```
99
+ ## Ship Report: <branch-name>
100
+ - Validation: PASS
101
+ - PR: #<number>
102
+ - CI: BLOCKED after 3 attempts
103
+ - Stopped at: babysit-pr
104
+ - Details: <failure summary>
105
+ ```
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: submit-branch
3
+ description: Push the current branch and create or reuse a PR on mermaid-js/zenuml-core. Use when the user says "submit", "create PR", "push and PR", "open a pull request", "submit branch", or wants to publish their work as a PR without merging. Does not fix CI or merge — those are separate skills.
4
+ ---
5
+
6
+ # Submit Branch
7
+
8
+ Publish the current branch as a pull request on `mermaid-js/zenuml-core`. Reuses an existing PR if one already exists for this branch.
9
+
10
+ ## Preconditions
11
+
12
+ The worktree must be in a committable state:
13
+
14
+ - **Clean worktree** — nothing to commit, just push. This is the ideal case.
15
+ - **Scoped changes** — all modified files relate to the current work. Stage and commit them.
16
+ - **Mixed/unrelated changes** — modified files include unrelated work. **Stop and ask the user** which files to include. Never auto-commit a mixed worktree.
17
+
18
+ To check: `git status` and review the file list. If in doubt, ask.
19
+
20
+ ## Steps
21
+
22
+ ### 1. Check worktree state
23
+
24
+ ```bash
25
+ git status
26
+ ```
27
+
28
+ If dirty, evaluate whether changes are scoped (all related to the branch's purpose) or mixed. If mixed, stop and ask.
29
+
30
+ If scoped, stage the relevant files and commit with a descriptive message. Follow the repo's commit conventions (one-line message, Co-Authored-By trailer).
31
+
32
+ ### 2. Push
33
+
34
+ ```bash
35
+ git push -u origin <branch-name>
36
+ ```
37
+
38
+ Use regular push — never force-push. If push fails due to upstream changes, report the conflict and stop.
39
+
40
+ ### 3. Create or reuse PR
41
+
42
+ Check if a PR already exists:
43
+
44
+ ```bash
45
+ gh pr view --json number,title,url 2>/dev/null
46
+ ```
47
+
48
+ If a PR exists, report its URL and stop — nothing more to do.
49
+
50
+ If no PR exists, create one:
51
+
52
+ ```bash
53
+ gh pr create --title "<concise title>" --body "$(cat <<'EOF'
54
+ ## Summary
55
+ <bullet points>
56
+
57
+ ## Test plan
58
+ <what was tested>
59
+ EOF
60
+ )"
61
+ ```
62
+
63
+ The PR targets `main` on `mermaid-js/zenuml-core`.
64
+
65
+ ## Output
66
+
67
+ Report:
68
+
69
+ - **SUBMITTED** — PR number, URL, and branch name
70
+ - **FAILED** — what went wrong (dirty worktree, push conflict, gh error)
71
+
72
+ ## Does NOT
73
+
74
+ - Run tests or lint (use `/validate-branch` for that)
75
+ - Fix CI failures (use `/babysit-pr` for that)
76
+ - Merge the PR (use `/land-pr` for that)
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: validate-branch
3
+ description: Run local validation checks on the current branch before shipping. Use when the user says "validate", "check branch", "am I good", "run tests", "preflight", "is this ready", or wants to verify their branch passes all checks before pushing or creating a PR. Also use as a precondition check before invoking submit-branch or ship-branch.
4
+ ---
5
+
6
+ # Validate Branch
7
+
8
+ Verify the current branch passes all local checks. This is the "am I good?" skill — run it anytime before shipping, or just to check your work.
9
+
10
+ ## Why this order matters
11
+
12
+ Checks run fastest-first so you get feedback quickly. Lint catches syntax issues in seconds. Unit tests catch logic errors in a few seconds. Playwright E2E is slowest (~1-2 min) and catches integration regressions. No point waiting for E2E if lint fails.
13
+
14
+ ## Steps
15
+
16
+ Run from the `zenuml-core` directory. Stop on first failure.
17
+
18
+ ### 1. Lint
19
+
20
+ ```bash
21
+ bun eslint
22
+ ```
23
+
24
+ If lint fails, report the errors and stop. These are usually quick fixes.
25
+
26
+ ### 2. Unit tests
27
+
28
+ ```bash
29
+ bun run test
30
+ ```
31
+
32
+ Do NOT use `bun test` — it picks up Playwright files and gives false failures. If tests fail, report the failing test names and stop.
33
+
34
+ ### 3. Playwright E2E
35
+
36
+ Before running Playwright, make sure port `8080` is either free or owned by a dev server started from **this repo**. `playwright.config.ts` uses `reuseExistingServer`, so an unrelated Vite server on `8080` will cause false results.
37
+
38
+ ```bash
39
+ PORT="${PORT:-8080}"
40
+ THIS_REPO="$(pwd -P)"
41
+ LISTENER_PID="$(lsof -tiTCP:${PORT} -sTCP:LISTEN 2>/dev/null | head -n1 || true)"
42
+
43
+ if [ -n "$LISTENER_PID" ]; then
44
+ LISTENER_CMD="$(ps -p "$LISTENER_PID" -o command=)"
45
+ if [[ "$LISTENER_CMD" != *"$THIS_REPO"* ]]; then
46
+ echo "Port ${PORT} is owned by another repo; killing PID ${LISTENER_PID}"
47
+ kill "$LISTENER_PID"
48
+ fi
49
+ fi
50
+ ```
51
+
52
+ If you killed a different repo's server, do **not** start Vite manually. `bun pw` will launch the correct dev server from this folder via Playwright's `webServer` config.
53
+
54
+ ```bash
55
+ bun pw
56
+ ```
57
+
58
+ If snapshot tests fail, check whether the changes are intentional (rendering code changed) or unexpected. Report which snapshots failed.
59
+
60
+ ## Output
61
+
62
+ Report one of:
63
+
64
+ - **PASS** — all 3 checks passed, branch is ready
65
+ - **FAIL** — which check failed, the error output, and a one-line suggestion
66
+
67
+ ## Gotchas
68
+
69
+ - `bun run test` not `bun test` — critical difference, the latter runs E2E too
70
+ - Playwright needs browsers installed (`bun pw:install` if missing)
71
+ - Before `bun pw`, verify any existing `8080` listener belongs to this repo; otherwise kill it and let Playwright start the right server
72
+ - HTML Playwright snapshot failures are a hard stop — never update HTML snapshots without understanding why they changed