Skip to main content
prompt GP ChatGPT

phase-10k-page-artifact-ui-builder — Claude Code prompt

phase-10k-page-artifact-ui-builder is a Claude Code prompt for extracting page artifacts from tool results and displaying them in a compact chat card.

Apache-2.0 ★ 1,497 updated 2026-06-16

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/phase-10k-page-artifact-ui-builder.md
Open on GitHub

What phase-10k-page-artifact-ui-builder does

The prompt outlines the smallest production artifact UI slice: a client-side extractor that derives safe, user-visible page artifacts from ToolCallState, and a compact card in chat-ui for rendering. It reuses semantics from src/chat/continuity-context.ts, recognizes phantom_create_page and phantom_preview_page, extracts safe URLs and metadata, filters out /ui/login and magic links, and deduplicates by URL. TypeScript throughout, no any or @ts-ignore. Tests cover extraction policy. Anti-patterns are explicit: no parsing of secrets, no surfacing of magic links, no new server schema before proving the UI, and no oversized card chrome.

The prompt ties to branch codex/chat-experience-polish-10j and PR #113, and requires local gates to pass before commit. Acceptance includes visible artifact cards with title, path, size, and Open/Copy URL actions for successful page creation, and verification with live Phantom on Murph.

What it helps with

  • extract safe page URLs from tool call outputs
  • render artifact cards under assistant answers with title and path
  • filter out /ui/login and magic-login links from artifacts
  • deduplicate artifact cards for repeated tool calls
  • add open and copy-URL actions to artifact cards

Example prompts for the agent

  • Use this prompt in Claude Code to build the artifact UI slice for phantom_create_page results
  • Apply the prompt to PR #113 on the codex/chat-experience-polish-10j branch
  • Run the prompt to add extraction logic and card components to chat-ui

How to install phase-10k-page-artifact-ui-builder

Manually: put the files in place

.claude/commands/phase-10k-page-artifact-ui-builder.md

Questions about phase-10k-page-artifact-ui-builder

How do I install phase-10k-page-artifact-ui-builder in Claude Code?

Load the prompt via .claude/commands/phase-10k-page-artifact-ui-builder.md in Claude Code. The prompt provides a full specification for building the client-side artifact extractor and UI component.

What does phase-10k-page-artifact-ui-builder do?

It specifies how to extract created page artifacts from phantom_create_page and phantom_preview_page tool results, filter out unsafe links like /ui/login, deduplicate cards, and render a compact card UI with title, path, size, and actions to open or copy the URL.

Which tool calls should the extractor recognize?

The extractor must handle phantom_create_page and phantom_preview_page, prefer output url/publicUrl/pageUrl, fall back to safe URLs from text, use input path/title when available, exclude /ui/login and magic-login links, and deduplicate by URL or path.

Source text

phase-10k-page-artifact-ui-builder.md · Apache-2.0
ultrathink. ultrathink. ultrathink.

You are acting as principal engineer, principal architect, and principal product manager for Phantom's chat experience on Murph.

Context:
- Branch: codex/chat-experience-polish-10j in /Users/truffle/work/phantom-murph-hardening.
- The open upstream PR #113 has been updated to current origin/main and is review-blocked only.
- Phase 10J has already implemented default-collapsed successful tool cards.
- The operator's current priority is best-in-class chat: durable run timeline, richer progress, file/artifact preview, markdown polish, and reliable long-running Murph conversations.
- We must not fake private chain-of-thought. We show only safe progress and existing runtime facts.
- We must not reinvent where Phantom already has primitives.

Relevant current code:
- chat-ui/src/components/assistant-message.tsx renders thinking blocks, tool cards, markdown, and cost metadata.
- chat-ui/src/components/tool-call-card.tsx renders tool inputs and outputs.
- chat-ui/src/lib/chat-types.ts defines ToolCallState.
- src/chat/continuity-context.ts already extracts page artifacts from phantom_create_page and phantom_preview_page tool calls for post-compaction continuity.

