mozilla/rag-skills/query
Claude Code and agent skill by mozilla/rag-skills
- community
Checking that the SKILL.md file is still in the repository.
Runs a read-only SQL query against the Customer Experience tables (moz-fx-data-shared-prod.customer_experience_derived) and returns results as a formatted table. Use when the question requires counts, aggregations, rankings, or distributions — not when it requires reading document text.
Install
npx vskill@latest install mozilla/rag-skills/querySKILL.md
Query Skill
Runs a read-only SQL query against BigQuery and prints results as a formatted text table. No embedding required.
This skill is locked to `moz-fx-data-shared-prod.customer_experience_derived` — it can read any table or view in that dataset, and anything outside it is rejected. Only a single read-only SELECT (optionally WITH … SELECT) is accepted. A static allowlist check rejects any out-of-dataset reference before the query runs; the authoritative boundary is the service account's IAM, which grants read access to that dataset only, so BigQuery rejects any out-of-bounds read regardless of the SQL.
Authentication
This skill connects to BigQuery using a service account — read-only access is enforced on the impersonated token. Just log in:
Your authenticated BigQuery credentials are only used to create a new and temporary read-only access token on behalf of the service account defined in SERVICE_ACCOUNT, which requires the roles/iam.serviceAccountTokenCreator role on that service account. Your login no longer needs --scopes.
Usage
Reference tables by their fully-qualified name (moz-fx-data-shared-prod.customer_experience_derived.<table>).
When to use
Use this skill instead of embed + vector-search when the question requires:
- Counts ("how many tickets about X?")
- Rankings ("top N topics by volume")
- Distributions ("ticket count by product")
- Aggregations ("average sentiment by category")
- Any answer that is a number, ranked list, or summary statistic
Use embed + vector-search when the question requires reading and synthesizing document text.
Common SQL patterns
Dataset: moz-fx-data-shared-prod.customer_experience_derived Tables: kitsune_retrieval_index, zendesk_retrieval_index, knowledge_base_retrieval_index
Date filter columns:
- Kitsune:
creation_dateDATE — usecreation_date BETWEEN 'YYYY-MM-DD' AND 'YYYY-MM-DD' - Zendesk:
creation_dateDATE — usecreation_date BETWEEN 'YYYY-MM-DD' AND 'YYYY-MM-DD' - Knowledge Base: query the whole table — no date filter. It is a small, curated reference set, so never bound it by
last_approved_revision_dateor any other date column.
Every query against the date-partitioned Kitsune/Zendesk tables must carry a creation_date window — the period the caller asked for, or the last 30 days by default. "Most recent / latest N" questions bound the window first and ORDER BY creation_date DESC LIMIT N within it; never run an unbounded ORDER BY creation_date DESC across all history. (The Knowledge Base is exempt — query it in full.)
Output
A plain-text formatted table:
Troubleshooting
| Symptom | Fix | |
|---|---|---|
Authentication rejected (401) / GCP authentication required | Re-run gcloud auth application-default login; confirm you have roles/iam.serviceAccountTokenCreator on the service account in SERVICE_ACCOUNT | |
Missing dependency | pip install google-auth requests | |
Refusing to run … outside the allowed dataset / Only read-only SELECT | Query only tables or views in moz-fx-data-shared-prod.customer_experience_derived with a single read-only SELECT | |
No results | Check date range, table name, and filter values |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/query/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mozilla/rag-skills/query)