🚀 Project Setup and Miyabi Integration
Version: 2.0.0
Last Updated: 2025-11-22
Priority: ⭐⭐⭐ (P2 Level)
Purpose: Project initialization, Cargo Workspace setup, Miyabi integration
📋 Overview
From creating a new project to integrating the Miyabi framework,
we provide complete project setup.
🎯 P0: Invocation Triggers
| Trigger |
Example |
| New project |
"create a new project" |
| Miyabi integration |
"integrate Miyabi into this project" |
| Rust Workspace |
"set up a new Rust workspace" |
| Microservices |
"starting new microservices" |
🔧 P1: Setup Modes
3 modes
| Mode |
Purpose |
Time required |
| New Project |
New from scratch |
10-15 min |
| Add Miyabi |
Add to existing |
5-10 min |
| Microservice |
Add new crate |
3-5 min |
🚀 P2: Setup Patterns
Pattern 1: New project
# Step 1: ディレクトリ作成
mkdir my-project && cd my-project
# Step 2: Cargo Workspace初期化
cat > Cargo.toml << 'EOF'
[workspace]
members = ["crates/*"]
resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
authors = ["Your Name <email@example.com>"]
license = "MIT"
[workspace.dependencies]
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1"
anyhow = "1"
tracing = "0.1"
EOF
# Step 3: 基本crate作成
mkdir -p crates/my-core
cargo init crates/my-core --lib
# Step 4: Git初期化
git init
Pattern 2: Miyabi integration
# Step 1: .claudeディレクトリ作成
mkdir -p .claude/{agents,context,commands,Skills}
# Step 2: CLAUDE.md作成
cat > CLAUDE.md << 'EOF'
# Project Name
## MCP First Approach
...
EOF
# Step 3: GitHub統合
# - Labels設定
# - Workflow追加
# - Issue templates
# Step 4: 環境変数設定
cat > .env.example << 'EOF'
GITHUB_TOKEN=
ANTHROPIC_API_KEY=
EOF
Pattern 3: New Microservice
# Step 1: crate作成
cargo init crates/my-service --lib
# Step 2: Cargo.toml設定
cat > crates/my-service/Cargo.toml << 'EOF'
[package]
name = "my-service"
version.workspace = true
edition.workspace = true
[dependencies]
tokio = { workspace = true }
serde = { workspace = true }
EOF
# Step 3: 基本構造
mkdir -p crates/my-service/src
⚡ P3: Directory Structure
Recommended structure
my-project/
├── Cargo.toml # Workspace root
├── CLAUDE.md # AI指示書
├── README.md # プロジェクト説明
├── .env.example # 環境変数例
├── .gitignore
├── crates/
│ ├── my-core/ # コアライブラリ
│ ├── my-cli/ # CLIバイナリ
│ └── my-api/ # APIサーバー
├── .claude/
│ ├── agents/ # Agent定義
│ ├── context/ # コンテキスト
│ ├── commands/ # カスタムコマンド
│ └── Skills/ # スキル定義
├── .github/
│ ├── workflows/ # CI/CD
│ ├── ISSUE_TEMPLATE/ # Issueテンプレート
│ └── labels.yml # ラベル定義
└── docs/
└── README.md # ドキュメント
📊 Checklist
New project
- Cargo.toml (workspace)
- Basic crate creation
- Git initialization
- .gitignore
- README.md
- CLAUDE.md
Miyabi integration
- .claude directory
- Agent definitions
- Context
- Custom commands
- GitHub Labels
- CI/CD Workflow
Environment setup
- .env.example
- Environment variable documentation
- Development environment procedure
✅ Success Criteria
| Check item |
Criteria |
cargo build |
Success |
cargo test |
Success |
| Git |
Initial commit completed |
| Documentation |
README exists |
🔗 Related Skills
- Rust Development: Build verification
- Git Workflow: Initial commit
- Documentation: README creation