🤖 feat: move Mermaid instructions into built-in diagram skill#2611
Merged
ethanndickson merged 3 commits intomainfrom Feb 25, 2026
Merged
🤖 feat: move Mermaid instructions into built-in diagram skill#2611ethanndickson merged 3 commits intomainfrom
ethanndickson merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf5a6edf6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move Mermaid diagram authoring guidance out of the always-on system PRELUDE and into a new built-in
mux-diagramskill that agents load on-demand viaagent_skill_read.Relates to #2334
Background
Every model request currently receives ~200 tokens of Mermaid best-practice instructions in the system prompt, even though the vast majority of requests never produce a diagram. This is a vestige of the pre-skills approach to context injection and wastes tokens on every single request.
Implementation
src/node/builtinSkills/mux-diagram.md— contains the migrated Mermaid best practices plus a new section on text-based chart alternatives (markdown tables, ASCII bars, indented trees) for cases where full Mermaid rendering is unnecessary.<markdown>block insystemMessage.tsnow has a single-line routing hint ("load the built-inmux-diagramskill viaagent_skill_readfor best practices") instead of the full Mermaid instruction set. Generic markdown guidance (katex,<details>/<summary>) remains.mux-diagram— follows themux-*convention (matchingmux-docs) so project/global skills don't accidentally shadow the built-in.agentSkillsService.test.tsthat hardcode the built-in skill list now include"mux-diagram".Risks
Low — the Mermaid instructions are still available to the agent; they're just loaded on-demand instead of injected unconditionally. If diagram quality regresses, the routing hint in PRELUDE should be sufficient to prompt the model to load the skill.
Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh• Cost:$5.66