Skip to content

refactor(config): auto-update agent instructions, never create new files#1027

Merged
graphite-app[bot] merged 1 commit intomainfrom
vp-config-dont-auto-add-agent-skills
Mar 19, 2026
Merged

refactor(config): auto-update agent instructions, never create new files#1027
graphite-app[bot] merged 1 commit intomainfrom
vp-config-dont-auto-add-agent-skills

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Mar 18, 2026

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

  • pnpm -F vite-plus snap-test-global command-config — all 9 tests pass
  • pnpm -F vite-plus snap-test — all tests pass
  • New snap test: command-config-update-agents — verifies outdated markers are updated, user content preserved
  • New snap test: command-config-no-agent-writes — verifies no writes when no markers, no new files created

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 18, 2026

Deploy Preview for viteplus-preview canceled.

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

@fengmk2 fengmk2 self-assigned this Mar 18, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 18, 2026


How to use the Graphite Merge Queue

Add 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.

@fengmk2 fengmk2 changed the title refactor(config): skip agent setup when instruction files exist refactor(config): don't auto-modify existing agent instruction files Mar 18, 2026
@fengmk2 fengmk2 marked this pull request as ready for review March 18, 2026 14:46
@fengmk2 fengmk2 requested review from Brooooooklyn and cpojer March 18, 2026 14:46
Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 18, 2026

image.png

image.png

@cpojer
Copy link
Copy Markdown
Member

cpojer commented Mar 18, 2026

It's best not to create any new agent files automatically, but when vp config runs, I think it makes sense to detect the Vite header and if it is present, update it to the latest version. We may need to embed the Vite+ version in AGENTS.md so that we don't ping-pong between upgrade and downgrade when different team members are on different versions.

Then it would be:

  • No agent files → no writes
  • No Vite+ header → no writes
  • Vite+ header, up to date → no writes
  • Vite+ header, outdated → update to the latest AGENTS.md version

This behavior should be the same if it is run via "prepare" or manually.

What do you think about this approach?

@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 19, 2026

@cpojer Ok, I'll improve it following this logic.

@fengmk2 fengmk2 changed the title refactor(config): don't auto-modify existing agent instruction files refactor(config): auto-update agent instructions, never create new files Mar 19, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Mar 19, 2026

@cpojer changed

@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Mar 19, 2026

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
@graphite-app graphite-app bot force-pushed the vp-config-dont-auto-add-agent-skills branch from 6644144 to 0e9d243 Compare March 19, 2026 04:33
@graphite-app graphite-app bot merged commit 0e9d243 into main Mar 19, 2026
23 checks passed
@graphite-app graphite-app bot deleted the vp-config-dont-auto-add-agent-skills branch March 19, 2026 04:41
TheAlexLichter pushed a commit that referenced this pull request Mar 19, 2026
…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
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.

2 participants