Skip to content

Comments

🤖 feat: move Mermaid instructions into built-in diagram skill#2611

Merged
ethanndickson merged 3 commits intomainfrom
skills-5rd0
Feb 25, 2026
Merged

🤖 feat: move Mermaid instructions into built-in diagram skill#2611
ethanndickson merged 3 commits intomainfrom
skills-5rd0

Conversation

@ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Feb 25, 2026

Summary

Move Mermaid diagram authoring guidance out of the always-on system PRELUDE and into a new built-in mux-diagram skill that agents load on-demand via agent_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

  • New built-in skill 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.
  • Trimmed PRELUDE — the <markdown> block in systemMessage.ts now has a single-line routing hint ("load the built-in mux-diagram skill via agent_skill_read for best practices") instead of the full Mermaid instruction set. Generic markdown guidance (katex, <details>/<summary>) remains.
  • Namespaced as mux-diagram — follows the mux-* convention (matching mux-docs) so project/global skills don't accidentally shadow the built-in.
  • Test expectations updated — two assertions in agentSkillsService.test.ts that 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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@ethanndickson
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

@ethanndickson ethanndickson added this pull request to the merge queue Feb 25, 2026
Merged via the queue into main with commit 6bc0c0e Feb 25, 2026
23 checks passed
@ethanndickson ethanndickson deleted the skills-5rd0 branch February 25, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant