real-prototypes-skill 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/.claude/skills/agent-browser-skill/SKILL.md +252 -0
  2. package/.claude/skills/real-prototypes-skill/.gitignore +188 -0
  3. package/.claude/skills/real-prototypes-skill/ACCESSIBILITY.md +668 -0
  4. package/.claude/skills/real-prototypes-skill/INSTALL.md +259 -0
  5. package/.claude/skills/real-prototypes-skill/LICENSE +21 -0
  6. package/.claude/skills/real-prototypes-skill/PUBLISH.md +310 -0
  7. package/.claude/skills/real-prototypes-skill/QUICKSTART.md +240 -0
  8. package/.claude/skills/real-prototypes-skill/README.md +442 -0
  9. package/.claude/skills/real-prototypes-skill/SKILL.md +375 -0
  10. package/.claude/skills/real-prototypes-skill/capture/capture-engine.js +1153 -0
  11. package/.claude/skills/real-prototypes-skill/capture/config.schema.json +170 -0
  12. package/.claude/skills/real-prototypes-skill/cli.js +596 -0
  13. package/.claude/skills/real-prototypes-skill/docs/TROUBLESHOOTING.md +278 -0
  14. package/.claude/skills/real-prototypes-skill/docs/schemas/capture-config.md +167 -0
  15. package/.claude/skills/real-prototypes-skill/docs/schemas/design-tokens.md +183 -0
  16. package/.claude/skills/real-prototypes-skill/docs/schemas/manifest.md +169 -0
  17. package/.claude/skills/real-prototypes-skill/examples/CLAUDE.md.example +73 -0
  18. package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/CLAUDE.md +136 -0
  19. package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/FEATURES.md +222 -0
  20. package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/README.md +82 -0
  21. package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/design-tokens.json +87 -0
  22. package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/screenshots/homepage-viewport.png +0 -0
  23. package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/screenshots/prototype-chatbot-final.png +0 -0
  24. package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/screenshots/prototype-fullpage-v2.png +0 -0
  25. package/.claude/skills/real-prototypes-skill/references/accessibility-fixes.md +298 -0
  26. package/.claude/skills/real-prototypes-skill/references/accessibility-report.json +253 -0
  27. package/.claude/skills/real-prototypes-skill/scripts/CAPTURE-ENHANCEMENTS.md +344 -0
  28. package/.claude/skills/real-prototypes-skill/scripts/IMPLEMENTATION-SUMMARY.md +517 -0
  29. package/.claude/skills/real-prototypes-skill/scripts/QUICK-START.md +229 -0
  30. package/.claude/skills/real-prototypes-skill/scripts/QUICKSTART-layout-analysis.md +148 -0
  31. package/.claude/skills/real-prototypes-skill/scripts/README-analyze-layout.md +407 -0
  32. package/.claude/skills/real-prototypes-skill/scripts/analyze-layout.js +880 -0
  33. package/.claude/skills/real-prototypes-skill/scripts/capture-platform.js +203 -0
  34. package/.claude/skills/real-prototypes-skill/scripts/comprehensive-capture.js +597 -0
  35. package/.claude/skills/real-prototypes-skill/scripts/create-manifest.js +338 -0
  36. package/.claude/skills/real-prototypes-skill/scripts/enterprise-pipeline.js +428 -0
  37. package/.claude/skills/real-prototypes-skill/scripts/extract-tokens.js +468 -0
  38. package/.claude/skills/real-prototypes-skill/scripts/full-site-capture.js +738 -0
  39. package/.claude/skills/real-prototypes-skill/scripts/generate-tailwind-config.js +296 -0
  40. package/.claude/skills/real-prototypes-skill/scripts/integrate-accessibility.sh +161 -0
  41. package/.claude/skills/real-prototypes-skill/scripts/manifest-schema.json +302 -0
  42. package/.claude/skills/real-prototypes-skill/scripts/setup-prototype.sh +167 -0
  43. package/.claude/skills/real-prototypes-skill/scripts/test-analyze-layout.js +338 -0
  44. package/.claude/skills/real-prototypes-skill/scripts/test-validation.js +307 -0
  45. package/.claude/skills/real-prototypes-skill/scripts/validate-accessibility.js +598 -0
  46. package/.claude/skills/real-prototypes-skill/scripts/validate-manifest.js +499 -0
  47. package/.claude/skills/real-prototypes-skill/scripts/validate-output.js +361 -0
  48. package/.claude/skills/real-prototypes-skill/scripts/validate-prerequisites.js +319 -0
  49. package/.claude/skills/real-prototypes-skill/scripts/verify-layout-analysis.sh +77 -0
  50. package/.claude/skills/real-prototypes-skill/templates/dashboard-widget.tsx.template +91 -0
  51. package/.claude/skills/real-prototypes-skill/templates/data-table.tsx.template +193 -0
  52. package/.claude/skills/real-prototypes-skill/templates/form-section.tsx.template +250 -0
  53. package/.claude/skills/real-prototypes-skill/templates/modal-dialog.tsx.template +239 -0
  54. package/.claude/skills/real-prototypes-skill/templates/nav-item.tsx.template +265 -0
  55. package/.claude/skills/real-prototypes-skill/validation/validation-engine.js +559 -0
  56. package/.env.example +74 -0
  57. package/LICENSE +21 -0
  58. package/README.md +444 -0
  59. package/bin/cli.js +319 -0
  60. package/package.json +59 -0
