42Crunchの環境をセットアップして、監査と検査のスキルがスムーズに動作するようにします。 次のような場合に使用: ユーザーが42Crunchを初めて設定したい、42c-astバイナリ(実行可能なプログラム)をインストールまたは更新したい、APIキー(認証用の暗号化コード)を設定したい、または認証情報やバイナリのエラーをトラブルシューティングしたい場合。 「42crunchのセットアップ」「42crunchの設定」「42c-astのインストール」「42c-astの更新」「APIキーの設定」「42crunchが動作しない」「バイナリが見つからない」といった表現や、監査・検査の実行前に環境を準備するリクエストで自動起動します。
Set up the 42Crunch environment so that audit and scan skills can run without friction. Use this skill whenever the user wants to configure 42Crunch for the first time, install or update the 42c-ast binary, configure an API key, or troubleshoot missing credentials or binary errors. Triggers on phrases like "setup 42crunch", "configure 42crunch", "install 42c-ast", "update 42c-ast", "set api key", "42crunch not working", "binary not found", or any request to prepare the environment before running an audit or scan.
42Crunch の監査とスキャンのワークフローを使用するために、2つのフェーズで環境を準備します:
42c-ast バイナリ(実行ファイル)が指定の場所にインストールされていることを確認する呼び出し元の状況: このスキルは、ユーザーが直接実行することも、別のスキル(例:
pre-flight)から部品として呼び出されることもあります。呼び出し元が指定されているかを確認してください。ステップ 1 と 6 の動作は、この状況によって異なります。各ステップの説明を参照してください。
ユーザーが直接実行した場合(呼び出し元の情報がない場合)、ユーザーに挨拶をして、セットアップ完了後にできることを説明してください:
ようこそ。42Crunch の環境準備をお手伝いします。これは1回限りのセットアップで、約2分で完了します。セットアップ完了後は、以下のことができるようになります:
- OpenAPI ファイルを監査 して、セキュリティの問題を発見し、スコアと改善方法をまとめたレポートを取得
- ライブ API をスキャン して、BOLA(認可回避)、BFLA(機能の不正利用)、仕様適合性の問題を検出
- 問題を自動修正 (各ステップで承認が必要)
2つの簡単なステップで対応します:
- このマシンに
42c-ast分析バイナリをインストール- 42Crunch の認証情報を登録(スターター(無料試用版)/ 個人 / 個人 Pro プランのトークン、またはチーム 10 / チーム 25 / エンタープライズ向けプラットフォームアカウントと API キー)
始めましょう。
別のスキルから部品として呼び出された場合(呼び出し元の情報がある場合)、この挨拶をスキップして、ステップ 2 に進んでください。
../../references/binary-setup.md に完全に従います(詳細モード — 主要な各ステップをユーザーに説明します)。
バイナリがインストールできない場合は、エラーを明確に表示して停止します。ステップ 3 には進みません。
../../references/credential-setup.md に完全に従います。
このプロセスは以下の順序で実施します:
~/.42crunch/conf/env(macOS/Linux)または %APPDATA%\42Crunch\conf\env(Windows)に認証情報が既に存在するか静かに確認します。既に設定されている場合は、モードとマスク済みキーを表示し、保持するか変更するか選択させます。[42Crunch Starter (Free Trial)](https://42crunch.com/freemium/?source=claude))と有料プランの料金詳細(個人 / 個人 Pro はトークンを使用、チーム 10 / チーム 25 / エンタープライズはプラットフォームアカウントと API キーを使用)を表示して停止し、ユーザーの戻りを待ってからトークンまたはプラットフォーム API キーを選択させ、それぞれのフローに振り分け~/.42crunch/conf/env に書き込み、macOS/Linux では chmod 600 を設定します。ステップ 2 と 3 は既にそれぞれの確認で終了しています:binary-setup.md は --version が 0 で終了することを確認し、credential-setup.md のステップ 4 は認証情報行が存在することを確認します。このやり取りにこれら両方の結果が既にある場合は、再度実行せず、結果を再利用してステップ 5 に進んでください。
このやり取りに結果がない部分に対してのみ、以下のチェックを実行してください。認証情報チェックは存在確認のみです — 値は絶対に表示しないでください:
# バイナリ(macOS / Linux)
"$HOME/.42crunch/bin/42c-ast" --version
# バイナリ(Windows)
& "$env:APPDATA\42Crunch\bin\42c-ast.exe" --version
# 認証情報(macOS / Linux)
grep -qE "^(API_KEY|TRIAL_TOKEN)=" "$HOME/.42crunch/conf/env" && echo "CREDS=OK" || echo "CREDS=MISSING"
# 認証情報(Windows)
if (Select-String -Path "$env:APPDATA\42Crunch\conf\env" -Pattern "^(API_KEY|TRIAL_TOKEN)=" -Quiet) { "CREDS=OK" } else { "CREDS=MISSING" }
チェックのいずれかが失敗した場合は、具体的な失敗を報告し、ユーザーがそれを解決するよう案内してから続行してください。
セットアップサマリーを表示します(出力形式は下記を参照)。
別のスキルから部品として呼び出された場合(呼び出し元の情報がある場合)、次のステップの提案をスキップしてください。「セットアップ完了 — 続行します。」と表示して、呼び出し元にコントロールを戻します。呼び出し元(例:pre-flight)は中断したところから再開します。
ユーザーが直接実行した場合(呼び出し元の情報がない場合)、以下を表示します:
セットアップが完了しました。これからできることをご紹介します:
42crunch-audit— OpenAPI ファイルを渡していただければ、スコアを算出し、セキュリティ問題を重大度で分類して、SQG 対応が必要な問題を承認を得たうえで自動修正します。API を初めて監査する場合は最初のステップです。
42crunch-scan— ライブ API に対して仕様適合性と認可のテストを実行します。BOLA、BFLA、レスポンス仕様違反をチェックします。監査完了後の実行がお勧めです。
42crunch-api-security-testing— 監査とスキャンを連続実行します。1回のセッションで全体像を把握したい場合の推奨ワークフローです。どれから始めますか?
## 42Crunch セットアップ完了
| 項目 | 状態 |
|------------------|-----------------------------------------------------|
| バイナリ | <バイナリパス> v<バージョン> |
| 認証情報モード | <プラットフォーム / トークン> |
| API キー / トークン | プラットフォーム: `api_••••••••` または `ide_••••••••` |
| | トークン: `<先頭4文字>••••••••` |
| | (保存先: <パス>) |
| プラットフォームホスト | <URL> ← トークンモードではこの行を省略 |
api_•••••••• / ide_•••••••• — プリフィックスは保持、残りは置換;トークンは <先頭4文字>••••••••、例:eyJh••••••••)。curl を使用;curl が利用できない場合は wget にフォールバック。Windows では Invoke-WebRequest を使用します。42c-ast.exe、パスは \ を使用、設定は %APPDATA%\42Crunch\conf\env に配置、chmod 600 はスキップ(Windows ACL が APPDATA を保護)。| 変数 | デフォルト | モード |
|---|---|---|
API_KEY |
(必須) | プラットフォーム(チーム 10 / チーム 25 / エンタープライズ) |
PLATFORM_HOST |
(セットアップ時に設定) | プラットフォームのみ(チーム 10 / チーム 25 / エンタープライズ) |
TRIAL_TOKEN |
(必須) | トークン方式(スターター(無料試用版)/ 個人 / 個人 Pro) |
Prepares the environment for 42Crunch audit and scan workflows in two phases:
42c-ast binary is installed at the canonical path.Caller context: This skill may be invoked directly by the user or as a subroutine by another skill (e.g.
pre-flight). Check whether a caller was passed. Steps 1 and 6 behave differently depending on this context — see each step for details.
If called directly by the user (no caller context), greet the user and explain what they'll be able to do once setup is complete:
Welcome — let me get your 42Crunch environment ready. This is a one-time setup that takes about two minutes. Once done, you'll be able to:
- Audit any OpenAPI file for security issues and get a scored, actionable report
- Scan a live API to catch BOLA, BFLA, and conformance problems
- Fix SQG-blocking issues automatically, with your approval at every step
I'll handle this in two quick steps:
- Install the
42c-astanalysis binary on this machine.- Connect your 42Crunch credentials (a token from Starter (Free Trial) / Individual / Individual Pro, or a Platform account with an API key for Team 10 / Team 25 / Enterprise).
Let's go.
If called as a subroutine (caller context is set), skip this greeting entirely and proceed directly to Step 2.
Follow ../../references/binary-setup.md completely (verbose mode — announce each major step to the user).
Stop and surface a clear error if the binary cannot be installed. Do not proceed to Step 3.
Follow ../../references/credential-setup.md completely.
The procedure covers, in order:
~/.42crunch/conf/env (macOS/Linux) or %APPDATA%\42Crunch\conf\env
(Windows). If already configured: show mode + masked key, offer to keep or replace.[42Crunch Starter (Free Trial)](https://42crunch.com/freemium/?source=claude)) and the paid-plans pricing breakdown (Individual / Individual Pro use a token; Team 10 / Team 25 / Enterprise use a Platform account with an API key); stop and wait for the user to return, then ask token vs Platform-API-key and route accordingly~/.42crunch/conf/env, set chmod 600 on macOS/Linux.Steps 2 and 3 already end with their own verification: binary-setup.md
confirms --version exits 0, and credential-setup.md Step 4 confirms the
credential line is present. If both results are already in this conversation,
do not re-run those commands — reuse the results and continue to Step 5.
Only run the checks below for a part whose result is missing from this conversation. The credential check is presence-only — never print the value:
# Binary (macOS / Linux)
"$HOME/.42crunch/bin/42c-ast" --version
# Binary (Windows)
& "$env:APPDATA\42Crunch\bin\42c-ast.exe" --version
# Credentials (macOS / Linux)
grep -qE "^(API_KEY|TRIAL_TOKEN)=" "$HOME/.42crunch/conf/env" && echo "CREDS=OK" || echo "CREDS=MISSING"
# Credentials (Windows)
if (Select-String -Path "$env:APPDATA\42Crunch\conf\env" -Pattern "^(API_KEY|TRIAL_TOKEN)=" -Quiet) { "CREDS=OK" } else { "CREDS=MISSING" }
If either check fails, report the specific failure and guide the user to resolve it before continuing.
Display the setup summary (see Output Format below).
If called as a subroutine (caller context is set), skip the next-steps
prompt entirely. Announce "Setup complete — continuing." and return control
to the caller. The caller (e.g. pre-flight) will resume from where it left
off.
If called directly by the user (no caller context), present the following:
You're all set. Here's what you can do right now:
42crunch-audit— Hand me an OpenAPI file and I'll score it, classify every security issue by severity, and fix the SQG-blocking ones with your approval. A good first step if you haven't audited this API before.
42crunch-scan— Run a live conformance and authorization test against a running API. I'll check for BOLA, BFLA, and response-contract violations. Best run after the audit passes.
42crunch-api-security-testing— Runs both audit and scan back-to-back. The recommended workflow when you want the full picture in one session.Which would you like to start with?
## 42Crunch Setup Complete
| Item | Status |
|------------------|-----------------------------------------------------|
| Binary | <BINARY_PATH> v<version> |
| Credential mode | <Platform \| Token> |
| API key / Token | Platform: `api_••••••••` or `ide_••••••••` |
| | Token: `<first-4-chars>••••••••` |
| | (stored in <path>) |
| Platform host | <url> ← omit this row for Token mode |
api_•••••••• / ide_•••••••• for platform tokens — keep
prefix, replace rest; <first-4-chars>•••••••• for tokens, e.g.
eyJh••••••••).Bash tool for all shell commands; use the Edit or Write
tools when writing config files — never shell redirection.curl for downloads; fall back to wget if curl is unavailable. On
Windows use Invoke-WebRequest.42c-ast.exe, paths use \, config lives in
%APPDATA%\42Crunch\conf\env, skip chmod 600 (Windows ACLs protect APPDATA).| Variable | Default | Mode |
|---|---|---|
API_KEY |
(required) | Platform (Team 10 / Team 25 / Enterprise) |
PLATFORM_HOST |
(set during setup) | Platform only (Team 10 / Team 25 / Enterprise) |
TRIAL_TOKEN |
(required) | Token-based (Starter (Free Trial) / Individual / Individual Pro) |
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。