/looker-skills:looker-architectfrom looker-skills
Scaffolds, builds, refactors, validates, and audits enterprise LookML projects with raw/refined separation, functional sequencing, and advanced drilling configurations.
Ships in looker-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This master developer skill governs the lifecycle of building, refactoring, validating, and auditing enterprise-grade LookML projects. Built upon the architectural standards, design principles, and best practices used internally at Google to engineer official Looker Blocks, it empowers developers to build block-quality analytical applications. It enforces a strict separation of concerns, performance-first design, automated testing, and comprehensive documentation.
All LookML projects developed under this skill must be dialect-agnostic, schema-agnostic, and compatible with any database connection. They strictly adhere to the highest standards of LookML, Google Cloud best practices, and enterprise data governance guidelines.
Every LookML project MUST follow this clean, modular directory structure to ensure maintainability, enable robust version control, and prevent compilation bloat:
├── views/
│ ├── raw/ # Raw views mapping 1:1 to physical database tables
│ │ ├── [view_name].view.lkml
│ └── refined/ # Refined views (extends/refines raw views with business logic)
│ └── [view_name]_rfn.view.lkml
├── explores/ # Modular Explore files (one explore per file: *.explore.lkml)
│ └── [explore_name].explore.lkml
├── tests/ # LookML test suites (one suite per explore: *.test.lkml)
│ └── [explore_name].test.lkml
├── dashboards/ # LookML dashboard files (*.dashboard.lookml)
│ └── [dashboard_name].dashboard.lookml
├── [project_name].model.lkml # Clean model file (connection constant, caching, and includes only)
├── manifest.lkml # Defines constants (connection, dataset, and visualization configs)
├── README.md # End-user documentation (installation, PDT config, KPIs)
├── LICENSE # Apache 2.0 or standard open-source license
└── CONTRIBUTING.md # Guidelines for contributing to the project
The Looker Architect skill operates in two distinct modes depending on the state of the codebase. In both modes, the agent MUST adhere to the Mandatory PRD Audit Checklist & Full-Coverage Rule:
[!IMPORTANT] Mandatory PRD Audit Checklist & Full-Coverage Rule: Before writing a single line of code, the agent MUST read and analyze all provided external document URLs (including Google Docs PRDs, database schema specifications, and database dialect manuals). The agent MUST compile and write a concrete Completeness Checklist listing every required dashboard, tab, tile, metric, and view.
Furthermore, the agent MUST implement the advanced modeling standards (custom visual drills, value formatting, and Period-over-Period comparisons) across 100% of the views, measures, and dashboard tiles created for the project. Applying these standards selectively (e.g., only to the primary view while leaving secondary views as unformatted boilerplate) or introducing shortcuts is strictly prohibited.
Use this mode when starting a brand new project. Follow the full 8-step development workflow:
./looker_scaffold.py script (ensuring the project name matches the target project name in the Looker instance).views/raw/, and layer business logic in views/refined/.Use this mode when reviewing or improving an existing LookML project. The agent MUST execute the following audit and refactoring pipeline:
looker-cli or Looker MCP (get_project_files, get_project_file) to inspect the active LookML files.explores/).type parameters.tabs.views/raw/ (direct 1:1 columns) and views/refined/ (refinements with measures, inheriting metadata via ${field_name}).NULLIF safe-math divisions.tabs: and tab_name:), resetting grid coordinates to row: 0, col: 0 for each tab.pop_*_current and pop_*_change measures and mapping filters to the explore's pop_date_filter.looker-cli project validate or MCP validate_project) to ensure the refactored project compiles perfectly and has zero syntax errors.run_dashboard or query tool to generate and execute the underlying SQL query against the target database.Name query_text not found or SQL syntax/type-coercion errors).get_connection_table_columns), surgically edit the LookML views to map to correct columns, adjust the SQL casts to match the target dialect, and re-verify until the queries return HTTP 200 (successful data retrieval).Building an enterprise LookML project follows a strict 8-step lifecycle:
looker-cli session login --oauth --host <your-looker-domain.com>
looker-cli session update dev
looker_scaffold.py to automatically generate the standard directory structure, parameterized manifest.lkml, clean .model.lkml, raw views with primary keys, and refined views pre-populated with functional sequencing headers.dashboards/ directory:
looker-cli api dashboard dashboard_lookml <dashboard_id> > dashboards/<dashboard_name>.dashboard.lookml
tests/ to validate primary keys and business calculations. Refer to testing_suite.md.looker-cli project validate <project_name>
README.md file detailing the installation steps, PDT rebuild frequencies, and KPI definitions.gh credential helper), merge to main, and trigger a production deploy:
looker-cli project deploy <project_name>
Never hardcode connection or dataset names in your model or view files. Always parameterize them in manifest.lkml with override_optional export settings so users can override them during block installation or deployment.
manifest.lkml:
project_name: "my_lookml_project"
constant: CONNECTION_NAME {
value: "my_connection"
export: override_optional
}
constant: DATASET_NAME {
value: "my_dataset"
export: override_optional
}
views/raw/users.view.lkml:
view: users {
# References the dataset constant
sql_table_name: @{DATASET_NAME}.users ;;
# ...
}
my_model.model.lkml:
# References the connection constant
connection: "@{CONNECTION_NAME}"
To provide a premium, highly interactive user experience without cluttering view files with massive, duplicated JSON blocks, define centralized Visualization Drill Constants in manifest.lkml.
drill_fields Quirk: The agent MUST define an empty array drill_fields: [] on the measure to force the Looker frontend to activate the hyperlink in the UI. Without this parameter, custom links will not render.manifest.lkml:
constant: DRILL_COLUMN_VIZ {
value: "{% assign vis_config = '{
\"type\": \"looker_column\",
\"x_axis_gridlines\": false,
\"y_axis_gridlines\": true,
\"show_view_names\": false,
\"show_y_axis_labels\": true,
\"show_y_axis_ticks\": true,
\"show_x_axis_label\": true,
\"show_x_axis_ticks\": true,
\"stacking\": \"\",
\"show_value_labels\": true
}' %}"
}
views/refined/users_rfn.view.lkml:
view: +users {
dimension: country {
type: string
sql: ${TABLE}.country ;;
# References the visualization constant, passing dynamic filter values
link: {
label: "📊 Country Connection States (Bar)"
url: "@{DRILL_COLUMN_VIZ}{{ link }}&fields=users.state,users.total_connections&f[users.country]={{ value | url_encode }}&sorts=users.total_connections+desc&limit=10&toggle=vis"
}
}
}
views/raw/): Map 1:1 to the physical database tables. They contain only raw dimensions mapping directly to columns. They MUST NOT define measures, labels, or complex business logic. The Primary Key must be the first dimension defined in the file.views/refined/): Use the refinement syntax (view: +view_name) to layer business logic. This is where you write measures, labels, descriptions, group labels, Period-over-Period engines, and custom calculations.To maximize readability, fields within any refined view file MUST be organized from top to bottom in the following functional order:
primary_key: yes) and Foreign Keys.Internal Ordering: Within each category, fields should be ordered either Alphabetically (A-Z) or grouped logically by Group Label (group_label).
${field_name})When defining measures or compound dimensions, ALWAYS use the LookML substitution operator ${field_name} rather than the raw SQL column ${TABLE}.field_name.
dimension: sale_price {
type: number
sql: ${TABLE}.sale_price ;;
description: "Unit price of the item sold."
value_format_name: usd
}
measure: total_revenue {
type: sum
sql: ${sale_price} ;; # INHERITS metadata (description, formatting, type)
}
measure: total_revenue {
type: sum
sql: ${TABLE}.sale_price ;; # BYPASSES LookML layer, loses metadata
}
${sale_price} ensures that the measure inherits all its formatting, descriptions, and metadata. If the column name changes in the database, you only need to update it once in the base dimension.Always utilize Looker's native type parameter for aggregations (e.g., type: sum, type: average, type: count) instead of writing aggregation functions directly in the sql: parameter (e.g., using type: number with sql: SUM(col)).
measure: average_benchmark {
type: average
sql: ${benchmark_dynamic} ;; # Looker knows this is an average natively
}
measure: average_benchmark {
type: number
sql: AVERAGE(${TABLE}.benchmark_dynamic) ;; # Bypasses aggregation engine
}
snake_case (lowercase with underscores)._count or _total for Count and Distinct Count measures (e.g., user_count, active_users_total)._total or _amount for Sum measures (e.g., revenue_total, discount_amount).SAFE_DIVIDE(num, den) for BigQuery, or num / NULLIF(den, 0) for Snowflake/Redshift).measure: conversion_rate {
type: number
sql: 1.0 * ${orders_count} / NULLIF(${sessions_count}, 0) ;; # Aggregates first, then divides
value_format_name: percent_1
}
measure: conversion_rate {
type: average
sql: ${TABLE}.conversion_rate ;; # Aggregates a ratio, mathematically invalid
}
0.072826486327 in a dashboard visualization) look highly unprofessional and clutter the UI. Every count, sum, average, ratio, or size measure in refined views MUST have a clean, reader-friendly formatting parameter defined:
value_format_name: percent_1 (e.g., 7.3%) or percent_2 (e.g., 7.28%).value_format_name: decimal_2 (e.g., 12.34) or decimal_1 (e.g., 12.3).value_format_name: decimal_0 or integer to force comma separators (e.g., 1,234).value_format_name: usd (e.g., $1,234.56) or usd_0 (e.g., $1,234).value_format with a custom format string to append clean units in quotation marks:
value_format: "#,##0.00 \"s\"" (formats 0.0728 to 0.07 s).value_format: "#,##0.0 \"ms\"" (formats 72.82 to 72.8 ms).value_format: "#,##0.00 \"GB\"" (formats 12.345 to 12.35 GB).value_format: "[>=1000000]#,##0.0,,\"M\";[>=1000]#,##0.0,\"K\";#,##0" (formats 1500000 to 1.5M, and 2500 to 2.5K).explores/ (e.g., explores/orders.explore.lkml)..model.lkml file must contain only the connection constant, caching policy (datagroups), and includes for explores and dashboards. No explore definitions are allowed in the model file itself..dashboard.lookml file using native Looker Tabbed Dashboards (the tabs metadata parameter).tabs parameter.row: 0, col: 0. When designing layouts, elements on a new tab must reset their row and col values to 0.single_value scorecards) MUST implement the Period-over-Period (PoP) comparison pattern. They must query exactly two fields (the current period measure and the percentage change measure), enable comparison settings (show_comparison: true and comparison_type: change), and map their filters to the explore's PoP date filter (pop_date_filter). Refer to references/dashboard_standards.md for LookML examples.The compilation of LookML only validates syntax; it does not check if calculations are mathematically or logically sound. To prevent creating non-functional, "fake" projects, the agent MUST adhere to this strict rule:
sql: 0.05 ;;, sql: 0.15 ;;, sql: 1 ;;) inside measures, especially in Period-over-Period percentage change metrics, is strictly prohibited.references/pop_engine.md (which dynamically compares current vs. previous periods using Looker filters).CASE WHEN expressions that dynamically compare the current period's aggregated value against the previous period's aggregated value.To manage the lifecycle of a LookML project, the AI agent MUST leverage either the Looker CLI (looker-cli) or the Looker MCP server. The Looker MCP server is preferred when interacting with the active Looker instance programmatically. Below is the mapping of core actions to their equivalent CLI commands and MCP tools:
Ensure your development session is active and targeting Developer Mode before making any edits.
looker-cli session update dev
dev_mode tool:
{ "state": true }
Before mapping columns or planning joins, fetch table details and schemas directly from the database.
get_connection_tablesget_connection_table_columns (e.g., {"connection_name": "my_conn", "table_name": "users"})Create and modify the LookML files in the active Looker project.
looker-cli project create <project_id>
looker-cli project checkout <project_id> <branch_name>
get_project_files (e.g., {"project_id": "my_project"})get_project_file (e.g., {"project_id": "my_project", "file_id": "views/raw/users.view.lkml"})create_project_file (e.g., {"project_id": "my_project", "file_id": "views/refined/users_rfn.view.lkml"})update_project_file (e.g., {"project_id": "my_project", "file_id": "views/refined/users_rfn.view.lkml", "content": "..."})Validate that the LookML compiles perfectly on the Looker server before deployment.
looker-cli project validate <project_id>
validate_project (e.g., {"project_id": "my_project"})Import visual dashboards designed by users in the Looker UI into code.
looker-cli api dashboard dashboard_lookml <dashboard_id>
get_dashboardsrun_dashboardDeploy all validated changes to the production environment.
looker-cli project deploy <project_id>
To optimize execution speed, prevent token bloat, and avoid hitting turn or context limits in your agentic environment, follow these execution strategies:
When initializing a project, the main agent MUST execute the looker_scaffold.py script non-interactively in the terminal using Unix input piping (e.g., echo -e "..." | python3 looker_scaffold.py). Extract the project parameters (name, connection, dialect, tables) directly from the user's natural language prompt. Do not halt the terminal to ask the user for inputs.
operational-intelligence-cloud-sql) to the scaffolding script to ensure that the local directory structure and LookML model/project names match the Looker instance perfectly, preventing local/remote naming mismatches.Writing massive, multi-tab dashboards can be slow and token-heavy. The main agent MUST partition the dashboard creation process:
tab_name parameter and independent grid coordinates starting at row: 0, col: 0.elements array, defines the global tabs metadata array, and writes the final .dashboard.lookml file in one clean step.If a server-side validation check (looker-cli project validate) returns compilation, join, or syntax errors, the main agent SHOULD delegate the debugging loop to a specialized subagent. The subagent will surgically edit the specific files, rerun the validator locally, and only report back once the build is 100% green, keeping the main conversation focused and highly efficient.
If dashboard queries return execution-time errors on the database (e.g., column not found, type coercion mismatch, invalid dialect functions):
To protect developer comments, preserve custom dimensions, and optimize API token efficiency, the agent MUST adhere to the following surgical editing protocol:
README.md (opens in a new tab)examples/ecommerce_block/dashboards/ecommerce_overview.dashboard.lookml (opens in a new tab)examples/ecommerce_block/ecommerce.model.lkml (opens in a new tab)examples/ecommerce_block/explores/orders.explore.lkml (opens in a new tab)examples/ecommerce_block/manifest.lkml (opens in a new tab)examples/ecommerce_block/tests/orders.test.lkml (opens in a new tab)examples/ecommerce_block/views/raw/orders.view.lkml (opens in a new tab)examples/ecommerce_block/views/raw/users.view.lkml (opens in a new tab)examples/ecommerce_block/views/refined/orders_rfn.view.lkml (opens in a new tab)examples/ecommerce_block/views/refined/users_rfn.view.lkml (opens in a new tab)looker_scaffold.py (opens in a new tab)references/aggregate_awareness.md (opens in a new tab)references/consumption_guide.md (opens in a new tab)references/dashboard_standards.md (opens in a new tab)references/pop_engine.md (opens in a new tab)references/sql_runtime_debugging.md (opens in a new tab)references/templates.md (opens in a new tab)references/testing_suite.md (opens in a new tab)references/visual_drilling.md (opens in a new tab)templates/lookml_linter.yml (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (looker-open-source/looker-skills) — no native marketplace selected
npx claudepluginhub p/looker-open-source-looker-skills27 skills in this plugin
/authenticating-looker-cliLooker Developer Onboarding: Step 3. Authenticates the Looker CLI using OAuth. Only execute this after Step 2 (CLI Verification using `installing-looker-cli`)./connecting-looker-to-bigqueryLooker Developer Onboarding: Step 4. Creates a database connection in Looker to Google BigQuery. Only execute this after Step 3 (CLI Authentication using `authenticating-looker-cli`)./creating-looker-dashboardLooker Developer Onboarding: Step 7 (Final Step). Creates a LookML dashboard in the project, imports it as a user-defined dashboard (UDD) in Looker, and iteratively refines it based on user feedback by syncing changes. Only execute this after Step 6 (Model Setup using `creating-lookml-model`).Other plugins' skills for the same job