schema-readme-generator
Use this skill to create or update README.md files for BigQuery ETL tables in the mozilla bigquery-etl repository. Follows layout conventions derived from comparing README files across the repo β rich style with emoji headings, Mermaid data flow diagram, graduated example queries, and concise metadata overview table. Requires schema.yaml with complete descriptions (run schema-enricher first if needed) and a complete metadata.yaml.
What this skill does
# README Generator
**Prerequisites:** Run `schema-enricher` first if schema.yaml is missing descriptions; ensure metadata.yaml is present and complete.
**When to use:** Creating or updating README.md for any shared dataset, derived table, or table with multiple downstream consumers
## π¨ REQUIRED READING - Start Here
**BEFORE generating any README, review the following:**
1. **Layout conventions:** READ `references/layout_conventions.md`
- Section order, conciseness rules, anti-patterns to avoid
- Information sources (which file to read for which section)
2. **README template:** READ `assets/readme_template.md` and COPY its structure
- Fill every `{placeholder}` from the source files
- Do not skip or reorder sections
## Workflow
### Step 1: Read source files
Read all three files before writing anything:
```
sql/<project>/<dataset>/<table>/query.sql β source tables, GROUP BY dimensions, metrics, @param
sql/<project>/<dataset>/<table>/metadata.yaml β DAG, partitioning, clustering, retention, owners
sql/<project>/<dataset>/<table>/schema.yaml β field names, types, descriptions for Key Fields section
```
If only `query.py` exists (no `query.sql`): note it β the Data Flow and How It Works sections may be incomplete or require manual input. Fill what is possible from metadata.yaml and schema.yaml.
Extract and record:
- **FROM clause** β source table(s) with fully qualified name
- **GROUP BY fields** β these become Dimensions
- **Aggregated fields** β SUM/COUNT/DISTINCT targets become Metrics
- **WHERE clause** β `@param_name` for Implementation Notes
- **DAG name, partition field, cluster fields, owners** β for Overview table
- **Table version** β from directory name (e.g., `_v1`)
### Step 2: Check if README.md already exists
```bash
ls sql/<project>/<dataset>/<table>/README.md
```
- **Exists** β read it, identify sections to update or add (do not remove existing content without noting it)
- **Does not exist** β generate from template
### Step 3: Write README.md
READ `assets/readme_template.md` and fill every placeholder:
**π Overview table** β use metadata.yaml for DAG/partition/cluster/retention/owner; derive Version from directory name.
**πΊοΈ Data Flow** β Mermaid `flowchart TD` with exactly 3 nodes:
- Node A: source table(s) with short label + fully qualified name
- Node B: `**This query**` with filter and GROUP BY description
- Node C: `Partitioned table` with time and cluster annotation
- For multiple sources: A1, A2 β B
**π§ How It Works** β 4β5 numbered steps. Step 5 MUST explicitly state data inclusion/exclusion policy:
- "All records from source are included; no exclusions applied at this layer."
- OR list specific exclusions (bots, synthetic clients, test populations)
**π§Ύ Key Fields** β two sub-tables (Dimensions, Metrics). Use `{a\|b\|c}` shorthand for related field families. Group dimensions by: Date & Geo, Browser, Search, [Product] config, User. Omit dimension rows not applicable to this table.
**π§© Example Queries** β exactly 3, graduated:
1. Basic aggregation β date filter + 1β2 GROUP BY dimensions
2. Segmentation β GROUP BY a user/product dimension with SAFE_DIVIDE ratio
3. Attribution/Advanced β multi-metric, WHERE filter on a dimension, SAFE_DIVIDE
Rules:
- Always use `SAFE_DIVIDE()` for ratios β never raw division
- Use `GROUP BY 1, 2` shorthand
- Comment each: `-- N. Description`
- Fully qualified table name in FROM
**π§ Implementation Notes** β 3β5 bullets extracted from query.sql logic.
**π Notes & Conventions** β bullet definitions for key fields from schema.yaml descriptions.
**ποΈ Schema & Related Tables** β one section; combine schema.yaml link + upstream + downstream.
### Step 4: Conciseness check
Before finalizing, verify:
- [ ] Total line count β€ 170
- [ ] No separate sections for Scheduling, Storage, Owners, Retention (all in Overview table)
- [ ] No separate "Schema Reference" + "Related Tables" (merged into ποΈ)
- [ ] SQL examples use `GROUP BY 1, 2` shorthand
- [ ] How It Works uses single-line numbered steps (no multi-paragraph blocks)
- [ ] How It Works Step 5 explicitly states data inclusion/exclusion policy
If over 170 lines, trim by: shortening SQL examples, collapsing Notes & Conventions bullets, abbreviating How It Works steps.
### Step 5: Write and report
Write the README.md to:
```
sql/<project>/<dataset>/<table>/README.md
```
Then read back the written file and confirm:
- [ ] All sections from the template are present and in order
- [ ] No `{placeholder}` tokens remain unfilled (exception: if only `query.py` exists, Data Flow and How It Works may be partially filled β note which sections and why)
- [ ] Line count is within target (β€ 170)
- [ ] Mermaid block renders valid `flowchart TD` syntax
Report:
- Path written
- Line count
- Sections included
- Any placeholders left unfilled (with reason)
## Integration with Other Skills
| Skill | When to invoke |
|---|---|
| `schema-enricher` | Run first if schema.yaml is missing descriptions β needed for Notes & Conventions |
| `create-pr` | After README.md is written β stages, commits, and opens a draft PR |
## Decision Tree: Rich vs. Minimal Style
```
Table has multiple downstream consumers OR is a shared dataset?
β Rich style (this skill)
Table is a UDF, static reference, or simple single-consumer table?
β Minimal style: title + ## Description with 5β10 bullet points
β Do not use this skill for minimal style
```
## Example Invocations
```
Create a README.md for telemetry_derived.newtab_daily_interactions_aggregates_v1
Update the README.md for firefox_desktop_derived.newtab_clients_daily_v2 β add missing example queries
Generate README for ads_derived.impressions_v1
```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.