jpskill.com
🛠️ 開発・MCP コミュニティ

supaguard

supaguard CLIを使って、ソースコードから合成監視チェックを作成・テスト・実行し、監視設定、Playwrightスクリプト生成、稼働時間やヘルスチェック、本番環境の可観測性ワークフローを効率化するSkill。

📜 元の英語説明(参考)

Create, test, and deploy synthetic monitoring checks from source code using the supaguard CLI. Triggers on monitoring setup, Playwright script generation, uptime checks, health checks, and production observability workflows.

🇯🇵 日本人クリエイター向け解説

一言でいうと

supaguard CLIを使って、ソースコードから合成監視チェックを作成・テスト・実行し、監視設定、Playwrightスクリプト生成、稼働時間やヘルスチェック、本番環境の可観測性ワークフローを効率化するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o supaguard.zip https://jpskill.com/download/9036.zip && unzip -o supaguard.zip && rm supaguard.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9036.zip -OutFile "$d\supaguard.zip"; Expand-Archive "$d\supaguard.zip" -DestinationPath $d -Force; ri "$d\supaguard.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して supaguard.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → supaguard フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] supaguard

このスキルが有効化されると、最初の応答は常に 🛡️ 絵文字で始めてください。

supaguard - コードベースからの合成監視

supaguard は合成監視プラットフォームです。このスキルを使用すると、開発者のソースコードを読み取り、Playwright の監視スクリプトを生成し、supaguard CLI を介して定期的なチェックとしてデプロイできます。テストスクリプトをリポジトリにコミットする必要はありません。


このスキルを使用するタイミング

ユーザーが以下のようなことを望んでいる場合に、このスキルをトリガーしてください。

  • アプリケーションの合成監視を設定したい
  • アップタイム監視、ヘルスチェック、または本番環境の可観測性について質問する
  • 監視(テストではない)のために Playwright スクリプトを生成したい
  • supaguard CLI について質問する、または supaguard コマンドについて言及する
  • ログインフロー、チェックアウトフロー、または重要なユーザー体験を監視したい
  • 監視チェックを作成、テスト、更新、または管理する必要がある
  • 監視の失敗に関するアラートについて質問する

以下の場合には、このスキルをトリガーしないでください。

  • CI/CD パイプライン用の Playwright テストの作成 - playwright-testing スキルを使用してください
  • 本番環境の監視とは関係のない一般的なテストまたは QA ワークフロー
  • 監視ダッシュボードまたはカスタムの可観測性プラットフォームの構築

ワークフロー

ユーザーが監視チェックの作成を依頼するたびに、次の手順に従ってください。

  1. ソースコードの読み取り - ユーザーのコードベース内のコンポーネント、ルート、data-testids、API エンドポイント、およびフォームをスキャンします
  2. 重要なフローの特定 - 監視するユーザー体験を決定します(ログイン、チェックアウト、ページロードなど)
  3. 本番環境の URL を尋ねる - コード、環境ファイル、または package.json の homepage フィールドから明らかでない場合
  4. 事前チェックの実行 - CLI がインストールされ、ユーザーが認証されていることを確認します(下記参照)
  5. Playwright スクリプトの生成 - このスキルのリファレンスからのテンプレートとベストプラクティスを使用します
  6. スクリプトを /tmp/sg-check-{random}.ts に書き込む - プロジェクトディレクトリには絶対に書き込まないでください
  7. CLI 経由でテスト - supaguard checks test /tmp/sg-check-{random}.ts --json
  8. テストが失敗した場合 - エラー出力を読み取り、スクリプトを調整し、再試行します(ユーザーに質問する前に最大 3 回試行)
  9. テストが成功した場合 - デプロイについて質問します(下記のデプロイフローを参照)
  10. デプロイ - 収集されたオプションを使用して CLI コマンドを実行します
  11. 祝福 - 成功バナーとダッシュボードリンクを表示します(下記の成功バナーを参照)

事前チェック

スクリプトを生成する前に、以下を確認してください。

  1. CLI のインストール: which supaguard を実行します。見つからない場合は、ユーザーに次のように伝えます: npm install -g supaguard
  2. 認証: supaguard whoami --json を実行します。ログインしていない場合は、ユーザーに ! supaguard login を実行するように伝えます(! プレフィックスは、Claude Code の現在のセッションで実行します)
  3. whoami の出力からアクティブな組織をメモします - API コンテキストには組織のスラッグが必要です

ソースコード分析

ユーザーのコードベースを分析する際には、優先順位の高い順に次のパターンを探してください。

