AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Agents-Md Codemod Emits Invalid --Output Flag In Generated AGENTS.Md Command

The `agents-md` codemod generates an AGENTS.md file containing the instruction `npx @next/codemod agents-md --output AGENTS.md`, but the `@next/codemod` CLI does not support the `--output` flag, causing the command to fail when an agent attempts to re-run it.

highConfidence 75%Next.jsnext buildHydrationTurbopackAffected V16.1.6

Origin Analysis

The codemod's generated instruction string includes `--output AGENTS.md`, but the `@next/codemod` CLI expects only the transform name and optional paths. Passing `--output` results in an unknown option error or misinterpretation as a file path, breaking the command.
1. In a Next.js project, run `npx @next/codemod agents-md --output AGENTS.md`. 2. Open the generated `AGENTS.md` and inspect the command embedded in the instructions. 3. Execute that command in a clean checkout. 4. Observe that the command fails with an error such as `Unknown option '--output'` or `Input file not found`.

Fixing Code Block

Edge Case Audit

If a future version of `@next/codemod` adds official `--output` support, this change may become unnecessary but still harmless. To roll back, restore the original string. Validate that running `npx @next/codemod agents-md` from a clean checkout generates the expected AGENTS.md without errors before deploying the fix.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state