Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
agents-md does not detect version properly if ranges are used | GoodFirstPicks

agents-md does not detect version properly if ranges are used

vercel/next.js 1 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Version detection fails when ranges are used in package.json.

AI Summary

The issue involves incorrect version detection when a range (e.g., ^16) is specified for Next.js in package.json. The code currently tries to download documentation for the base version (16) instead of the latest version within the range (16.1.6). The fix requires modifying the version detection logic to handle ranges properly.

Issue Description

Link to the code that reproduces this issue

https://codesandbox.io/p/sandbox/optimistic-star-2nq57m

To Reproduce

Run npx @next/codemod@canary agents-md --output AGENTS.md in a repo with a range provided for next.

Current vs. Expected behavior

If I run npx @next/codemod@canary agents-md --output AGENTS.md in a repo using ^16 for next, the code detects version 16 and tries to download it, which is both incorrect and does not work:

$ npx @next/codemod@canary agents-md --output AGENTS.md

Downloading Next.js 16 documentation to .next-docs...
Failed to pull docs: Could not find documentation for Next.js v16. This version may not exist on GitHub yet.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #12-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan  9 20:46:52 UTC 2026
  Available memory (MB): 31021
  Available CPU cores: 22
Binaries:
  Node: 24.12.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 16.1.6 // Latest available version is detected (16.1.6).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: standalone

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • version detection logic may be complex
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno