-
Notifications
You must be signed in to change notification settings - Fork 249
docs: add coding agent guide #1602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+133
−1
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| # Coding Agents | ||
|
|
||
| This page is a compact command guide for AI coding agents and humans directing them. Read this before automating Vite+ workflows so arguments are sent to the right command and validation uses the Vite+ command surface. | ||
|
|
||
| ## Quick Rules | ||
|
|
||
| - Run `vp help` and `vp help <command>` before guessing command syntax. | ||
| - Prefer non-interactive flags in automated runs, such as `--no-interactive`, when a command supports them. | ||
| - Keep Vite+ command options before `--`; put template or underlying-tool options after `--` only where the command documents forwarding. | ||
| - Prefer `vp check` for local validation loops because it runs the configured format, lint, and type-check workflow together. | ||
| - Use `vp run <script-or-task>` for project scripts. Do not call package-manager scripts directly unless you specifically need package-manager behavior. | ||
|
|
||
| ## Forwarding Arguments | ||
|
|
||
| `--` separates Vite+ options from options that should be forwarded to another tool. The most common case is `vp create <template> -- <template-options>`. | ||
|
|
||
| For example, the Vite template selector belongs to `create-vite`, not to `vp create` itself: | ||
|
|
||
| ```bash | ||
| vp create vite -- --template react-ts | ||
| ``` | ||
|
|
||
| Vite+ options still go before the separator: | ||
|
|
||
| ```bash | ||
| vp create vite --directory apps/web --no-interactive -- --template react-ts | ||
| ``` | ||
|
|
||
| If a command page does not document `--` forwarding, do not assume it exists. Check `vp help <command>` or the relevant guide page first. | ||
|
|
||
| ## Creating Projects | ||
|
|
||
| Use [`vp create`](/guide/create) for scaffolding. Agents should choose an explicit template when they already know the target stack. | ||
|
|
||
| ```bash | ||
| # Interactive project creation | ||
| vp create | ||
|
|
||
| # Create a Vite app and forward the Vite template option | ||
| vp create vite -- --template react-ts | ||
|
|
||
| # Create from a built-in Vite+ template without prompts | ||
| vp create vite:application --directory apps/web --no-interactive | ||
|
|
||
| # Inspect templates when an organization manifest is available | ||
| vp create @your-org --no-interactive | ||
| ``` | ||
|
|
||
| Common mistakes: | ||
|
|
||
| ```bash | ||
| # Wrong: --template is parsed as a vp create option instead of a template option | ||
| vp create vite --template react-ts | ||
|
|
||
| # Right: forward --template to create-vite | ||
| vp create vite -- --template react-ts | ||
| ``` | ||
|
|
||
| ## Migrating Projects | ||
|
|
||
| Use [`vp migrate`](/guide/migrate) to move an existing project onto Vite+. For agent-driven migrations, combine the migration guide's prompt with non-interactive execution when appropriate. | ||
|
|
||
| ```bash | ||
| # Migrate the current project | ||
| vp migrate | ||
|
|
||
| # Migrate without prompts | ||
| vp migrate --no-interactive | ||
|
|
||
| # Migrate another directory and write agent/editor setup | ||
| vp migrate my-app --agent claude --editor vscode | ||
| ``` | ||
|
|
||
| After migration, run the normal Vite+ validation loop: | ||
|
|
||
| ```bash | ||
| vp install | ||
| vp check | ||
| vp test | ||
| vp build | ||
| ``` | ||
|
|
||
| ## Running Tasks | ||
|
|
||
| Use [`vp run`](/guide/run) for package scripts and Vite+ task definitions. | ||
|
|
||
| ```bash | ||
| # Run a script or task in the current package | ||
| vp run build | ||
|
|
||
| # Run a task for a specific workspace package | ||
| vp run @my/app#build | ||
|
|
||
| # Run recursively across workspace packages | ||
| vp run -r build | ||
|
|
||
| # Enable task caching for package.json scripts | ||
| vp run --cache build | ||
| ``` | ||
|
|
||
| Remember that `vp test` is the built-in Vite+ test command, while `vp run test` runs the `test` script from `package.json`. | ||
|
|
||
| ## Validation Checklist | ||
|
|
||
| Before handing work back: | ||
|
|
||
| 1. Run the command-specific help for anything unfamiliar: `vp help <command>`. | ||
| 2. Use Vite+ validation commands where possible: `vp check`, `vp test`, and `vp build`. | ||
| 3. When creating or migrating projects, confirm whether any flags after `--` are intended for the template or underlying tool. | ||
| 4. Summarize which Vite+ commands were run and whether any manual follow-up remains. | ||
|
|
||
| ## Related Guides | ||
|
|
||
| - [Creating a Project](/guide/create) | ||
| - [Migrate to Vite+](/guide/migrate) | ||
| - [Run](/guide/run) | ||
| - [Check](/guide/check) | ||
| - [Commit Hooks and Agent Integration](/guide/commit-hooks) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.