Skip to content

fix(config): auto-install hooks and staged config in prepare script#1028

Merged
graphite-app[bot] merged 1 commit intomainfrom
auto-fix-hooks-on-prepare-script
Mar 19, 2026
Merged

fix(config): auto-install hooks and staged config in prepare script#1028
graphite-app[bot] merged 1 commit intomainfrom
auto-fix-hooks-on-prepare-script

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Mar 18, 2026

Summary

  • When vp config runs from a prepare script (npm_lifecycle_event=prepare), skip the interactive hooks prompt and install automatically — the prepare script implies the project opted into hooks
  • Auto-create .vite-hooks/pre-commit with vp staged and ensure default staged config ({ '*': 'vp check --fix' }) in vite.config.ts when missing, so the pre-commit hook is functional out of the box
  • Skip agent setup when instruction files already exist (CLAUDE.md, etc.)

Test plan

  • New snap test command-config-prepare-auto-hooks verifies hooks, pre-commit hook, and staged config are all created automatically
  • All existing command-config-* snap tests pass without changes

🤖 Generated with Claude Code

@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 fix(config): auto-install hooks without prompting in prepare script fix(config): auto-install hooks and staged config in prepare script Mar 18, 2026
@fengmk2 fengmk2 marked this pull request as ready for review March 18, 2026 15:45
@fengmk2 fengmk2 requested review from Brooooooklyn and cpojer March 18, 2026 15:46
@fengmk2 fengmk2 force-pushed the auto-fix-hooks-on-prepare-script branch 2 times, most recently from 655c4eb to 5ef9301 Compare March 19, 2026 03:37
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Mar 19, 2026

Merge activity

…1028)

## Summary

- When `vp config` runs from a `prepare` script (`npm_lifecycle_event=prepare`), skip the interactive hooks prompt and install automatically — the prepare script implies the project opted into hooks
- Auto-create `.vite-hooks/pre-commit` with `vp staged` and ensure default staged config (`{ '*': 'vp check --fix' }`) in `vite.config.ts` when missing, so the pre-commit hook is functional out of the box
- Skip agent setup when instruction files already exist (CLAUDE.md, etc.)

## Test plan

- [x] New snap test `command-config-prepare-auto-hooks` verifies hooks, pre-commit hook, and staged config are all created automatically
- [x] All existing `command-config-*` snap tests pass without changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@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 force-pushed the auto-fix-hooks-on-prepare-script branch from 5ef9301 to 5e77c9b Compare March 19, 2026 04:34
Base automatically changed from vp-config-dont-auto-add-agent-skills to main March 19, 2026 04:41
@graphite-app graphite-app bot merged commit 5e77c9b into main Mar 19, 2026
19 checks passed
@graphite-app graphite-app bot deleted the auto-fix-hooks-on-prepare-script branch March 19, 2026 04:43
TheAlexLichter pushed a commit that referenced this pull request Mar 19, 2026
…1028)

## Summary

- When `vp config` runs from a `prepare` script (`npm_lifecycle_event=prepare`), skip the interactive hooks prompt and install automatically — the prepare script implies the project opted into hooks
- Auto-create `.vite-hooks/pre-commit` with `vp staged` and ensure default staged config (`{ '*': 'vp check --fix' }`) in `vite.config.ts` when missing, so the pre-commit hook is functional out of the box
- Skip agent setup when instruction files already exist (CLAUDE.md, etc.)

## Test plan

- [x] New snap test `command-config-prepare-auto-hooks` verifies hooks, pre-commit hook, and staged config are all created automatically
- [x] All existing `command-config-*` snap tests pass without changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

3 participants