Agent skill

SQL Analyst

by RightNow-AI in RightNow-AI/openfang

SQL query expert for optimization, schema design, and data analysis

Apache-2.0Auto-check passedDatabases

Install SQL Analyst

skills CLI
$ npx skills add RightNow-AI/openfang --skill sql-analyst -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install RightNow-AI/openfang sql-analyst --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/RightNow-AI/openfang.git skills-src && mkdir -p .claude/skills && cp -r skills-src/crates/openfang-skills/bundled/sql-analyst .claude/skills/sql-analyst && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sql-analyst
GitHub stars
18k
Token cost
~655 tokens
SKILL.md length
340 words
Files
1
Skills in repo
68
Repo updated
First seen
Licence
Apache-2.0

At a glance

SQL query expert for optimization, schema design, and data analysis

  • Tasks that involve SQL
  • SKILL.md covers Key Principles, Query Optimization, Schema Design and Analysis Patterns, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Database schema design

What it does

SQL Analyst is an agent skill from RightNow-AI/openfang. SQL query expert for optimization, schema design, and data analysis

Its SKILL.md is about 660 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering SQL and Database schema design. It works with SQL. The repository describes itself as: Open-source Agent Operating System. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve SQL
  • Tasks that involve Database schema design

Example prompts

  • “/sql-analyst”

What it can do on your machine

Read from SKILL.md and the folder at commit acf2587. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

SQL Analyst loads about 655 tokens when it runs. Until then it costs about 20 tokens; SKILL.md has 340 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~20
When it runs · the whole SKILL.md, loaded when a task matches
~655

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from RightNow-AI/openfang at commit acf2587, republished under its Apache-2.0 licence (© RightNow-AI). 340 words, ~655 tokens.

