Harden pr-description-skill mermaid conventions (diagram-type-by-intent + GH-renderer gotchas)#984
Conversation
Add assets/mermaid-conventions.md with diagram-type-by-intent table:
- sequenceDiagram for execution flow (with rect rgb(...) boxing for new paths)
- flowchart LR for pipeline/architecture (classDef new + class N new)
- stateDiagram-v2 for state machines
- classDiagram only for true type hierarchies
Capture GitHub-renderer gotchas that mmdc does NOT always catch:
- Square brackets in flowchart edge labels MUST be quoted
("|[EXEC] x|" parses on mmdc but is rejected by GitHub)
- Inline :::cssClass on classDiagram relationship lines fails on GitHub
- stateDiagram-v2 notes require multi-line form with end note
Slim SKILL.md inline pitfall list; load-trigger to the asset.
Driven by genesis design discipline (R3 EXTRACT refactor):
- pr-description-skill diagram guidance was incomplete
(no diagram-type-by-intent mapping, missing bracket-edge-label
gotcha that bit issue #983 proposal comment).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens the pr-description-skill mermaid guidance so PR-body diagrams choose an appropriate mermaid diagram type for the reviewer’s intent and avoid known GitHub mermaid renderer pitfalls.
Changes:
- Add a new
assets/mermaid-conventions.mdreference asset with diagram-type-by-intent guidance, canonical templates, and GitHub-renderer gotchas. - Update
pr-description-skill’s checklist/validation sections to require loading the new asset before authoring diagrams and to keep the most common GitHub-renderer pitfall inline. - Add an Unreleased CHANGELOG entry describing the maintainer-tooling update.
Show a summary per file
| File | Description |
|---|---|
| CHANGELOG.md | Adds an Unreleased “Maintainer tooling” entry describing the mermaid-guidance hardening. |
| .github/skills/pr-description-skill/assets/mermaid-conventions.md | New mermaid conventions asset for PR-body diagrams (type selection, templates, GitHub-renderer gotchas). |
| .github/skills/pr-description-skill/SKILL.md | Points diagram authoring/validation steps to the new asset; keeps the bracket-in-edge-label gotcha inline. |
| .apm/skills/pr-description-skill/assets/mermaid-conventions.md | Same new asset mirrored into .apm/ source-of-truth location. |
| .apm/skills/pr-description-skill/SKILL.md | Same SKILL.md updates mirrored into .apm/. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 7
| |---|---|---| | ||
| | Which jobs / participants run, in what order? (execution flow) | `sequenceDiagram` | `rect rgb(255, 247, 200)` block around new participant interactions; `Note over X` for invariants | | ||
| | What is the data / control pipeline? (stages, transformations) | `flowchart LR` | `subgraph` per stage; `classDef new stroke-dasharray: 5 5` for new stages; class assignment via `class N1,N2 new` | | ||
| | What does the state machine look like? | `stateDiagram-v2` | `note right of S: NEW` markers on changed states | |
There was a problem hiding this comment.
The table row for stateDiagram-v2 suggests single-line note right of S: NEW markers, but this same doc later states that single-line note right of X: text is NOT supported in stateDiagram-v2. Please align the table with the multi-line note ... end note form (or adjust the later rule).
| | What does the state machine look like? | `stateDiagram-v2` | `note right of S: NEW` markers on changed states | | |
| | What does the state machine look like? | `stateDiagram-v2` | multi-line `note right of S` ... `end note` markers on changed states | |
| end | ||
| subgraph Validate[Validate] | ||
| V1[schema check] | ||
| V2[policy check]:::new |
There was a problem hiding this comment.
The flowchart template marks V2 with inline :::new, but the conventions immediately below say to avoid inline N:::new and instead use a separate class N new assignment. Please update the template to follow the documented convention (and keep only one mechanism for marking NEW nodes).
| V2[policy check]:::new | |
| V2[policy check] |
| For everything else (semicolons in classDiagram links, `note right | ||
| of` closing rules, round brackets in node labels, inline | ||
| `:::cssClass` failing in classDiagram on GitHub), see |
There was a problem hiding this comment.
This parenthetical contains inline-code spans that are split across lines (starts at `note right and ends at of` on the next line). That tends to render poorly/ambiguously in Markdown. Please keep each inline-code span on a single line (or rephrase to avoid splitting the code span).
| For everything else (semicolons in classDiagram links, `note right | |
| of` closing rules, round brackets in node labels, inline | |
| `:::cssClass` failing in classDiagram on GitHub), see | |
| For everything else (semicolons in classDiagram links, `note right of` | |
| closing rules, round brackets in node labels, inline `:::cssClass` | |
| failing in classDiagram on GitHub), see |
|
|
||
| ### Maintainer tooling | ||
|
|
||
| - `pr-description-skill` mermaid guidance hardened: new asset `assets/mermaid-conventions.md` defines diagram-type-by-intent (sequenceDiagram for execution flow with `rect rgb(...)` boxing, flowchart for pipelines/architecture with `classDef new`, stateDiagram-v2 for state machines) and captures GitHub-renderer gotchas that `mmdc` does not always catch (notably: square brackets in flowchart edge labels MUST be quoted -- `|"[label]"|` not `|[label]|`). |
There was a problem hiding this comment.
The new Unreleased changelog entry is missing the required PR reference at the end (e.g. "(#123)"). Please append this PR number (and consider shortening the line so it stays scannable, consistent with other entries).
| - `pr-description-skill` mermaid guidance hardened: new asset `assets/mermaid-conventions.md` defines diagram-type-by-intent (sequenceDiagram for execution flow with `rect rgb(...)` boxing, flowchart for pipelines/architecture with `classDef new`, stateDiagram-v2 for state machines) and captures GitHub-renderer gotchas that `mmdc` does not always catch (notably: square brackets in flowchart edge labels MUST be quoted -- `|"[label]"|` not `|[label]|`). | |
| - `pr-description-skill` mermaid guidance was hardened: new `assets/mermaid-conventions.md` maps diagram type to intent and documents GitHub renderer gotchas that `mmdc` can miss, including quoted flowchart edge labels like `|"[label]"|`. (#PR_NUMBER) |
| |---|---|---| | ||
| | Which jobs / participants run, in what order? (execution flow) | `sequenceDiagram` | `rect rgb(255, 247, 200)` block around new participant interactions; `Note over X` for invariants | | ||
| | What is the data / control pipeline? (stages, transformations) | `flowchart LR` | `subgraph` per stage; `classDef new stroke-dasharray: 5 5` for new stages; class assignment via `class N1,N2 new` | | ||
| | What does the state machine look like? | `stateDiagram-v2` | `note right of S: NEW` markers on changed states | |
There was a problem hiding this comment.
The table row for stateDiagram-v2 suggests single-line note right of S: NEW markers, but this same doc later states that single-line note right of X: text is NOT supported in stateDiagram-v2. Please align the table with the multi-line note ... end note form (or adjust the later rule).
| | What does the state machine look like? | `stateDiagram-v2` | `note right of S: NEW` markers on changed states | | |
| | What does the state machine look like? | `stateDiagram-v2` | multi-line `note right of S` ... `end note` markers on changed states | |
| end | ||
| subgraph Validate[Validate] | ||
| V1[schema check] | ||
| V2[policy check]:::new |
There was a problem hiding this comment.
The flowchart template marks V2 with inline :::new, but the conventions immediately below say to avoid inline N:::new and instead use a separate class N new assignment. Please update the template to follow the documented convention (and keep only one mechanism for marking NEW nodes).
| V2[policy check]:::new | |
| V2[policy check] |
| For everything else (semicolons in classDiagram links, `note right | ||
| of` closing rules, round brackets in node labels, inline | ||
| `:::cssClass` failing in classDiagram on GitHub), see |
There was a problem hiding this comment.
This parenthetical contains inline-code spans that are split across lines (starts at `note right and ends at of` on the next line). That tends to render poorly/ambiguously in Markdown. Please keep each inline-code span on a single line (or rephrase to avoid splitting the code span).
| For everything else (semicolons in classDiagram links, `note right | |
| of` closing rules, round brackets in node labels, inline | |
| `:::cssClass` failing in classDiagram on GitHub), see | |
| For everything else (semicolons in classDiagram links, `note right of` | |
| closing rules, round brackets in node labels, inline `:::cssClass` | |
| failing in classDiagram on GitHub), see |
Promotes [Unreleased] to [0.10.0] - 2026-04-27. Each PR since v0.9.4 gets one 'so what' line: - #926 Microsoft 365 Cowork target ships impl - #790 marketplace authoring CLI (init, package add/set, build, check, outdated, doctor, publish) -- collapsed from 20+ bullets to one - #722 marketplace plugin -> package rename + --help sectioning -- collapsed - #980 README 'Coming from npx skills add' conversion block - #981 docs auto-deploy on tag push (real fix for the #953 attempt) - #985 pr-description-skill evals suite - #984 pr-description-skill mermaid hardening - #989 cowork sys.platform mock for Windows CI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Promotes [Unreleased] -> [0.11.0] - 2026-04-29 and bumps pyproject.toml + uv.lock to 0.11.0. Version-bump rationale: 0.11.0 (minor bump) chosen over 0.10.1 because this release ships one BREAKING removal (`apm marketplace build` -> exits 2, use `apm pack`) plus several net-new features (Dev Container Feature, Codex project-scoped MCP, `marketplace:` block in apm.yml, `apm pack` unification, multi-org `apps[]`). Strict semver in 0.x: minor for features-with-break, patch only for bugfixes. Milestone admin (done out-of-band): - Renamed milestone #8 `0.10.1` -> `0.11.0` - Created milestone #9 `0.12.0` as next-up bucket - Moved 43 open items (42 issues + 1 open PR #999) from `0.11.0` -> `0.12.0` - 6 closed items stay in `0.11.0` PRs shipping in 0.11.0 (22 commits since v0.10.0): User-facing features: - #1042/#722 `apm pack` unifies bundle + marketplace.json (BREAKING: `apm marketplace build` removed) - #1038 `marketplace:` block in apm.yml + `apm marketplace migrate` - #803 /#502 Codex project-scoped MCP (`.codex/config.toml`) + user-scope primitives - #861 Dev Container Feature `ghcr.io/microsoft/apm/apm-cli` - #982/#984 shared/apm.md `apps:` array for cross-org private packages - #820 `target:` in apm.yml validates at parse time - #1032 `apm marketplace add` honors manifest.name (Claude Code parity) - #1000/#998/#994 unified `--policy` / `--policy-source` accepted forms User-facing fixes: - #1015 ADO Entra ID auth + `apm install --update` pre-flight abort - #1019/#1020 GEMINI.md only created when target requested - #1008 marketplace producer respects GITHUB_HOST + multi-host URL forms - #1018 POSIX paths in auto-discovery output (Windows compat) - #996 drop stray 'specify' from generated file footer Maintainer tooling: - #1043 NOTICE.md per CELA template - #1045/#1044 NOTICE drift gate + license-policy gate in CI - #1033 shared/apm.md `[a b]` import-input repair (gh-aw#29076 paper-cut) - #1030 panel workflows skip-don't-fail on unmatched labels; gh-aw v0.71.1 - #1026 shared/apm.md recompiled to apm-action v1.5.0 + bundles-file - #1022 review-panel: true fan-out + binary verdict + label automation - #918 complexity audit + benchmarks suite - #1002 CodeQL clear-text-storage false-positive resolved (token -> placeholder) Files changed: - pyproject.toml: 0.10.0 -> 0.11.0 - uv.lock: regenerated (version field only) - CHANGELOG.md: [Unreleased] promoted to [0.11.0] - 2026-04-29 NOTICE drift check passes against the bumped lockfile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Promotes [Unreleased] -> [0.11.0] - 2026-04-29 and bumps pyproject.toml + uv.lock to 0.11.0. Version-bump rationale: 0.11.0 (minor bump) chosen over 0.10.1 because this release ships one BREAKING removal (`apm marketplace build` -> exits 2, use `apm pack`) plus several net-new features (Dev Container Feature, Codex project-scoped MCP, `marketplace:` block in apm.yml, `apm pack` unification, multi-org `apps[]`). Strict semver in 0.x: minor for features-with-break, patch only for bugfixes. Milestone admin (done out-of-band): - Renamed milestone #8 `0.10.1` -> `0.11.0` - Created milestone #9 `0.12.0` as next-up bucket - Moved 43 open items (42 issues + 1 open PR #999) from `0.11.0` -> `0.12.0` - 6 closed items stay in `0.11.0` PRs shipping in 0.11.0 (22 commits since v0.10.0): User-facing features: - #1042/#722 `apm pack` unifies bundle + marketplace.json (BREAKING: `apm marketplace build` removed) - #1038 `marketplace:` block in apm.yml + `apm marketplace migrate` - #803 /#502 Codex project-scoped MCP (`.codex/config.toml`) + user-scope primitives - #861 Dev Container Feature `ghcr.io/microsoft/apm/apm-cli` - #982/#984 shared/apm.md `apps:` array for cross-org private packages - #820 `target:` in apm.yml validates at parse time - #1032 `apm marketplace add` honors manifest.name (Claude Code parity) - #1000/#998/#994 unified `--policy` / `--policy-source` accepted forms User-facing fixes: - #1015 ADO Entra ID auth + `apm install --update` pre-flight abort - #1019/#1020 GEMINI.md only created when target requested - #1008 marketplace producer respects GITHUB_HOST + multi-host URL forms - #1018 POSIX paths in auto-discovery output (Windows compat) - #996 drop stray 'specify' from generated file footer Maintainer tooling: - #1043 NOTICE.md per CELA template - #1045/#1044 NOTICE drift gate + license-policy gate in CI - #1033 shared/apm.md `[a b]` import-input repair (gh-aw#29076 paper-cut) - #1030 panel workflows skip-don't-fail on unmatched labels; gh-aw v0.71.1 - #1026 shared/apm.md recompiled to apm-action v1.5.0 + bundles-file - #1022 review-panel: true fan-out + binary verdict + label automation - #918 complexity audit + benchmarks suite - #1002 CodeQL clear-text-storage false-positive resolved (token -> placeholder) Files changed: - pyproject.toml: 0.10.0 -> 0.11.0 - uv.lock: regenerated (version field only) - CHANGELOG.md: [Unreleased] promoted to [0.11.0] - 2026-04-29 NOTICE drift check passes against the bumped lockfile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore(release): cut 0.11.0 Promotes [Unreleased] -> [0.11.0] - 2026-04-29 and bumps pyproject.toml + uv.lock to 0.11.0. Version-bump rationale: 0.11.0 (minor bump) chosen over 0.10.1 because this release ships one BREAKING removal (`apm marketplace build` -> exits 2, use `apm pack`) plus several net-new features (Dev Container Feature, Codex project-scoped MCP, `marketplace:` block in apm.yml, `apm pack` unification, multi-org `apps[]`). Strict semver in 0.x: minor for features-with-break, patch only for bugfixes. Milestone admin (done out-of-band): - Renamed milestone #8 `0.10.1` -> `0.11.0` - Created milestone #9 `0.12.0` as next-up bucket - Moved 43 open items (42 issues + 1 open PR #999) from `0.11.0` -> `0.12.0` - 6 closed items stay in `0.11.0` PRs shipping in 0.11.0 (22 commits since v0.10.0): User-facing features: - #1042/#722 `apm pack` unifies bundle + marketplace.json (BREAKING: `apm marketplace build` removed) - #1038 `marketplace:` block in apm.yml + `apm marketplace migrate` - #803 /#502 Codex project-scoped MCP (`.codex/config.toml`) + user-scope primitives - #861 Dev Container Feature `ghcr.io/microsoft/apm/apm-cli` - #982/#984 shared/apm.md `apps:` array for cross-org private packages - #820 `target:` in apm.yml validates at parse time - #1032 `apm marketplace add` honors manifest.name (Claude Code parity) - #1000/#998/#994 unified `--policy` / `--policy-source` accepted forms User-facing fixes: - #1015 ADO Entra ID auth + `apm install --update` pre-flight abort - #1019/#1020 GEMINI.md only created when target requested - #1008 marketplace producer respects GITHUB_HOST + multi-host URL forms - #1018 POSIX paths in auto-discovery output (Windows compat) - #996 drop stray 'specify' from generated file footer Maintainer tooling: - #1043 NOTICE.md per CELA template - #1045/#1044 NOTICE drift gate + license-policy gate in CI - #1033 shared/apm.md `[a b]` import-input repair (gh-aw#29076 paper-cut) - #1030 panel workflows skip-don't-fail on unmatched labels; gh-aw v0.71.1 - #1026 shared/apm.md recompiled to apm-action v1.5.0 + bundles-file - #1022 review-panel: true fan-out + binary verdict + label automation - #918 complexity audit + benchmarks suite - #1002 CodeQL clear-text-storage false-positive resolved (token -> placeholder) Files changed: - pyproject.toml: 0.10.0 -> 0.11.0 - uv.lock: regenerated (version field only) - CHANGELOG.md: [Unreleased] promoted to [0.11.0] - 2026-04-29 NOTICE drift check passes against the bumped lockfile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): tighten 0.11.0 entries to lead with user impact Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): move Dev Container Feature to Maintainer tooling (not yet published) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(changelog): de-dupe within 0.11.0 (combine #722 Removed bullets, drop #820 Fixed pointer) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TL;DR
Harden
pr-description-skill's mermaid guidance so PR-body diagrams (a) pick the right diagram TYPE per reviewer intent and (b) survive GitHub's renderer.The proposal comment on #983 surfaced the gap concretely: a
flowchartedge label|[EXEC] jq normalize, ...|parsed locally but was rejected by GitHub (Expecting 'TAGEND', ..., got 'SQS'). That class of bug was not in the skill's pitfall list.Problem (WHY)
The current
pr-description-skillSKILL.md inlines a partial pitfall list and says "1-3 mermaid diagrams" with no guidance on which diagram TYPE to pick. Two consequences:flowchart TD, forcing reviewers to reconstruct the temporal axis from arrows.mmdcdoes NOT catch. Square brackets in flowchart edge labels are the most recent example;:::cssClassonclassDiagramrelationship lines is a known prior one.Approach (WHAT)
R3 EXTRACT refactor (per
genesisdesign discipline):assets/mermaid-conventions.md(~230 lines).apm/skills/pr-description-skill/rect rgb(255, 247, 200)for new sequence interactions;classDef new stroke-dasharray: 5 5+class N newfor new flowchart nodesImplementation (HOW)
assets/mermaid-conventions.md: diagram-type table with one row per reviewer question; canonical mermaid templates for the three common PR-body shapes; "GitHub-renderer gotchas" section listing the rejections thatmmdcmay parse cleanly; validation discipline (mmdc + mermaid.live + post-push eyeball).SKILL.mdexecution checklist step 5: now mandates loading the new asset BEFORE drafting any block.SKILL.mdmermaid validation section: kept themmdcstep; replaced inline pitfall list with a load-trigger to the asset; kept the bracket-edge-label rule inline because it is the most likely to silently bite..github/skills/pr-description-skill/viaapm install --target copilot(committed; matches repo convention per CHANGELOG entry).Note
The
genesisskill owns architectural-design diagram conventions. This asset is scoped explicitly to PR bodies (sequence-flow-heavy, not architecture-heavy). No duplication today; if drift appears, R3 EXTRACT into a shared substrate later.Validation
All three canonical templates in the new asset validate via
mmdc:The bracket-edge-label gotcha was reproduced and confirmed against GitHub on issue #983: #983 (comment) -- the comment had to be re-edited with
|"[EXEC] ..."|(quoted) before it rendered.Trade-offs
mmdcstays. The drift-known gotchas are documented in prose, not a script -- adding a GitHub-render validator would require headless browser + GH's mermaid version, not worth the ROI today.How to test
cd /path/to/microsoft/apm && git checkout harden/pr-description-mermaid-conventions.apm/skills/pr-description-skill/assets/mermaid-conventions.mdand.github/skills/pr-description-skill/assets/mermaid-conventions.md-- verify both exist and match.A -->|[EXEC] x| Binto https://mermaid.live and confirm it errors withgot 'SQS'; replace withA -->|"[EXEC] x"| Band confirm it renders.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com