
deploy-website
by chaitin
SKILL.md
name: deploy-website description: Deploy and serve web projects locally for preview. Automatically detects project type (Node.js, PHP, Python/Django/Flask/Unicorn, Go, Ruby/Rails, Java/Spring Boot, Rust, or static HTML) and starts the appropriate development server. arguments:
- name: workspace description: Absolute path to the workspace directory to deploy required: false
Deploy Website
Automatically detect the project type and start the appropriate development server IN THE BACKGROUND, then request a Preview URL with MCP Tool request_preview
Detection Logic
-
Node.js web project
- Look for
package.jsonin the workspace root - Check if it contains a
devorstartscript - Execute
npm run dev(ornpm startifdevis not available)
- Look for
-
Static website
- Look for
.htmlfiles in the workspace (especiallyindex.html) - Execute
python3 -m http.server 8000to serve static files
- Look for
-
Other kind of websites
Detect project type and use appropriate server:
-
PHP projects - Look for
.phpfiles orcomposer.json- Execute
php -S localhost:8000to serve PHP files - If
public/index.phpexists, serve frompublicdirectory
- Execute
-
Python projects
- Django - Look for
manage.pyandsettings.py- Execute
python manage.py runserver 8000
- Execute
- Flask - Look for
app.pyorwsgi.py- Execute
python app.pyorflask run --port=8000
- Execute
- Unicorn/uWSGI - Look for
gunicorn.conf.pyoruwsgi.ini- Execute
gunicorn -b 0.0.0.0:8000 app:app(adjust module name)
- Execute
- Generic - Look for
requirements.txtorpyproject.toml- Execute
python -m http.server 8000
- Execute
- Django - Look for
-
Go projects - Look for
go.mod- Execute
go run main.goorgo run .(usually handles its own server)
- Execute
-
Ruby/Rails - Look for
Gemfilewithrails- Execute
rails server -p 8000orbundle exec rails server -p 8000
- Execute
-
Java/Spring Boot - Look for
pom.xml(Maven) orbuild.gradle(Gradle)- Execute
mvn spring-boot:runor./gradlew bootRun
- Execute
-
Rust/Axum/Actix - Look for
Cargo.toml- Execute
cargo run
- Execute
-
README-based detection - If standard detection fails:
- Search README files (
README.md,README.rst,README.txt,doc/README.md) - Look for keywords like
run,start,serve,dev,preview - Extract and execute the suggested command
- Search README files (
-
Workflow
- Detect the project type and start the appropriate server in the background:
# Step 1: Node.js project
if [ -f "package.json" ]; then
npm install # Ensure dependencies are installed
if grep -q '"dev"' package.json; then
npm run dev
elif grep -q '"start"' package.json; then
npm start
fi
# Step 2: PHP project
elif [ -f "composer.json" ] || ls *.php 1> /dev/null 2>&1; then
if [ -f "public/index.php" ]; then
php -S localhost:8000 -t public
else
php -S localhost:8000
fi
# Step 3: Python projects
elif [ -f "manage.py" ]; then
# Django
python manage.py runserver 8000
elif [ -f "app.py" ] || [ -f "wsgi.py" ]; then
# Flask or WSGI app
if command -v flask &> /dev/null; then
flask run --port=8000
else
python app.py || python wsgi.py
fi
elif [ -f "gunicorn.conf.py" ] || [ -f "uwsgi.ini" ]; then
# Unicorn/uWSGI
gunicorn -b 0.0.0.0:8000 app:app
elif [ -f "requirements.txt" ] || [ -f "pyproject.toml" ]; then
python -m http.server 8000
# Step 4: Go project
elif [ -f "go.mod" ]; then
go run . || go run main.go
# Step 5: Ruby/Rails project
elif [ -f "Gemfile" ] && grep -q "rails" Gemfile; then
bundle exec rails server -p 8000 || rails server -p 8000
# Step 6: Java/Spring Boot
elif [ -f "pom.xml" ]; then
./mvnw spring-boot:run || mvn spring-boot:run
elif [ -f "build.gradle" ]; then
./gradlew bootRun || gradle bootRun
# Step 7: Rust project
elif [ -f "Cargo.toml" ]; then
cargo run
# Step 8: Static HTML files
elif [ -f "index.html" ] || ls *.html 1> /dev/null 2>&1; then
python3 -m http.server 8000
# Step 9: README-based detection
else
# Search README for startup commands
README_FILE=$(find . -maxdepth 2 -iname "README*" | head -1)
if [ -n "$README_FILE" ]; then
# Extract command containing keywords
grep -E "(run|start|serve|dev|preview)" "$README_FILE" | grep -E "^\s*\`?[a-z]+" | head -1 | \
sed -E 's/.*\`?([^`]+)$/\1/' | sh
fi
fi
-
Capture the port number from the server output (or use default 8000).
-
Call MCP Tool
request_previewwith the listening port number to get a preview URL. -
Present the preview URL to the user.
Notes
- The server MUST run in the background or as a subagent task in order NOT TO block the session.
- Default port for static server is 8000.
- For Node.js projects, the port depends on the project configuration.
- The port number can be dynamically changed when conflicted with another service.
- Make sure dependencies are installed before running:
- Node.js:
npm install - Python:
pip install -r requirements.txt(if exists) - PHP:
composer install(if composer.json exists) - Ruby/Rails:
bundle install(if Gemfile exists) - Go:
go mod download(automatically handled by go run) - Java: Dependencies are handled by Maven/Gradle wrapper
- Rust:
cargo fetch(automatically handled by cargo run)
- Node.js:
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です