Tauri Project Creation
Feature Overview
Interactively create cross-platform desktop application projects with Tauri. Guide users through steps such as template selection, UI framework installation, Git initialization, and port configuration.
Interaction Method
All inquiries should use the tool for interactive Q&A as much as possible.
Quick Creation Process
Step 1: Get Project Information
Check Current Directory: Execute
to check if the current directory is empty.
Determine Creation Location:
- If the current directory is empty: Use to ask the user whether to create in the current directory or create a subdirectory
- If the current directory is not empty: Inform the user that a subdirectory will be created
Select Template: Use
to ask the user for template selection, with
as the default recommendation.
| Template Parameter | Tech Stack |
|---|
| Vue + TypeScript (Recommended) |
| Vue |
| React + TypeScript |
| React |
| Svelte + TypeScript |
| Svelte |
| Vanilla + TypeScript |
| Vanilla JS |
Execute Creation:
Create in current directory (empty directory):
bash
pnpm create tauri-app . --template <模板> --yes
pnpm install
Create subdirectory:
bash
pnpm create tauri-app <项目名> --template <模板> --yes
cd <项目名>
pnpm install
Step 2: Git Initialization (Recommended)
Check Git Status: Execute
git rev-parse --git-dir > /dev/null 2>&1
to check if the current directory is already a git repository.
- If it is already a git repository: Inform the user, skip initialization, and subsequent steps will commit directly
- If it is not a git repository: Use to ask the user if they need Git version control
Inform the user that each subsequent step will be committed to git to record the creation process.
If initialization is needed, execute immediately:
bash
git init && git add . && git commit -m "init"
Step 3: Install UI Framework
Use
to ask the user:
Do you need to use a UI framework?
If yes, recommend a suitable framework based on the selected template and execute the installation command immediately.
If Git is selected, commit after installation is complete:
bash
git add .
git commit -m "feat: add UI framework"
Step 4: Port Configuration
Use
to ask the user:
Do you want to use the default port 1420?
If not, ask the user to specify a new port number and immediately edit
and
to change the port.
If Git is selected, commit after modification is complete:
bash
git add .
git commit -m "config: change port to <新端口>"
Step 5: Install window-state Plugin
Use
to ask the user:
Do you need window state memory functionality (desktop)?
Explain the benefits: Automatically remembers window position and size, and retains them when opened next time.
If yes, execute immediately:
bash
pnpm tauri add window-state
If Git is selected, commit after installation is complete:
bash
git add .
git commit -m "feat: add window-state plugin"
Step 6: Create AGENTS.md
Prompt the AI to generate an AGENTS.md file based on the current project situation, with additional content including: a reminder to use the
skill.
If Git is selected, commit after creation is complete:
bash
git add AGENTS.md
git commit -m "docs: add AGENTS.md"
Step 7: Inform Development Commands
After creation is complete, inform the user of:
bash
pnpm dev # Pure web development
pnpm tauri dev # Development mode
pnpm tauri build # Build application
Usage Examples
Scenario 1: Create a New Project (Empty Directory)
User Input: "Help me create a Tauri application"
Interaction Flow:
- Check that the current directory is empty
- Ask the user: Create in the current directory or create a subdirectory?
- Ask for template selection (recommend vue-ts)
- Execute creation command
- Ask whether to initialize Git
- Ask whether a UI framework is needed (recommended based on template)
- Ask about port configuration
- Ask whether to install the window-state plugin
- Create AGENTS.md
- Inform development commands
Scenario 2: Create with Specified Template
User Input: "Create a Tauri project with React"
Handling Method:
- Directly use the react-ts template (TypeScript recommended)
- If the user explicitly says not to use TS, use the react template
- The rest of the process is the same as Scenario 1
Scenario 3: Quick Creation (Skip Interaction)
User Input: "Quickly create a basic Tauri project without additional configuration"
Handling Method:
- Use the default template (vue-ts)
- Create a subdirectory or use the current directory (if empty)
- Skip inquiries about Git, UI frameworks, ports, plugins, etc.
- Only complete basic creation and dependency installation
Scenario 4: Create in an Existing Project
User Input: "Create a Tauri project in the current directory" (current directory is not empty)
Handling Method:
- Inform the user that a subdirectory will be created
- Ask for the project name
- Complete creation in the subdirectory
Notes
- Environment Requirements: Ensure Node.js 18+ and pnpm are installed
- Rust Toolchain: If you need to write custom Rust code, you need to install Rust additionally
- Skill Scope: Only responsible for project creation and initial configuration, not subsequent development
- Plugin Installation Limit: can only add one plugin at a time, so it needs to be executed multiple times
- Git Commit Strategy: Commit immediately after each configuration step to record the creation process
- Port Conflict: If port 1420 is occupied, it is recommended that the user change the port
- Best Practices: Remind users to refer to the skill after creation is complete
Reference Resources