Communityコーディング&開発github.com

alfathafp/portofolio-web-design

アプリケーションやウェブサイトをVercelにデプロイします。ユーザーが「アプリをデプロイして」「デプロイしてリンクを教えて」「本番公開して」「プレビューデプロイを作成して」などのデプロイ操作をリクエストしたときに使用します。

portofolio-web-design とは?

このスキル「Deploy to Vercel」は、任意のプロジェクトをVercelにデプロイするための包括的なツールです。特に、デフォルトではプレビューデプロイとして実行し、ユーザーが明示的に本番環境を要求した場合にのみ本番デプロイを行います。スキルの核心的な目標は、ユーザーのプロジェクトをVercelにリンクし、git pushによる自動デプロイが可能な長期的な開発フローを確立することです。 対応プラットフォームは、Claude Code(ターミナルベースのエージェント)、claude.ai(サンドボックス環境)、Codex(サンドボックス環境)の3つです。各環境に応じて最適なデプロイ方法が選択されます。スキルは4つの状態をチェックします。gitリモートの有無、Vercel CLIへのログイン状態、プロジェクトがVercelにリンクされているか(`.vercel/project.json`または`.vercel/repo.json`の存在)、そして利用可能なチーム一覧です。この情報に基づき、最適なデプロイ方法(git push、`vercel deploy`コマンド、リンク後のデプロイ、認証不要のフォールバックスクリプト)を自動的に選択します。 開発者にとっての最大の利点は、環境の複雑さを吸収し、常に最も効率的でベストプラクティスに沿ったデプロイフローを提供する点です。チーム選択、git連携、認証状態の自動検出により、手動設定の手間を省き、一貫したデプロイ体験を実現します。また、サンドボックス環境では認証不要のフォールバックスクリプトが用意されており、CLIが使えない場合でもデプロイが可能です。

対応✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/deploy-to-vercel

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Vercelにデプロイする

任意のプロジェクトをVercelにデプロイします。常にプレビューとしてデプロイし(本番ではありません)、ユーザーが明示的に本番を要求した場合のみ本番デプロイを行います。

目標は、ユーザーを最適な長期的なセットアップ(プロジェクトがVercelにリンクされ、git pushでデプロイされる状態)に導くことです。以下の各方法は、ユーザーをその状態に近づけるように設計されています。

ステップ1: プロジェクトの状態を把握する

以下の4つのチェックをすべて実行してから、使用する方法を決定します。

# 1. gitリモートの確認
git remote get-url origin 2>/dev/null

# 2. Vercelプロジェクトにローカルでリンクされているか確認(どちらかのファイルが存在すればリンク済み)
cat .vercel/project.json 2>/dev/null || cat .vercel/repo.json 2>/dev/null

# 3. Vercel CLIがインストールされ、認証されているか確認
vercel whoami 2>/dev/null

# 4. 利用可能なチームの一覧を取得(認証されている場合)
vercel teams list --format json 2>/dev/null

チーム選択

ユーザーが複数のチームに属している場合は、利用可能なすべてのチームスラッグを箇条書きで提示し、どれにデプロイするかを尋ねます。ユーザーがチームを選択したら、すぐに次のステップに進みます。追加の確認は求めないでください。

以降のすべてのCLIコマンド(vercel deploy、vercel link、vercel inspectなど)で、チームスラッグを--scopeで渡します。

vercel deploy [path] -y --no-wait --scope <team-slug>

プロジェクトがすでにリンクされている場合(.vercel/project.jsonまたは.vercel/repo.jsonが存在する場合)、それらのファイル内のorgIdがチームを決定します。再度尋ねる必要はありません。チームが1つだけの場合(または個人アカウントのみの場合)、プロンプトをスキップして直接使用します。

.vercel/ディレクトリについて: リンクされたプロジェクトには、以下のいずれかが存在します。

  • .vercel/project.json — vercel linkによって作成されます(単一プロジェクトのリンク)。projectIdとorgIdが含まれます。
  • .vercel/repo.json — vercel link --repoによって作成されます(リポジトリベースのリンク)。orgId、remoteName、およびディレクトリをVercelプロジェクトIDにマッピングするprojects配列が含まれます。

どちらかのファイルが存在すれば、プロジェクトはリンクされています。両方を確認してください。

リンクされていないディレクトリで状態を検出するためにvercel project inspect、vercel ls、またはvercel linkを使用しないでください。 .vercel/設定がない場合、これらは対話的にプロンプトを表示するか(--yesを付けると、副作用として自動的にリンクされます)。安全に実行できるのはvercel whoamiのみです。

ステップ2: デプロイ方法を選択する

リンク済み(.vercel/が存在する)+ gitリモートあり → git push

