fix(cli): skip agent selector when AGENTS.md already exists#937
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
|
The DX issue reported should automatically detect existing Agent types, but should not directly skip the agent's content updates |
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>
1faabca to
3608288
Compare
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. |
Summary
vp migrate, the agent selector prompt is now skipped if agent instruction files (e.g.AGENTS.md,CLAUDE.md) already exist in the project rootdetectExistingAgentTargetPaths()utility to check for files before showing the interactive multiselectprojectRootparameter toselectAgentTargetPaths()to enable detection without breaking existing callersFixes #903
Test plan
vp migratein a project with an existingAGENTS.md— agent selector prompt should be skippedvp migratein a project without any agent files — agent selector prompt should appear as beforevp migrate --no-agent— should still skip agent setup entirelyvp migrate --agent claude— should still use the explicit agent selection🤖 Generated with Claude Code