refactor(config): auto-update agent instructions, never create new files#1027
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
It's best not to create any new agent files automatically, but when Then it would be:
This behavior should be the same if it is run via What do you think about this approach? |
|
@cpojer Ok, I'll improve it following this logic. |
|
@cpojer changed |
Merge activity
|
…les (#1027) ## Summary - `vp config` no longer creates new agent files or prompts for agent selection - Silently updates existing files that contain Vite+ markers (`<!--VITE PLUS START-->`) when content is outdated - Same behavior for `prepare` lifecycle, interactive, and non-interactive modes - Skipped with `--hooks-only` - Delete `config/agent.ts` and its tests (superseded by shared `utils/agent.ts`) ## Behavior | Scenario | Action | |----------|--------| | No agent files | No writes | | Agent files exist, no Vite+ markers | No writes | | Vite+ markers, content up to date | No writes | | Vite+ markers, content outdated | Update marked section silently | | `--hooks-only` | Skip agent update | ## Test plan - [x] `pnpm -F vite-plus snap-test-global command-config` — all 9 tests pass - [x] `pnpm -F vite-plus snap-test` — all tests pass - [x] New snap test: `command-config-update-agents` — verifies outdated markers are updated, user content preserved - [x] New snap test: `command-config-no-agent-writes` — verifies no writes when no markers, no new files created
6644144 to
0e9d243
Compare
…les (#1027) ## Summary - `vp config` no longer creates new agent files or prompts for agent selection - Silently updates existing files that contain Vite+ markers (`<!--VITE PLUS START-->`) when content is outdated - Same behavior for `prepare` lifecycle, interactive, and non-interactive modes - Skipped with `--hooks-only` - Delete `config/agent.ts` and its tests (superseded by shared `utils/agent.ts`) ## Behavior | Scenario | Action | |----------|--------| | No agent files | No writes | | Agent files exist, no Vite+ markers | No writes | | Vite+ markers, content up to date | No writes | | Vite+ markers, content outdated | Update marked section silently | | `--hooks-only` | Skip agent update | ## Test plan - [x] `pnpm -F vite-plus snap-test-global command-config` — all 9 tests pass - [x] `pnpm -F vite-plus snap-test` — all tests pass - [x] New snap test: `command-config-update-agents` — verifies outdated markers are updated, user content preserved - [x] New snap test: `command-config-no-agent-writes` — verifies no writes when no markers, no new files created



Summary
vp configno longer creates new agent files or prompts for agent selection<!--VITE PLUS START-->) when content is outdatedpreparelifecycle, interactive, and non-interactive modes--hooks-onlyconfig/agent.tsand its tests (superseded by sharedutils/agent.ts)Behavior
--hooks-onlyTest plan
pnpm -F vite-plus snap-test-global command-config— all 9 tests passpnpm -F vite-plus snap-test— all tests passcommand-config-update-agents— verifies outdated markers are updated, user content preservedcommand-config-no-agent-writes— verifies no writes when no markers, no new files created