@ziamana/bruine 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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +315 -0
  3. package/THIRD_PARTY_NOTICES.md +24 -0
  4. package/cordis.patch.yml +166 -0
  5. package/dist/bin.js +5358 -0
  6. package/dist/compat.js +40 -0
  7. package/dist/plugins/approval.js +147 -0
  8. package/dist/plugins/headless.js +236 -0
  9. package/dist/plugins/herdr.js +470 -0
  10. package/dist/plugins/mcp.js +275 -0
  11. package/dist/plugins/modes.js +850 -0
  12. package/dist/plugins/render.js +3723 -0
  13. package/dist/plugins/repl.js +9589 -0
  14. package/dist/plugins/silence.js +234 -0
  15. package/dist/plugins/startup.js +42 -0
  16. package/dist/plugins/web-search.js +138 -0
  17. package/package.json +93 -0
  18. package/skills/code-review/SKILL.md +30 -0
  19. package/skills/git-workflow/SKILL.md +31 -0
  20. package/skills/impeccable/LICENSE +191 -0
  21. package/skills/impeccable/NOTICE.md +11 -0
  22. package/skills/impeccable/SKILL.md +87 -0
  23. package/skills/impeccable/reference/adapt.md +318 -0
  24. package/skills/impeccable/reference/adapt.native.md +58 -0
  25. package/skills/impeccable/reference/android.md +46 -0
  26. package/skills/impeccable/reference/animate.md +89 -0
  27. package/skills/impeccable/reference/audit.md +137 -0
  28. package/skills/impeccable/reference/audit.native.md +139 -0
  29. package/skills/impeccable/reference/bolder.md +33 -0
  30. package/skills/impeccable/reference/clarify.md +94 -0
  31. package/skills/impeccable/reference/colorize.md +86 -0
  32. package/skills/impeccable/reference/component-review.md +63 -0
  33. package/skills/impeccable/reference/craft-floor.md +44 -0
  34. package/skills/impeccable/reference/craft.md +5 -0
  35. package/skills/impeccable/reference/critique.md +806 -0
  36. package/skills/impeccable/reference/degraded/asset-producer.md +42 -0
  37. package/skills/impeccable/reference/degraded/documenter.md +24 -0
  38. package/skills/impeccable/reference/degraded/finish-reviewer.md +38 -0
  39. package/skills/impeccable/reference/degraded/manual-edit-applier.md +92 -0
  40. package/skills/impeccable/reference/delight.md +70 -0
  41. package/skills/impeccable/reference/distill.md +111 -0
  42. package/skills/impeccable/reference/doctor.md +54 -0
  43. package/skills/impeccable/reference/document.md +416 -0
  44. package/skills/impeccable/reference/extract.md +69 -0
  45. package/skills/impeccable/reference/generate.md +101 -0
  46. package/skills/impeccable/reference/harden.md +345 -0
  47. package/skills/impeccable/reference/hooks.md +113 -0
  48. package/skills/impeccable/reference/init.md +131 -0
  49. package/skills/impeccable/reference/ios.md +51 -0
  50. package/skills/impeccable/reference/layout.md +84 -0
  51. package/skills/impeccable/reference/live-setup.md +104 -0
  52. package/skills/impeccable/reference/live.md +325 -0
  53. package/skills/impeccable/reference/mode-operate.md +21 -0
  54. package/skills/impeccable/reference/mode-persuade.md +19 -0
  55. package/skills/impeccable/reference/mode-read.md +21 -0
  56. package/skills/impeccable/reference/new-work.md +154 -0
  57. package/skills/impeccable/reference/onboard.md +234 -0
  58. package/skills/impeccable/reference/operate.md +61 -0
  59. package/skills/impeccable/reference/optimize.md +258 -0
  60. package/skills/impeccable/reference/overdrive.md +127 -0
  61. package/skills/impeccable/reference/polish.md +105 -0
  62. package/skills/impeccable/reference/quieter.md +99 -0
  63. package/skills/impeccable/reference/region-map.md +26 -0
  64. package/skills/impeccable/reference/routing.md +24 -0
  65. package/skills/impeccable/reference/shape.md +59 -0
  66. package/skills/impeccable/reference/typeset.md +80 -0
  67. package/skills/impeccable/reference/visualize.md +46 -0
  68. package/skills/impeccable/scripts/VERSION +1 -0
  69. package/skills/impeccable/scripts/command-metadata.json +98 -0
  70. package/skills/impeccable/scripts/data/font-index-failures.json +121 -0
  71. package/skills/impeccable/scripts/data/font-index.json +1 -0
  72. package/skills/impeccable/scripts/impeccable +206 -0
  73. package/skills/impeccable/scripts/impeccable.cmd +214 -0
  74. package/skills/impeccable/scripts/live-browser-dom.js +167 -0
  75. package/skills/impeccable/scripts/live-browser-ignores.js +242 -0
  76. package/skills/impeccable/scripts/live-browser-session.js +148 -0
  77. package/skills/impeccable/scripts/live-browser.js +13510 -0
  78. package/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  79. package/skills/make-interfaces-feel-better/LICENSE +21 -0
  80. package/skills/make-interfaces-feel-better/SKILL.md +187 -0
  81. package/skills/make-interfaces-feel-better/agents/openai.yaml +3 -0
  82. package/skills/make-interfaces-feel-better/animations.md +403 -0
  83. package/skills/make-interfaces-feel-better/icons.md +63 -0
  84. package/skills/make-interfaces-feel-better/performance.md +88 -0
  85. package/skills/make-interfaces-feel-better/surfaces.md +256 -0
  86. package/skills/make-interfaces-feel-better/typography.md +157 -0
  87. package/skills/playwright-cli/LICENSE +201 -0
  88. package/skills/playwright-cli/SKILL.md +489 -0
  89. package/skills/playwright-cli/references/element-attributes.md +23 -0
  90. package/skills/playwright-cli/references/playwright-tests.md +39 -0
  91. package/skills/playwright-cli/references/pr-attachments.md +60 -0
  92. package/skills/playwright-cli/references/request-mocking.md +87 -0
  93. package/skills/playwright-cli/references/running-code.md +245 -0
  94. package/skills/playwright-cli/references/session-management.md +227 -0
  95. package/skills/playwright-cli/references/storage-state.md +275 -0
  96. package/skills/playwright-cli/references/test-generation.md +433 -0
  97. package/skills/playwright-cli/references/tracing.md +139 -0
  98. package/skills/playwright-cli/references/video-recording.md +216 -0
  99. package/skills/remotion/SKILL.md +42 -0
  100. package/skills/systematic-debugging/SKILL.md +26 -0
  101. package/skills/thermo-nuclear-code-quality-review/LICENSE +21 -0
  102. package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
  103. package/skills/write-tests/SKILL.md +35 -0
  104. package/skills/youtube-transcript/LICENSE +21 -0
  105. package/skills/youtube-transcript/SKILL.md +41 -0
  106. package/skills/youtube-transcript/package.json +8 -0
  107. package/skills/youtube-transcript/transcript.js +44 -0
