docs: enable the testing API at build and server startup (#101443)
## Summary
Production tests need the Instant Navigation testing API enabled during
both the build and server startup. With the flag set only during the
build, initial page loads render request-time content during `instant()`
tests while client navigations still pause.
The command examples now set the flag for both stages. The skill
templates link to the config reference instead of repeating its
explanation, while retaining their environment and server lifecycle
instructions. The static-shell eval also passes the flag to its
Playwright server.
Addresses [agent feedback finding
5264](https://next-maintainer-agent.vercel.tools/agent-feedback/5264).
Updated files
-
`docs/01-app/03-api-reference/05-config/01-next-config-js/exposeTestingApiInProductionBuild.mdx`
- `docs/01-app/02-guides/instant-navigation.mdx`
- `skills/next-cache-components-optimizer/rig-template.md`
- `skills/next-partial-prefetching-adoption/rig-template.md`
- `skills/next-partial-prefetching-optimizer/rig-template.md`
- `evals/evals/agent-050-optimize-static-shell/playwright.config.ts`
- `evals/evals/agent-050-optimize-static-shell/instant-nav.rig.md`
## Verification
- Reproduced the original setup with matching Next.js and
`@next/playwright` versions 16.4.2 and 16.5.0-canary.45. Restarting the
same build with the variable enabled fixed initial page locking on both
versions.
- Passed 12 Playwright tests on 16.5.0-canary.45. Each test checks that
request-time content stays absent during the lock and appears after
release. Initial page tests also inspect the response markup.
- Tested the exact TypeScript and CommonJS config examples with manual
startup. Verified both Playwright startup configurations against a
production build, then checked development without an opt-in and a
Webpack production build.
- Confirmed that enabling the flag only at startup cannot add the client
lock. That configuration also produced a document hydration error.
- Formatting, scoped ESLint, and diff checks passed. The final style
edit preserves all code blocks and executable commands.
Full repository lint previously failed on unused Rust task items in
untouched files. Process cleanup also reported a sandbox permission
error. The full agent-eval suite was not run.
<!-- NEXT_JS_LLM -->