用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aibot88/sec_skill_store --skill bigquery-auth命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Guides the creation of agile user stories and Gherkin feature files. Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files. This should trigger for requests such as Create a user story; Write a user story; I need to write a user story. Part of cursor-rules-java project
Guía técnica completa para integrar 250+ servicios externos con agentes IA usando Composio. Cubre instalación, autenticación OAuth, gestión de herramientas, triggers y flujos multi-servicio.
Facilitates conversational discovery to create Architectural Decision Records (ADRs) for non-functional requirements using the ISO/IEC 25010:2023 quality model. Use when the user wants to document quality attributes, NFR decisions, security/performance/scalability architecture, or design systems with measurable quality criteria. This should trigger for requests such as Create ADR for Non-functional requirements; Document Non-functional requirements; Capture Non-functional requirements; Generate Non-functional requirements in an ADR. Part of cursor-rules-java project
基于 SOC 职业分类
正在显示 SKILL.md
| name | bigquery-auth |
| description | GCPプロジェクト単位でBigQuery認証を設定。gcloud設定プロファイルで複数プロジェクトを安全に分離管理。「BigQueryに繋ぎたい」「{プロジェクト名}のデータを見たい」と言うだけで認証をガイド。 |
GCPプロジェクト単位でgcloud設定プロファイルを作成し、BigQuery認証を行うスキルです。
gcloud config configurations list
既存プロファイルを表示し、目的のプロジェクト用があるか確認。
# プロファイル作成
gcloud config configurations create {PROFILE_NAME}
# プロジェクト設定
gcloud config set project {PROJECT_ID}
# メイン認証(ブラウザが開く)
gcloud auth login
# Python SDK用認証(ブラウザが開く)
gcloud auth application-default login --quiet
注意: 両方のコマンドでブラウザ認証が必要です。
# 現在のプロファイル確認
gcloud config configurations list
# プロジェクト確認
gcloud config get-value project
# ADCトークン確認
gcloud auth application-default print-access-token
import 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)}個のデータセット")
# プロファイル一覧
gcloud config configurations list
# 切り替え
gcloud config configurations activate {PROFILE_NAME}
| プロファイル | プロジェクトID | アカウント | 用途 |
|---|---|---|---|
default | tokenpocket | kouhei_nakamura@tokenpocket.jp | デフォルト |
infobox | infobox-jp-prd | kouhei.nakamura@info-box.jp | InfoBox分析 |
imagen4 | yoake-dev-analysis | kohei.nakamura@yoake-entertainment.jp | YOAKE分析 |
| プロファイル | プロジェクトID | キーファイル | 用途 |
|---|---|---|---|
dionysus | gree-dionysus-infobox | ~/.gcp/gree-dionysus-infobox.json | GREE InfoBox分析 |
外部プロジェクトにサービスアカウントで接続する場合:
import os
from google.cloud import bigquery
from google.oauth2 import service_account
# サービスアカウントキーで認証
credentials = service_account.Credentials.from_service_account_file(
os.path.expanduser("~/.gcp/gree-dionysus-infobox.json")
)
# BigQueryクライアント作成
client = bigquery.Client(
project="gree-dionysus-infobox",
credentials=credentials
)
# 接続テスト
datasets = list(client.list_datasets())
print(f"接続成功!{len(datasets)}個のデータセット")
主なデータセット(gree-dionysus-infobox):
production_infobox - 商用データproduction_infobox_mart - マートstaging_infobox - ステージング| エラー | 原因 | 対処法 |
|---|---|---|
| File xxx was not found | GOOGLE_APPLICATION_CREDENTIALS が無効 | unset GOOGLE_APPLICATION_CREDENTIALS |
| Reauthentication needed | 認証期限切れ | 再度認証実行 |
| Permission denied | BigQuery権限なし | IAM設定を確認 |
GOOGLE_APPLICATION_CREDENTIALS 環境変数が設定されている場合、ADCより優先されます。
Pythonコードで以下を実行して回避:
import os
if "GOOGLE_APPLICATION_CREDENTIALS" in os.environ:
del os.environ["GOOGLE_APPLICATION_CREDENTIALS"]
.cursor/rules/notebook.mdc のルールに従い:
gcloud config configurations list でプロファイル一覧を表示gcloud) インストール済み