Pinchtab pinchtab-dev
Develop and contribute to the PinchTab project. Use when working on PinchTab source code, adding features, fixing bugs, running tests, or preparing PRs. Triggers on "work on pinchtab", "pinchtab development", "contribute to pinchtab", "fix pinchtab bug", "add pinchtab feature".
git clone https://github.com/pinchtab/pinchtab
T=$(mktemp -d) && git clone --depth=1 https://github.com/pinchtab/pinchtab "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pinchtab-dev" ~/.claude/skills/pinchtab-pinchtab-pinchtab-dev && rm -rf "$T"
skills/pinchtab-dev/SKILL.mdPinchTab Development
PinchTab is a browser control server for AI agents — Small Go binary with HTTP API.
Project Location
cd ~/dev/pinchtab
Dev Commands
All development commands run via
./dev:
| Command | Description |
|---|---|
| Build the application |
| Build & run |
| Hot-reload dashboard development (Vite + Go) |
| Run the application |
| All checks (Go + Dashboard) |
| Go checks only |
| Dashboard checks only |
| Go unit tests |
| Dashboard unit tests |
| PR suite (api + cli + infra) |
| Release suite (all extended) |
| Build local image and Docker smoke test |
| Setup dev environment |
Architecture
cmd/pinchtab/ CLI entry point internal/ bridge/ Chrome CDP communication handlers/ HTTP API handlers server/ HTTP server dashboard/ Embedded React dashboard config/ Configuration assets/ Embedded assets (stealth.js) dashboard/ React dashboard source (Vite + TypeScript) tests/e2e/ E2E test suites
Workflow: New Feature or Bug Fix
-
Create branch from
:maingit checkout main && git pull git checkout -b feat/my-feature # or fix/my-bug -
Make changes — follow code patterns in existing files
-
Run checks locally:
./dev check # Lint + format + typecheck ./dev test unit # Go unit tests ./dev e2e pr # E2E tests (Docker required) -
Commit with conventional commits:
new featurefeat:
bug fixfix:
code change without behavior changerefactor:
adding teststest:
documentationdocs:
maintenancechore:
-
Push and create PR
Definition of Done (PR Checklist)
Required — Code Quality
- Error handling explicit — all errors wrapped with
, no silent failures%w - No regressions — verify stealth, token efficiency, session persistence
- SOLID principles — functions do one thing, testable
- No redundant comments — explain why, not what
Required — Testing
- New/changed functionality has tests
- Docker E2E tests pass locally:
./dev e2e pr - If npm wrapper touched:
andnpm pack
worknpm install
Required — Documentation
- README.md updated if user-facing changes
- /docs/ updated if API/architecture changed
Required — Review
- PR description explains what + why
- Commits are atomic with good messages
Key Files
| File | Purpose |
|---|---|
| Bot detection evasion (light/medium/full levels) |
| Chrome CDP bridge |
| HTTP API endpoints |
| React dashboard source |
| API E2E tests |
| CLI E2E tests |
Testing
Unit Tests
./dev test unit # All Go tests go test ./internal/handlers # Specific package
E2E Tests (requires Docker)
./dev e2e pr # PR suite (api + cli + infra basic tests) ./dev e2e api # API basic tests ./dev e2e cli # CLI basic tests ./dev e2e infra # Infra basic tests ./dev e2e api-extended # API extended tests (multi-instance) ./dev e2e cli-extended # CLI extended tests ./dev e2e infra-extended # Infra extended tests (multi-instance) ./dev e2e release # Full release suite (all extended tests) ./dev e2e docker # Docker smoke test only # Run specific test file(s) with filter (second argument) ./dev e2e api clipboard # Run only clipboard-basic.sh ./dev e2e api-extended "clipboard|console" # Run clipboard and console tests ./dev e2e cli browser # Run browser-basic.sh in CLI suite
The filter is a regex pattern matched against scenario filenames. Requires Docker daemon running.
Dashboard Tests
./dev test dashboard # Vitest cd dashboard && npm test
Dashboard Development
Setup
Start hot-reload development:
./dev dashboard
This runs:
- Backend on
:9867 - Vite dev server on
with hot-reload:5173 - Dashboard at
http://localhost:5173/dashboard/
Development Workflow (Use PinchTab to Develop PinchTab)
Do not assume changes worked. Use pinchtab itself to verify changes visually:
-
Start dev mode:
./dev dashboard -
Make changes to files in
dashboard/src/ -
Verify with pinchtab — use the pinchtab skill to inspect the dashboard:
# Navigate to the page under development curl -X POST http://localhost:9867/navigate \ -d '{"url":"http://localhost:5173/dashboard/settings"}' # Take a screenshot to verify the change curl -X POST http://localhost:9867/screenshot \ -d '{"path":"/tmp/dashboard-check.png"}' # Or get a snapshot to inspect elements curl -s http://localhost:9867/snapshot | jq . -
Provide evidence — when reporting changes, include:
- Link to the page:
http://localhost:5173/dashboard/{page} - Screenshot of the result
- Relevant snapshot data if inspecting specific elements
- Link to the page:
Example: Verifying a Settings Page Change
# Navigate to settings curl -X POST http://localhost:9867/navigate \ -d '{"url":"http://localhost:5173/dashboard/settings"}' # Screenshot the result curl -X POST http://localhost:9867/screenshot \ -d '{"path":"./dashboard-settings.png","fullPage":true}' # Find specific element curl -X POST http://localhost:9867/find \ -d '{"selector":"[data-testid=stealth-level]"}'
Key Dashboard Pages
| Page | URL | Purpose |
|---|---|---|
| Home | | Instance overview |
| Settings | | Configuration |
| Profiles | | Browser profiles |
| Tabs | | Active tabs |
Dashboard Tech Stack
- React 19 + TypeScript
- Vite (build/dev)
- Tailwind CSS
- Zustand (state)
- Vitest (tests)
Stealth Module
The stealth module (
internal/assets/stealth.js) has three levels:
| Level | Features | Trade-offs |
|---|---|---|
| webdriver, CDP markers, plugins, hardware | None — safe |
| + userAgentData, chrome.runtime.connect, csi/loadTimes | May affect error monitoring |
| + WebGL/canvas noise, WebRTC relay | May break WebRTC, canvas apps |
Configure in
~/.pinchtab/config.json:
{ "instanceDefaults": { "stealthLevel": "medium" } }
Common Tasks
Add new API endpoint
- Create handler in
internal/handlers/ - Register route in
internal/server/routes.go - Add tests in same package
- Add E2E test in
tests/e2e/scenarios-api/
Modify stealth behavior
- Edit
internal/assets/stealth.js - Run
(embeds via go:embed)./dev build - Test with
(includes stealth tests)./dev e2e api-fast
Update dashboard
- Run
for hot-reload./dev dashboard - Edit files in
dashboard/src/ - Run
before commit./dev check dashboard