これが理想的な状態です。プロジェクトがリンクされ、git統合が有効です。

  1. プッシュする前にユーザーに確認します。 明示的な承認なしにプッシュしないでください。

    このプロジェクトはVercelにgit経由で接続されています。コミットしてプッシュし、デプロイをトリガーできます。続行しますか?
    
  2. コミットしてプッシュします:

    git add .
    git commit -m "deploy: <変更内容の説明>"
    git push
    

    Vercelはプッシュから自動的にビルドします。非本番ブランチはプレビューデプロイを取得し、本番ブランチ(通常はmain)は本番デプロイを取得します。

  3. プレビューURLを取得します。 CLIが認証されている場合:

    sleep 5
    vercel ls --format json
    

    JSON出力にはdeployments配列があります。最新のエントリを見つけます。そのurlフィールドがプレビューURLです。

    CLIが認証されていない場合は、ユーザーにVercelダッシュボードまたはgitプロバイダーのコミットステータスチェックでプレビューURLを確認するように伝えます。


リンク済み(.vercel/が存在する)+ gitリモートなし → vercel deploy

プロジェクトはリンクされていますが、gitリポジトリがありません。CLIで直接デプロイします。

vercel deploy [path] -y --no-wait

--no-waitを使用すると、CLIはビルドが完了するのをブロックせずに(ビルドには時間がかかる場合があります)、デプロイメントURLをすぐに返します。その後、以下のコマンドでデプロイのステータスを確認します。

vercel inspect <deployment-url>

本番デプロイの場合(ユーザーが明示的に要求した場合のみ):

vercel deploy [path] --prod -y --no-wait

リンクされていない + CLIが認証されている → 最初にリンクし、その後デプロイ

CLIは動作していますが、プロジェクトはまだリンクされていません。これはユーザーを最適な状態にする機会です。

  1. どのチームにデプロイするかユーザーに尋ねます。 ステップ1のチームスラッグを箇条書きで提示します。チームが1つだけの場合(または個人アカウントのみの場合)、このステップをスキップします。

  2. チームが選択されたら、すぐにリンクに進みます。 何が起こるかをユーザーに伝えますが、別途確認は求めないでください。

    このプロジェクトをVercelの<チーム名>にリンクします。これにより、デプロイ先のVercelプロジェクトが作成され、将来のgitプッシュで自動デプロイが有効になります。
    
  3. gitリモートが存在する場合、選択したチームスコープでリポジトリベースのリンクを使用します。

    vercel link --repo --scope <team-slug>
    

    これにより、gitリモートURLが読み取られ、そのリポジトリからデプロイする既存のVercelプロジェクトと照合されます。.vercel/repo.jsonが作成されます。これは、vercel link(--repoなし)よりもはるかに信頼性が高く、vercel linkはディレクトリ名で一致を試みるため、ローカルフォルダとVercelプロジェクトの名前が異なる場合によく失敗します。

    gitリモートがない場合、標準のリンクにフォールバックします。

    vercel link --scope <team-slug>
    

    これにより、ユーザーはプロジェクトを選択または作成するように求められます。.vercel/project.jsonが作成されます。

  4. 次に、利用可能な最良の方法でデプロイします:

    • gitリモートが存在する場合 → コミットしてプッシュ(上記のgit pushメソッドを参照)
    • gitリモートがない場合 → vercel deploy [path] -y --no-wait --scope <team-slug>、その後 vercel inspect <url> でステータスを確認

リンクされていない + CLIが認証されていない → インストール、認証、リンク、デプロイ

Vercel CLIがまったくセットアップされていません。

  1. CLIをインストールします(まだインストールされていない場合):

    npm install -g vercel
    
  2. 認証します:

    vercel login
    

    ユーザーはブラウザで認証を完了します。ログインが不可能な非対話型環境で実行している場合は、以下の認証不要フォールバックにスキップします。

  3. どのチームにデプロイするか尋ねます — vercel teams list --format json からチームスラッグを箇条書きで提示します。チームが1つだけ/個人アカウントのみの場合はスキップします。選択されたら、すぐに進みます。

  4. 選択したチームスコープでプロジェクトをリンクします(gitリモートが存在する場合は --repo を使用し、それ以外の場合は通常の vercel link を使用します):

    vercel link --repo --scope <team-slug>   # gitリモートが存在する場合
    vercel link --scope <team-slug>          # gitリモートがない場合
    
  5. 利用可能な最良の方法でデプロイします(リモートが存在する場合はgit push、それ以外の場合は vercel deploy -y --no-wait --scope <team-slug>、その後 vercel inspect <url> でステータスを確認)。


認証不要フォールバック — claude.ai サンドボックス

使用するタイミング: CLIをインストールできない、またはclaude.aiサンドボックスで認証できない場合の最後の手段。認証は不要で、プレビューURL(ライブサイト)とクレームURL(Vercelアカウントに転送するため)を返します。

bash /mnt/skills/user/deploy-to-vercel/resources/deploy.sh [path]

引数:

  • path - デプロイするディレクトリ、または .tgz ファイル(デフォルトはカレントディレクトリ)

例:

# カレントディレクトリをデプロイ
bash /mnt/skills/user/deploy-to-vercel/resources/deploy.sh

# 特定のプロジェクトをデプロイ
bash /mnt/skills/user/deploy-to-vercel/resources/deploy.sh /path/to/project

