data-access

data-access is a skill for Claude Code, Codex from mexmarv/ai-genie-factory. It costs 85 tokens per session (1,507 once invoked), scanned A, original, MIT.

A set of rules for reading Databricks data, including tables stored in Unity Catalog, Databricks' governed data catalogue.

In plain words
What is it for?
Use it when writing or reviewing data.py, SQL, table references, filters, query failures, or data reads from apps and notebooks.
Why use it?
It reduces unsafe queries, unclear table references, excessive reads, and accidental bypassing of access controls.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it when writing or reviewing data.py, SQL, table references, filters, query failures, or data reads from apps and notebooks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mexmarv/ai-genie-factory/data-access
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mexmarv/ai-genie-factory --skill data-access
Clone the repo
git clone --depth 1 https://github.com/mexmarv/ai-genie-factory

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for data-access

README.md
[![agentmods](https://agentmods.dev/badge/skills/mexmarv/ai-genie-factory/data-access/github.svg)](https://agentmods.dev/skills/mexmarv/ai-genie-factory/data-access)
Your own site
<a href="https://agentmods.dev/skills/mexmarv/ai-genie-factory/data-access"><img src="https://agentmods.dev/badge/skills/mexmarv/ai-genie-factory/data-access/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for data-access

Your own site · 80×15
<a href="https://agentmods.dev/skills/mexmarv/ai-genie-factory/data-access"><img src="https://agentmods.dev/badge/skills/mexmarv/ai-genie-factory/data-access.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00085 $0.01507
Opus 5 $0.00043 $0.00754
Sonnet 5 $0.00017 $0.00301
Haiku 4.5 $0.00009 $0.00151

Measured 10d ago against content hash 0968f13385dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

data-access scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/data-access/SKILL.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Governed Data Access

Apply this skill whenever code reads Databricks data. AGENTS.md and workspace instructions have higher priority than examples in this skill.

Runtime decision

Runtime Required API Forbidden
Databricks Apps databricks.sdk.WorkspaceClient + Statement Execution API Spark sessions, JDBC, SQL in UI/logic modules
Notebook spark.table("catalog.schema.table") Two-part or unqualified names
Lakeflow/DLT pipeline spark.table("catalog.schema.table") and declarative pipeline APIs UI-facing reads from Bronze/Silver

Non-negotiable rules

  • UI-facing apps read Gold Unity Catalog tables only.
  • Every table reference is catalog.schema.table and comes from configuration.
  • SQL exists only in data.py; logic and UI modules never contain SQL.
  • Never concatenate user-provided values into SQL. Bind Statement Execution parameters.
  • Validate catalog, schema, table, and column identifiers against configuration allowlists.
  • Catch Exception as e, log it, and raise DataAccessError with a safe message.
  • Preserve Unity Catalog authorization. Never elevate or bypass the app identity.
  • Do not fetch an unbounded table for client-side filtering. Push filters and limits to SQL.

Databricks Apps standard pattern

"""Data layer — governed SQL reads only; no business transformations."""
import re
from typing import Any

import pandas as pd
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.sql import StatementParameterListItem

from _logger import get_logger

logger = get_logger(__name__)


class DataAccessError(Exception):
    pass


class LogicError(Exception):
    pass


_IDENTIFIER = re.compile(r"^[A-Za-z_][A-Za-z0-9_]*$")


def _identifier(value: str, allowed: set[str] | None = None) -> str:
    if not _IDENTIFIER.fullmatch(value) or (allowed is not None and value not in allowed):
        raise DataAccessError("Invalid configured identifier")
    return value


def _full_name(config: dict[str, Any]) -> str:
    parts = config["table_name"].split(".")
    if len(parts) != 3:
        raise DataAccessError("A three-part table name is required")
    catalog, schema, table = (_identifier(part) for part in parts)
    if schema.lower() != "gold":
        raise DataAccessError("UI applications may read only from the Gold schema")
    return f"{catalog}.{schema}.{table}"


def _execute(
    warehouse_id: str,
    statement: str,
    parameters: list[StatementParameterListItem] | None = None,
) -> pd.DataFrame:
    try:
        client = WorkspaceClient()
        result = client.statement_execution.execute_statement(
            warehouse_id=warehouse_id,
            statement=statement,
            parameters=parameters,
            wait_timeout="30s",
        )
        state = result.status.state.value
        if state != "SUCCEEDED":
            message = result.status.error.message if result.status.error else state
            raise DataAccessError(f"Query failed: {message}")

        columns = [column.name for column in result.manifest.schema.columns]
        rows = result.result.data_array or []
        frame = pd.DataFrame(rows, columns=columns)
        logger.info(f"Statement returned {len(frame)} rows")
        return frame
    except DataAccessError:
        raise
    except Exception as e:
        logger.error(f"Data access failed: {e}")
        raise DataAccessError("The requested data is unavailable") from e


def load_orders(config: dict[str, Any], start_date: str, end_date: str) -> pd.DataFrame:
    full_name = _full_name(config)
    warehouse_id = config["warehouse_id"]
    statement = f"""
        SELECT order_date, region, amount, order_id, customer_id
        FROM {full_name}
        WHERE order_date BETWEEN :start_date AND :end_date
        ORDER BY order_date
        LIMIT :row_limit
    """
    parameters = [
        StatementParameterListItem(name="start_date", value=start_date, type="DATE"),
        StatementParameterListItem(name="end_date", value=end_date, type="DATE"),
        StatementParameterListItem(name="row_limit", value=str(config["row_limit"]), type="INT"),
    ]
    logger.info(f"Loading: {full_name}")
    try:
        frame = _execute(warehouse_id, statement, parameters)
        logger.info(f"Loaded {len(frame)} rows from {full_name}")
        return frame
    except Exception as e:
        logger.error(f"Failed to load {full_name}: {e}")
        if isinstance(e, DataAccessError):
            raise
        raise DataAccessError(f"Table unavailable: {full_name}") from e

Read the full file on GitHub · 184 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 184 lines · 85 tokens per session scan A 0968f13385dd

Subscribe to this mod's changes

data-access is a skill published in the GitHub repository mexmarv/ai-genie-factory (5 stars, last pushed 1mo ago), licensed MIT. It adds 85 tokens to every session and 1,507 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

sql-diagram

Diagram a SQL query and explain what it shows — either its execution steps (mode=plan) or its column lineage (mode=lineage) — then trace it through small data so the defects the picture cannot show become visible. Use when asked to visualize, diagram, explain or review what a query does, how it joins its tables, or…

andre-salvati/databricks-template · 121 tokens

data-divergence

Investigate why two datasets that should agree don't — two pipelines writing the same logical table, a rollup vs the detail it aggregates, a dashboard vs its source, one environment vs another. Use when row counts, totals, or date ranges disagree and the question is what happened rather than just what differs. Covers…

andre-salvati/databricks-template · 123 tokens

data-engineer

Builds data infrastructure — ETL/ELT pipelines, data warehousing, stream processing, data quality, orchestration (Airflow/Dagster), and analytics engineering (dbt). Use when the user asks to build data pipelines, set up ETL/ELT workflows, design a data warehouse, configure stream processing, or implement analytics…

buiphucminhtam/forgewright · 85 tokens

pinecone

Managed vector DB for production RAG and search.

NousResearch/hermes-agent · 13 tokens

data-engineer

Build scalable data pipelines, modern data warehouses, and real-time streaming architectures. Implements Apache Spark, dbt, Airflow, and cloud-native data platforms.

davila7/claude-code-templates · 35 tokens

graphjin-env

Use when setting up a training or evaluation loop against a GraphJin agent environment — running the container, reading /health, driving episodes hosted or step-by-step or with your own agent over MCP, splitting train from eval, exporting trajectories, and deciding whether two rewards can be compared.

dosco/graphjin · 61 tokens