enforcing-resource-attribution

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

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/SmileAfterBurn/pani-dumka-ai --skill enforcing-resource-attribution-smileafterburn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enforcing-resource-attribution
Source: https://github.com/SmileAfterBurn/pani-dumka-ai/tree/main/.gemini/skills/enforcing-resource-attribution
Command: npx skills add https://github.com/SmileAfterBurn/pani-dumka-ai --skill enforcing-resource-attribution-smileafterburn

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 consistent labeling so resource usage can be traced back to its origin. ## Core Features & Use Cases - BigQuery Labeling: Automatically appends --label datacloud:<ide> to supported 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 client identifier (e.g., vscode, cloud-shell, gemini-cli, cursor) with an ai-agent fallback when the environment is unknown. - Use Case: An AI agent running a BigQuery query from VS Code would execute bq query --use_legacy_sql=false --label datacloud:vscode "SELECT 1" instead of the unlabeled equivalent. ## Quick Start Ask the agent to run a BigQuery query or any gcloud command and it will automatically attach the correct attribution label or environment variable for your current client.

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 subcommands that accept them: query, load, extract, mk, update, and cp.

How do I track which environment ran a gcloud command?▼

Prepend the CLOUDSDK_METRICS_ENVIRONMENT environment variable, such as CLOUDSDK_METRICS_ENVIRONMENT=datacloud.vscode gcloud compute disks create my-disk. This applies to all gcloud commands, both read-only and mutations.

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

The --label flag is unsupported on bq show, bq ls, bq version, bq rm, bq cancel, and bq head. Applying it to these read-only or administrative subcommands causes errors, so labels must be omitted there.

What label value should I use if my environment is unknown?▼

Use ai-agent as the fallback identifier when the client environment cannot be determined. BigQuery label values cannot contain dots or spaces, while gcloud environment values use dots, such as datacloud.vscode.

When should resource attribution labels be omitted?▼

Omit labels for generic administrative commands unrelated to Data Cloud or Analytics, such as managing Compute Engines for web apps or setting standard IAM policies. Labels apply only to BigQuery, GCS, and analytics infrastructure work.