$npx -y skills add vercel-labs/dev3000 --skill d3kUse when the user asks to use d3k, run/dev/test/debug a web project with d3k, or reproduce a browser issue. Own the runtime: reuse or background-start d3k non-interactively, wait for readiness, use its project-stable managed Chrome profile, and inspect unified browser/server evid
| 1 | # d3k Agent Runtime |
| 2 | |
| 3 | d3k is the local web runtime for this task. It starts the dev server behind a stable Portless URL, owns a project-stable Chrome profile, and records server logs, browser console output, network activity, interactions, and screenshots in one timeline. |
| 4 | |
| 5 | When this skill triggers, operate d3k. Do not merely tell the user how to run it. |
| 6 | |
| 7 | ## Interpret the Request |
| 8 | |
| 9 | - "Let me test/dev my project with d3k": prepare the runtime and headed browser, confirm it is ready, then hand control to the user. Wait for them to reproduce the issue before inspecting evidence. |
| 10 | - "Test/debug/fix this with d3k": prepare the runtime, then drive the managed browser and investigate autonomously. |
| 11 | - If ambiguous, start the runtime and browser first. That action is safe and useful for either path. |
| 12 | |
| 13 | ## Start or Reuse d3k |
| 14 | |
| 15 | Run from the project root. |
| 16 | |
| 17 | 1. Check for an existing project runtime: |
| 18 | |
| 19 | ```bash |
| 20 | d3k status --json |
| 21 | ``` |
| 22 | |
| 23 | If it reports `"running": true`, reuse it. Do not start a second dev server or browser. |
| 24 | |
| 25 | 2. If d3k is not installed, install it: |
| 26 | |
| 27 | ```bash |
| 28 | bun install -g dev3000 |
| 29 | ``` |
| 30 | |
| 31 | Use `npm install -g dev3000` only when Bun is unavailable. |
| 32 | |
| 33 | 3. Start d3k with the agent's shell/process tool as a retained background or yielded session: |
| 34 | |
| 35 | ```bash |
| 36 | d3k --no-agent --no-tui -t |
| 37 | ``` |
| 38 | |
| 39 | Do not wait for this long-running command to exit. Keep its process/session handle so you can monitor or stop it later. Prefer the execution tool's background/session support over shelling with `&`. |
| 40 | |
| 41 | If the target URL is already known, pass it so the managed browser opens there: |
| 42 | |
| 43 | ```bash |
| 44 | d3k --no-agent --no-tui -t --app-url "<url>" |
| 45 | ``` |
| 46 | |
| 47 | Let d3k auto-detect the package manager, dev command, and port. Add `--command`, `--script`, or `--port` only when detection is wrong or the user specified them. |
| 48 | |
| 49 | 4. Poll until the runtime is ready: |
| 50 | |
| 51 | ```bash |
| 52 | d3k status --json |
| 53 | ``` |
| 54 | |
| 55 | A successful status response is the readiness boundary. Prefer the reported Portless `appUrl`; the underlying app port may change between runs. If startup fails, inspect the retained process output and `d3k logs --type server`; do not launch a separate dev server. |
| 56 | |
| 57 | ## User-Driven Testing |
| 58 | |
| 59 | When the user says "let me test": |
| 60 | |
| 61 | 1. Confirm the status response includes the app URL and `"browserConnected": true`. |
| 62 | 2. Tell the user the monitored browser is ready. |
| 63 | 3. Keep the d3k process running and wait for the user to reproduce the behavior. |
| 64 | 4. When they report that it happened, begin with: |
| 65 | |
| 66 | ```bash |
| 67 | d3k errors --context |
| 68 | d3k logs -n 200 |
| 69 | ``` |
| 70 | |
| 71 | Do not replace the headed browser with automation while the user is testing. |
| 72 | |
| 73 | ## Agent-Driven Testing |
| 74 | |
| 75 | Drive the exact browser d3k is monitoring: |
| 76 | |
| 77 | ```bash |
| 78 | d3k agent-browser snapshot -i |
| 79 | d3k agent-browser click @e2 |
| 80 | d3k agent-browser fill @e3 "text" |
| 81 | d3k errors --context |
| 82 | ``` |
| 83 | |
| 84 | Use `--require-d3k-browser` when opening a URL so failure cannot silently create another browser: |
| 85 | |
| 86 | ```bash |
| 87 | d3k agent-browser --require-d3k-browser open "<url>" |
| 88 | ``` |
| 89 | |
| 90 | After every reproduction or code change, replay the relevant interaction and check `d3k errors --context` again. |
| 91 | |
| 92 | ## Evidence Commands |
| 93 | |
| 94 | Prefer these over ad-hoc log scraping: |
| 95 | |
| 96 | ```bash |
| 97 | d3k status --json |
| 98 | d3k errors --context |
| 99 | d3k logs -n 200 |
| 100 | d3k logs --type browser |
| 101 | d3k logs --type server |
| 102 | ``` |
| 103 | |
| 104 | Artifacts live under `~/.d3k/<project>/`, including `session.json`, logs, screenshots, and the Chrome profile. |
| 105 | |
| 106 | ## Browser and Auth Safety |
| 107 | |
| 108 | d3k must own browser startup by default. Its per-project Chrome profile preserves login state, cookies, and local storage. |
| 109 | |
| 110 | For Google OAuth, Supabase auth, and other auth-sensitive flows, never substitute raw Chrome, Playwright, a browser MCP session, manual CDP attachment, or `agent-browser --profile`. Those paths use a different browser/profile and can trigger "This browser or app may not be secure." |
| 111 | |
| 112 | If the managed browser is unavailable, stop or interrupt the retained d3k process and restart d3k cleanly. Do not work around it by creating another browser. |
| 113 | |
| 114 | Use `--headless` only for CI or when explicitly requested. Use `--servers-only` only when browser monitoring is intentionally unwanted. |
| 115 | |
| 116 | ## Operating Rules |
| 117 | |
| 118 | - Do not run `npm run dev`, `bun run dev`, or another dev server alongside d3k. |
| 119 | - Do not start a second d3k when `d3k status --json` reports an active one. |
| 120 | - Keep d3k alive across edits and retests. |
| 121 | - Preserve the project-stable Chrome profile unless the user explicitly asks for a fresh profile. |
| 122 | - Leave the runtime running when handing a headed browser to the user; stop it only when asked or when the task requires a clean restart. |
| 123 | - Portless routing is the default. Use `--no-portless` or `PORTLESS=0` only when direct localhost routing is explicitly required. |