Task:
Implement the smallest production-grade artifact UI slice:
1. Add a client-side artifact extractor that derives safe, user-visible created page artifacts from existing ToolCallState data.
2. Reuse the same semantics as src/chat/continuity-context.ts where practical:
   - Recognize phantom_create_page and phantom_preview_page.
   - Prefer output url/publicUrl/pageUrl, then safe URL from text.
   - Use input path/title when available.
   - Include size when available.
   - Exclude /ui/login and magic-login links.
   - Deduplicate by URL or path.
3. Add a compact artifact card/tray in chat-ui that renders under the assistant answer when artifacts exist.
4. Keep this as a UI affordance. Do not add a new MCP tool or Phantom built-in for this slice.
5. Add focused tests for extraction policy.
6. Maintain strict TypeScript. No explicit any, no @ts-ignore, no em dashes, no emojis.
7. Keep files small and components focused.

Acceptance criteria:
- Successful phantom_create_page results produce a visible artifact card with title, path/URL, size when known, Open, and Copy URL actions.
- phantom_generate_login output never becomes a created artifact.
- Relative and absolute /ui/<path> page URLs work; /ui/login does not.
- Duplicate tool frames do not duplicate artifact cards.
- Existing tool card tests and chat store tests remain green.
- Full local gates pass before commit.
- Live verification with Phantom on Murph/OpenAI creates a page and shows the artifact card.

Anti-patterns:
- Do not parse arbitrary secrets into visible cards.
- Do not surface magic links as artifacts.
- Do not create a new server schema before proving the UI affordance.
- Do not bury the final answer under oversized artifact chrome.
- Do not make the card depend on hover-only controls.

Self-review:
After implementation, review the diff for overreach, accessibility, long URLs, mobile fit, and whether this should have reused an existing helper.

© ghostwright · Apache-2.0 · ghostwright/phantom

Similar prompts

All prompts for Frontend and UI →

From the same set38

The whole set →
phase-10h-pi-thinking-research The phase-10h-pi-thinking-research prompt asks Claude Code to examine how Pi presents model thinking, tool activity, and long-running work, then write chat UI guidance for Phantom. GP ChatGPT ★ 1,497repo stars phase-10h-provider-thinking-research phase-10h-provider-thinking-research — a Claude slash command that digs through Murph, Pi and Phantom sources to find what providers really expose about thinking and reasoning events. GP ChatGPT ★ 1,497repo stars phase-10b-durable-timeline-re-reviewer The phase-10b-durable-timeline-re-reviewer prompt for Claude Code re-audits fixes in Phantom PR #106 Phase 10B, checking durable timelines for secret leaks and validating session resume states. GP ChatGPT ★ 1,497repo stars phase-10i-transcript-recovery-re-review The phase-10i-transcript-recovery-re-review prompt guides Claude Code through a second review of transcript-recovery fixes, including project file inspection, required checks, and a written report. GP ChatGPT ★ 1,497repo stars phase-10l-phantom-continuity-researcher phase-10l-phantom-continuity-researcher is a Claude Code prompt for diagnosing session continuity in Phantom, including context compaction, transcript recovery, and SQLite state analysis. GP ChatGPT ★ 1,497repo stars phase-10l-murph-continuity-researcher phase-10l-murph-continuity-researcher investigates how Murph handles context compaction and interrupted turns, then produces a code-backed fix and test plan. It expects local Murph and Phantom repositories. GP ChatGPT ★ 1,497repo stars phase-10j-tool-card-collapse-research phase-10j-tool-card-collapse-research is a prompt for Claude Code and ChatGPT that examines Phantom tool cards: collapsing completed calls while keeping errors and blocked work visible. GP ChatGPT ★ 1,497repo stars phase-10i-transcript-search-research phase-10i-transcript-search-research guides an architectural study for historical chat transcript search in Phantom after Murph compaction. Useful when planning agent context retrieval. GP ChatGPT ★ 1,497repo stars

Project sponsors

Companies that keep this analytics open