Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads.
npx skills add https://github.com/FrankChen021/datastoria --skill optimize-clickhouse-sql
Workflow is evidence-driven: collect evidence with tools, then recommend based on evidence only.
collect_sql_optimization_evidence immediately).ask_user_question with exactly one question:header: Please provide one of the following for optimizationoptions:{ "id": "sql", "label": "Provide SQL", "input": "text" }{ "id": "query_id", "label": "Provide query_id", "input": "text" }{ "id": "resource", "label": "Find the query that consumes the most", "input": "select", "choices": ["duration", "cpu", "memory", "disk"] }After the tool returns:
optionId is sql, treat value as the SQL text and continue with evidence collection.optionId is query_id, treat value as the query_id and continue with evidence collection.optionId is resource, treat value as the ranking metric and run discovery for the top 1 query in the last 1 day before continuing.search_query_log for discovery from system.query_log (slowest, most expensive, user-scoped, database-scoped, text-scoped, etc.).search_query_log cannot express the request, then load the clickhouse-system-queries skill, immediately call skill_resource for references/system-query-log.md, and follow that reference strictly.system.query_log from this skill when search_query_log can satisfy the request.query_id from the discovery results for the next step (evidence collection).time_window: Relative minutes from now (e.g., 60 = last hour).time_range: Absolute range { from: "ISO date", to: "ISO date" }.collect_sql_optimization_evidence after discovery, you MUST pass the same time_window or time_range used in discovery.collect_sql_optimization_evidence to light mode for the first pass.mode argument entirely unless full detail is required.mode: "full" only when the user explicitly asks for detailed/raw evidence or the light pass is insufficient.full just because the request says "optimize", "analyze", or "investigate".search_query_log to find candidates. If the request exceeds the tool's schema, then load clickhouse-system-queries, load references/system-query-log.md via skill_resource, and use that reference. Extract query_id from the results.collect_sql_optimization_evidence with query_id (preferred) or sql (and same time params if coming from discovery).validate_sql for any proposed SQL changes. Add inline comments (-- comment) to highlight key changes.optimization_target is present, treat it as the real local-table schema behind a Distributed table and base key/index recommendations on it.minmax for range predicates on sorted columns.set for low-cardinality equality filters.bloom_filter for high-cardinality equality filters (e.g., trace_id, user_id).tokenbf_v1 for frequent token-based text search.validate_sql before recommending.query_id instead of sql.query_id and SQL are available, prefer query_id to reduce tokens and avoid truncation issues.Efficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.
Access BRENDA enzyme database via SOAP API. Retrieve kinetic parameters (Km, kcat), reaction equations, organism data, and substrate-specific enzyme information for biochemical research and metabolic pathway analysis.
Access ClinPGx pharmacogenomics data (successor to PharmGKB). Query gene-drug interactions, CPIC guidelines, allele functions, for precision medicine and genotype-guided dosing decisions.
Query NCBI ClinVar for variant clinical significance. Search by gene/position, interpret pathogenicity classifications, access via E-utilities API or FTP, annotate VCFs, for genomic medicine.
Access COSMIC cancer mutation database. Query somatic mutations, Cancer Gene Census, mutational signatures, gene fusions, for cancer research and precision oncology. Requires authentication.
Query Ensembl genome database REST API for 250+ species. Gene lookups, sequence retrieval, variant analysis, comparative genomics, orthologs, VEP predictions, for genomic research.
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.
Query NCBI Gene via E-utilities/Datasets API. Search by symbol/ID, retrieve gene info (RefSeqs, GO, locations, phenotypes), batch lookups, for gene annotation and functional analysis.
Take frankchen021/optimize-clickhouse-sql from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.