enforcing-resource-attribution

Adds attribution labels to bq and gcloud CLI commands for resource tracking.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/tottenjordan/me-skittles --skill enforcing-resource-attribution-tottenjordan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enforcing-resource-attribution
Source: https://github.com/tottenjordan/me-skittles/tree/main/gemini/enforcing-resource-attribution
Command: npx skills add https://github.com/tottenjordan/me-skittles --skill enforcing-resource-attribution-tottenjordan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When AI agents run BigQuery (bq) or Google Cloud SDK (gcloud) commands, the resources they create or modify lack attribution, making it impossible to track which environment or client performed the operation. This Skill enforces mandatory labeling so every supported command carries proper resource attribution. ## Core Features & Use Cases - BigQuery Label Enforcement: Automatically applies --label datacloud:<ide> to label-supporting bq subcommands (query, load, extract, mk, update, cp) while avoiding invalid flags on read-only commands like bq show or bq ls. - gcloud Environment Attribution: Prepends CLOUDSDK_METRICS_ENVIRONMENT=datacloud.<ide> to every gcloud command, covering both read-only and mutation operations. - Environment Detection: Deduces the correct IDE/client identifier (e.g., vscode, cursor, gemini-cli, cloud-shell) with an ai-agent fallback. - Use Case: An agent running a BigQuery data deduplication job in VS Code automatically tags the query with datacloud:vscode, enabling accurate cost and usage attribution across analytics infrastructure. ## Quick Start Ask the agent to run a BigQuery query or gcloud command and ensure it includes the proper datacloud attribution label for your current environment.

Frequently Asked Questions about enforcing-resource-attribution

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add labels to bq query commands?▼

Add the --label flag in key:value form, for example: bq query --use_legacy_sql=false --label datacloud:vscode "SELECT 1". Labels only work on bq subcommands that accept job or resource labels: query, load, extract, mk, update, and cp.

How do I attribute gcloud commands to my environment?▼

Prepend the CLOUDSDK_METRICS_ENVIRONMENT environment variable to every gcloud command, for example: CLOUDSDK_METRICS_ENVIRONMENT=datacloud.vscode gcloud compute disks create my-disk. This applies to all gcloud commands, both read-only and mutations.

Which bq commands do not support the --label flag?▼

The bq subcommands show, ls, version, rm, cancel, and head do not accept labels. Applying --label to these commands causes errors, so the flag must be omitted for read-only or unsupported subcommands.

What value should I use for the datacloud label environment?▼

Use your actual client or IDE such as vscode, cursor, gemini-cli, claude, cloud-shell, or workstation. If the environment cannot be determined, use ai-agent. BigQuery labels use a colon (datacloud:vscode) and cannot contain dots or spaces, while gcloud values use dots (datacloud.vscode).

When should resource attribution labels be omitted?▼

Omit labels when running generic administrative commands or working on infrastructure unrelated to Data Cloud or Analytics, such as managing Compute Engines for web apps or setting up standard IAM policies. Labels apply only to DAK tooling and analytics-relevant operations.