Generate managed agent instructions on next dev and respect opt-outs (#101746)
## Summary
Create and refresh the managed documentation pointer in `AGENTS.md`
whenever `next dev` runs, so projects are ready before their first
coding-agent session. `agentRules: false` removes only the managed rules
block and preserves other content.
`next dev` also manages upgrade instructions
(`experimental.agentUpgrade`) and enabled feedback instructions
(`experimental.agentFeedback`). Each block has its own opt-out. Feedback
is opt-in, requires telemetry, and is excluded from CI.
Honor existing CLI telemetry opt-outs in Docker and CI when dev and
build use different cache directories. These commands now read the CLI's
existing preference store while keeping anonymous identifiers in their
original caches.
Update the agent guide and config references with the default behavior,
version support, and independent opt-outs. Correct the existing setup
guidance in the Next.js 16 upgrade guide.
## Verification
- Three concurrent telemetry suite runs passed without retries in both
development and production, matching the flake-check modes and strict
route-types setting. Preferences are isolated per fixture.
- All 16 focused development integration tests passed, covering
generation, existing files, stale documentation and upgrade blocks,
idempotence, independent opt-outs, telemetry, and CI.
- Core package build, lint, and formatting passed.
- All 120 related unit tests passed, including 12 telemetry preference
regressions.
- All 20 telemetry CLI integration tests passed with Turbopack. The new
disable/build/enable/build regression also passed with Webpack and
reproduced the opt-out failure against the pre-fix code. Telemetry
delivery is captured locally without sending test data.
- CI's types-and-precompiled check passed.
- Published Linux x64 preview tarball for `b450b15b9c6`: all 37 checks
passed, including every agent-setting combination with Turbopack and
Webpack, ten automatic config restarts, saved telemetry opt-outs, CLI
disable/enable, telemetry environment overrides, CI behavior, and
production commands. The installed tarball integrity and matching native
package version were verified.
<!-- NEXT_JS_LLM -->