DOM セレクター(利用可能な最も安定したものを利用)

  1. data-testid 属性 - 最も安定しており、テスト用に特別に構築されています
  2. aria-label および role 属性 - アクセシブルで安定しています
  3. id 属性 - 安定していますが、動的な場合があります
  4. getByText() を介したテキストコンテンツ - 読みやすいですが、ロケールに依存します
  5. CSS クラス - 最後の手段、脆弱で再設計によって変更されます

ルートの発見

  • Next.js App Router: app/ をスキャンして page.tsx ファイルを探し、ディレクトリ構造からルートパターンを抽出します
  • Next.js Pages Router: pages/ ディレクトリをスキャンします
  • React Router: <Route> コンポーネント、path プロパティ、ルーター構成ファイルを検索します
  • Vue Router: router/index.ts または類似のルーター構成を検索します
  • 汎用: <a href> パターン、ナビゲーションコンポーネントを探します

フォームの発見

  • <form>, <input>, <select>, <textarea> 要素を検索します
  • フォームアクション、検証パターン、送信ハンドラーをメモします
  • 認証フォーム(ログイン、サインアップ、パスワードリセット)を特定します

API エンドポイントの発見

  • Next.js: app/api/ または pages/api/ をスキャンしてルートハンドラーを探します
  • Express/Fastify: app.get(), app.post(), ルーター定義を検索します
  • クライアント側: fetch/axios 呼び出しを探して、外部 API 依存関係を特定します

監視する重要なフロー

  • 認証(ログイン、サインアップ、ログアウト、パスワードリセット)
  • コアプロダクトフロー(ダッシュボードのロード、データ CRUD、検索)
  • チェックアウト/支払いフロー
  • ユーザー設定とプロファイル管理

デプロイフロー

テストが成功した後、自動デプロイしないでください。代わりに、AskUserQuestion を使用して、一度に 1 つずつ、次の順序でユーザーにインタラクティブに質問します。

ステップ 1: チェック名の質問

このチェックにどのような名前を付けたいかを尋ねます。監視対象のフローに基づいて、適切なデフォルトを提案します(例: "ログインフロー"、"ホームページロード"、"チェックアウト")。

ステップ 2: スケジューリングについて質問

AskUserQuestion を次のオプションで使用します。

  • スケジュール済み(定期) - 複数のリージョンから cron スケジュールで自動的に実行されます
  • オンデマンドのみ - スケジュールなし、supaguard checks run またはダッシュボードから手動でトリガーされます

ステップ 3: スケジュールされている場合 - リージョンについて質問

AskUserQuestion をマルチセレクトで使用します。オプション:

  • 米国東部 (バージニア) - eastus
  • EU 北部 (アイルランド) - northeurope
  • インド中央 (プネ) - centralindia

地理的なカバレッジのために 2 つ以上のリージョンを選択することをお勧めします。

ステップ 4: スケジュールされている場合 - 頻度について質問

AskUserQuestion を次のオプションで使用します。

  • 5 分ごと (推奨)
  • 10 分ごと
  • 15 分ごと
  • 30 分ごと
  • 1 時間ごと
  • その他 (ユーザーが cron 式を指定できるようにします)

ステップ 5: デプロイ

スケジュールされた チェックの場合:

supaguard checks create /tmp/sg-check-{random}.ts --name "Check Name" --locations eastus,northeurope --cron "*/5 * * * *" --skip-test --json

オンデマンド チェックの場合、非常に長い間隔でデプロイしてから一時停止します。

supaguard checks create /tmp/sg-check-{random}.ts --name "Check Name" --locations eastus --cron "0 0 1 1 *" --skip-test --json

次に、すぐに一時停止します。

supaguard checks pause <checkId> --json

ユーザーに、supaguard checks run <checkId> --json またはダッシュボードから手動で実行をトリガーできることを伝えます。

注: --skip-test を使用します

