Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: "20"

- name: Install dependencies
working-directory: skills/dev-browser
run: bun install --frozen-lockfile
run: npm install

- name: TypeScript check
working-directory: skills/dev-browser
run: bun x tsc --noEmit
run: npx tsc --noEmit

test:
name: Tests
Expand All @@ -38,22 +38,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: "20"

- name: Install dependencies
working-directory: skills/dev-browser
run: bun install --frozen-lockfile
run: npm install

- name: Install Playwright browsers
working-directory: skills/dev-browser
run: bun x playwright install --with-deps chromium
run: npx playwright install --with-deps chromium

- name: Run tests
working-directory: skills/dev-browser
run: bun run test
run: npm test

format:
name: Formatting
Expand All @@ -62,13 +62,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
bun-version: latest
node-version: "20"
cache: "npm"

- name: Install dependencies
run: bun install --frozen-lockfile
run: npm ci

- name: Check formatting
run: bun run format:check
run: npm run format:check
24 changes: 12 additions & 12 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Build and Development Commands

Always use Bun instead of Node.js/npm/pnpm.
Always use Node.js/npm instead of Bun.

```bash
# Install dependencies (from skills/dev-browser/ directory)
cd skills/dev-browser && bun install
cd skills/dev-browser && npm install

# Start the dev-browser server
cd skills/dev-browser && bun run start-server
cd skills/dev-browser && npm run start-server

# Run dev mode with watch
cd skills/dev-browser && bun run dev
cd skills/dev-browser && npm run dev

# Run tests (uses vitest)
cd skills/dev-browser && bun run test
cd skills/dev-browser && npm test

# Run TypeScript check
cd skills/dev-browser && bun x tsc --noEmit
cd skills/dev-browser && npx tsc --noEmit
```

## Important: Before Completing Code Changes

**Always run these checks before considering a task complete:**

1. **TypeScript check**: `bun x tsc --noEmit` - Ensure no type errors
2. **Tests**: `bun run test` - Ensure all tests pass
1. **TypeScript check**: `npx tsc --noEmit` - Ensure no type errors
2. **Tests**: `npm test` - Ensure all tests pass

Common TypeScript issues in this codebase:

Expand Down Expand Up @@ -95,8 +95,8 @@ await page.goto("https://example.com");
await client.disconnect(); // Disconnects CDP but page stays alive on server
```

## Bun-Specific Guidelines
## Node.js Guidelines

- Use `bun x tsx` for running TypeScript files
- Bun auto-loads `.env` files (no dotenv needed)
- Prefer `Bun.file` over `node:fs` where possible
- Use `npx tsx` for running TypeScript files
- Use `dotenv` or similar if you need to load `.env` files
- Use `node:fs` for file system operations
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ In practice, Claude will often explore a page step-by-step first, then generate
## Prerequisites

- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI installed
- [Bun](https://bun.sh) runtime (v1.0 or later)
```bash
curl -fsSL https://bun.sh/install | bash
```
- [Node.js](https://nodejs.org) (v18 or later) with npm

## Installation

Expand Down Expand Up @@ -81,8 +78,8 @@ Before using the skill, start the dev-browser server in a separate terminal:

```bash
cd ~/.claude/skills/dev-browser
bun install # First time only
bun run start-server
npm install # First time only
npm run start-server
```

Keep this terminal running while you use Amp.
Expand Down Expand Up @@ -134,14 +131,14 @@ Add to your `~/.claude/settings.json` (user-level, applies to all projects):
```json
{
"permissions": {
"allow": ["Skill(dev-browser:dev-browser)", "Bash(bun x tsx:*)"],
"allow": ["Skill(dev-browser:dev-browser)", "Bash(npx tsx:*)"],
"deny": [],
"ask": []
}
}
```

This allowlists the dev-browser skill and the `bun x tsx` command that runs the browser automation scripts, regardless of which directory the skill is installed in.
This allowlists the dev-browser skill and the `npx tsx` command that runs the browser automation scripts, regardless of which directory the skill is installed in.

For project-level settings, add to `.claude/settings.json` in your project root.

Expand Down
Loading