Install any skill in seconds. Free to start, no credit card required.
Get Started Free →GCPプロジェクト単位でBigQuery認証を設定するスキル。 gcloud設定プロファイルで複数プロジェクトを安全に分離管理。 「BigQueryに繋ぎたい」「BQ認証」「gcloud認証」「データ分析の認証設定」等のリクエストで発動。
.claude/skills/minicoohei-bigquery-auth/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 5% | 0% |
「BigQuery認証」「BQ繋ぎたい」「データ分析の認証」「gcloud認証」
GCPプロジェクト単位でgcloud設定プロファイルを作成し、BigQuery認証を行うスキルです。
bashgcloud config configurations list
既存プロファイルを表示し、目的のプロジェクト用があるか確認。
bash# プロファイル作成 gcloud config configurations create {PROFILE_NAME} # プロジェクト設定 gcloud config set project {PROJECT_ID}
bash# メイン認証(ブラウザが開く) gcloud auth login # Python SDK用認証(ブラウザが開く) gcloud auth application-default login --quiet
注意: 両方のコマンドでブラウザ認証が必要です。
bash# 現在のプロファイル確認 gcloud config configurations list # プロジェクト確認 gcloud config get-value project # ADCトークン確認 gcloud auth application-default print-access-token
pythonimport os # 環境変数競合を回避 if "GOOGLE_APPLICATION_CREDENTIALS" in os.environ: del os.environ["GOOGLE_APPLICATION_CREDENTIALS"] from google.cloud import bigquery client = bigquery.Client(project="{PROJECT_ID}") datasets = list(client.list_datasets()) print(f"接続成功!{len(datasets)}個のデータセット")
bash# プロファイル一覧 gcloud config configurations list # 切り替え gcloud config configurations activate {PROFILE_NAME}
| プロファイル | プロジェクトID | アカウント | 用途 | |-------------|---------------|-----------|------| | default | {YOUR_PROJECT_ID} | {YOUR_EMAIL} | デフォルト | | {PROFILE_2} | {PROJECT_ID_2} | {EMAIL_2} | 分析用 |
> 自分のプロジェクト情報に置き換えてください。
| プロファイル | プロジェクトID | キーファイル | 用途 | |-------------|---------------|-------------|------| | {SA_PROFILE} | {SA_PROJECT_ID} | ~/.gcp/{SA_KEY_FILE}.json | 外部プロジェクト分析 |
外部プロジェクトにサービスアカウントで接続する場合:
pythonimport os from google.cloud import bigquery from google.oauth2 import service_account # サービスアカウントキーで認証 credentials = service_account.Credentials.from_service_account_file( os.path.expanduser("~/.gcp/{SA_KEY_FILE}.json") ) # BigQueryクライアント作成 client = bigquery.Client( project="{SA_PROJECT_ID}", credentials=credentials ) # 接続テスト datasets = list(client.list_datasets()) print(f"接続成功!{len(datasets)}個のデータセット")
| エラー | 原因 | 対処法 | |--------|------|--------| | File xxx was not found | GOOGLE_APPLICATION_CREDENTIALS が無効 | unset GOOGLE_APPLICATION_CREDENTIALS | | Reauthentication needed | 認証期限切れ | 再度認証実行 | | Permission denied | BigQuery権限なし | IAM設定を確認 |
GOOGLE_APPLICATION_CREDENTIALS 環境変数が設定されている場合、ADCより優先されます。 Pythonコードで以下を実行して回避:
pythonimport os if "GOOGLE_APPLICATION_CREDENTIALS" in os.environ: del os.environ["GOOGLE_APPLICATION_CREDENTIALS"]
.cursor/rules/notebook.mdc のルールに従い:
gcloud config configurations list でプロファイル一覧を表示gcloud) インストール済み| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 10,663 | 6,891 | -35% | 1 | 1 | 0% | 2,167 | 2,419 | +12% | 0 | 0 | — |
case-02 | fail→pass | 12,592 | 5,180 | -59% | 1 | 1 | 0% | 2,523 | 2,074 | -18% | 0 | 0 | — |
case-03 | fail→pass | 9,524 | 4,745 | -50% | 1 | 1 | 0% | 1,970 | 1,970 | 0% | 0 | 0 | — |
case-04 | fail→pass | 8,064 | 6,333 | -21% | 1 | 1 | 0% | 1,440 | 2,275 | +58% | 0 | 0 | — |
case-05 | pass→pass | 9,332 | 3,014 | -68% | 1 | 1 | 0% | 1,518 | 1,600 | +5% | 0 | 0 | — |
case-06 | pass→pass | 2,939 | 2,697 | -8% | 1 | 1 | 0% | 491 | 1,412 | +188% | 0 | 0 | — |
case-07 | pass→pass | 12,829 | 5,520 | -57% | 1 | 1 | 0% | 2,480 | 2,017 | -19% | 0 | 0 | — |
case-17 | pass→pass | 3,988 | 2,839 | -29% | 1 | 1 | 0% | 589 | 1,510 | +156% | 0 | 0 | — |
case-08 | pass→pass | 9,045 | 4,798 | -47% | 1 | 1 | 0% | 1,567 | 1,895 | +21% | 0 | 0 | — |
case-09 | pass→pass | 5,422 | 4,517 | -17% | 1 | 1 | 0% | 1,059 | 1,748 | +65% | 0 | 0 | — |
case-10 | pass→pass | 7,710 | 4,861 | -37% | 1 | 1 | 0% | 1,271 | 1,922 | +51% | 0 | 0 | — |
case-11 | pass→pass | 12,920 | 9,808 | -24% | 1 | 1 | 0% | 2,292 | 2,777 | +21% | 0 | 0 | — |
case-12 | fail→fail | 14,646 | 9,092 | -38% | 1 | 1 | 0% | 2,406 | 2,743 | +14% | 0 | 0 | — |
case-13 | pass→pass | 1,923 | 3,506 | +82% | 1 | 1 | 0% | 264 | 1,452 | +450% | 0 | 0 | — |
case-14 | pass→pass | 5,801 | 2,448 | -58% | 1 | 1 | 0% | 969 | 1,428 | +47% | 0 | 0 | — |
case-15 | fail→fail | 7,680 | 4,708 | -39% | 1 | 1 | 0% | 1,344 | 1,916 | +43% | 0 | 0 | — |
case-16 | pass→pass | 5,771 | 3,542 | -39% | 1 | 1 | 0% | 1,037 | 1,616 | +56% | 0 | 0 | — |
case-23 | pass→pass | 9,692 | 5,482 | -43% | 1 | 1 | 0% | 1,780 | 2,078 | +17% | 0 | 0 | — |
case-18 | fail→fail | 3,240 | 3,593 | +11% | 1 | 1 | 0% | 549 | 1,628 | +197% | 0 | 0 | — |
case-19 | pass→pass | 3,099 | 4,249 | +37% | 1 | 1 | 0% | 566 | 1,902 | +236% | 0 | 0 | — |
case-20 | pass→pass | 4,719 | 3,545 | -25% | 1 | 1 | 0% | 863 | 1,696 | +97% | 0 | 0 | — |
case-21 | pass→pass | 10,574 | 8,591 | -19% | 1 | 1 | 0% | 1,824 | 2,606 | +43% | 0 | 0 | — |
case-22 | fail→pass | 11,869 | 5,800 | -51% | 1 | 1 | 0% | 2,034 | 2,108 | +4% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +17 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.