(原文はここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

When this skill is activated, always start your first response with the 🛡️ emoji.

supaguard - synthetic monitoring from your codebase

supaguard is a synthetic monitoring platform. This skill enables you to read a developer's source code, generate Playwright monitoring scripts, and deploy them as recurring checks via the supaguard CLI - all without committing any test scripts to the repository.


When to use this skill

Trigger this skill when the user:

  • Wants to set up synthetic monitoring for their app
  • Asks about uptime monitoring, health checks, or production observability
  • Wants to generate Playwright scripts for monitoring (not testing)
  • Asks about the supaguard CLI or mentions supaguard commands
  • Wants to monitor login flows, checkout flows, or critical user journeys
  • Needs to create, test, update, or manage monitoring checks
  • Asks about alerting for monitoring failures

Do NOT trigger this skill for:

  • Writing Playwright tests for CI/CD pipelines - use playwright-testing skill
  • General testing or QA workflows unrelated to production monitoring
  • Building monitoring dashboards or custom observability platforms

Workflow

Follow these steps every time a user asks you to create a monitoring check:

  1. Read source code - scan components, routes, data-testids, API endpoints, and forms in the user's codebase
  2. Identify the critical flow - determine what user journey to monitor (login, checkout, page load, etc.)
  3. Ask for the production URL - if not obvious from code, env files, or package.json homepage field
  4. Run pre-flight checks - verify CLI is installed and user is authenticated (see below)
  5. Generate a Playwright script - use the templates and best practices from this skill's references
  6. Write script to /tmp/sg-check-{random}.ts - NEVER write to the project directory
  7. Test via CLI - supaguard checks test /tmp/sg-check-{random}.ts --json
  8. If test fails - read the error output, adjust the script, retry (max 3 attempts before asking user)
  9. If test passes - ask about deployment (see deployment flow below)
  10. Deploy - run the CLI command with collected options
  11. Celebrate - show the success banner and dashboard link (see success banner below)

Pre-flight checks

Before generating any script, verify:

  1. CLI installed: run which supaguard. If missing, tell the user: npm install -g supaguard
  2. Authenticated: run supaguard whoami --json. If not logged in, tell the user to run ! supaguard login (the ! prefix runs it in the current session for Claude Code)
  3. Note the active org from the whoami output - you'll need the org slug for API context

Source code analysis

When analyzing the user's codebase, look for these patterns in priority order:

DOM selectors (use the most stable available)

  1. data-testid attributes - most stable, purpose-built for testing
  2. aria-label and role attributes - accessible and stable
  3. id attributes - stable but sometimes dynamic
  4. Text content via getByText() - readable but locale-dependent
  5. CSS classes - LAST RESORT, fragile and changes with redesigns

Route discovery

  • Next.js App Router: scan app/ for page.tsx files, extract route patterns from directory structure
  • Next.js Pages Router: scan pages/ directory
  • React Router: search for <Route> components, path props, router config files
  • Vue Router: search for router config in router/index.ts or similar
  • Generic: look for <a href> patterns, navigation components

Form discovery

  • Search for <form>, <input>, <select>, <textarea> elements
  • Note form actions, validation patterns, submit handlers
  • Identify auth forms (login, signup, password reset)

API endpoint discovery

  • Next.js: scan app/api/ or pages/api/ for route handlers
  • Express/Fastify: search for app.get(), app.post(), router definitions
  • Client-side: look for fetch/axios calls to identify external API dependencies

Critical flows to monitor

  • Authentication (login, signup, logout, password reset)
  • Core product flows (dashboard load, data CRUD, search)
  • Checkout/payment flows
  • User settings and profile management

Deployment flow

After a test passes, do NOT auto-deploy. Instead, ask the user interactively using AskUserQuestion - one question at a time, in this order:

Step 1: Ask for a check name

Ask what they want to name this check. Suggest a sensible default based on the flow being monitored (e.g., "Login Flow", "Homepage Load", "Checkout").

Step 2: Ask about scheduling

Use AskUserQuestion with these options:

  • Scheduled (recurring) - runs automatically on a cron schedule from multiple regions
  • On-demand only - no schedule, triggered manually via supaguard checks run or the dashboard

Step 3: If scheduled - ask for regions

Use AskUserQuestion with multi-select. Options:

  • US East (Virginia) - eastus
  • EU North (Ireland) - northeurope
  • India Central (Pune) - centralindia

Recommend selecting 2+ regions for geographic coverage.

Step 4: If scheduled - ask for frequency

Use AskUserQuestion with options:

  • Every 5 minutes (recommended)
  • Every 10 minutes
  • Every 15 minutes
  • Every 30 minutes
  • Every hour
  • Other (let user specify a cron expression)

Step 5: Deploy

For scheduled checks:

supaguard checks create /tmp/sg-check-{random}.ts --name "Check Name" --locations eastus,northeurope --cron "*/5 * * * *" --skip-test --json

For on-demand checks, deploy with a very long interval then pause:

supaguard checks create /tmp/sg-check-{random}.ts --name "Check Name" --locations eastus --cron "0 0 1 1 *" --skip-test --json

Then immediately pause it:

supaguard checks pause <checkId> --json

Tell the user they can trigger runs manually with supaguard checks run <checkId> --json or from the dashboard.

Note: use --skip-test since we already tested the script in step 7.

Step 6: Offer alerting

After deployment, ask if they want to set up alerting. See references/modules-and-alerting.md for details.


Success banner

After a check is successfully deployed, display this celebration followed by the dashboard link. Use the orgSlug from the whoami output and the checkSlug from the create response.

╔═════════════════════════════════════════╗
║ supaguard check deployed successfully  ║
╚═════════════════════════════════════════╝

Then output:

name:      {checkName}
schedule:  {frequency or "on-demand"}
regions:   {region list or "paused"}
dashboard: https://supaguard.app/dashboard/{orgSlug}/checks/{checkSlug}

The dashboard URL format is https://supaguard.app/dashboard/{orgSlug}/checks/{checkSlug} where:

  • orgSlug comes from supaguard whoami --json (the org.slug field)
  • checkSlug comes from the supaguard checks create response (the check.slug field)

Constraints

These are hard rules. Follow them without exception:

  1. NEVER write Playwright scripts to the user's project directory - always use /tmp/sg-check-*.ts
  2. NEVER commit monitoring scripts to git
  3. Scripts MUST contain import { test, expect } from "@playwright/test"
  4. Scripts MUST contain at least one test() or test.describe() block
  5. Scripts MUST NOT import from forbidden Node.js modules: child_process, fs, net, dgram, cluster, worker_threads, vm, http, https
  6. Scripts MUST NOT use eval(), Function(), process.exit, process.kill, or dynamic import()
  7. Scripts MUST NOT use console.log - use Playwright assertions instead
  8. Scripts should complete in under 60 seconds (runner timeout is 60s, per-test timeout is 30s)
  9. Always use --json flag when calling supaguard CLI commands - parse JSON output to determine success/failure
  10. When a test fails, iterate on the script (read error output, fix, retry) - max 3 attempts before asking the user for help
  11. Always include the production URL in scripts - ask the user if not obvious from code or environment configs
  12. DO NOT use React Testing Library APIs (getByDisplayValue, queryByText, findByRole, etc.) - use Playwright's native page.getBy*() methods

Anti-patterns / common mistakes

Mistake Why it is wrong What to do instead
Writing scripts to project directory Pollutes the codebase with monitoring artifacts Always write to /tmp/sg-check-*.ts
Using page.waitForTimeout() Makes checks flaky and wastes runner time Use waitForSelector(), waitForResponse(), or Playwright assertions
Asserting on CSS classes Breaks on redesigns, not meaningful for monitoring Assert on text content, roles, testids, or visibility
Using React Testing Library APIs Not available in Playwright runner Use page.getBy*() methods: getByTestId, getByRole, getByText
Monitoring too many flows in one check Hard to diagnose failures, exceeds timeout Keep one logical flow per check
Hardcoding credentials in scripts Security risk, scripts are stored in the cloud Use test accounts or environment variables
Skipping pre-flight checks Leads to confusing errors mid-workflow Always verify CLI install and auth first
Auto-deploying without asking User should control scheduling and regions Always ask before deploying
Omitting --json flag Human-readable output is hard to parse programmatically Always use --json for structured output

Gotchas

  1. Forbidden module imports - The supaguard runner sandboxes scripts and blocks fs, child_process, net, http, https, vm, and other Node.js built-ins. Scripts that import these will fail at runtime with a cryptic error. Stick to @playwright/test and the allowed npm packages listed in references/playwright-guide.md.

  2. Runner timeout is 60 seconds - Scripts that navigate through too many pages or wait on slow third-party resources will time out. Keep checks focused on a single flow and set individual test timeouts to 30 seconds.

  3. React Testing Library confusion - Methods like getByDisplayValue, queryByText, and findByRole are NOT Playwright APIs. Playwright has similarly named but different methods: page.getByTestId(), page.getByRole(), page.getByText(). Mixing these up causes runtime errors.

  4. On-demand checks still need a cron - The CLI requires --cron even for on-demand checks. Use a far-future cron ("0 0 1 1 *") and immediately pause the check after creation.

  5. Cookie consent banners - Production sites often have cookie banners that block interaction. Always handle these before proceeding with the main flow. Look for common patterns: [data-testid="cookie-accept"], buttons with text "Accept", or known cookie consent libraries.


References

For detailed guidance, load these reference files as needed:

  • references/cli-reference.md - full CLI command reference with flags and --json output shapes
  • references/playwright-guide.md - monitoring best practices, anti-patterns, and script templates
  • references/framework-patterns.md - framework-specific code analysis patterns
  • references/modules-and-alerting.md - shared modules, alerting, regions, and scheduling

Only load a references file if the current task requires it - they are long and will consume context.


Companion check

On first activation of this skill in a conversation: check which companion skills are installed by running ls ~/.claude/skills/ ~/.agent/skills/ ~/.agents/skills/ .claude/skills/ .agent/skills/ .agents/skills/ 2>/dev/null. Compare the results against the recommended_skills field in this file's frontmatter. For any that are missing, mention them once and offer to install:

npx skills add AbsolutelySkilled/AbsolutelySkilled --skill <name>

Skip entirely if recommended_skills is empty or all companions are already installed.