Clawhub Publish — Clawhub工具
v1.4.2[AI辅助] Deploy to Vercel. Auto-activates for any Vercel task — editing a landing page, deploying, aliasing, updating a site.
详细分析 ▾
运行时依赖
版本
- Added a critical guideline: never output HTML in response text; always write HTML directly to files using the Write/Edit tool to avoid hitting token limits. - Updated anti-patterns table to include the new HTML handling rule. - Clarified instructions on editing large HTML files in logical sections. - No changes to deployment, authentication, or post-deploy steps.
安装命令 点击复制
技能文档
当...时 到 activate (automatically, 没有 prompting)
- 任何 mention 的 Vercel, landing page, 或 site 在...上 vercel.app
- task "更新 site", "deploy", "fix landing"
- editing HTML file 在...中 project folder 带有
.vercel/project.json
Auth flow (之前 anything 否则)
vercel whoami 2>&1
Authorized → proceed.
不 authorized → one-时间 setup:
→ In Claude Code (has a browser):
vercel login
→ In OpenClaw or any headless agent:
- Tell 用户:
- Once received, 验证:
export VERCEL_TOKEN=
vercel whoami
- Store securely — 做 不 写入 令牌 到
~/.zshrc或 任何 file. Keep 在...中 env 对于 会话 仅, 或 ask 用户 到 添加 到 secrets manager.
Creating 或 editing HTML files
CRITICAL: Never 输出 HTML 在...中 响应 text.
Always write directly to a file using the Write/Edit tool:
- ✅ 写入 tool →
索引.html→ deploy - ❌ 打印 HTML 在...中 响应 → 复制-paste → deploy
Reason: large HTML files exceed the 32k output token limit and Claude hangs mid-generation. Writing to a file has no such limit.
If the file is very large (>300 lines), build it in logical sections using Edit tool rather than rewriting from scratch.
Pre-deploy checklist (必填)
1. 使 所有 changes 第一个
❌ ANTI-PATTERN: deploy after each individual edit ✅ Rule: all edits in file first → one deploy2. Check 对于 .vercel/project.json
ls .vercel/project.json
File exists → proceed 到 deploy.
File 做 不 exist → 第一个 deploy, Vercel 将 创建 project automatically:
vercel deploy --yes --prod
# Vercel creates the project and .vercel/project.json on first run
3. 验证 changes actually 在...中 file
grep -c "expected string" index.html
Deploy recipe
# Deploy (run from project folder)
vercel deploy --yes --prod 2>&1 | grep -E "https://|Error"# If custom alias was not assigned automatically — set it manually:
# For personal accounts (no --scope needed):
vercel alias set .vercel.app
# For team accounts only:
vercel alias set .vercel.app --scope YOUR_TEAM_SCOPE
Note: script -q /dev/null suppresses interactive prompts on macOS but breaks on Linux. Use plain vercel deploy instead — --yes flag handles prompts cross-platform.
Post-deploy verification (必填)
curl -s https://.vercel.app | grep "expected string"
# 200 + expected string = ✅ done
Removing SSO (如果 site locked 后面 auth)
PROJECT_ID=$(python3 -c "import json; print(json.load(open('.vercel/project.json'))['projectId'])")
TOKEN=$(python3 -c "import json; print(json.load(open('$HOME/Library/Application Support/com.vercel.cli/auth.json'))['token'])")# For personal accounts:
curl -s -X PATCH "https://api.vercel.com/v9/projects/$PROJECT_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ssoProtection":null,"passwordProtection":null,"trustedIps":null}'
# For team accounts — add teamId:
curl -s -X PATCH "https://api.vercel.com/v9/projects/$PROJECT_ID?teamId=YOUR_TEAM_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ssoProtection":null,"passwordProtection":null,"trustedIps":null}'
Final 输出 (always)
After a successful deploy, the last message to the user must be the public URL — nothing else:
✅ https://.vercel.app
❌ Anti-patterns (从 practice)
| What went wrong | How to do it right |
|---|---|
| Generated HTML in response text (hit 32k token limit) | Always write HTML directly to file using Write/Edit tool |
| Deployed from home directory (wrong CWD) | Always deploy from the project folder with .vercel/project.json |
| Multiple deploys for separate edits | All edits → one deploy |
| Didn't verify file actually changed before deploying | grep before deploying |
| Didn't verify after deploy | curl on the live URL after every deploy |
Used --scope on a personal account | --scope is for team accounts only |
Used script -q /dev/null on Linux | Use plain vercel deploy --yes instead |
Stored token in ~/.zshrc | Keep token in env only, never write to files |
| Started with partial understanding | Read source fully first, make a diff, then apply all edits |
Gotchas
--namedeprecated — don't 使用vercel project rmdoesn't support--是— interactive 仅vercelAuthentication不 supported 在...中 API v9 — 使用ssoProtection: 空- 之后
vercel deploy --prod默认 alias assigned automatically, custom alias 不 (always 验证) - 第一个 deploy 在...上 新的 project: 否
.vercel/project.json尚未 — 只是 runvercel deploy --是 --prod, creates project automatically
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制