agentleFS
Google CloudKnown publisherGoogleCloudPlatform/cloud-solutions/projects/legacy-detox-demo/skills/zero-copy-ingestion/SKILL.md

zero-copy-ingestion

Skill135 starsChanged 6 months agoApache-2.0View on GitHub

This skill enforces the Zero-Copy Architecture of the modern Google Cloud Lakehouse. It eliminates the overhead of copying data to external compute engines or creating intermediate files (CSVs/JSONs) on GCS. It standardizes: 1. Reading from BigQuery directly into Spark DataFrames using the Spark-BigQuery connector. 2. Reading from BigQuery using BigQuery DataFrames (bigframes.pandas) for in-warehouse processing. - Spark: Managed Service for Apache Spark Serverless (Runtime 3.0+ recommended) with the Spark BigQuery Connector pre-bundled. - BigQuery: bigframes Python package installed. When generating…

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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
  1. Distinctive:

    When generating data loading or exploration code:

    line 30
  2. Very specific:

    Never export to GCS first: Do not write code that exports BigQuery tables to GCS as CSV/Avro/Parquet before loading them into Spark or …

    line 32
  3. Very specific:

    Use BigQuery Storage API: Ensure Spark reads use the "bigquery" format, which utilizes the high-speed BigQuery Storage Read API.

    line 34
  4. Very specific:

    Use BigFrames for BQ: Ensure BigQuery-centric pipelines use bigframes.pandas.read_gbq to create references to the tables.

    line 36
  5. Distinctive:

    Use the Spark-BigQuery connector to load tables directly.

    line 43
  6. Distinctive:

    Use BigQuery DataFrames to create a virtual DataFrame.

    line 59

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Zero-Copy Data Exploration & Ingestion

<!-- Disabling markdownlint MD029 to provide explicit ordering to avoid confusing the LLM. --><!-- markdownlint-disable MD029 -->

1. Description & Rationale

This skill enforces the Zero-Copy Architecture of the modern Google Cloud Lakehouse. It eliminates the overhead of copying data to external compute engines or creating intermediate files (CSVs/JSONs) on GCS.

It standardizes:

  1. Reading from BigQuery directly into Spark DataFrames using the Spark-BigQuery connector.
  2. Reading from BigQuery using BigQuery DataFrames (bigframes.pandas) for in-warehouse processing.

2. Environment Prerequisites

  • Spark: Managed Service for Apache Spark Serverless (Runtime 3.0+ recommended) with the Spark BigQuery Connector pre-bundled.
  • BigQuery: bigframes Python package installed.

3. Agent Execution Guidelines (System Prompts)

When generating data loading or exploration code:

  1. Never export to GCS first: Do not write code that exports BigQuery tables to GCS as CSV/Avro/Parquet before loading them into Spark or Pandas.
  2. Use BigQuery Storage API: Ensure Spark reads use the "bigquery" format, which utilizes the high-speed BigQuery Storage Read API.
  3. Use BigFrames for BQ: Ensure BigQuery-centric pipelines use bigframes.pandas.read_gbq to create references to the tables.

4. Opinionated Code Patterns

A. Spark-Centric Zero-Copy Load

Use the Spark-BigQuery connector to load tables directly.

# Load BigQuery table directly into Spark DataFrame
users_df = (
    spark.read.format("bigquery")
    .option("table", "bigquery-public-data.thelook_ecommerce.users")
    .load()
)

# Create temporary view for Spark SQL queries
users_df.createOrReplaceTempView("users")

B. BigQuery-Centric Zero-Copy Load

Use BigQuery DataFrames to create a virtual DataFrame.

import bigframes.pandas as bpd

# Configure BigQuery DataFrames global options
bpd.options.bigquery.project = PROJECT_ID
bpd.options.bigquery.location = "US"  # Or your dataset location

# Load table reference (zero data movement)
users_df = bpd.read_gbq("bigquery-public-data.thelook_ecommerce.users")

5. Verification Checklist

  • No GCS Export: Verify the code does not contain bq extract or GCS export steps before loading.
  • Spark Format: Ensure the Spark read format is explicitly "bigquery".
  • BigFrames Config: Ensure bpd.options.bigquery.project is set before calling read_gbq.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.