@@ -0,0 +1,252 @@
1
+ ---
2
+ name: agent-browser
3
+ description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
4
+ allowed-tools: Bash(agent-browser:*)
5
+ ---
6
+
7
+ # Browser Automation with agent-browser
8
+
9
+ ## Quick start
10
+
11
+ ```bash
12
+ agent-browser open <url> # Navigate to page
13
+ agent-browser snapshot -i # Get interactive elements with refs
14
+ agent-browser click @e1 # Click element by ref
15
+ agent-browser fill @e2 "text" # Fill input by ref
16
+ agent-browser close # Close browser
17
+ ```
18
+
19
+ ## Core workflow
20
+
21
+ 1. Navigate: `agent-browser open <url>`
22
+ 2. Snapshot: `agent-browser snapshot -i` (returns elements with refs like `@e1`, `@e2`)
23
+ 3. Interact using refs from the snapshot
24
+ 4. Re-snapshot after navigation or significant DOM changes
25
+
26
+ ## Commands
27
+
28
+ ### Navigation
29
+ ```bash
30
+ agent-browser open <url> # Navigate to URL
31
+ agent-browser back # Go back
32
+ agent-browser forward # Go forward
33
+ agent-browser reload # Reload page
34
+ agent-browser close # Close browser
35
+ ```
36
+
37
+ ### Snapshot (page analysis)
38
+ ```bash
39
+ agent-browser snapshot # Full accessibility tree
40
+ agent-browser snapshot -i # Interactive elements only (recommended)
41
+ agent-browser snapshot -c # Compact output
42
+ agent-browser snapshot -d 3 # Limit depth to 3
43
+ agent-browser snapshot -s "#main" # Scope to CSS selector
44
+ ```
45
+
46
+ ### Interactions (use @refs from snapshot)
47
+ ```bash
48
+ agent-browser click @e1 # Click
49
+ agent-browser dblclick @e1 # Double-click
50
+ agent-browser focus @e1 # Focus element
51
+ agent-browser fill @e2 "text" # Clear and type
52
+ agent-browser type @e2 "text" # Type without clearing
53
+ agent-browser press Enter # Press key
54
+ agent-browser press Control+a # Key combination
55
+ agent-browser keydown Shift # Hold key down
56
+ agent-browser keyup Shift # Release key
57
+ agent-browser hover @e1 # Hover
58
+ agent-browser check @e1 # Check checkbox
59
+ agent-browser uncheck @e1 # Uncheck checkbox
60
+ agent-browser select @e1 "value" # Select dropdown
61
+ agent-browser scroll down 500 # Scroll page
62
+ agent-browser scrollintoview @e1 # Scroll element into view
63
+ agent-browser drag @e1 @e2 # Drag and drop
64
+ agent-browser upload @e1 file.pdf # Upload files
65
+ ```
66
+
67
+ ### Get information
68
+ ```bash
69
+ agent-browser get text @e1 # Get element text
70
+ agent-browser get html @e1 # Get innerHTML
71
+ agent-browser get value @e1 # Get input value
72
+ agent-browser get attr @e1 href # Get attribute
73
+ agent-browser get title # Get page title
74
+ agent-browser get url # Get current URL
75
+ agent-browser get count ".item" # Count matching elements
76
+ agent-browser get box @e1 # Get bounding box
77
+ ```
78
+
79
+ ### Check state
80
+ ```bash
81
+ agent-browser is visible @e1 # Check if visible
82
+ agent-browser is enabled @e1 # Check if enabled
83
+ agent-browser is checked @e1 # Check if checked
84
+ ```
85
+
86
+ ### Screenshots & PDF
87
+ ```bash
88
+ agent-browser screenshot # Screenshot to stdout
89
+ agent-browser screenshot path.png # Save to file
90
+ agent-browser screenshot --full # Full page
91
+ agent-browser pdf output.pdf # Save as PDF
92
+ ```
93
+
94
+ ### Video recording
95
+ ```bash
96
+ agent-browser record start ./demo.webm # Start recording (uses current URL + state)
97
+ agent-browser click @e1 # Perform actions
98
+ agent-browser record stop # Stop and save video
99
+ agent-browser record restart ./take2.webm # Stop current + start new recording
100
+ ```
101
+ Recording creates a fresh context but preserves cookies/storage from your session. If no URL is provided, it automatically returns to your current page. For smooth demos, explore first, then start recording.
102
+
103
+ ### Wait
104
+ ```bash
105
+ agent-browser wait @e1 # Wait for element
106
+ agent-browser wait 2000 # Wait milliseconds
107
+ agent-browser wait --text "Success" # Wait for text
108
+ agent-browser wait --url "**/dashboard" # Wait for URL pattern
109
+ agent-browser wait --load networkidle # Wait for network idle
110
+ agent-browser wait --fn "window.ready" # Wait for JS condition
111
+ ```
112
+
113
+ ### Mouse control
114
+ ```bash
115
+ agent-browser mouse move 100 200 # Move mouse
116
+ agent-browser mouse down left # Press button
117
+ agent-browser mouse up left # Release button
118
+ agent-browser mouse wheel 100 # Scroll wheel
119
+ ```
120
+
121
+ ### Semantic locators (alternative to refs)
122
+ ```bash
123
+ agent-browser find role button click --name "Submit"
124
+ agent-browser find text "Sign In" click
125
+ agent-browser find label "Email" fill "user@test.com"
126
+ agent-browser find first ".item" click
127
+ agent-browser find nth 2 "a" text
128
+ ```
129
+
130
+ ### Browser settings
131
+ ```bash
132
+ agent-browser set viewport 1920 1080 # Set viewport size
133
+ agent-browser set device "iPhone 14" # Emulate device
134
+ agent-browser set geo 37.7749 -122.4194 # Set geolocation
135
+ agent-browser set offline on # Toggle offline mode
136
+ agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers
137
+ agent-browser set credentials user pass # HTTP basic auth
138
+ agent-browser set media dark # Emulate color scheme
139
+ ```
140
+
141
+ ### Cookies & Storage
142
+ ```bash
143
+ agent-browser cookies # Get all cookies
144
+ agent-browser cookies set name value # Set cookie
145
+ agent-browser cookies clear # Clear cookies
146
+ agent-browser storage local # Get all localStorage
147
+ agent-browser storage local key # Get specific key
148
+ agent-browser storage local set k v # Set value
149
+ agent-browser storage local clear # Clear all
150
+ ```
151
+
152
+ ### Network
153
+ ```bash
154
+ agent-browser network route <url> # Intercept requests
155
+ agent-browser network route <url> --abort # Block requests
156
+ agent-browser network route <url> --body '{}' # Mock response
157
+ agent-browser network unroute [url] # Remove routes
158
+ agent-browser network requests # View tracked requests
159
+ agent-browser network requests --filter api # Filter requests
160
+ ```
161
+
162
+ ### Tabs & Windows
163
+ ```bash
164
+ agent-browser tab # List tabs
165
+ agent-browser tab new [url] # New tab
166
+ agent-browser tab 2 # Switch to tab
167
+ agent-browser tab close # Close tab
168
+ agent-browser window new # New window
169
+ ```
170
+
171
+ ### Frames
172
+ ```bash
173
+ agent-browser frame "#iframe" # Switch to iframe
174
+ agent-browser frame main # Back to main frame
175
+ ```
176
+
177
+ ### Dialogs
178
+ ```bash
179
+ agent-browser dialog accept [text] # Accept dialog
180
+ agent-browser dialog dismiss # Dismiss dialog
181
+ ```
182
+
183
+ ### JavaScript
184
+ ```bash
185
+ agent-browser eval "document.title" # Run JavaScript
186
+ ```
187
+
188
+ ## Example: Form submission
189
+
190
+ ```bash
191
+ agent-browser open https://example.com/form
192
+ agent-browser snapshot -i
193
+ # Output shows: textbox "Email" [ref=e1], textbox "Password" [ref=e2], button "Submit" [ref=e3]
194
+
195
+ agent-browser fill @e1 "user@example.com"
196
+ agent-browser fill @e2 "password123"
197
+ agent-browser click @e3
198
+ agent-browser wait --load networkidle
199
+ agent-browser snapshot -i # Check result
200
+ ```
201
+
202
+ ## Example: Authentication with saved state
203
+
204
+ ```bash
205
+ # Login once
206
+ agent-browser open https://app.example.com/login
207
+ agent-browser snapshot -i
208
+ agent-browser fill @e1 "username"
209
+ agent-browser fill @e2 "password"
210
+ agent-browser click @e3
211
+ agent-browser wait --url "**/dashboard"
212
+ agent-browser state save auth.json
213
+
214
+ # Later sessions: load saved state
215
+ agent-browser state load auth.json
216
+ agent-browser open https://app.example.com/dashboard
217
+ ```
218
+
219
+ ## Sessions (parallel browsers)
220
+
221
+ ```bash
222
+ agent-browser --session test1 open site-a.com
223
+ agent-browser --session test2 open site-b.com
224
+ agent-browser session list
225
+ ```
226
+
227
+ ## JSON output (for parsing)
228
+
229
+ Add `--json` for machine-readable output:
230
+ ```bash
231
+ agent-browser snapshot -i --json
232
+ agent-browser get text @e1 --json
233
+ ```
234
+
235
+ ## Debugging
236
+
237
+ ```bash
238
+ agent-browser open example.com --headed # Show browser window
239
+ agent-browser console # View console messages
240
+ agent-browser errors # View page errors
241
+ agent-browser record start ./debug.webm # Record from current page
242
+ agent-browser record stop # Save recording
243
+ agent-browser open example.com --headed # Show browser window
244
+ agent-browser --cdp 9222 snapshot # Connect via CDP
245
+ agent-browser console # View console messages
246
+ agent-browser console --clear # Clear console
247
+ agent-browser errors # View page errors
248
+ agent-browser errors --clear # Clear errors
249
+ agent-browser highlight @e1 # Highlight element
250
+ agent-browser trace start # Start recording trace
251
+ agent-browser trace stop trace.zip # Stop and save trace
252
+ ```
@@ -0,0 +1,188 @@
1
+ # Platform Prototype Skill - Git Ignore
2
+
3
+ # ============================================
4
+ # Node.js / npm
5
+ # ============================================
6
+ node_modules/
7
+ npm-debug.log*
8
+ yarn-debug.log*
9
+ yarn-error.log*
10
+ lerna-debug.log*
11
+ .pnpm-debug.log*
12
+
13
+ # ============================================
14
+ # Lock Files
15
+ # ============================================
16
+ # Uncomment these if you want to exclude lock files
17
+ # package-lock.json
18
+ # yarn.lock
19
+ # pnpm-lock.yaml
20
+
21
+ # ============================================
22
+ # Environment Variables & Secrets
23
+ # ============================================
24
+ .env
25
+ .env.*
26
+ !.env.example
27
+ *.env
28
+
29
+ # Credentials
30
+ **/credentials*.json
31
+ **/secrets*.json
32
+ **/*-credentials.*
33
+ **/*-secrets.*
34
+
35
+ # ============================================
36
+ # Next.js (in example prototypes)
37
+ # ============================================
38
+ .next/
39
+ out/
40
+ build/
41
+ dist/
42
+ *.tsbuildinfo
43
+ next-env.d.ts
44
+
45
+ # ============================================
46
+ # Example Projects
47
+ # ============================================
48
+ # Exclude node_modules in examples
49
+ examples/*/prototype/node_modules/
50
+ examples/*/prototype/.next/
51
+ examples/*/prototype/out/
52
+ examples/*/prototype/build/
53
+ examples/*/prototype/package-lock.json
54
+
55
+ # Keep design tokens and manifests
56
+ !examples/*/references/design-tokens.json
57
+ !examples/*/references/manifest.json
58
+ !examples/*/FEATURES.md
59
+
60
+ # ============================================
61
+ # Build & Generated Files
62
+ # ============================================
63
+ *.log
64
+ *.pid
65
+ *.seed
66
+ *.pid.lock
67
+ .DS_Store
68
+ Thumbs.db
69
+ *.swp
70
+ *~
71
+
72
+ # ============================================
73
+ # IDE & Editor Files
74
+ # ============================================
75
+ # VSCode
76
+ .vscode/
77
+ !.vscode/extensions.json
78
+
79
+ # IntelliJ / WebStorm
80
+ .idea/
81
+ *.iml
82
+ *.iws
83
+ *.ipr
84
+
85
+ # Sublime
86
+ *.sublime-project
87
+ *.sublime-workspace
88
+
89
+ # Vim
90
+ *.swp
91
+ *.swo
92
+ .*.swp
93
+
94
+ # ============================================
95
+ # OS Files
96
+ # ============================================
97
+ # macOS
98
+ .DS_Store
99
+ .AppleDouble
100
+ .LSOverride
101
+ ._*
102
+ .Spotlight-V100
103
+ .Trashes
104
+
105
+ # Windows
106
+ Thumbs.db
107
+ ehthumbs.db
108
+ Desktop.ini
109
+ $RECYCLE.BIN/
110
+
111
+ # Linux
112
+ .directory
113
+ *~
114
+
115
+ # ============================================
116
+ # Testing & Coverage
117
+ # ============================================
118
+ coverage/
119
+ .nyc_output/
120
+ *.lcov
121
+ .coverage
122
+ htmlcov/
123
+ .pytest_cache/
124
+ test-results/
125
+
126
+ # ============================================
127
+ # Browser Automation
128
+ # ============================================
129
+ .playwright/
130
+ playwright-report/
131
+ screenshots/temp/
132
+ *.trace
133
+
134
+ # ============================================
135
+ # Temporary Files
136
+ # ============================================
137
+ *.tmp
138
+ *.temp
139
+ .cache/
140
+ tmp/
141
+ temp/
142
+
143
+ # ============================================
144
+ # Backup Files
145
+ # ============================================
146
+ *.backup
147
+ *.bak
148
+ *.old
149
+
150
+ # ============================================
151
+ # Archives
152
+ # ============================================
153
+ *.zip
154
+ *.tar
155
+ *.tar.gz
156
+ *.rar
157
+
158
+ # ============================================
159
+ # Project-Specific
160
+ # ============================================
161
+ # CLI output
162
+ cli-output/
163
+ validation-reports/
164
+
165
+ # Runtime data
166
+ captured-data/temp/
167
+
168
+ # ============================================
169
+ # Claude Code Configuration
170
+ # ============================================
171
+ # Exclude Claude Code settings files
172
+ **/settings.json
173
+ **/settings.local.json
174
+ ../../settings.json
175
+ ../../settings.local.json
176
+
177
+ # Exclude other Claude directories
178
+ **/commands/
179
+ ../../commands/
180
+
181
+ # ============================================
182
+ # Keep These Files
183
+ # ============================================
184
+ !.gitignore
185
+ !.gitkeep
186
+ !README.md
187
+ !LICENSE
188
+ !SKILL.md