Unverified Commit 88ef2160 authored by Aurora Scharff's avatar Aurora Scharff Committed by GitHub

skill(next-dev-loop): fix --session flag, agent-browser bootstrap, --headed daemon note (#95005)

Three small `next-dev-loop` skill fixes from a real adoption run.

**1. Flag mismatch.** Preflight documented `--session-name <slug>` but
the CLI flag is `--session <name>`. The skill tells agents to trust the
documented command over source, so the copy-paste failed. Fixed in two
places (preflight + post-loop close).

**2. `agent-browser` bootstrap.** The CLI isn't always installed; the
skill said "upgrade" but not "install if missing." Reworded the prereq
bullet to *"Install or upgrade `agent-browser`"* and added a line
telling the agent to install it before continuing if it isn't on `PATH`.

**3. `--headed` daemon gotcha.** Launch flags like `--headed` are
silently ignored when the `agent-browser` daemon is already running from
a previous session (`⚠ --headed ignored: daemon already running`). The
preflight just listed `--headed` without noting this, so a second
session inherited the first one's flags. Added a callout telling the
agent to run `agent-browser close` first to change launch flags.

Docs-only.

<!-- NEXT_JS_LLM_PR -->
parent e7f4e336
...@@ -41,7 +41,9 @@ at the versions above. ...@@ -41,7 +41,9 @@ at the versions above.
Docs: https://nextjs.org/docs/app/getting-started/upgrading Docs: https://nextjs.org/docs/app/getting-started/upgrading
(version-16 guide: (version-16 guide:
https://nextjs.org/docs/app/guides/upgrading/version-16) https://nextjs.org/docs/app/guides/upgrading/version-16)
- Upgrade `agent-browser`: `npm i -g agent-browser@latest`. - Install or upgrade `agent-browser`: `npm i -g agent-browser@latest`.
If the CLI isn't on `PATH`, install it before continuing — preflight
expects to invoke it directly.
## preflight ## preflight
...@@ -49,12 +51,16 @@ Once per session, confirm both views are live. ...@@ -49,12 +51,16 @@ Once per session, confirm both views are live.
1. **Open `agent-browser` at the target URL, restoring saved 1. **Open `agent-browser` at the target URL, restoring saved
login state when present.** Build the `open` command from: login state when present.** Build the `open` command from:
- `--session-name <slug>` where `<slug>` is the project - `--session <name>` where `<name>` is the project
directory basename. directory basename.
- `--state ~/.agent-browser/sessions/<slug>-default.json` if - `--state ~/.agent-browser/sessions/<name>-default.json` if
that file exists. Omit on first run — a missing path fails that file exists. Omit on first run — a missing path fails
the open. the open.
- `--headed --enable react-devtools`. - `--headed --enable react-devtools`. **If the `agent-browser`
daemon is already running from a previous session**, launch
flags like `--headed` are ignored and a warning is printed
(`⚠ --headed ignored: daemon already running`). To change
them, run `agent-browser close` first, then re-open.
The browser is the user's. If state was not restored (first The browser is the user's. If state was not restored (first
run, expired session) and the page is gated, the user drives run, expired session) and the page is gated, the user drives
...@@ -133,7 +139,7 @@ get_compilation_issues Turbopack only; errors on webpack ...@@ -133,7 +139,7 @@ get_compilation_issues Turbopack only; errors on webpack
## teardown ## teardown
Close the `agent-browser` session — `--session-name` writes state Close the `agent-browser` session — `--session` writes state
to disk so the next loop's `--state` restores login. Leave to disk so the next loop's `--state` restores login. Leave
`next dev` up for the next loop. `next dev` up for the next loop.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment