{"id":"add-vercel","name":"add-vercel","summary":"NanoClawエージェントにVercel展開機能を追加。Vercel CLIをエージェントコンテナにインストールし、OneCLIの認証注入を api.vercel.com 設定します。","body":"# Add Vercel\n\nThis skill gives NanoClaw agents the ability to deploy web applications to Vercel. It installs the Vercel CLI in agent containers and configures OneCLI to inject Vercel credentials automatically.\n\n**Principle:** Do the work — don't tell the user to do it. Only ask for their input when it genuinely requires manual action (pasting a token).\n\n## Phase 1: Pre-flight\n\n### Check if already applied\n\nCheck if the container skill exists:\n\n```bash\ntest -d container/skills/vercel-cli && echo \"INSTALLED\" || echo \"NOT_INSTALLED\"\n```\n\nIf `INSTALLED`, skip to Phase 3 (Configure Credentials).\n\n### Check prerequisites\n\nVerify OneCLI is working (required for credential injection):\n\n```bash\nonecli version 2>/dev/null && echo \"ONECLI_OK\" || echo \"ONECLI_MISSING\"\n```\n\nIf `ONECLI_MISSING`, tell the user to run `/init-onecli` first, then retry `/add-vercel`. Stop here.\n\n## Phase 2: Install Container Skill\n\nCopy the bundled container skill into the container skills directory:\n\n```bash\nrsync -a .claude/skills/add-vercel/container-skills/ container/skills/\n```\n\nVerify:\n\n```bash\nhead -5 container/skills/vercel-cli/SKILL.md\n```\n\n## Phase 3: Configure Credentials\n\n### Check if Vercel credential already exists\n\n```bash\nonecli secrets list 2>/dev/null | grep -i vercel\n```\n\nIf a Vercel credential already exists, skip to Phase 4.\n\n### Set up Vercel API credential\n\nThe agent needs a Vercel personal access token. Tell the user:\n\n> I need your Vercel personal access token. Go to https://vercel.com/account/tokens and create one with these settings:\n>\n> - **Token name:** `nanoclaw` (or any name you'll recognize)\n> - **Scope:** \"Full Account\" — the agent needs to create projects, deploy, and manage domains\n> - **Expiration:** \"No expiration\" recommended (avoids credential rotation), or pick a date if your security policy requires it\n>\n> After creating the token, copy it — you'll only see it once.\n\nOnce the user provides the token, add it to OneCLI:\n\n```bash\nonecli secrets create \\\n  --name \"Vercel API Token\" \\\n  --type generic \\\n  --value \"<TOKEN>\" \\\n  --host-pattern \"api.vercel.com\" \\\n  --header-name \"Authorization\" \\\n  --value-format \"Bearer {value}\"\n```\n\nVerify:\n\n```bash\nonecli secrets list | grep -i vercel\n```\n\n### Assign the secret to all agents\n\nOneCLI uses selective secret mode — secrets must be explicitly assigned to each agent. Get the Vercel secret ID from the output above, then assign it to every agent:\n\n```bash\n# set-secrets replaces the entire list — read and merge for each agent.\nVERCEL_SECRET_ID=$(onecli secrets list | jq -r '.data[] | select(.name | test(\"(?i)vercel\")) | .id' | head -1)\nfor agent in $(onecli agents list | jq -r '.data[].id'); do\n  CURRENT=$(onecli agents secrets --id \"$agent\" | jq -r '[.data[]] | join(\",\")')\n  MERGED=$(printf '%s' \"$CURRENT,$VERCEL_SECRET_ID\" | tr ',' '\\n' | sort -u | paste -sd ',' -)\n  onecli agents set-secrets --id \"$agent\" --secret-ids \"$MERGED\"\ndone\n```\n\n## Phase 4: Ensure Vercel CLI in Container Image\n\nThe Vercel CLI is not in the agent image by default — this skill is what adds\nit. It goes in `container/cli-tools.json` as a json-merge rather than a\nDockerfile edit, which is what keeps the change deterministic and removable.\n\n```bash\ngrep -q '\"vercel\"' container/cli-tools.json && echo \"PRESENT\" || echo \"MISSING\"\n```\n\nIf `MISSING`, append the entry, keeping an exact pinned version — the manifest\nrejects ranges, so the supply-chain policy still applies:\n\n```json\n{ \"name\": \"vercel\", \"version\": \"52.2.1\" }\n```\n\nThen apply it:\n\n```bash\n./container/build.sh\n```\n\nOn an install that builds its own image, that rebuilds it. On one that fetches a\npublished image, the same command adds Vercel as a single layer on top of the\nimage already there, so the publisher's patched components underneath are kept —\nyou are adding a tool, not replacing the runtime. The command says what that does\nand does not cover.\n\nIf `PRESENT`, the CLI is already in the manifest — skip the rebuild.\n\n## Phase 4b: Copy and Run the Dependency Guard\n\nThe Vercel CLI is a globally-installed binary — not importable or typed — so a structural test guards the install. Copy it into the host test tree and run it:\n\n```bash\ncp .claude/skills/add-vercel/vercel-manifest.test.ts src/vercel-manifest.test.ts\npnpm exec vitest run src/vercel-manifest.test.ts\n```\n\nThe test asserts both halves of the install: a pinned `vercel` entry in `container/cli-tools.json`, and the container skill at `container/skills/vercel-cli/`. Either alone is a broken install — a manifest entry with no skill leaves the agent a binary nobody told it about, and a skill with no entry tells it to run a command that is not there.\n\n## Phase 5: Sync Skills to Running Agent Groups\n\nContainer skills are copied once at group creation and not auto-synced. After installing or updating a container skill, sync it to all existing agent groups:\n\n```bash\nfor session_dir in data/v2-sessions/ag-*; do\n  if [ -d \"$session_dir/.claude-shared/skills\" ]; then\n    rsync -a container/skills/ \"$session_dir/.claude-shared/skills/\"\n    echo \"Synced skills to: $session_dir\"\n  fi\ndone\n```\n\n## Phase 6: Restart Running Containers\n\nStop all running agent containers so they pick up the new skills on next wake:\n\n```bash\ndocker ps --filter label=nanoclaw-session -q | xargs -r docker stop\n```\n\n## Done\n\nThe agent can now deploy web applications to Vercel. Key commands:\n\n- `vercel deploy --yes --prod --token placeholder` — deploy to production\n- `vercel ls --token placeholder` — list deployments\n- `vercel whoami --token placeholder` — check auth\n\nFor the full command reference, the agent has the `vercel-cli` container skill loaded automatically.","author":"@nanocoai","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/nanocoai/nanoclaw/tree/main/.claude/skills/add-vercel","license":"MIT","category":"writing","lang":"en","tokens":1448,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"REMOVE.md","size":1555,"sha256":"5cfcd42c39168baf31944c45913287c9ac82c17474cb0cb5f4077f8f8d28e408"},{"path":"vercel-manifest.test.ts","size":2360,"sha256":"0a701e151726460972425161c13eab47917a58ea8c9cf7643b7a69c907c8eacd"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[{"code":"net.endpoints","kind":"exfiltration","excerpt":"vercel.com","message":"bundled scripts reach 1 external host(s)","severity":"warn"}],"scannedAt":"2026-08-22","hasScripts":true,"networkEndpoints":["vercel.com"]}}