lookml-reviewer
Reviews LookML files, branches, or pull requests for code quality, LAMS style compliance, maintainability, and Conversational Analytics semantic readiness using looker-cli. Use when asked to review, lint, critique, or audit .view.lkml and .model.lkml files against LookML best practices (primary_key rules, string ID types, naming conventions, hidden ID fields, join relationships, field descriptions). Don't use for live instance System Activity health checks (use looker-healthcheck), refactoring slow SQL/PDTs or caching triggers for runtime performance (use looker-performance-optimizer), or greenfield project scaffolding (use looker-architect).
How do I install this agent skill?
npx skills add https://github.com/looker-open-source/looker-skills --skill lookml-reviewerIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill performs automated reviews of LookML code by executing commands via the Looker CLI. It accesses project files and interacts with Looker instances to audit code quality, which is consistent with its purpose as a developer tool.
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
LookML Reviewer Skill
This skill performs a rigorous code audit on LookML files, checking them against a bundled set of best practice references and style guidelines using the Looker CLI (looker-cli).
Workflow Instructions
When invoked, execute the following steps precisely:
-
Pre-flight Guardrails & Verification: Before requesting details or fetching code, verify that
looker-cliis installed and authenticated (ensure~/.local/binis inPATHand never scan/withfind):- Verify CLI Installation:
Run:
export PATH="$HOME/.local/bin:$PATH" && command -v looker-cliIf the command fails or is not found: Halt immediately and instruct the user:"
looker-cliis not installed or not in your PATH. Please refer to the installation instructions in the Looker CLI documentation: https://github.com/looker-open-source/looker-cli" - Verify Authentication & Looker Configuration:
Run:
looker-cli user meIf unauthenticated or connection fails: Halt immediately and instruct the user:"You are not authenticated to a Looker instance. Please configure and authenticate
looker-cliusing one of the following methods:Method 1: Interactive OAuth (Recommended)
- In Looker, ensure the Looker CLI connector is enabled: Navigate to Admin > Platform > BI Connectors > under Developer Tools, toggle Looker CLI to ON.
- Configure your profile and log in:
looker-cli profile add default --host <your-looker-host> --port 443 looker-cli profile use default looker-cli session login --oauth
Method 2: API Keys (Client ID & Client Secret) If OAuth is not enabled or for headless/service accounts:
looker-cli profile add default --host <your-looker-host> --port 443 --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET> looker-cli profile use defaultOnce configured, please rerun your review request."
- Verify CLI Installation:
Run:
-
Understand Scope & Validate Branch:
- Identify the Looker Instance URL (e.g.,
https://<instance>.looker.comorhttps://<instance-id>.<region>.looker.app), the Looker Project Name (e.g.,fashionly), the target branch, and whether the user wants to review the entire project or a single specific LookML file (e.g.,views/order_items.view.lkml). - CRITICAL - Looker Instance URL: If the Looker instance URL is not mentioned, you MUST ask the user to provide it before proceeding.
- CRITICAL: You MUST always ask the user for the project name and branch name before proceeding, unless they explicitly provided them in their request.
- CRITICAL Guardrail - Branch Verification (DO NOT CREATE BRANCHES):
- Ensure the session workspace is in dev mode:
looker-cli session update dev - Check all existing branches:
looker-cli project branch <project_id> --all - DO NOT create a branch if it does not exist. Never use commands or API calls that create branches.
master/mainEquivalence: If the user requestedmasterbut onlymainexists (or vice versa), automatically map to the existing one (mainormaster) and inform the user.- Branch Not Found: If the specified branch (or its
master/mainequivalent) does not exist in the branch list, halt immediately, list the available branches to the user, and ask for clarification.
- Ensure the session workspace is in dev mode:
- Identify the Looker Instance URL (e.g.,
-
Retrieve LookML Files via
looker-cli:- Checkout Target Branch:
looker-cli project checkout <project_id> <branch_name>- Conflict Guardrail: If checkout fails due to uncommitted local changes or checkout conflicts in the current dev workspace, halt immediately. Report the conflicting files to the user and ask them to commit or discard their changes in Looker before retrying.
- List Project Files: Retrieve the file listing for the project:
looker-cli project file ls <project_id> - Fetch File Content:
- Single File Mode: If the user explicitly mentioned a single LookML file, verify that it exists in the project file listing and retrieve only that file:
(If the file is not found, halt, list matching project files, and ask for clarification).looker-cli project file cat <project_id> <file_path> - Full Project Mode: If no single file was specified, read the content of each LookML file (
*.model.lkml,*.explore.lkml,*.view.lkml,manifest.lkml, and config files):looker-cli project file cat <project_id> <file_path>
- Single File Mode: If the user explicitly mentioned a single LookML file, verify that it exists in the project file listing and retrieve only that file:
- Checkout Target Branch:
-
Analyze Codebase / Target File:
- Load only the reference guides and line ranges in
references/matching the user's review scope:- Core Style & LAMS Rules (Default): lams-style-guide.md (
Lines 17-110), lookml-dos-and-donts.md (Lines 20-55), and playbook_lookml_quality.md (Lines 7-111) - DRY & Refinement Architecture: sustainable-maintainable-lookml.md (
Lines 15-108) - Conversational Analytics Readiness (Load only when reviewing for BI / GenAI agents): conversational-analytics-best-practices.md (
Lines 25-71) - 0–4 Transcriber Quantitative Rubric (Load only when a numeric quality score is requested): playbook_transcriber_scoring.md (
Lines 21-140)
- Core Style & LAMS Rules (Default): lams-style-guide.md (
- If reviewing a single file, audit the file thoroughly (checking field definitions,
${TABLE}vs hardcoded SQL table references, primary keys, foreign keys, naming conventions, descriptions, count measure filters, and conversational analytics readiness). - If reviewing the full project, analyze the project as a whole to provide a holistic review (checking explicit file includes vs wildcard
*.viewincludes in.model.lkml, model-explore relationships, explicit joinrelationship:definitions, primary keys, symmetric aggregateSUM(DISTINCT)fanout prevention, datagroups, naming conventions, conversational analytics readiness, and optional 0–4 Transcriber scoring).
- Load only the reference guides and line ranges in
-
Compile Report: Draft a highly verbose and comprehensive review report based on your analysis. The report must contain the following sections:
- Summary: A high-level summary of the health of the target file or full codebase, naming the project, branch, and target file (if single-file mode) reviewed, along with key findings.
- Strengths: A bulleted list highlighting code patterns that were done exceptionally well.
- Improvement Points: A highly detailed breakdown of violations organized by file. For each point:
- Describe the violation clearly. Do NOT explicitly list or recite the full rules in the report.
- Suggest exactly how to fix it (providing concrete before/after code snippets).
- CRITICAL: Include the exact file path and line number(s) of the violation (e.g.,
views/order_items.view.lkml:L16-L19). Use the Looker instance URL to construct a direct link to the file in the Looker IDE:<instance_url>/projects/<project_id>/files/<file_path>.
-
Print Report: Formulate the report and print it directly in the chat or console as your primary response (do not save it to a file unless explicitly requested by the user).
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/looker-open-source/looker-skills/lookml-reviewer">View lookml-reviewer on skillZs</a>