|
| 1 | +--- |
| 2 | +name: ui-preview |
| 3 | +description: |
| 4 | + 'Preview and screenshot local dev servers and storybooks. Use when asked to |
| 5 | + view UI components, take screenshots of storybooks, or inspect the web/server |
| 6 | + apps.' |
| 7 | +metadata: |
| 8 | + version: '1' |
| 9 | +--- |
| 10 | + |
| 11 | +# UI Preview Skill |
| 12 | + |
| 13 | +Preview local dev servers and storybooks using Chrome DevTools. |
| 14 | + |
| 15 | +## Available Tools |
| 16 | + |
| 17 | +- `navigate_page` - Navigate to a URL |
| 18 | +- `take_screenshot` - Capture a screenshot of the current page |
| 19 | +- `new_page` - Open a new browser tab |
| 20 | +- `press_key` - Press keyboard keys (e.g., scrolling with PageDown, End) |
| 21 | +- `evaluate_script` - Run JavaScript on the page |
| 22 | + |
| 23 | +## Workflow |
| 24 | + |
| 25 | +1. **Navigate** to the target URL using `navigate_page` |
| 26 | +2. **Screenshot** the page using `take_screenshot` |
| 27 | +3. **Analyze** captured screenshots with `look_at` for visual analysis |
| 28 | + |
| 29 | +## Local Dev URLs |
| 30 | + |
| 31 | +Check `.amp/dev-environment.txt` for the running URLs (defaults: |
| 32 | +web=http://localhost:7001, server=https://localhost:7002). |
| 33 | + |
| 34 | +| Service | Path | |
| 35 | +| ----------------- | ---------- | |
| 36 | +| Web dev server | / | |
| 37 | +| Server dev server | / | |
| 38 | +| Webview storybook | /storybook | |
| 39 | +| Server storybook | /storybook | |
| 40 | + |
| 41 | +## Storybooks |
| 42 | + |
| 43 | +Access a specific story directly using the hash: `/storybook#${story-title}` |
| 44 | + |
| 45 | +The story title is derived from the filename: `handoff-story.svelte` → |
| 46 | +`#handoff-tool` |
| 47 | + |
| 48 | +### Webview Storybook (localhost:7001) |
| 49 | + |
| 50 | +Components for the VS Code extension webview UI. |
| 51 | + |
| 52 | +**Thread Components:** |
| 53 | + |
| 54 | +- `#thread` - Full thread view |
| 55 | +- `#streaming-thread` - Thread with streaming content |
| 56 | +- `#scrollable-thread` - Thread with scroll behavior |
| 57 | +- `#thread-reply-area` - Message input area |
| 58 | +- `#thread-status` - Thread status indicators |
| 59 | +- `#thread-summary` - Thread summary view |
| 60 | +- `#thread-hints` - Thread hint suggestions |
| 61 | +- `#thread-environment-input` - Environment input |
| 62 | + |
| 63 | +**Tool Calls:** |
| 64 | + |
| 65 | +- `#bash` - Bash tool output |
| 66 | +- `#edit-file` - File edit diffs |
| 67 | +- `#create-file` - File creation |
| 68 | +- `#read` - File read output |
| 69 | +- `#grep` - Search results |
| 70 | +- `#glob` - File glob results |
| 71 | +- `#handoff-tool` - Handoff tool states |
| 72 | +- `#mermaid` - Diagram rendering |
| 73 | +- `#oracle-tool` - Oracle tool output |
| 74 | +- `#task-tool` - Task tool output |
| 75 | +- `#web-search` - Web search results |
| 76 | + |
| 77 | +**Editor & Input:** |
| 78 | + |
| 79 | +- `#prompt-editor` - Message input editor |
| 80 | +- `#mention-menu` - @mention autocomplete |
| 81 | +- `#combobox` - Combobox component |
| 82 | +- `#agent-mode-selector` - Agent mode picker |
| 83 | + |
| 84 | +**Diff Viewer:** |
| 85 | + |
| 86 | +- `#diff-viewer` - Side-by-side diff |
| 87 | +- `#diff-display` - Inline diff display |
| 88 | +- `#unified-diff` - Unified diff format |
| 89 | + |
| 90 | +**Settings:** |
| 91 | + |
| 92 | +- `#settings-page` - Settings page |
| 93 | +- `#settings-error-modal` - Error modal |
| 94 | +- `#sign-in-page` - Authentication page |
| 95 | + |
| 96 | +**Layout:** |
| 97 | + |
| 98 | +- `#layout-navbar` - Navigation bar |
| 99 | +- `#current-thread-navbar-item` - Thread nav item |
| 100 | + |
| 101 | +### Server Storybook (localhost:7002) |
| 102 | + |
| 103 | +Components for the ampcode.com web app. |
| 104 | + |
| 105 | +**Thread Management:** |
| 106 | + |
| 107 | +- `#thread-feed` - Thread list feed |
| 108 | +- `#thread-feed-item` - Individual thread item |
| 109 | +- `#thread-feed-list` - Virtualized thread list |
| 110 | +- `#thread-actions` - Thread action buttons |
| 111 | +- `#thread-visibility` - Visibility settings |
| 112 | +- `#thread-visibility-edit` - Edit visibility |
| 113 | +- `#thread-page` - Full thread page |
| 114 | +- `#thread-open-in-button` - Open in editor button |
| 115 | +- `#pull-request-badge` - PR badge display |
| 116 | + |
| 117 | +**Settings:** |
| 118 | + |
| 119 | +- `#settings-access-token-section` - API tokens |
| 120 | +- `#settings-advanced-section` - Advanced settings |
| 121 | +- `#settings-client-section` - Client settings |
| 122 | +- `#billing-section` - Billing info |
| 123 | +- `#amp-free-section` - Free tier info |
| 124 | +- `#code-host-connections-section` - GitHub/GitLab connections |
| 125 | + |
| 126 | +**User & Profile:** |
| 127 | + |
| 128 | +- `#avatar` - User avatar |
| 129 | +- `#profile-card` - Profile card |
| 130 | +- `#profile-dropdown` - Profile menu |
| 131 | +- `#user-display` - User name display |
| 132 | + |
| 133 | +**Dashboard:** |
| 134 | + |
| 135 | +- `#welcome` - Welcome page |
| 136 | +- `#usage-by-day` - Usage metrics |
| 137 | + |
| 138 | +**UI Components:** |
| 139 | + |
| 140 | +- `#amp-logo` - Logo variants |
| 141 | +- `#badge-single` - Single badge |
| 142 | +- `#badge-group` - Badge group |
| 143 | +- `#copyable-text` - Copy-to-clipboard text |
| 144 | +- `#colors` - Color palette |
| 145 | +- `#icons` - Icon set |
| 146 | + |
| 147 | +**OG Images:** |
| 148 | + |
| 149 | +- `#og-images` - Social preview images |
| 150 | + |
| 151 | +## Tips |
| 152 | + |
| 153 | +- Story titles use kebab-case from filenames (remove `-story.svelte`) |
| 154 | +- Reload the skill if MCP tools become unavailable |
| 155 | +- Use `list_pages` to manage multiple browser tabs |
| 156 | +- Use `press_key` with "End" or "PageDown" to scroll the page |
| 157 | +- Use `evaluate_script` for custom page interactions |
0 commit comments