Repository navigation
[POC - testing only, do not merge] Add an agent-prompt directive - #4659
Draft
georgewallace wants to merge 3 commits into
Draft
georgewallace wants to merge 3 commits into
georgewallace wants to merge 3 commits into
Conversation
Readers can paste a prompt into an AI coding agent that does a page's steps and reports what it did. The directive keeps the prompt out of the page, shows a compact card with review and copy buttons, and sends view, review and copy events without the prompt text. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4659/ Sample changed pages: |
The design-system test `ComponentCss_ReadsTokensOnly` rejects colour functions in component CSS, and the backdrop used `rgb()`. It now reads `--color-emphasis` through `color-mix`, as the flyout and lightbox do. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The card stacked a label, a large title, a two-line description and two controls, and stood about 280 px tall. It now shows the icon, title and a one-line description together with the controls beneath, about 100 px tall at the docs column width. The default description is one sentence, and both stylesheets carry the same layout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Proof of concept for testing only. Please don't review or merge.
Adds an
{agent-prompt}directive. A docs page can offer a prompt that readers paste into an AI coding agent, which then does the page's steps and reports what it did. The prompt stays out of the page: readers see a compact card with a Review prompt button and a Copy prompt button.Affects: Authoring, Site UI
Prompt summary: Build a directive that gives readers a copyable prompt for their AI coding agent without cluttering the page. Say clearly that it needs an agent that can run commands, make the compact inline card the version readers see, track how readers use it, and add a sample page like the other directives.
Why
A page can show readers how to do a task, but it cannot give their AI coding agent a reviewed set of instructions. Readers write their own, and the results vary. Showing the instructions on the page would clutter it.
What
The card and the dialog
The card shows a label, a title, a one-line description, Review prompt with the character count, and Copy prompt. Review prompt opens a dialog with the full text and a second copy button. The default description tells readers to use an AI coding agent that can run commands. The prompt lives in a fenced code block inside the directive and is copied exactly as written. A directive without that block fails the build.
Exports
The prompt is left out of the LLM (
.md) and plain text renderings of the page.Telemetry
The script sends
agent_prompt_viewed,agent_prompt_review_opened,agent_prompt_copiedandagent_prompt_copy_failedthrough the existing logger. Events carry the title, the prompt length, the block's position and whether the control was the card or the dialog. The prompt text is never sent.The sample page
docs/syntax/agent-prompt.mdshows the live output and the Markdown source in tabs, like the other directive pages. It lists the properties and gives guidance for writing a prompt that works.Out of scope: Earlier mock-ups also had a sidebar card and page-actions links. They are not in this PR; only the inline card ships. The Markdown export also drops the method and path line of Console code blocks. This PR does not change that.
Verify
Check on the preview
🤖 Generated with Claude Code