Skip to content

Add the Vite+ block to AGENTS.md and drop the Husky self-heal - #2453

Merged
kmcginnes merged 2 commits into
mainfrom
vp-agent-block
Oct 22, 2026
Merged

kmcginnes merged 2 commits into
mainfrom
vp-agent-block

Conversation

@kmcginnes

Copy link
Copy Markdown
Collaborator

Summary

Agents should use the same vp commands the Vite+ docs and CI use, and the Husky self-heal in prepare was only there for clones from before the Vite+ switch, which the docs now cover.

User-facing: none

 package.json
-  "prepare": "(git config --unset core.hooksPath husky || cd .) && vp config --no-agent"
+  "prepare": "vp config"

 AGENTS.md
+  <!--VITE PLUS START--> … <!--VITE PLUS END-->   # rewritten by vp config on install
   ## Commands
-    pnpm checks / pnpm test / pnpm lint / pnpm format
+    vp check / vp check --fix / vp test / pnpm dedupe --check

 ci.yml
   install
   pnpm dedupe --check
+  git diff --exit-code AGENTS.md                    # fails when the block is stale
  • The Vite+ block is wrapped in prettier-ignore. Without it the pre-commit formatter reflows the block's hard-wrapped paragraph, the next install rewrites it back, and every fresh clone ends up with a dirty AGENTS.md.
  • docs/development.md now covers clones still pointing at Husky: unset core.hooksPath, then pnpm run prepare. pnpm install can skip prepare when it reports "Already up to date", so the old "install again" advice didn't always reinstall the hook.
  • docs/agents/testing.md names vp check and vp test. The pnpm scripts stay as aliases for humans, and the PR template is unchanged.

Evidence

Verified live:

  • In a fresh worktree, CI=true pnpm install --frozen-lockfile runs vp config, leaves AGENTS.md unchanged, and sets core.hooksPath to .vite-hooks/_. The pre-commit hook ran on the commits in this branch.
  • After an edit inside the markers, pnpm run prepare restores the block byte for byte.
  • In a clone with core.hooksPath=.husky/_, install prints core.hooksPath is already set to ".husky/_", skipping and exits 0. After git config --unset core.hooksPath and pnpm run prepare, the hook is back.
  • vp test <path> and vp test -t select the same files and tests as their pnpm test forms.

Merge Danger

Door: two-way

Impact: tooling

Clones from before the Vite+ switch that haven't run pnpm install since then lose the pre-commit hook until their owners follow the docs. CI runs the same checks.

@kmcginnes kmcginnes left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@kmcginnes
kmcginnes merged commit d9c1c56 into main Oct 22, 2026
6 checks passed
@kmcginnes
kmcginnes deleted the vp-agent-block branch October 22, 2026 23:35
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.

1 participant