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

tderoussel/ship-gate

Next.js-on-Vercel + Supabase + GitHub Actions スタック向けの検証ゲート。「出荷した」「デプロイした」「本番にある」などの主張をする前に必ず実行する。

ship-gate とは?

Ship gate は、Next.js(Vercel デプロイ)+ Supabase + GitHub Actions のスタックにおいて、コード変更が本番環境で正しく動作し、CI が通過し、データベースへの影響が適切であることを確認するための検証ルールセットです。「本番にある」「マージした」「CI が通った」といった主張をユーザーが行う前に、このゲートを実行するよう促します。各ルールは、よくある「誤った合格」を防ぐためのトラップ(時間帯の罠、CI の pipe コマンド、スキーマの誤適用など)を具体的に記述しており、開発者が本番環境の状態を正確に把握できるように設計されています。Claude Code などのエージェントで使用することを想定しています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/tderoussel/agent-skills/tree/main/skills/ship-gate

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

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

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

ドキュメント

Ship gate

ここにあるすべてのルールは、一見正しく見えるチェックが誤って合格したという経験に基づいています。主張をする前にゲートを実行してください。後から実行しても意味がありません。

スタックに合わせて具体的な内容は調整してください。重要なのは「この主張が偽になる条件は何か?」という形です。これはどのスタックにも応用可能な部分です。

主張のルール

本番環境に関する主張は、本番環境に対してクエリを実行しなければならない。

テストが通ったことは本番環境ではありません。PR のマージは本番環境ではありません。デプロイが成功したことも本番環境ではありません。それらはすべて、主張しているシステムとは別のシステムに関する主張です。

結果を人間が目視確認していなければ、「検証済み」とは言えません。代わりに、実際に何を確認したのかを言いましょう。

デプロイ検証

  • 実際にデプロイをトリガーするものを把握する。 Git 連携ホストでは、CLI の呼び出しではなくプッシュがトリガーです。CLI でデプロイした場合、プロジェクトがプッッシュでデプロイする設定になっていると、ユーザーが受け取るビルドとは異なるビルドが生成されます。
  • プロジェクトを所有するアカウントを確認する。 ローカルにログインした CLI が、本番プロジェクトを所有していない個人アカウントで認証されている場合があります。その場合、すべてのコマンドが間違ったターゲットに対して静かに成功します。
  • デプロイされた SHA に対するコミットステータスを確認する。ダッシュボードを一目見ただけでは不十分です。
  • 現在の本番環境のデプロイを確認すること。READY 状態のデプロイが複数存在することがあります。
  • Edge/サーバーレス関数はアプリとは別にデプロイされる。 PR をマージしても Edge 関数はデプロイされません。バージョンを明示的に確認してください。
  • クライアントのみの変更では、関数のデプロイは不要な場合があります。来ることのないデプロイを待ってはいけません。
  • バージョンを主張する前に、ライブマニフェストを再取得してください。並行作業によってバージョンが下書きされることがあります。

CI 検証

  • すべての必須コンテキストに対してゲートを適用し、最初の緑だけを見ない。
  • パイプされたコマンドをゲートに使わないこと。 some-check | tail は tail の終了コードを報告するため、実際の失敗を隠蔽します。PIPESTATUS がないシェル(zsh は bash と異なります)では、これを間違えやすいです。コマンド自身のステータスを確認してください。
  • steps: 0 はジョブが一度も実行されなかったことを意味し、合格ではない。 Checks API は、何も仕事をしなかったジョブに対して結論を報告することがあります。
  • ステップなしで不自然に速い失敗は、通常 課金または権限の問題であり、YAML の問題ではありません。
  • 失敗したジョブだけを再実行すると、ブランチの古いスナップショットを再実行することになります。最初にブランチを更新し、その後に再実行してください。
  • チェックリストには、作成されなかったジョブは含まれない。 失敗がないことは合格の証拠にはなりません。
  • gh pr create では明示的な --base が必要です。その周りにチェーンされたヒアドキュメントは静かに失敗することがあります。

型とリンターのゲート

  • 大規模な TypeScript プロジェクトでは Node.js のヒープサイズを増やす必要がある場合があります。増やさないと tsc がコードエラーのように見える形でクラッシュします。
  • 型チェッカーとリンターが実際にカバーするディレクトリを把握する。 Edge 関数のディレクトリは、両方から除外されていることがよくあります。別のランタイム上で動作する場合は、そのランタイムの独自のチェッカーで確認してください。テストジョブは型ゲートではありません。
  • ワークツリーまたはクリーンチェックアウトでビルドし、未コミットのドリフトがある作業ディレクトリではビルドしない。

