Skip to content

Commit 54b7202

Browse files
chore: Improve CLAUDE.md (#547)
1 parent a060082 commit 54b7202

176 files changed

Lines changed: 22141 additions & 839 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/agent-browser/SKILL.md

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ agent-browser type @e2 "text" # Type without clearing
6464
agent-browser select @e1 "option" # Select dropdown option
6565
agent-browser check @e1 # Check checkbox
6666
agent-browser press Enter # Press key
67+
agent-browser keyboard type "text" # Type at current focus (no selector)
68+
agent-browser keyboard inserttext "text" # Insert without key events
6769
agent-browser scroll down 500 # Scroll page
70+
agent-browser scroll down 500 --selector "div.content" # Scroll within a specific container
6871

6972
# Get information
7073
agent-browser get text @e1 # Get element text
@@ -77,6 +80,11 @@ agent-browser wait --load networkidle # Wait for network idle
7780
agent-browser wait --url "**/page" # Wait for URL pattern
7881
agent-browser wait 2000 # Wait milliseconds
7982

83+
# Downloads
84+
agent-browser download @e1 ./file.pdf # Click element to trigger download
85+
agent-browser wait --download ./output.zip # Wait for any download to complete
86+
agent-browser --download-path ./downloads open <url> # Set default download directory
87+
8088
# Capture
8189
agent-browser screenshot # Screenshot to temp dir
8290
agent-browser screenshot --full # Full page screenshot
@@ -107,6 +115,22 @@ agent-browser click @e5
107115
agent-browser wait --load networkidle
108116
```
109117
118+
### Authentication with Auth Vault (Recommended)
119+
120+
```bash
121+
# Save credentials once (encrypted with AGENT_BROWSER_ENCRYPTION_KEY)
122+
# Recommended: pipe password via stdin to avoid shell history exposure
123+
echo "pass" | agent-browser auth save github --url https://github.com/login --username user --password-stdin
124+
125+
# Login using saved profile (LLM never sees password)
126+
agent-browser auth login github
127+
128+
# List/show/delete profiles
129+
agent-browser auth list
130+
agent-browser auth show github
131+
agent-browser auth delete github
132+
```
133+
110134
### Authentication with State Persistence
111135
112136
```bash
@@ -182,6 +206,19 @@ agent-browser --auto-connect snapshot
182206
agent-browser --cdp 9222 snapshot
183207
```
184208
209+
### Color Scheme (Dark Mode)
210+
211+
```bash
212+
# Persistent dark mode via flag (applies to all pages and new tabs)
213+
agent-browser --color-scheme dark open https://example.com
214+
215+
# Or via environment variable
216+
AGENT_BROWSER_COLOR_SCHEME=dark agent-browser open https://example.com
217+
218+
# Or set during session (persists for subsequent commands)
219+
agent-browser set media dark
220+
```
221+
185222
### Visual Browser (Debugging)
186223
187224
```bash
@@ -227,6 +264,56 @@ agent-browser -p ios close
227264
228265
**Real devices:** Works with physical iOS devices if pre-configured. Use `--device "<UDID>"` where UDID is from `xcrun xctrace list devices`.
229266
267+
## Security
268+
269+
All security features are opt-in. By default, agent-browser imposes no restrictions on navigation, actions, or output.
270+
271+
### Content Boundaries (Recommended for AI Agents)
272+
273+
Enable `--content-boundaries` to wrap page-sourced output in markers that help LLMs distinguish tool output from untrusted page content:
274+
275+
```bash
276+
export AGENT_BROWSER_CONTENT_BOUNDARIES=1
277+
agent-browser snapshot
278+
# Output:
279+
# --- AGENT_BROWSER_PAGE_CONTENT nonce=<hex> origin=https://example.com ---
280+
# [accessibility tree]
281+
# --- END_AGENT_BROWSER_PAGE_CONTENT nonce=<hex> ---
282+
```
283+
284+
### Domain Allowlist
285+
286+
Restrict navigation to trusted domains. Wildcards like `*.example.com` also match the bare domain `example.com`. Sub-resource requests, WebSocket, and EventSource connections to non-allowed domains are also blocked. Include CDN domains your target pages depend on:
287+
288+
```bash
289+
export AGENT_BROWSER_ALLOWED_DOMAINS="example.com,*.example.com"
290+
agent-browser open https://example.com # OK
291+
agent-browser open https://malicious.com # Blocked
292+
```
293+
294+
### Action Policy
295+
296+
Use a policy file to gate destructive actions:
297+
298+
```bash
299+
export AGENT_BROWSER_ACTION_POLICY=./policy.json
300+
```
301+
302+
Example `policy.json`:
303+
```json
304+
{"default": "deny", "allow": ["navigate", "snapshot", "click", "scroll", "wait", "get"]}
305+
```
306+
307+
Auth vault operations (`auth login`, etc.) bypass action policy but domain allowlist still applies.
308+
309+
### Output Limits
310+
311+
Prevent context flooding from large pages:
312+
313+
```bash
314+
export AGENT_BROWSER_MAX_OUTPUT=50000
315+
```
316+
230317
## Diffing (Verifying Changes)
231318
232319
Use `diff snapshot` after performing an action to verify it had the intended effect. This compares the current accessibility tree against the last snapshot taken in the session.
@@ -254,7 +341,7 @@ agent-browser diff url https://staging.example.com https://prod.example.com --sc
254341
255342
## Timeouts and Slow Pages
256343
257-
The default Playwright timeout is 60 seconds for local browsers. For slow websites or large pages, use explicit waits instead of relying on the default timeout:
344+
The default Playwright timeout is 25 seconds for local browsers. This can be overridden with the `AGENT_BROWSER_DEFAULT_TIMEOUT` environment variable (value in milliseconds). For slow websites or large pages, use explicit waits instead of relying on the default timeout:
258345
259346
```bash
260347
# Wait for network activity to settle (best for slow pages)

.agents/skills/agent-browser/templates/authenticated-session.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
# Purpose: Login once, save state, reuse for subsequent runs
44
# Usage: ./authenticated-session.sh <login-url> [state-file]
55
#
6+
# RECOMMENDED: Use the auth vault instead of this template:
7+
# echo "<pass>" | agent-browser auth save myapp --url <login-url> --username <user> --password-stdin
8+
# agent-browser auth login myapp
9+
# The auth vault stores credentials securely and the LLM never sees passwords.
10+
#
611
# Environment variables:
712
# APP_USERNAME - Login username/email
813
# APP_PASSWORD - Login password

.agents/skills/turborepo/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: |
99
monorepo, shares code between apps, runs changed/affected packages, debugs cache,
1010
or has apps/packages directories.
1111
metadata:
12-
version: 2.8.11-canary.17
12+
version: 2.8.13-canary.8
1313
---
1414

1515
# Turborepo Skill
@@ -722,7 +722,7 @@ import { Button } from "@repo/ui/button";
722722

723723
```json
724724
{
725-
"$schema": "https://turborepo.dev/schema.v2.json",
725+
"$schema": "https://v2-8-13-canary-8.turborepo.dev/schema.json",
726726
"tasks": {
727727
"build": {
728728
"dependsOn": ["^build"],

.agents/skills/turborepo/references/best-practices/RULE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@ export * from './modal';
192192

193193
```typescript
194194
// BAD: Reaching into another package
195-
import { Button } from '../../packages/ui/src/button';
195+
import { Button } from "../../packages/ui/src/button";
196196

197197
// GOOD: Install and import properly
198-
import { Button } from '@repo/ui/button';
198+
import { Button } from "@repo/ui/button";
199199
```
200200

201201
### Shared Code in Apps

.agents/skills/turborepo/references/best-practices/dependencies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ catalog:
161161
// Any package.json
162162
{
163163
"dependencies": {
164-
"react": "catalog:" // Uses version from catalog
164+
"react": "catalog:" // Uses version from catalog
165165
}
166166
}
167167
```
@@ -200,7 +200,7 @@ For library packages that expect the consumer to provide dependencies:
200200
"react-dom": "^18.0.0"
201201
},
202202
"devDependencies": {
203-
"react": "^18.0.0", // For development/testing
203+
"react": "^18.0.0", // For development/testing
204204
"react-dom": "^18.0.0"
205205
}
206206
}

.agents/skills/turborepo/references/best-practices/packages.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ Package handles its own compilation.
9393
```json
9494
{
9595
"exports": {
96-
".": "./src/index.ts", // @repo/ui
97-
"./button": "./src/button.tsx", // @repo/ui/button
98-
"./card": "./src/card.tsx", // @repo/ui/card
96+
".": "./src/index.ts", // @repo/ui
97+
"./button": "./src/button.tsx", // @repo/ui/button
98+
"./card": "./src/card.tsx", // @repo/ui/card
9999
"./hooks": "./src/hooks/index.ts" // @repo/ui/hooks
100100
}
101101
}
@@ -124,7 +124,7 @@ Package handles its own compilation.
124124
// apps/web/package.json
125125
{
126126
"dependencies": {
127-
"@repo/ui": "workspace:*" // pnpm/bun
127+
"@repo/ui": "workspace:*" // pnpm/bun
128128
// "@repo/ui": "*" // npm/yarn
129129
}
130130
}
@@ -287,7 +287,7 @@ TypeScript `compilerOptions.paths` breaks with JIT packages. Use Node.js subpath
287287

288288
```typescript
289289
// packages/ui/button.tsx
290-
import { MY_STRING } from "#utils.ts"; // Uses .ts extension
290+
import { MY_STRING } from "#utils.ts"; // Uses .ts extension
291291
```
292292

293293
**Compiled Package:**
@@ -303,7 +303,7 @@ import { MY_STRING } from "#utils.ts"; // Uses .ts extension
303303

304304
```typescript
305305
// packages/ui/button.tsx
306-
import { MY_STRING } from "#utils.js"; // Uses .js extension
306+
import { MY_STRING } from "#utils.js"; // Uses .js extension
307307
```
308308

309309
### Use `tsc` for Internal Packages

.agents/skills/turborepo/references/best-practices/structure.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Package tasks enable Turborepo to:
9595

9696
```json
9797
{
98-
"$schema": "https://turborepo.dev/schema.v2.json",
98+
"$schema": "https://v2-8-13-canary-8.turborepo.dev/schema.json",
9999
"tasks": {
100100
"build": {
101101
"dependsOn": ["^build"],
@@ -124,8 +124,8 @@ You can group packages by adding more workspace paths:
124124
packages:
125125
- "apps/*"
126126
- "packages/*"
127-
- "packages/config/*" # Grouped configs
128-
- "packages/features/*" # Feature packages
127+
- "packages/config/*" # Grouped configs
128+
- "packages/features/*" # Feature packages
129129
```
130130
131131
This allows:
@@ -148,7 +148,7 @@ packages/
148148
```yaml
149149
# BAD: Nested wildcards cause ambiguous behavior
150150
packages:
151-
- "packages/**" # Don't do this!
151+
- "packages/**" # Don't do this!
152152
```
153153
154154
## Package Anatomy
@@ -167,10 +167,11 @@ packages/ui/
167167

168168
```json
169169
{
170-
"name": "@repo/ui", // Unique, namespaced name
171-
"version": "0.0.0", // Version (can be 0.0.0 for internal)
172-
"private": true, // Prevents accidental publishing
173-
"exports": { // Entry points
170+
"name": "@repo/ui", // Unique, namespaced name
171+
"version": "0.0.0", // Version (can be 0.0.0 for internal)
172+
"private": true, // Prevents accidental publishing
173+
"exports": {
174+
// Entry points
174175
"./button": "./src/button.tsx"
175176
}
176177
}
@@ -254,7 +255,7 @@ packages/
254255
```js
255256
// apps/web/.eslintrc.js
256257
module.exports = {
257-
extends: ["@repo/eslint-config/next"],
258+
extends: ["@repo/eslint-config/next"]
258259
};
259260
```
260261

.agents/skills/turborepo/references/caching/gotchas.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Task uses an env var not listed in `env`:
109109

110110
```javascript
111111
// build.js
112-
const apiUrl = process.env.API_URL; // not tracked!
112+
const apiUrl = process.env.API_URL; // not tracked!
113113
```
114114

115115
Fix: add to task config:
@@ -134,7 +134,7 @@ Task reads a file outside default inputs:
134134
"build": {
135135
"inputs": [
136136
"$TURBO_DEFAULT$",
137-
"../../shared-config.json" // file outside package
137+
"../../shared-config.json" // file outside package
138138
]
139139
}
140140
}

.agents/skills/turborepo/references/ci/RULE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This requires Git history to compute what changed.
4949
# GitHub Actions
5050
- uses: actions/checkout@v4
5151
with:
52-
fetch-depth: 2 # Minimum for --affected
52+
fetch-depth: 2 # Minimum for --affected
5353
# Use 0 for full history if merge base is far
5454
```
5555

@@ -60,7 +60,7 @@ Turborepo compares the current HEAD to the merge base with `main`. If that commi
6060
For PRs with many commits, consider:
6161

6262
```yaml
63-
fetch-depth: 0 # Full history
63+
fetch-depth: 0 # Full history
6464
```
6565
6666
## Environment Variables Reference

.agents/skills/turborepo/references/ci/github-actions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- uses: actions/setup-node@v4
4545
with:
4646
node-version: 20
47-
cache: 'pnpm'
47+
cache: "pnpm"
4848

4949
- run: pnpm install --frozen-lockfile
5050
```
@@ -55,7 +55,7 @@ jobs:
5555
- uses: actions/setup-node@v4
5656
with:
5757
node-version: 20
58-
cache: 'yarn'
58+
cache: "yarn"
5959

6060
- run: yarn install --frozen-lockfile
6161
```
@@ -146,7 +146,7 @@ jobs:
146146
- uses: actions/setup-node@v4
147147
with:
148148
node-version: 20
149-
cache: 'pnpm'
149+
cache: "pnpm"
150150
151151
- name: Install dependencies
152152
run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)