Skip to content

docs: add AgentPrompt and OpenInAgentButton components - #220

Merged
damirka merged 1 commit into
mainfrom
add-agent-prompt-component
Jun 9, 2026
Merged

docs: add AgentPrompt and OpenInAgentButton components#220
damirka merged 1 commit into
mainfrom
add-agent-prompt-component

Conversation

@jessiemongeon1

Copy link
Copy Markdown
Collaborator

Summary

  • New AgentPrompt component: Page-level callout that surfaces a ready-made builder prompt. Readers can copy the prompt or open it directly in Claude, ChatGPT, or Gemini. Registered as a global MDX component so it can be used in any .mdx page without imports.
  • New OpenInAgentButton component: Dropdown button added to code blocks that lets users send code snippets to an AI agent. Supports configurable prompt presets via the agentPrompt metastring (e.g., ```move agentPrompt="build").
  • CodeBlock wrapper: Parses the agentPrompt metastring and passes it as a data-agent-prompt attribute for the button to read.
  • MDXContent swizzle: Registers AgentPrompt globally so MDX pages can use <AgentPrompt prompt="..." /> without importing.

Both components match the implementations in the Sui docs and Walrus docs.

Test plan

  • Verify <AgentPrompt prompt="..." /> renders in an MDX page
  • Verify "Use an Agent" dropdown appears on code blocks
  • Verify all three agents (Claude, ChatGPT, Gemini) open with correct URLs
  • Verify agentPrompt="build" metastring triggers the build preset

🤖 Generated with Claude Code

- Add AgentPrompt shared component for page-level AI agent prompts
  with copy-to-clipboard and open-in-agent (Claude, ChatGPT, Gemini)
- Add OpenInAgentButton shared component for code block agent dropdown
  with configurable prompt presets via agentPrompt metastring
- Register AgentPrompt as global MDX component via MDXContent swizzle
- Add CodeBlock wrapper to parse agentPrompt metastring
- Wire OpenInAgentButton into the CodeBlock button bar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@damirka
damirka merged commit fd18c3e into main Jun 9, 2026
6 checks passed
@damirka
damirka deleted the add-agent-prompt-component branch June 9, 2026 09:18
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.

3 participants