# 既存のtarballをデプロイ
bash /mnt/skills/user/deploy-to-vercel/resources/deploy.sh /path/to/project.tgz

このスクリプトは package.json からフレームワークを自動検出し、プロジェクトをパッケージ化し(node_modules、.git、.env を除外)、アップロードして、ビルドが完了するのを待ちます。

ユーザーに伝える: 「デプロイの準備ができました: [previewUrl]。デプロイを管理するには [claimUrl] でクレームしてください。」


認証不要フォールバック — Codex サンドボックス

使用するタイミング: Codexサンドボックスで、CLIが認証されていない可能性がある場合。Codexはデフォルトでサンドボックス環境で実行されます。最初にCLIを試し、認証に失敗した場合はデプロイスクリプトにフォールバックします。

  1. Vercel CLIがインストールされているか確認します(この確認に権限昇格は不要):

    command -v vercel
    
  2. vercel がインストールされている場合、CLIでデプロイを試みます:

    vercel deploy [path] -y --no-wait
    
  3. vercel がインストールされていない場合、またはCLIが「No existing credentials found」で失敗した場合、フォールバックスクリプトを使用します:

    skill_dir="<path-to-skill>"
    
    # カレントディレクトリをデプロイ
    bash "$skill_dir/resources/deploy-codex.sh"
    
    # 特定のプロジェクトをデプロイ
    bash "$skill_dir/resources/deploy-codex.sh" /path/to/project
    
    # 既存のtarballをデプロイ
    bash "$skill_dir/resources/deploy-codex.sh" /path/to/project.tgz
    

このスクリプトはフレームワークの検出、パッケージ化、デプロイを処理します。ビルドが完了するのを待ち、previewUrl と claimUrl を含むJSONを返します。

ユーザーに伝える: 「デプロイの準備ができました: [previewUrl]。デプロイを管理するには [claimUrl] でクレームしてください。」

昇格されたネットワークアクセス: サンドボックスがネットワーク呼び出しをブロックしている場合にのみ、実際のデプロイコマンドを昇格します(sandbox_permissions=require_escalated)。command -v vercel チェックは昇格しないでください。


エージェント固有の注意事項

Claude Code / ターミナルベースのエージェント

シェルへの完全なアクセス権があります。/mnt/skills/ パスは使用しないでください。上記の決定フローに従い、CLIを直接使用します。

認証不要フォールバックの場合、スキルのインストール先からデプロイスクリプトを実行します。

bash ~/.claude/skills/deploy-to-vercel/resources/deploy.sh [path]

パスは、ユーザーがスキルをインストールした場所によって異なる場合があります。

サンドボックス環境(claude.ai)

vercel login や git push はおそらく実行できません。認証不要フォールバック — claude.ai サンドボックス に直接進みます。

Codex

Codexはサンドボックスで実行されます。最初にCLIが利用可能かどうかを確認し、利用できない場合はデプロイスクリプトにフォールバックします。認証不要フォールバック — Codex サンドボックス に進みます。


出力

常にユーザーにデプロイメントURLを表示します。

  • git push: vercel ls --format json を使用してプレビューURLを見つけます。CLIが認証されていない場合は、ユーザーにVercelダッシュボードまたはコミットステータスチェックを確認するように伝えます。
  • CLIデプロイ: vercel deploy --no-wait によって返されたURLを表示します。vercel inspect <url> を使用してビルドステータスを確認し、ユーザーに報告します。
  • 認証不要フォールバック: プレビューURLとクレームURLの両方を表示します。
    デプロイに成功しました!
    
    プレビューURL: https://my-app-abc123.vercel.app
    クレームURL:   https://vercel.com/claim-deployment?code=...
    
    プレビューURLでサイトを表示できます。
    このデプロイをVercelアカウントに転送するには、クレームURLにアクセスしてください。
    

デプロイされたURLをcurlやfetchで確認しないでください。リンクを返すだけです。


トラブルシューティング

ネットワーク出力エラー(claude.ai)

claude.aiのネットワーク制限によりデプロイが失敗した場合、ユーザーに次のように伝えます。

ネットワーク制限のためデプロイに失敗しました。修正するには:

1. https://claude.ai/settings/capabilities にアクセス
2. 許可ドメインに *.vercel.com を追加
3. 再度デプロイを試行

昇格されたネットワークアクセス(Codex / サンドボックス環境)

サンドボックス環境でネットワーク問題(タイムアウト、DNSエラー、接続リセット)が原因でデプロイが失敗した場合、昇格された権限で再実行します(sandbox_permissions=require_escalated)。初期のCLI可用性チェックは昇格せず、実際のデプロイコマンドのみを昇格します。

ユーザーへのガイダンス例:

デプロイをVercelに実行するには、昇格されたネットワークアクセスが必要です。昇格された権限でコマンドを再実行できます。続行しますか?

CLI認証エラー

vercel login または vercel deploy が認証エラーで失敗した場合、認証不要のデプロイスクリプト(環境に応じてclaude.aiまたはCodexバリアント)にフォールバックします。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, when you're about to write a large amount of code at once, or when a task feels too big to land in one step.

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

関連スキル