google-cloud-auth-verification
Skill211 starsChanged 6 months agoApache-2.0View on GitHub
Mandatory Step 0 pre-flight execution order and authentication verification for Google Cloud Platform (GCP), Application Default Credentials (ADC), gcloud CLI, Spark, Dataproc, BigQuery, GCS, and notebook runtimes. Use whenever interacting with GCP resources, running Spark/PySpark pipelines, BigQuery queries, GCS paths (gs://), or creating/running notebooks.
In this repository36 other files it gives its agents.
- accidental-data-loss-preventionSkill
- bigquery-ai-mlSkill
- bigquery-bigframesSkill
- bigquery-data-transfer-serviceSkill
- bigquery-graph-authorSkill
- bigquery-graph-querySkill
- bigquery-sqlSkill
- bigtable-basicsSkill
- building-data-appsSkill
- dak-setupSkill
- data-autocleaningSkill
- dataform-bigquerySkill
- dbt-bigquerySkill
- discovering-gcp-data-assetsSkill
- enforcing-resource-attributionSkill
- federate-lakehouse-catalogSkill
- gcp-composer-troubleshootingSkill
- gcp-dataflowSkill
- gcp-data-pipelinesSkill
- gcp-managed-airflow-dag-authoringSkill
- gcp-managed-airflow-migrationsSkill
- gcp-managed-airflow-recommendationsSkill
- gcp-managed-spark-upgradesSkill
- gcp-pipeline-orchestrationSkill
- gcp-pipeline-resource-provisioningSkill
- gcp-sparkSkill
- gcp-spark-troubleshootingSkill
- gcs-security-assessmentSkill
- google-cloud-storage-basicsSkill
- google-cloud-storage-bucket-architectSkill
- google-cloud-storage-fuseSkill
- managing-python-dependenciesSkill
- ml-best-practicesSkill
- notebook-guidanceSkill
- resolving-mcp-region-configsSkill
- schema-mappingSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
Before asking the user to log in, independently verify authentication status using a single bundled probe command:
- Very specific: line 62
If the output contains No credentialed accounts.
- Very specific: line 64
If an account *is* listed but the user still receives a 403 Access Denied error, the issue is likely IAM permissions (e.g., missing …
- Distinctive: line 71
When missing credentials are confirmed, DO NOT attempt to fix credentials via code or local virtualenv workarounds.
- Very specific: line 83
After the user confirms they have logged in, verify with: gcloud auth list Then proceed with the original task.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Google Cloud Authentication Guidelines
Mandatory Pre-Flight Execution & Auth Hierarchy
[!IMPORTANT] Pre-Flight Execution Priority Order: Before generating code, implementation plans, or executing tasks for any GCP or Notebook workload:
- Verify Shell, Script & Notebook Credentials: If shell-based commands, local Python scripts, or notebook kernels (
gs://..., BigQuery, Dataproc) are required, verify credentials via bundled probe (gcloud auth list && gcloud config list) or Application Default Credentials (ADC).- Distinguish Authentication vs. IAM Permissions:
- If
gcloud auth listreturnsNo credentialed accounts, HARD STOP immediately and instruct the user to rungcloud auth loginandgcloud auth application-default login.- If Python throws
google.auth.exceptions.DefaultCredentialsError, explicitly direct the user to rungcloud auth application-default login.- If
gcloud auth listshows an active credentialed account but a BigQuery/GCP call returns403 Forbidden: Access Denied, DO NOT tell the user to log in again withgcloud auth login. Diagnose missing IAM roles (e.g.,roles/bigquery.dataEditor) on the active account.- HARD STOP if Unauthenticated: If no active GCP credentials or valid
gcloudauthentication are detected, STOP IMMEDIATELY. Prompt the user to rungcloud auth loginandgcloud auth application-default login. Do NOT attempt local virtualenv creation, package installation, or local binary/JDK setup loops as workarounds.
Common Error Messages
- gcloud/bq CLI:
ERROR: (bq) You do not currently have an active account selected.No credentialed accounts.Configuration error: No account is currently active.
- Execution Failures (Python/Notebooks):
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials.Forbidden: 403 Access Denied(when it's clearly an auth issue).
Verification Step
Before asking the user to log in, independently verify authentication status using a single bundled probe command:
gcloud auth list --format="json" && gcloud config list --format="json"- If the output contains
No credentialed accounts.or missing active account, proceed to Corrective Action. - If an account is listed but the user still receives a
403 Access Deniederror, the issue is likely IAM permissions (e.g., missing BigQuery roles) on their active account, rather than missing authentication. In this case, investigate permissions rather than asking them to log in again.
Corrective Action
When missing credentials are confirmed, DO NOT attempt to fix credentials via code or local virtualenv workarounds. Credentials must be established by the user.
Stop and ask the user to run the following commands in their terminal:
- To authenticate the gcloud CLI:
gcloud auth login - To set up Application Default Credentials (ADC) (required for BQ CLI AND
most libraries/notebooks):
gcloud auth application-default login
Post-Login Verification
After the user confirms they have logged in, verify with: gcloud auth list
Then proceed with the original task.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

