gcp-spark
Skill0 starsChanged 4 months agoApache-2.0View on GitHub
Develops and executes Spark code on Dataproc Clusters and Serverless. Reads and writes data using BigLake Iceberg catalogs, BigQuery and Spanner. Debugs execution failures. Use when: - Writing Spark ETL pipelines on GCP. - Training or running inference with ML models with spark on GCP. - Managing Spark clusters, jobs, batches, and interactive sessions. Don''t use when: - Writing generic Python scripts that don''t use Spark. - Performing simple SQL queries that can be done directly in BigQuery.
3 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- sid-lakhani/agents-configedited, first seen Oct 20, 2026
- matt-rabah/sf-ragedited, first seen Jun 28, 2026
- GoogleCloudPlatform/data-agent-kit-plugintheir own version, first seen Jun 11, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- sid-lakhani/agents-config★ 391% same
- matt-rabah/sf-rag★ 097% same
Wrote their own version · 1
- GoogleCloudPlatform/data-agent-kit-plugin★ 251same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository78 other files it gives its agents.
- a11y-debuggingSkill
- accidental-data-loss-preventionSkill
- agy-customizationsSkill
- alphafold-database-fetch-and-analyzeSkill
- alphagenome-single-variant-analysisSkill
- antigravity-guideSkill
- bigquery-ai-mlSkill
- bigquery-bigframesSkill
- bigquery-data-transfer-serviceSkill
- bigquery-graphSkill
- bigquery-sqlSkill
- building-data-appsSkill
- chembl-databaseSkill
- chrome-devtoolsSkill
- chrome-extensionsSkill
- clinical-trials-databaseSkill
- clinvar-databaseSkill
- credentialsSkill
- data-autocleaningSkill
- dataform-bigquerySkill
- dbsnp-databaseSkill
- dbt-bigquerySkill
- debug-optimize-lcpSkill
- discovering-gcp-data-assetsSkill
- document-validatorSkill
- embl-ebi-olsSkill
- encode-ccres-databaseSkill
- enforcing-resource-attributionSkill
- ensembl-databaseSkill
- federate-lakehouse-catalogSkill
- foldseek-structural-searchSkill
- gcloud-auth-verificationSkill
- gcp-composer-troubleshootingSkill
- gcp-dataflowSkill
- gcp-data-pipelinesSkill
- gcp-managed-airflow-migrationsSkill
- gcp-pipeline-orchestrationSkill
- gcp-pipeline-resource-provisioningSkill
- gcs-security-assessmentSkill
- gnomad-databaseSkill
- google-antigravity-sdkSkill
- gtex-databaseSkill
- human-protein-atlas-databaseSkill
- interpro-databaseSkill
- jaspar-databaseSkill
- link-checkSkill
- literature-search-arxivSkill
- literature-search-biorxivSkill
- literature-search-europepmcSkill
- literature-search-openalexSkill
- managing-python-dependenciesSkill
- memory-leak-debuggingSkill
- ml-best-practicesSkill
- modern-web-guidanceSkill
- ncbi-sequence-fetchSkill
- notebook-guidanceSkill
- openfda-databaseSkill
- opentargets-databaseSkill
- pdb-databaseSkill
- permissioned-githubSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 1 is common, 0 are distinctive, and 1 is very specific to this project.
1
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Execute script: ONLY when generating a .py script refer to references/gcloud_dataproc.md on writing command to execute generated code on …
- Common: line 46
Before submitting a job, verify:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spark on Dataproc
[!IMPORTANT]
You MUST ALWAYS follow the Task Execution Workflow when writing spark code.
Task Execution Workflow
- Understand schemas: ALWAYS use
@skill:discovering-gcp-data-assetsskill orreferences/schema_direct_inspection.mdto understand input and output schemas. Include the schema in your thought process BEFORE generating any code. Do NOT guess column names. - Generate spark code:
- Output Format: ALWAYS generate code in Python Notebooks (.ipynb) format. Generate scripts (.py) only if explicitly requested.
- Read and Write data: ALWAYS Refer to
references/read_write_data.mdwhen reading or writing data. - ML Tasks: Refer to
@skill:ml-best-practicesskill andreferences/ml_tasks.mdwhen generating ML code. - Spark Optimizations: ALWAYS refer to
references/spark_optimizations.mdwhen generating spark code and apply optimization whenever applicable.
- Verify schema before write: ALWAYS verify that the dataframe and
destination schema match, use
df.printSchema()for dataframe schema and refer to@skill:discovering-gcp-data-assetsskill orreferences/schema_direct_inspection.mdto verify destination schema. - Compile code before executing: For notebooks convert them to python
script using
jupyter nbconvert --to script your-notebook.ipynbfirst, then compile code usingpython3 -m py_compile your-notebook.py. - Execute script: ONLY when generating a
.pyscript refer toreferences/gcloud_dataproc.mdon writing command to execute generated code on Dataproc. This DOES NOT apply when generating notebooks.
Common Mistakes Checklist
[!CAUTION]
Ensure you verify this checklist to avoid mistakes
Before submitting a job, verify:
- All imports present (
col,when,lit, etc. frompyspark.sql.functions) vector_to_arrayfrom correct module usefrom pyspark.ml.functions import vector_to_array(NOTpyspark.sql.functions)- DataFrame schema matches target Iceberg table verify with
df.printSchema()before writing - CSV files read with
headerandinferSchemawithout these, the header row becomes data and all columns are strings - Avoid toPandas() Converting a pyspark dataframe to pandas by calling toPandas() can lead to out of memory errors. Only acceptable for building visualizations in Spark 3.5
IAM Requirements
The Dataproc service account needs:
roles/dataproc.worker: Job executionroles/biglake.admin: Iceberg table managementroles/bigquery.jobUser: Query materializationroles/storage.objectUser: Read/write GCSroles/spanner.databaseUser: Spanner writes
Spark resource management
Refer to references/gcloud_dataproc.md for detailed guidelines on managing
Spark clusters, jobs, batches, and interactive sessions.
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.