Download SKILL.mdSave it as .claude/skills/sql-analyst/SKILL.md (or your agent's skills folder).
name
sql-analyst
description
SQL query expert for optimization, schema design, and data analysis

SQL Query Expert

You are a SQL expert. You help users write, optimize, and debug SQL queries, design database schemas, and perform data analysis across PostgreSQL, MySQL, SQLite, and other SQL dialects.

Key Principles

  • Always clarify which SQL dialect is being used — syntax differs significantly between PostgreSQL, MySQL, SQLite, and SQL Server.
  • Write readable SQL: use consistent casing (uppercase keywords, lowercase identifiers), meaningful aliases, and proper indentation.
  • Prefer explicit JOIN syntax over implicit joins in the WHERE clause.
  • Always consider the query execution plan when optimizing — use EXPLAIN or EXPLAIN ANALYZE.

Query Optimization

  • Add indexes on columns used in WHERE, JOIN, ORDER BY, and GROUP BY clauses.
  • Avoid SELECT * in production queries — specify only the columns you need.
  • Use EXISTS instead of IN for subqueries when checking existence, especially with large result sets.
  • Avoid functions on indexed columns in WHERE clauses (e.g., WHERE YEAR(created_at) = 2025 prevents index use; use range conditions instead).
  • Use LIMIT and pagination for large result sets. Never return unbounded results to an application.
  • Consider CTEs (WITH clauses) for readability, but be aware that some databases materialize them (impacting performance).

Schema Design

  • Normalize to at least 3NF for transactional workloads. Denormalize deliberately for read-heavy analytics.
  • Use appropriate data types: TIMESTAMP WITH TIME ZONE for dates, NUMERIC/DECIMAL for money, UUID for distributed IDs.
  • Always add NOT NULL constraints unless the column genuinely needs to represent missing data.
  • Define foreign keys for referential integrity. Add ON DELETE behavior explicitly.
  • Include created_at and updated_at timestamp columns on all tables.

Analysis Patterns

  • Use window functions (ROW_NUMBER, RANK, LAG, LEAD, SUM OVER) for running totals, rankings, and comparisons.
  • Use GROUP BY with HAVING to filter aggregated results.
  • Use COALESCE and NULLIF to handle null values gracefully in calculations.

Pitfalls to Avoid

  • Never concatenate user input into SQL strings — always use parameterized queries.
  • Do not add indexes without measuring — too many indexes slow writes and increase storage.
  • Do not use OFFSET for deep pagination — use keyset pagination (WHERE id > last_seen_id) instead.
  • Avoid implicit type conversions in joins and comparisons — they prevent index usage.

© RightNow-AI, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in crates/openfang-skills/bundled/sql-analyst of RightNow-AI/openfang.

Open the folder on GitHubat commit acf2587

Compare with similar skills

SQL Analyst next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

SQL Analyst compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SQL Analyst this skillRightNow-AI/openfang18k—~655Automated safety check: PassApache-2.0
SQL Optimization Patternsynulihao/AgentSkillOS61710 repos~3.3kAutomated safety check: PassNone
DB Migrationskurealnum/dotfiles290—~820Automated safety check: PassNone
SQL Prodavila7/claude-code-templates32k8 repos~1.9kAutomated safety check: PassMIT
Optimizing Ef Core Queriesdotnet/skills5.6k1 repos~2.7kAutomated safety check: PassMIT
Migrationkortix-ai/suna20k—~1.2kAutomated safety check: PassCustom licence

Similar skills

  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 10 repos~3.3k tokens
    DatabasesAuto-check passed
  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • SQL Pro

    davila7/claude-code-templates

    Master modern SQL with cloud-native databases, OLTP/OLAP optimization, and advanced query techniques.

    32k GitHub starsUsed in 8 repos~1.9k tokens
    DatabasesAuto-check passed
  • Official

    Optimize and improve the performance of slow Entity Framework Core (EF Core) queries: make them generate less SQL, make fewer database round-trips, and return results faster.

    5.6k GitHub starsUsed in 1 repo~2.7k tokens
    DatabasesAuto-check passed
  • Migration

    kortix-ai/suna

    How to change the database schema in this repo. An agent skill from kortix-ai/suna.

    20k GitHub stars~1.2k tokensUpdated today
    DatabasesAuto-check passed
  • Database Architecture Interviewer

    PrepLabsAI/InterviewMentor

    A Principal Database Engineer interviewer. An agent skill from PrepLabsAI/InterviewMentor.

    112 GitHub stars~2.4k tokensUpdated today
    DatabasesAuto-check passed

More from RightNow-AI/openfang

All 68 skills in this repo
  • Reference of CSS selectors, step-by-step web workflows and error recovery tactics for an agent that browses, fills forms and compares prices on live sites.

    18k GitHub stars~1k tokensUpdated 3 mo ago
    Auto-check passed
  • Reference knowledge for open-source intelligence collection: the collection cycle, source reliability tiers, search query patterns and entity extraction.

    18k GitHub stars~2.1k tokensUpdated 3 mo ago
    Auto-check passed
  • Lead Generation Research Guide

    RightNow-AI/openfang

    Reference knowledge for AI lead generation: building an ideal customer profile, researching prospects on the web, enriching lead records and finding email formats.

    18k GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Video Clipping Reference

    RightNow-AI/openfang

    Command reference for cutting clips from online video: yt-dlp downloads, whisper transcription, SRT subtitle files and ffmpeg processing, with Windows, macOS and Linux differences.

    18k GitHub stars~4.1k tokensUpdated 3 mo ago
    Auto-check: warnings
  • Forecasting Expert Knowledge

    RightNow-AI/openfang

    Reference knowledge for AI forecasting: superforecasting principles, a signal taxonomy, confidence calibration rules and reasoning chains for making and tracking predictions.

    18k GitHub stars~2.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Deep Research Methodology

    RightNow-AI/openfang

    Reference knowledge for AI deep research: a five-phase process, strategies by question type, CRAAP source scoring, cross-referencing, synthesis and citation formats.

    18k GitHub stars~2.6k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about SQL Analyst

What does SQL Analyst do?

SQL query expert for optimization, schema design, and data analysis. SQL Analyst is an agent skill from RightNow-AI/openfang.

When should I use SQL Analyst?

SQL Analyst fits situations like: tasks that involve SQL; tasks that involve Database schema design.

How do I install SQL Analyst in Claude Code?

Run `npx skills add RightNow-AI/openfang --skill sql-analyst -a claude-code`. Or copy the skill folder (crates/openfang-skills/bundled/sql-analyst in RightNow-AI/openfang) into .claude/skills/sql-analyst in your project. Claude Code loads it when a task matches its description.

How do I install SQL Analyst in Codex?

Run `npx skills add RightNow-AI/openfang --skill sql-analyst -a codex`. Or copy the skill folder (crates/openfang-skills/bundled/sql-analyst in RightNow-AI/openfang) into .agents/skills/sql-analyst in your project. Codex loads it when a task matches its description.

Can I use SQL Analyst in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add RightNow-AI/openfang --skill sql-analyst -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sql-analyst, .gemini/skills/sql-analyst, .github/skills/sql-analyst and .opencode/skills/sql-analyst in your project.

What does SQL Analyst need to run?

SKILL.md names no scripts, command-line tools or credentials: SQL Analyst is instructions for the agent only.

Does SQL Analyst access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is SQL Analyst safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does SQL Analyst use?

SQL Analyst is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does SQL Analyst use?

About 655 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to SQL Analyst?

Skills that share tags, products or a category with SQL Analyst: SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), DB Migrations (kurealnum/dotfiles, 290 stars), SQL Pro (davila7/claude-code-templates, 32k stars) and Optimizing Ef Core Queries (dotnet/skills, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SQL Analyst?

RightNow-AI (a GitHub organization) maintains it in RightNow-AI/openfang, which has 18,212 GitHub stars. The repository holds 68 skills in this directory. The repository was last updated on July 2, 2026.

Source: RightNow-AI/openfang on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.