データベース

  • 決して本番環境に対してカジュアルにスキーマをプッシュしたりマイグレーションを実行しないでください。プロジェクトが選択したレビュー済みのパスを通じて、一度だけスキーマを適用します。
  • 新しいストアドプロシージャは、実際のデータベースに対して呼び出してから信頼する。 モックは、実際の型と実際の曖昧性でのみ現れる実行時エラーを隠します。
  • テストスイートがデータベースをグローバルにモックしている場合、単体テストがパスしてもデータベースについては何も証明できない。
  • トリガー管理カラムでは比較と設定を行わないでください。トリガーが書き込みの下で値を変更します。
  • マージする前に、変更の影響範囲を本番データに対して測定する。 ローカルシードに対して狭く見えるフィルターが、実際の行に対してはまったく異なる割合にマッチすることがあります。

環境の罠

  • マシンのタイムゾーンを決して仮定せず、date を実行する。 日付依存のテストはオフセットで失敗し、その失敗はコードのバグのように見えます。
  • Git の identity が設定されていないと、デプロイがブロックされ、無関係なネットワークエラーのように見えることがあります。
  • ホスト環境変数はインライン代入ではなくファイルから設定してください。シェルや CLI が末尾の改行を埋め込んで、値を目に見えない形で壊すことがあります。
  • スケジュールジョブの成功はジョブの効果の成功ではありません。ランナーが succeeded を報告するのは呼び出しが戻ったことを意味し、作業が行われたことではありません。効果を検証してください。

出力

各ゲートを PASS(証拠) または NOT CHECKED(理由) として記述してください。

実行していないゲートがあれば、そのことを暗に示すような表現は決して使わないでください。いずれかのゲートが失敗した、またはチェックされていない場合は、変更が検証されていないことを明確に述べてください。主張を差し控えることが正しい態度です。

Individual skills in this repo

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

tderoussel/codebase-audit

Runs a ranked, evidence-backed audit of a product, codebase, or subsystem, ending in a verify list that separates proven findings from inferred ones. Use when the user asks for an audit, a gap analysis, a deep read, a bug hunt, a readiness check, a re-audit, a state reconciliation, or asks what they are not seeing. Trigger phrases include "audit", "gap analysis", "what am I missing", "deep audit", "readiness", "bug hunt", "review the whole thing". Produces findings and a verify list; does not fix.

tderoussel/competitive-teardown

Researches a competing product against your own and produces a ranked build-or-ignore verdict, plus optional comparison-page copy. Use when the user names a competitor or asks how their product stacks up against one. Trigger phrases include "vs us", "competitor", "what does X have", "should we copy", "competitive gap", "teardown", "are we behind". Produces a ranked verdict with effort estimates and an explicit not-worth-copying list.

tderoussel/decision-council

Run a structured multi-perspective review of a decision instead of getting one agreeable answer. Use when the user says run a council, get me perspectives on this, should I do X, stress-test this decision, or is this a good idea.

tderoussel/fleet-brief

Authors a workstream brief for dispatching multiple parallel build agents across one codebase, with per-lane file ownership, shared-ground warnings, and a derived DO-NOT list. Use whenever work is about to be split across concurrent agents, workers, lanes, or waves — even if the user does not say "write a brief". Trigger phrases include "fan out", "parallel agents", "orchestrate this", "split into lanes", "workstreams", "run these in parallel", "review-gated build". Produces the brief; does not dispatch.

tderoussel/inbox-triage

Triage an email inbox — sort what needs a reply, draft the replies, flag what needs a decision, and surface what can be ignored or unsubscribed. Use when the user says triage my inbox, do my email, what's in my inbox, or clean up my email.

tderoussel/overnight-build

Composes an autonomous unattended Claude Code build prompt that survives usage-limit resets via BUILD_LOG.md checkpointing, plus the launcher that restarts it. Use when the user asks for an overnight build, an autonomous build, a build to run while they sleep, an unattended or unsupervised session, or any long build they will not be monitoring. Trigger phrases include "overnight build", "run overnight", "build while I sleep", "autonomous build", "let it run", "unattended". Produces a single copyable prompt; does not run the build.

tderoussel/session-log

Write a durable record of a work session — what was built, root-caused, or shipped — into the project's notes. Use when the user says log this session, write a session log, record this, or when a substantial piece of work has just finished and needs to be handed off to a future session.

tderoussel/vault-doctor

Audits and repairs an Obsidian vault's structural health — broken [[wikilinks]], ambiguous duplicate filenames, missing or malformed frontmatter, stale status markers, and hub notes whose state sections have gone cold. Use when the user asks about vault health, broken links, vault cleanup, dead links, orphan notes, tag consistency, or says the vault feels messy or out of date. Trigger phrases include "vault health", "broken links", "clean up the vault", "audit the vault", "is the vault current". Read-only by default; every repair is proposed before it is made.

関連スキル