@@ -0,0 +1,245 @@
1
+ # Running Custom Playwright Code
2
+
3
+ Use `run-code` to execute arbitrary Playwright code for advanced scenarios not covered by CLI commands.
4
+
5
+ ## Syntax
6
+
7
+ ```bash
8
+ playwright-cli run-code "async page => {
9
+ // Your Playwright code here
10
+ // Access page.context() for browser context operations
11
+ }"
12
+ ```
13
+
14
+ You can also load the function from a file:
15
+
16
+ ```bash
17
+ playwright-cli run-code --filename=./my-script.js
18
+ ```
19
+
20
+
21
+ The code must be a single function expression, it is wrapped in `(...)` and evaluated.
22
+ import/export/require syntax is not supported.
23
+
24
+ The code runs in an isolated context, not in a full Node.js environment. `require`, `process` and Node modules are not
25
+ available. Timers (`setTimeout`, `setInterval`), `fetch`, `URL`, `Buffer`, `crypto`, `AbortController`, `TextEncoder`
26
+ and `TextDecoder` are available.
27
+
28
+ ## Geolocation
29
+
30
+ ```bash
31
+ # Grant geolocation permission and set location
32
+ playwright-cli run-code "async page => {
33
+ await page.context().grantPermissions(['geolocation']);
34
+ await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });
35
+ }"
36
+
37
+ # Set location to London
38
+ playwright-cli run-code "async page => {
39
+ await page.context().grantPermissions(['geolocation']);
40
+ await page.context().setGeolocation({ latitude: 51.5074, longitude: -0.1278 });
41
+ }"
42
+
43
+ # Clear geolocation override
44
+ playwright-cli run-code "async page => {
45
+ await page.context().clearPermissions();
46
+ }"
47
+ ```
48
+
49
+ ## Permissions
50
+
51
+ ```bash
52
+ # Grant multiple permissions
53
+ playwright-cli run-code "async page => {
54
+ await page.context().grantPermissions([
55
+ 'geolocation',
56
+ 'notifications',
57
+ 'camera',
58
+ 'microphone'
59
+ ]);
60
+ }"
61
+
62
+ # Grant permissions for specific origin
63
+ playwright-cli run-code "async page => {
64
+ await page.context().grantPermissions(['clipboard-read'], {
65
+ origin: 'https://example.com'
66
+ });
67
+ }"
68
+ ```
69
+
70
+ ## Media Emulation
71
+
72
+ ```bash
73
+ # Emulate dark color scheme
74
+ playwright-cli run-code "async page => {
75
+ await page.emulateMedia({ colorScheme: 'dark' });
76
+ }"
77
+
78
+ # Emulate light color scheme
79
+ playwright-cli run-code "async page => {
80
+ await page.emulateMedia({ colorScheme: 'light' });
81
+ }"
82
+
83
+ # Emulate reduced motion
84
+ playwright-cli run-code "async page => {
85
+ await page.emulateMedia({ reducedMotion: 'reduce' });
86
+ }"
87
+
88
+ # Emulate print media
89
+ playwright-cli run-code "async page => {
90
+ await page.emulateMedia({ media: 'print' });
91
+ }"
92
+ ```
93
+
94
+ ## Wait Strategies
95
+
96
+ ```bash
97
+ # Wait for network idle
98
+ playwright-cli run-code "async page => {
99
+ await page.waitForLoadState('networkidle');
100
+ }"
101
+
102
+ # Wait for specific element
103
+ playwright-cli run-code "async page => {
104
+ await page.locator('.loading').waitFor({ state: 'hidden' });
105
+ }"
106
+
107
+ # Wait for function to return true
108
+ playwright-cli run-code "async page => {
109
+ await page.waitForFunction(() => window.appReady === true);
110
+ }"
111
+
112
+ # Wait with timeout
113
+ playwright-cli run-code "async page => {
114
+ await page.locator('.result').waitFor({ timeout: 10000 });
115
+ }"
116
+ ```
117
+
118
+ ## Frames and Iframes
119
+
120
+ ```bash
121
+ # Work with iframe
122
+ playwright-cli run-code "async page => {
123
+ const frame = page.locator('iframe#my-iframe').contentFrame();
124
+ await frame.locator('button').click();
125
+ }"
126
+
127
+ # Get all frames
128
+ playwright-cli run-code "async page => {
129
+ const frames = page.frames();
130
+ return frames.map(f => f.url());
131
+ }"
132
+ ```
133
+
134
+ ## File Downloads
135
+
136
+ ```bash
137
+ # Handle file download
138
+ playwright-cli run-code "async page => {
139
+ const downloadPromise = page.waitForEvent('download');
140
+ await page.getByRole('link', { name: 'Download' }).click();
141
+ const download = await downloadPromise;
142
+ await download.saveAs('./downloaded-file.pdf');
143
+ return download.suggestedFilename();
144
+ }"
145
+ ```
146
+
147
+ ## Clipboard
148
+
149
+ ```bash
150
+ # Read clipboard (requires permission)
151
+ playwright-cli run-code "async page => {
152
+ await page.context().grantPermissions(['clipboard-read']);
153
+ return await page.evaluate(() => navigator.clipboard.readText());
154
+ }"
155
+
156
+ # Write to clipboard
157
+ playwright-cli run-code "async page => {
158
+ await page.evaluate(text => navigator.clipboard.writeText(text), 'Hello clipboard!');
159
+ }"
160
+ ```
161
+
162
+ ## Page Information
163
+
164
+ ```bash
165
+ # Get page title
166
+ playwright-cli run-code "async page => {
167
+ return await page.title();
168
+ }"
169
+
170
+ # Get current URL
171
+ playwright-cli run-code "async page => {
172
+ return page.url();
173
+ }"
174
+
175
+ # Get page content
176
+ playwright-cli run-code "async page => {
177
+ return await page.content();
178
+ }"
179
+
180
+ # Get viewport size
181
+ playwright-cli run-code "async page => {
182
+ return page.viewportSize();
183
+ }"
184
+ ```
185
+
186
+ ## JavaScript Execution
187
+
188
+ ```bash
189
+ # Execute JavaScript and return result
190
+ playwright-cli run-code "async page => {
191
+ return await page.evaluate(() => {
192
+ return {
193
+ userAgent: navigator.userAgent,
194
+ language: navigator.language,
195
+ cookiesEnabled: navigator.cookieEnabled
196
+ };
197
+ });
198
+ }"
199
+
200
+ # Pass arguments to evaluate
201
+ playwright-cli run-code "async page => {
202
+ const multiplier = 5;
203
+ return await page.evaluate(m => document.querySelectorAll('li').length * m, multiplier);
204
+ }"
205
+ ```
206
+
207
+ ## Error Handling
208
+
209
+ ```bash
210
+ # Try-catch in run-code
211
+ playwright-cli run-code "async page => {
212
+ try {
213
+ await page.getByRole('button', { name: 'Submit' }).click({ timeout: 1000 });
214
+ return 'clicked';
215
+ } catch (e) {
216
+ return 'element not found';
217
+ }
218
+ }"
219
+ ```
220
+
221
+ ## Complex Workflows
222
+
223
+ ```bash
224
+ # Login and save state
225
+ playwright-cli run-code "async page => {
226
+ await page.goto('https://example.com/login');
227
+ await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
228
+ await page.getByRole('textbox', { name: 'Password' }).fill('secret');
229
+ await page.getByRole('button', { name: 'Sign in' }).click();
230
+ await page.waitForURL('**/dashboard');
231
+ await page.context().storageState({ path: 'auth.json' });
232
+ return 'Login successful';
233
+ }"
234
+
235
+ # Scrape data from multiple pages
236
+ playwright-cli run-code "async page => {
237
+ const results = [];
238
+ for (let i = 1; i <= 3; i++) {
239
+ await page.goto(\`https://example.com/page/\${i}\`);
240
+ const items = await page.locator('.item').allTextContents();
241
+ results.push(...items);
242
+ }
243
+ return results;
244
+ }"
245
+ ```
@@ -0,0 +1,227 @@
1
+ # Browser Session Management
2
+
3
+ Run multiple isolated browser sessions concurrently with state persistence.
4
+
5
+ ## Named Browser Sessions
6
+
7
+ Use `-s` flag to isolate browser contexts:
8
+
9
+ ```bash
10
+ # Browser 1: Authentication flow
11
+ playwright-cli -s=auth open https://app.example.com/login
12
+
13
+ # Browser 2: Public browsing (separate cookies, storage)
14
+ playwright-cli -s=public open https://example.com
15
+
16
+ # Commands are isolated by browser session
17
+ playwright-cli -s=auth fill e1 "user@example.com"
18
+ playwright-cli -s=public snapshot
19
+ ```
20
+
21
+ ## Browser Session Isolation Properties
22
+
23
+ Each browser session has independent:
24
+ - Cookies
25
+ - LocalStorage / SessionStorage
26
+ - IndexedDB
27
+ - Cache
28
+ - Browsing history
29
+ - Open tabs
30
+
31
+ ## Browser Session Commands
32
+
33
+ ```bash
34
+ # List all browser sessions
35
+ playwright-cli list
36
+
37
+ # Stop a browser session (close the browser)
38
+ playwright-cli close # stop the default browser
39
+ playwright-cli -s=mysession close # stop a named browser
40
+
41
+ # Stop all browser sessions
42
+ playwright-cli close-all
43
+
44
+ # Forcefully kill all daemon processes (for stale/zombie processes)
45
+ playwright-cli kill-all
46
+
47
+ # Delete browser session user data (profile directory)
48
+ playwright-cli delete-data # delete default browser data
49
+ playwright-cli -s=mysession delete-data # delete named browser data
50
+ ```
51
+
52
+ A headless session shuts down on its own after an hour without commands; the next command then reports that the browser is not open, so run `open` again. Headed browsers stay open. Use `open --idle-timeout=<ms>` to change the timeout, or `0` to disable it.
53
+
54
+ ## Environment Variable
55
+
56
+ Set a default browser session name via environment variable:
57
+
58
+ ```bash
59
+ export PLAYWRIGHT_CLI_SESSION="mysession"
60
+ playwright-cli open example.com # Uses "mysession" automatically
61
+ ```
62
+
63
+ ## Common Patterns
64
+
65
+ ### Concurrent Scraping
66
+
67
+ ```bash
68
+ #!/bin/bash
69
+ # Scrape multiple sites concurrently
70
+
71
+ # Start all browsers
72
+ playwright-cli -s=site1 open https://site1.com &
73
+ playwright-cli -s=site2 open https://site2.com &
74
+ playwright-cli -s=site3 open https://site3.com &
75
+ wait
76
+
77
+ # Take snapshots from each
78
+ playwright-cli -s=site1 snapshot
79
+ playwright-cli -s=site2 snapshot
80
+ playwright-cli -s=site3 snapshot
81
+
82
+ # Cleanup
83
+ playwright-cli close-all
84
+ ```
85
+
86
+ ### A/B Testing Sessions
87
+
88
+ ```bash
89
+ # Test different user experiences
90
+ playwright-cli -s=variant-a open "https://app.com?variant=a"
91
+ playwright-cli -s=variant-b open "https://app.com?variant=b"
92
+
93
+ # Compare
94
+ playwright-cli -s=variant-a screenshot
95
+ playwright-cli -s=variant-b screenshot
96
+ ```
97
+
98
+ ### Persistent Profile
99
+
100
+ By default, browser profile is kept in memory only. Use `--persistent` flag on `open` to persist the browser profile to disk:
101
+
102
+ ```bash
103
+ # Use persistent profile (auto-generated location)
104
+ playwright-cli open https://example.com --persistent
105
+
106
+ # Use persistent profile with custom directory
107
+ playwright-cli open https://example.com --profile=/path/to/profile
108
+ ```
109
+
110
+ ## Attaching to a Running Browser
111
+
112
+ Use `attach` to connect to a browser that is already running, instead of launching a new one.
113
+
114
+ ### Attach by channel name
115
+
116
+ Connect to a running Chrome or Edge instance by its channel name. The browser must have remote debugging enabled — navigate to `chrome://inspect/#remote-debugging` in the target browser and check "Allow remote debugging for this browser instance".
117
+
118
+ ```bash
119
+ # Attach to Chrome
120
+ playwright-cli attach --cdp=chrome
121
+
122
+ # Attach to Chrome Canary
123
+ playwright-cli attach --cdp=chrome-canary
124
+
125
+ # Attach to Microsoft Edge
126
+ playwright-cli attach --cdp=msedge
127
+
128
+ # Attach to Edge Dev
129
+ playwright-cli attach --cdp=msedge-dev
130
+ ```
131
+
132
+ Supported channels: `chrome`, `chrome-beta`, `chrome-dev`, `chrome-canary`, `msedge`, `msedge-beta`, `msedge-dev`, `msedge-canary`.
133
+
134
+ When `--session` is not provided, the session is named after the channel (e.g. `--cdp=msedge` creates a session called `msedge`), so parallel attaches to Chrome and Edge don't collide on `default`. Pass `--session=<name>` to override.
135
+
136
+ ### Attach via CDP endpoint
137
+
138
+ Connect to a browser that exposes a Chrome DevTools Protocol endpoint:
139
+
140
+ ```bash
141
+ playwright-cli attach --cdp=http://localhost:9222
142
+ ```
143
+
144
+ ### Attach via browser extension
145
+
146
+ Connect to a browser with the Playwright extension installed:
147
+
148
+ ```bash
149
+ playwright-cli attach --extension
150
+ ```
151
+
152
+ ### Detach
153
+
154
+ Tear down an attached session without affecting the external browser:
155
+
156
+ ```bash
157
+ # Detach the default attached session
158
+ playwright-cli detach
159
+
160
+ # Detach a specific attached session
161
+ playwright-cli -s=msedge detach
162
+ ```
163
+
164
+ `detach` only works on sessions created via `attach`. For sessions created via `open`, use `close`.
165
+
166
+ ## Default Browser Session
167
+
168
+ When `-s` is omitted, commands use the default browser session:
169
+
170
+ ```bash
171
+ # These use the same default browser session
172
+ playwright-cli open https://example.com
173
+ playwright-cli snapshot
174
+ playwright-cli close # Stops default browser
175
+ ```
176
+
177
+ ## Browser Session Configuration
178
+
179
+ Configure a browser session with specific settings when opening:
180
+
181
+ ```bash
182
+ # Open with config file
183
+ playwright-cli open https://example.com --config=.playwright/my-cli.json
184
+
185
+ # Open with specific browser
186
+ playwright-cli open https://example.com --browser=firefox
187
+
188
+ # Open in headed mode
189
+ playwright-cli open https://example.com --headed
190
+
191
+ # Open with persistent profile
192
+ playwright-cli open https://example.com --persistent
193
+ ```
194
+
195
+ ## Best Practices
196
+
197
+ ### 1. Name Browser Sessions Semantically
198
+
199
+ ```bash
200
+ # GOOD: Clear purpose
201
+ playwright-cli -s=github-auth open https://github.com
202
+ playwright-cli -s=docs-scrape open https://docs.example.com
203
+
204
+ # AVOID: Generic names
205
+ playwright-cli -s=s1 open https://github.com
206
+ ```
207
+
208
+ ### 2. Always Clean Up
209
+
210
+ ```bash
211
+ # Stop browsers when done
212
+ playwright-cli -s=auth close
213
+ playwright-cli -s=scrape close
214
+
215
+ # Or stop all at once
216
+ playwright-cli close-all
217
+
218
+ # If browsers become unresponsive or zombie processes remain
219
+ playwright-cli kill-all
220
+ ```
221
+
222
+ ### 3. Delete Stale Browser Data
223
+
224
+ ```bash
225
+ # Remove old browser data to free disk space
226
+ playwright-cli -s=oldsession delete-data
227
+ ```