Skip to content

fix(cli): skip agent selector when AGENTS.md already exists#937

Merged
fengmk2 merged 3 commits intovoidzero-dev:mainfrom
zerone0x:fix/skip-agent-selector-existing-agents-md
Mar 16, 2026
Merged

fix(cli): skip agent selector when AGENTS.md already exists#937
fengmk2 merged 3 commits intovoidzero-dev:mainfrom
zerone0x:fix/skip-agent-selector-existing-agents-md

Conversation

@zerone0x
Copy link
Contributor

Summary

  • When running vp migrate, the agent selector prompt is now skipped if agent instruction files (e.g. AGENTS.md, CLAUDE.md) already exist in the project root
  • Uses the existing detectExistingAgentTargetPaths() utility to check for files before showing the interactive multiselect
  • Adds an optional projectRoot parameter to selectAgentTargetPaths() to enable detection without breaking existing callers

Fixes #903

Test plan

  • Run vp migrate in a project with an existing AGENTS.md — agent selector prompt should be skipped
  • Run vp migrate in a project without any agent files — agent selector prompt should appear as before
  • Run vp migrate --no-agent — should still skip agent setup entirely
  • Run vp migrate --agent claude — should still use the explicit agent selection

🤖 Generated with Claude Code

@netlify
Copy link

netlify bot commented Mar 16, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit b7bbfac
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69b7940529b68700090cfd95

@fengmk2
Copy link
Member

fengmk2 commented Mar 16, 2026

The DX issue reported should automatically detect existing Agent types, but should not directly skip the agent's content updates
https://github.com/voidzero-dev/vite-plus/blob/main/packages/cli/src/utils/agent.ts#L501

zerone0x and others added 2 commits March 16, 2026 12:07
When running `vp migrate`, detect existing agent instruction files
(AGENTS.md, CLAUDE.md, etc.) in the project root and reuse them
instead of showing the interactive agent selector prompt.

Fixes voidzero-dev#903

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ying selectAgentTargetPaths

Revert changes to selectAgentTargetPaths and instead apply the same
auto-detection pattern already used in create/bin.ts to migration/bin.ts.
This skips the agent selector prompt when agent files exist, while
preserving the full conflict resolution and content update flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zerone0x zerone0x force-pushed the fix/skip-agent-selector-existing-agents-md branch from 1faabca to 3608288 Compare March 16, 2026 04:26
@zerone0x
Copy link
Contributor Author

The DX issue reported should automatically detect existing Agent types, but should not directly skip the agent's content updates main/packages/cli/src/utils/agent.ts#L501

Hey! Thanks for the feedback! the early one was too aggressive.

Updated approach: auto-detection is now moved to the call site in migration/bin.ts, aligning with the existing pattern in create/bin.ts. selectAgentTargetPaths remains unchanged — the detection only skips the selector prompt, while conflict resolution and content updates (append/skip) still proceed normally.

@fengmk2 fengmk2 merged commit 5898858 into voidzero-dev:main Mar 16, 2026
21 checks passed
@zerone0x zerone0x deleted the fix/skip-agent-selector-existing-agents-md branch March 16, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent selector prompt could be skipped if AGENTS.md already exists

2 participants