[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CDA84HC07QR9B4WNVS5W9M":3,"skill-same:01M7CDA84HC07QR9B4WNVS5W9M":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CDA84HC07QR9B4WNVS5W9M","spice-text-to-sql",null,"Generate accurate SQL for Spice.ai's Apache DataFusion engine (PostgreSQL dialect), and build text-to-SQL workflows. Use this skill whenever the user wants to write SQL queries against Spice datasets, convert natural language to SQL, debug SQL errors, understand Spice\u002FDataFusion data types and type casting, use Spice-specific functions (ai, embed, vector_search, text_search, rrf, JSON operators), build a text-to-SQL pipeline with schema introspection, or construct prompts for LLM-based SQL generation. Also use when the user hits SQL errors like \"table not found\", \"cannot cast\", or asks about DataFusion SQL dialect differences from PostgreSQL\u002FMySQL.","shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Fspiceai__skills__skills__spice-text-to-sql\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: spice-text-to-sql\ndescription: Generate accurate SQL for Spice.ai's Apache DataFusion engine (PostgreSQL dialect), and build text-to-SQL workflows. Use this skill whenever the user wants to write SQL queries against Spice datasets, convert natural language to SQL, debug SQL errors, understand Spice\u002FDataFusion data types and type casting, use Spice-specific functions (ai, embed, vector_search, text_search, rrf, JSON operators), build a text-to-SQL pipeline with schema introspection, or construct prompts for LLM-based SQL generation. Also use when the user hits SQL errors like \"table not found\", \"cannot cast\", or asks about DataFusion SQL dialect differences from PostgreSQL\u002FMySQL.\n---\n\n# Text-to-SQL with Spice (Bring Your Own Model)\n\nGenerate accurate SQL for Spice.ai using your own LLM. This skill provides the schema introspection workflow, type reference, SQL dialect rules, and prompt template needed to produce correct queries on the first attempt — avoiding trial-and-error.\n\n## How It Works\n\n1. **Read `spicepod.yaml`** to know which datasets, models, embeddings, and features are configured\n2. Introspect the Spice catalog to discover tables, columns, and types\n3. Build a prompt containing schema, type info, and dialect rules\n4. Send the prompt to your LLM to generate SQL\n5. Execute the SQL — on failure, feed the error back and retry\n\n## Step 0 — Read the Spicepod Configuration\n\nBefore generating SQL, read the application's `spicepod.yaml` to understand what is available. This tells you:\n\n- **Which datasets exist** and their source connectors (determines what SQL features work)\n- **Whether models are configured** (`models:` section) — required for `ai()` function\n- **Whether embeddings are configured** (`embeddings:` section) — required for `vector_search()`\n- **Whether columns have `full_text_search` enabled** — required for `text_search()`\n- **Column-level `description` and `metadata`** — semantic hints that improve SQL generation\n- **Whether acceleration is enabled** — JSON functions only work on accelerated (Arrow) datasets\n\n> **Do NOT use `ai()`, `embed()`, `vector_search()`, `text_search()`, or `rrf()` unless you have confirmed they are configured in `spicepod.yaml`.** These functions require specific runtime configuration (models, embeddings, full-text indexes) and will fail at runtime if missing.\n\n### Example spicepod.yaml inspection\n\n```yaml\n# If you see this — ai() is available with model name \"main_model\"\nmodels:\n  - from: openai:gpt-5\n    name: main_model\n    params:\n      openai_api_key: ${ secrets:OPENAI_API_KEY }\n\n# If you see this — vector_search() is available using \"openai_embed\"\nembeddings:\n  - from: openai:text-embedding-3-small\n    name: openai_embed\n    params:\n      openai_api_key: ${ secrets:OPENAI_API_KEY }\n\ndatasets:\n  - from: postgres:public.reviews\n    name: reviews\n    columns:\n      - name: body\n        description: 'The full text of the customer review' # semantic hint for LLMs\n        embeddings:\n          - from: openai_embed # enables vector_search on this column\n        full_text_search:\n          enabled: true # enables text_search on this column\n    acceleration:\n      enabled: true # required for JSON functions\n```\n\n## Step 1 — Introspect Schema\n\nRun these queries against Spice to gather context for the prompt. This mirrors what Spice's own `\u002Fv1\u002Fnsql` endpoint does internally with its `table_schema`, `random_sample`, and `sample_distinct_columns` tools.\n\n### List all tables\n\n```sql\nSHOW TABLES;\n-- or\nSELECT table_catalog, table_schema, table_name, table_type\nFROM information_schema.tables\nWHERE table_schema NOT IN ('information_schema');\n```\n\n### Get columns and types for a table\n\nSpice's internal schema tool returns a markdown table with **Column, SQL Type, Arrow Type, Nullable, and Metadata** for each field. Replicate this by querying `information_schema.columns`:\n\n```sql\nSHOW COLUMNS FROM my_table;\n-- or\nSELECT column_name, data_type, is_nullable\nFROM information_schema.columns\nWHERE table_name = 'my_table';\n```\n\nIf your `spicepod.yaml` defines column `description` or `metadata`, include those in the prompt too — they provide semantic hints (e.g. \"The full text of the customer review\") that dramatically improve SQL accuracy.\n\n### Random sample (3–5 rows to show value shapes)\n\n> **Only sample from accelerated datasets or tables known to be small.** Sampling from large, non-accelerated federated sources (e.g. a full Snowflake table or S3 data lake) can be slow and expensive. Check `spicepod.yaml` for `acceleration.enabled: true` before sampling. For non-accelerated datasets, rely on schema + column descriptions alone.\n\n```sql\nSELECT * FROM my_table LIMIT 3;\n```\n\n### Distinct column values (shows cardinality and vocabulary)\n\nThis is a key trick from Spice's nsql implementation — for each column, sample a few distinct values so the LLM knows what values are possible.\n\n> **Same rule: only on accelerated or known-small tables.** `SELECT DISTINCT` can trigger a full table scan on non-accelerated federated sources.\n\n```sql\n-- Per-column distinct sampling (repeat for important columns)\nSELECT DISTINCT status FROM my_table LIMIT 3;\nSELECT DISTINCT region FROM my_table LIMIT 3;\nSELECT DISTINCT category FROM my_table LIMIT 3;\n```\n\nFor high-cardinality columns (IDs, timestamps, free text), skip distinct sampling — a random sample is sufficient.\n\n## Step 2 — Build the Prompt\n\nInclude the following sections in the system\u002Fcontext prompt sent to your LLM. A complete template is at the bottom of this file.\n\n### Required context to include\n\n| Section                 | What to include                                                              |\n| ----------------------- | ---------------------------------------------------------------------------- |\n| **Engine**              | \"Spice.ai uses Apache DataFusion with PostgreSQL dialect\"                    |\n| **Schema**              | Table names, column names, SQL type, Arrow type, nullability, metadata       |\n| **Column descriptions** | Semantic descriptions from spicepod.yaml `columns[].description`             |\n| **Sample rows**          | 3–5 random rows per accelerated\u002Fsmall table (skip for large federated sources) |\n| **Distinct values**      | 3 distinct values per low-cardinality column (accelerated\u002Fsmall tables only)   |\n| **Dialect rules**       | The gotchas and rules below                                                  |\n| **Available functions** | Only Spice-specific UDFs\u002FUDTFs confirmed in spicepod.yaml                    |\n\n## Step 3 — SQL Dialect Rules & Gotchas\n\nInclude these rules verbatim in your prompt. They prevent the most common text-to-SQL failures.\n\n### Data types\n\n- Spice uses **Apache Arrow types** internally. SQL types map as follows:\n  - `VARCHAR`, `TEXT`, `CHAR`, `STRING` → `Utf8` (Arrow)\n  - `INT` \u002F `INTEGER` → `Int32`, `BIGINT` → `Int64`\n  - `FLOAT` → `Float32`, `DOUBLE` → `Float64`\n  - `BOOLEAN` → `Boolean`\n  - `TIMESTAMP` → `Timestamp(Nanosecond, None)` — **nanosecond precision, no timezone**\n  - `DATE` → `Date32`\n  - `DECIMAL(p, s)` → `Decimal128` (p ≤ 38) or `Decimal256` (p > 38)\n- **No UUID, BLOB, CLOB, DATETIME, ENUM, SET, ARRAY (SQL), NVARCHAR types.** If source data has these, they are typically mapped to `Utf8` or `Binary`.\n- Use `arrow_typeof(expr)` to inspect the actual Arrow type of any expression.\n\n### Casting\n\n- Use `CAST(x AS type)` or the PostgreSQL shorthand `x::type`.\n- Cast timestamps explicitly when comparing: `WHERE created_at > '2024-01-01'::TIMESTAMP`.\n- When casting to `DECIMAL`, always specify precision and scale: `CAST(x AS DECIMAL(10,2))`.\n\n### Timestamps & dates\n\n- `now()` returns `Timestamp(Nanosecond)`.\n- Use `INTERVAL` for relative time: `now() - INTERVAL '7 days'`.\n- Extract parts with `date_part('year', ts)` or `extract(YEAR FROM ts)`.\n- `date_trunc('month', ts)` truncates to the start of the period.\n- **No `DATEADD` \u002F `DATEDIFF`** — use arithmetic with `INTERVAL` or `date_part`.\n- For Unix timestamps, use `to_unixtime(ts)` (returns seconds as Float64) or `to_timestamp(epoch_secs)`.\n- `to_timestamp_millis(ms)`, `to_timestamp_micros(us)`, `to_timestamp_nanos(ns)` for other precisions.\n\n### String functions\n\n- Use `||` for concatenation (not `CONCAT` with `+`). `concat(a, b)` and `concat_ws(sep, a, b)` also work.\n- `LIKE` is case-sensitive. For case-insensitive matching use `ILIKE` or `lower(col) LIKE lower(pattern)`.\n- **No `~` or `!~` regex operators.** Use `regexp_like(col, pattern)`, `regexp_match(col, pattern)`, `regexp_replace(col, pattern, replacement)`.\n- `length(s)` returns character count; `octet_length(s)` returns byte count.\n- `trim()`, `ltrim()`, `rtrim()`, `btrim()` for whitespace removal.\n- `split_part(string, delimiter, index)` — index is **1-based**.\n- `starts_with(s, prefix)`, `ends_with(s, suffix)` return boolean.\n\n### Aggregation & grouping\n\n- **Every non-aggregated column in SELECT must appear in GROUP BY** (no implicit grouping).\n- Use `FILTER (WHERE condition)` to conditionally aggregate: `count(*) FILTER (WHERE status = 'active')`.\n- `BOOL_AND(expr)` \u002F `BOOL_OR(expr)` for boolean aggregation.\n- `STRING_AGG(expr, delimiter)` to concatenate strings within groups.\n- `ARRAY_AGG(expr)` collects values into an array.\n\n### NULLs\n\n- Use `IS NULL` \u002F `IS NOT NULL` (never `= NULL`).\n- `COALESCE(a, b, ...)` returns the first non-NULL argument.\n- `NULLIF(a, b)` returns NULL if `a = b`.\n- NULL propagates through most operations — be explicit with `COALESCE` when needed.\n\n### Identifiers\n\n- Use **double quotes** for identifiers with special characters or reserved words: `\"order\"`, `\"group\"`.\n- String literals use **single quotes**: `'hello'`.\n- Spice dataset naming: `name: foo` → fully qualified as `spice.public.foo`. You can also just use `foo`.\n\n### Subqueries & CTEs\n\n- CTEs (`WITH ... AS`) are supported and preferred for readability.\n- Correlated subqueries in `WHERE` and `HAVING` are supported.\n- `EXISTS`, `IN`, `NOT IN`, `ANY`, `ALL` subquery operators work.\n\n### JOINs\n\n- Standard `INNER`, `LEFT`, `RIGHT`, `FULL OUTER`, `CROSS` joins are supported.\n- **No `LATERAL` joins** — use correlated subqueries or CTEs instead.\n- When joining datasets from different connectors (federated queries), Spice handles cross-source joins transparently.\n\n### Window functions\n\n- Supported: `ROW_NUMBER()`, `RANK()`, `DENSE_RANK()`, `LAG()`, `LEAD()`, `FIRST_VALUE()`, `LAST_VALUE()`, `NTH_VALUE()`, `NTILE()`.\n- All aggregate functions work with `OVER (PARTITION BY ... ORDER BY ...)`.\n- `QUALIFY` clause is supported for filtering window function results.\n\n### LIMIT & ordering\n\n- `LIMIT n` and `OFFSET n` are supported.\n- `ORDER BY` supports `ASC\u002FDESC` and `NULLS FIRST\u002FLAST`.\n\n### Unsupported SQL features\n\n- **No stored procedures, triggers, or user-defined functions via SQL.**\n- **No `CREATE INDEX`** — search indexes are configured in `spicepod.yaml`.\n- **No `UPDATE` or `DELETE`** — only `INSERT INTO` is supported for DML.\n- **No `MERGE` \u002F `UPSERT`.**\n- **No `PIVOT` \u002F `UNPIVOT`** — use `CASE WHEN` with aggregation instead.\n- **No `LATERAL` join.**\n\n## Spice-Specific Functions\n\nInclude relevant function signatures in your prompt **only when confirmed available** via `spicepod.yaml`.\n\n### AI functions (requires `models:` in spicepod.yaml)\n\n```sql\n-- Text generation — use the model name from spicepod.yaml\nSELECT ai('Summarize this: ' || content) AS summary FROM docs;\nSELECT ai('Classify: ' || text, 'gpt-5') AS label FROM reviews;\n\n-- Embeddings — requires `embeddings:` in spicepod.yaml\nSELECT embed('hello world', 'my_embed_model') AS vec;\n```\n\n### Search UDTFs (requires embeddings and\u002For full_text_search configured on dataset columns)\n\n```sql\n-- Vector (semantic) search — requires column with `embeddings:` config\nSELECT id, score FROM vector_search(my_table, 'search query')\nORDER BY score DESC LIMIT 10;\n\n-- Full-text (keyword) search — requires `full_text_search: enabled: true` on column\nSELECT id, score FROM text_search(my_table, 'keywords', body_column)\nORDER BY score DESC LIMIT 10;\n\n-- Hybrid search (Reciprocal Rank Fusion) — requires both above\nSELECT id, fused_score FROM rrf(\n  vector_search(my_table, 'semantic query'),\n  text_search(my_table, 'keyword query', content),\n  join_key => 'id'\n) ORDER BY fused_score DESC LIMIT 10;\n```\n\n### JSON functions\n\nSpice includes `datafusion-functions-json` for querying JSON stored as strings:\n\n```sql\n-- Extract values\nSELECT json_get_str(metadata, 'name') AS name FROM items;\nSELECT json_get_int(payload, 'count') AS cnt FROM events;\n\n-- Operators (-> returns json value, ->> returns text)\nSELECT metadata->>'color' AS color FROM products;\nSELECT metadata->'nested'->'key' FROM products;\n\n-- Check key existence\nSELECT * FROM items WHERE metadata ? 'status';\n-- or\nSELECT * FROM items WHERE json_contains(metadata, 'status');\n```\n\n> **Note:** JSON functions only work during DataFusion (Arrow) execution. They may not work on federated sources that do not accelerate locally.\n\n### Spark-compatible functions\n\nSpice includes `datafusion-functions-spark`: `array()`, `bit_get()`, `date_add()`, `like()`, `parse_url()`, and others following [Spark SQL semantics](https:\u002F\u002Fspark.apache.org\u002Fdocs\u002Flatest\u002Fapi\u002Fsql\u002Findex.html).\n\n## Error Recovery (Retry with Feedback)\n\nSpice's `\u002Fv1\u002Fnsql` endpoint retries up to 10 times when generated SQL fails. It feeds back the failed query and error message so the model avoids repeating the same mistake. Use the same pattern:\n\n```\nThe following SQL query failed. Fix it.\n\nsql: `SELECT * FROM \"spice.public.orders\" LIMIT 1`\nerror: `Error during planning: table 'spice.public.spice.public.orders' not found`\n\nDo not repeat the same mistake. Return only corrected SQL.\n```\n\nCommon mistakes the model makes (and the fix to include in retry context):\n\n- **Double-qualifying table names**: `\"catalog.schema.table\"` instead of `\"catalog\".\"schema\".\"table\"` — tables with schemas and catalogs use separate quoted identifiers\n- **Using unsupported syntax**: `LATERAL`, `~`, `DATEADD` — reference the dialect rules\n- **Wrong column names**: the model hallucinated a column — re-include the schema\n\n## Prompt Template\n\nUse this template when sending schema + question to your LLM. Replace placeholders with actual introspected data. Only include the search\u002FAI sections if confirmed in `spicepod.yaml`.\n\n```\nYou are a SQL expert. Generate a single SQL query for Apache DataFusion (PostgreSQL dialect) running in Spice.ai.\n\n## Rules\n- DataFusion SQL, PostgreSQL dialect. No MySQL or T-SQL syntax.\n- Use CAST(x AS type) or x::type for type conversion.\n- Timestamps are Timestamp(Nanosecond, None). Use INTERVAL for date math (e.g. now() - INTERVAL '7 days').\n- No DATEADD\u002FDATEDIFF. No ~ regex operator — use regexp_like(). LIKE is case-sensitive; use ILIKE for case-insensitive.\n- String concat: || or concat(). Split: split_part(s, delim, 1-based-index).\n- No UPDATE, DELETE, MERGE, PIVOT, LATERAL, stored procedures.\n- INSERT INTO is the only DML.\n- Every non-aggregated SELECT column must be in GROUP BY.\n- Use COALESCE for NULL-safe defaults. Use IS NULL, never = NULL.\n- Double-quote reserved-word identifiers. Single-quote string literals.\n- For tables with schemas and catalogs: '\"catalog\".\"schema\".\"table\"' NOT '\"catalog.schema.table\"'.\n- Columns with capitals must be quoted.\n- Window functions: ROW_NUMBER(), RANK(), LAG(), LEAD(), etc. with OVER().\n- QUALIFY clause is supported.\n- JSON: use ->> for text extraction, -> for nested access, json_get_str\u002Fint\u002Ffloat\u002Fbool for typed access.\n{%- if has_search %}\n- vector_search(table, 'query') for semantic search. text_search(table, 'query', column) for keyword search.\n- rrf(vector_search(...), text_search(...), join_key => 'id') for hybrid search.\n{%- endif %}\n{%- if has_ai %}\n- ai('prompt') or ai('prompt', 'model_name') for LLM text generation in SQL.\n{%- endif %}\n\n## Schema\n{schema}\n\n## Column Descriptions\n{column_descriptions}\n\n## Sample Data\n{sample_rows}\n\n## Distinct Values\n{distinct_values}\n\n{%- if failed_attempts %}\n## Previous Failed Attempts\nAvoid repeating these mistakes:\n{failed_attempts}\n{%- endif %}\n\n## Question\n{user_question}\n\nRespond with ONLY the SQL query. No explanation.\n```\n\n## Example Workflow\n\n````python\nimport openai\n\n# 0. Read spicepod.yaml to know what's configured (models, embeddings, search)\n#    This determines which functions are available in prompts.\n\n# 1. Introspect schema (via Spice SDK or Flight SQL)\nschema_info = spice_client.query(\"\"\"\n  SELECT table_name, column_name, data_type, is_nullable\n  FROM information_schema.columns\n  WHERE table_schema = 'public'\n\"\"\")\n\n# 2. Random sample (as Spice's nsql does internally)\nsample = spice_client.query(\"SELECT * FROM orders LIMIT 3\")\n\n# 3. Distinct values for key columns (as Spice's nsql does internally)\ndistinct_status = spice_client.query(\"SELECT DISTINCT status FROM orders LIMIT 3\")\n\n# 4. Build prompt with schema + sample + distinct values\nprompt = f\"\"\"You are a SQL expert. Generate a single SQL query for Apache DataFusion (PostgreSQL dialect) running in Spice.ai.\n\n## Rules\n- DataFusion SQL, PostgreSQL dialect.\n- Timestamps are Timestamp(Nanosecond, None). Use INTERVAL for date math.\n- No DATEADD\u002FDATEDIFF. Use regexp_like() not ~. LIKE is case-sensitive; use ILIKE for insensitive.\n- Every non-aggregated SELECT column must be in GROUP BY.\n- No UPDATE, DELETE, MERGE, PIVOT, LATERAL.\n- For tables with schemas: '\"catalog\".\"schema\".\"table\"' NOT '\"catalog.schema.table\"'.\n- Columns with capitals must be quoted.\n\n## Schema\n{schema_info}\n\n## Sample Data\n{sample}\n\n## Distinct Values\nstatus: {distinct_status}\n\n## Question\n{user_question}\n\nRespond with ONLY the SQL query.\"\"\"\n\n# 5. Generate SQL\nresponse = openai.chat.completions.create(\n    model=\"gpt-5\",\n    messages=[{\"role\": \"user\", \"content\": prompt}],\n    temperature=0\n)\nsql = response.choices[0].message.content.strip().removeprefix(\"```sql\").removesuffix(\"```\").strip()\n\n# 6. Execute — on failure, retry with error feedback (up to N retries)\nfor attempt in range(3):\n    try:\n        result = spice_client.query(sql)\n        break\n    except Exception as e:\n        sql = retry_with_error_feedback(prompt, sql, str(e))\n````\n\n## Troubleshooting\n\n| Error                                      | Cause                           | Fix                                                                    |\n| ------------------------------------------ | ------------------------------- | ---------------------------------------------------------------------- |\n| `column X must appear in GROUP BY`         | Non-aggregated column in SELECT | Add missing column to GROUP BY or wrap in aggregate                    |\n| `Cannot cast Utf8 to Timestamp`            | Implicit cast failed            | Use explicit `CAST('...' AS TIMESTAMP)` or `::TIMESTAMP`               |\n| `This feature is not implemented: LATERAL` | Unsupported syntax              | Rewrite with correlated subquery or CTE                                |\n| `No function matches regex_operator ~`     | Wrong regex syntax              | Use `regexp_like(col, pattern)`                                        |\n| `Table not found`                          | Wrong name or schema            | Check with `SHOW TABLES`. Use fully qualified `schema.table` if needed |\n| `Arrow error: Cast error`                  | Type mismatch in operation      | Check types with `arrow_typeof()`, add explicit CAST                   |\n| `JSON function not supported`              | Querying federated source       | Accelerate the dataset locally (`acceleration.enabled: true`)          |\n| `ai() function not found`                  | No model configured             | Add `models:` section to spicepod.yaml                                 |\n| `vector_search: no embedding column`       | No embeddings on column         | Add `embeddings:` to the column in spicepod.yaml                       |\n| `text_search: column not indexed`          | Full-text search not enabled    | Add `full_text_search: enabled: true` to column config                 |\n\n## Documentation\n\n- [Spice SQL Reference](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql)\n- [DataFusion SQL Reference](https:\u002F\u002Fdatafusion.apache.org\u002Fuser-guide\u002Fsql\u002Findex.html)\n- [Spice Data Types](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fdatatypes)\n- [AI Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fai)\n- [Search Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fsearch)\n- [JSON Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fjson)\n- [Scalar Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fscalar_functions)\n- [Aggregate Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Faggregate_functions)\n","# Text-to-SQL with Spice (Bring Your Own Model)\n\nGenerate accurate SQL for Spice.ai using your own LLM. This skill provides the schema introspection workflow, type reference, SQL dialect rules, and prompt template needed to produce correct queries on the first attempt — avoiding trial-and-error.\n\n## How It Works\n\n1. **Read `spicepod.yaml`** to know which datasets, models, embeddings, and features are configured\n2. Introspect the Spice catalog to discover tables, columns, and types\n3. Build a prompt containing schema, type info, and dialect rules\n4. Send the prompt to your LLM to generate SQL\n5. Execute the SQL — on failure, feed the error back and retry\n\n## Step 0 — Read the Spicepod Configuration\n\nBefore generating SQL, read the application's `spicepod.yaml` to understand what is available. This tells you:\n\n- **Which datasets exist** and their source connectors (determines what SQL features work)\n- **Whether models are configured** (`models:` section) — required for `ai()` function\n- **Whether embeddings are configured** (`embeddings:` section) — required for `vector_search()`\n- **Whether columns have `full_text_search` enabled** — required for `text_search()`\n- **Column-level `description` and `metadata`** — semantic hints that improve SQL generation\n- **Whether acceleration is enabled** — JSON functions only work on accelerated (Arrow) datasets\n\n> **Do NOT use `ai()`, `embed()`, `vector_search()`, `text_search()`, or `rrf()` unless you have confirmed they are configured in `spicepod.yaml`.** These functions require specific runtime configuration (models, embeddings, full-text indexes) and will fail at runtime if missing.\n\n### Example spicepod.yaml inspection\n\n```yaml\n# If you see this — ai() is available with model name \"main_model\"\nmodels:\n  - from: openai:gpt-5\n    name: main_model\n    params:\n      openai_api_key: ${ secrets:OPENAI_API_KEY }\n\n# If you see this — vector_search() is available using \"openai_embed\"\nembeddings:\n  - from: openai:text-embedding-3-small\n    name: openai_embed\n    params:\n      openai_api_key: ${ secrets:OPENAI_API_KEY }\n\ndatasets:\n  - from: postgres:public.reviews\n    name: reviews\n    columns:\n      - name: body\n        description: 'The full text of the customer review' # semantic hint for LLMs\n        embeddings:\n          - from: openai_embed # enables vector_search on this column\n        full_text_search:\n          enabled: true # enables text_search on this column\n    acceleration:\n      enabled: true # required for JSON functions\n```\n\n## Step 1 — Introspect Schema\n\nRun these queries against Spice to gather context for the prompt. This mirrors what Spice's own `\u002Fv1\u002Fnsql` endpoint does internally with its `table_schema`, `random_sample`, and `sample_distinct_columns` tools.\n\n### List all tables\n\n```sql\nSHOW TABLES;\n-- or\nSELECT table_catalog, table_schema, table_name, table_type\nFROM information_schema.tables\nWHERE table_schema NOT IN ('information_schema');\n```\n\n### Get columns and types for a table\n\nSpice's internal schema tool returns a markdown table with **Column, SQL Type, Arrow Type, Nullable, and Metadata** for each field. Replicate this by querying `information_schema.columns`:\n\n```sql\nSHOW COLUMNS FROM my_table;\n-- or\nSELECT column_name, data_type, is_nullable\nFROM information_schema.columns\nWHERE table_name = 'my_table';\n```\n\nIf your `spicepod.yaml` defines column `description` or `metadata`, include those in the prompt too — they provide semantic hints (e.g. \"The full text of the customer review\") that dramatically improve SQL accuracy.\n\n### Random sample (3–5 rows to show value shapes)\n\n> **Only sample from accelerated datasets or tables known to be small.** Sampling from large, non-accelerated federated sources (e.g. a full Snowflake table or S3 data lake) can be slow and expensive. Check `spicepod.yaml` for `acceleration.enabled: true` before sampling. For non-accelerated datasets, rely on schema + column descriptions alone.\n\n```sql\nSELECT * FROM my_table LIMIT 3;\n```\n\n### Distinct column values (shows cardinality and vocabulary)\n\nThis is a key trick from Spice's nsql implementation — for each column, sample a few distinct values so the LLM knows what values are possible.\n\n> **Same rule: only on accelerated or known-small tables.** `SELECT DISTINCT` can trigger a full table scan on non-accelerated federated sources.\n\n```sql\n-- Per-column distinct sampling (repeat for important columns)\nSELECT DISTINCT status FROM my_table LIMIT 3;\nSELECT DISTINCT region FROM my_table LIMIT 3;\nSELECT DISTINCT category FROM my_table LIMIT 3;\n```\n\nFor high-cardinality columns (IDs, timestamps, free text), skip distinct sampling — a random sample is sufficient.\n\n## Step 2 — Build the Prompt\n\nInclude the following sections in the system\u002Fcontext prompt sent to your LLM. A complete template is at the bottom of this file.\n\n### Required context to include\n\n| Section                 | What to include                                                              |\n| ----------------------- | ---------------------------------------------------------------------------- |\n| **Engine**              | \"Spice.ai uses Apache DataFusion with PostgreSQL dialect\"                    |\n| **Schema**              | Table names, column names, SQL type, Arrow type, nullability, metadata       |\n| **Column descriptions** | Semantic descriptions from spicepod.yaml `columns[].description`             |\n| **Sample rows**          | 3–5 random rows per accelerated\u002Fsmall table (skip for large federated sources) |\n| **Distinct values**      | 3 distinct values per low-cardinality column (accelerated\u002Fsmall tables only)   |\n| **Dialect rules**       | The gotchas and rules below                                                  |\n| **Available functions** | Only Spice-specific UDFs\u002FUDTFs confirmed in spicepod.yaml                    |\n\n## Step 3 — SQL Dialect Rules & Gotchas\n\nInclude these rules verbatim in your prompt. They prevent the most common text-to-SQL failures.\n\n### Data types\n\n- Spice uses **Apache Arrow types** internally. SQL types map as follows:\n  - `VARCHAR`, `TEXT`, `CHAR`, `STRING` → `Utf8` (Arrow)\n  - `INT` \u002F `INTEGER` → `Int32`, `BIGINT` → `Int64`\n  - `FLOAT` → `Float32`, `DOUBLE` → `Float64`\n  - `BOOLEAN` → `Boolean`\n  - `TIMESTAMP` → `Timestamp(Nanosecond, None)` — **nanosecond precision, no timezone**\n  - `DATE` → `Date32`\n  - `DECIMAL(p, s)` → `Decimal128` (p ≤ 38) or `Decimal256` (p > 38)\n- **No UUID, BLOB, CLOB, DATETIME, ENUM, SET, ARRAY (SQL), NVARCHAR types.** If source data has these, they are typically mapped to `Utf8` or `Binary`.\n- Use `arrow_typeof(expr)` to inspect the actual Arrow type of any expression.\n\n### Casting\n\n- Use `CAST(x AS type)` or the PostgreSQL shorthand `x::type`.\n- Cast timestamps explicitly when comparing: `WHERE created_at > '2024-01-01'::TIMESTAMP`.\n- When casting to `DECIMAL`, always specify precision and scale: `CAST(x AS DECIMAL(10,2))`.\n\n### Timestamps & dates\n\n- `now()` returns `Timestamp(Nanosecond)`.\n- Use `INTERVAL` for relative time: `now() - INTERVAL '7 days'`.\n- Extract parts with `date_part('year', ts)` or `extract(YEAR FROM ts)`.\n- `date_trunc('month', ts)` truncates to the start of the period.\n- **No `DATEADD` \u002F `DATEDIFF`** — use arithmetic with `INTERVAL` or `date_part`.\n- For Unix timestamps, use `to_unixtime(ts)` (returns seconds as Float64) or `to_timestamp(epoch_secs)`.\n- `to_timestamp_millis(ms)`, `to_timestamp_micros(us)`, `to_timestamp_nanos(ns)` for other precisions.\n\n### String functions\n\n- Use `||` for concatenation (not `CONCAT` with `+`). `concat(a, b)` and `concat_ws(sep, a, b)` also work.\n- `LIKE` is case-sensitive. For case-insensitive matching use `ILIKE` or `lower(col) LIKE lower(pattern)`.\n- **No `~` or `!~` regex operators.** Use `regexp_like(col, pattern)`, `regexp_match(col, pattern)`, `regexp_replace(col, pattern, replacement)`.\n- `length(s)` returns character count; `octet_length(s)` returns byte count.\n- `trim()`, `ltrim()`, `rtrim()`, `btrim()` for whitespace removal.\n- `split_part(string, delimiter, index)` — index is **1-based**.\n- `starts_with(s, prefix)`, `ends_with(s, suffix)` return boolean.\n\n### Aggregation & grouping\n\n- **Every non-aggregated column in SELECT must appear in GROUP BY** (no implicit grouping).\n- Use `FILTER (WHERE condition)` to conditionally aggregate: `count(*) FILTER (WHERE status = 'active')`.\n- `BOOL_AND(expr)` \u002F `BOOL_OR(expr)` for boolean aggregation.\n- `STRING_AGG(expr, delimiter)` to concatenate strings within groups.\n- `ARRAY_AGG(expr)` collects values into an array.\n\n### NULLs\n\n- Use `IS NULL` \u002F `IS NOT NULL` (never `= NULL`).\n- `COALESCE(a, b, ...)` returns the first non-NULL argument.\n- `NULLIF(a, b)` returns NULL if `a = b`.\n- NULL propagates through most operations — be explicit with `COALESCE` when needed.\n\n### Identifiers\n\n- Use **double quotes** for identifiers with special characters or reserved words: `\"order\"`, `\"group\"`.\n- String literals use **single quotes**: `'hello'`.\n- Spice dataset naming: `name: foo` → fully qualified as `spice.public.foo`. You can also just use `foo`.\n\n### Subqueries & CTEs\n\n- CTEs (`WITH ... AS`) are supported and preferred for readability.\n- Correlated subqueries in `WHERE` and `HAVING` are supported.\n- `EXISTS`, `IN`, `NOT IN`, `ANY`, `ALL` subquery operators work.\n\n### JOINs\n\n- Standard `INNER`, `LEFT`, `RIGHT`, `FULL OUTER`, `CROSS` joins are supported.\n- **No `LATERAL` joins** — use correlated subqueries or CTEs instead.\n- When joining datasets from different connectors (federated queries), Spice handles cross-source joins transparently.\n\n### Window functions\n\n- Supported: `ROW_NUMBER()`, `RANK()`, `DENSE_RANK()`, `LAG()`, `LEAD()`, `FIRST_VALUE()`, `LAST_VALUE()`, `NTH_VALUE()`, `NTILE()`.\n- All aggregate functions work with `OVER (PARTITION BY ... ORDER BY ...)`.\n- `QUALIFY` clause is supported for filtering window function results.\n\n### LIMIT & ordering\n\n- `LIMIT n` and `OFFSET n` are supported.\n- `ORDER BY` supports `ASC\u002FDESC` and `NULLS FIRST\u002FLAST`.\n\n### Unsupported SQL features\n\n- **No stored procedures, triggers, or user-defined functions via SQL.**\n- **No `CREATE INDEX`** — search indexes are configured in `spicepod.yaml`.\n- **No `UPDATE` or `DELETE`** — only `INSERT INTO` is supported for DML.\n- **No `MERGE` \u002F `UPSERT`.**\n- **No `PIVOT` \u002F `UNPIVOT`** — use `CASE WHEN` with aggregation instead.\n- **No `LATERAL` join.**\n\n## Spice-Specific Functions\n\nInclude relevant function signatures in your prompt **only when confirmed available** via `spicepod.yaml`.\n\n### AI functions (requires `models:` in spicepod.yaml)\n\n```sql\n-- Text generation — use the model name from spicepod.yaml\nSELECT ai('Summarize this: ' || content) AS summary FROM docs;\nSELECT ai('Classify: ' || text, 'gpt-5') AS label FROM reviews;\n\n-- Embeddings — requires `embeddings:` in spicepod.yaml\nSELECT embed('hello world', 'my_embed_model') AS vec;\n```\n\n### Search UDTFs (requires embeddings and\u002For full_text_search configured on dataset columns)\n\n```sql\n-- Vector (semantic) search — requires column with `embeddings:` config\nSELECT id, score FROM vector_search(my_table, 'search query')\nORDER BY score DESC LIMIT 10;\n\n-- Full-text (keyword) search — requires `full_text_search: enabled: true` on column\nSELECT id, score FROM text_search(my_table, 'keywords', body_column)\nORDER BY score DESC LIMIT 10;\n\n-- Hybrid search (Reciprocal Rank Fusion) — requires both above\nSELECT id, fused_score FROM rrf(\n  vector_search(my_table, 'semantic query'),\n  text_search(my_table, 'keyword query', content),\n  join_key => 'id'\n) ORDER BY fused_score DESC LIMIT 10;\n```\n\n### JSON functions\n\nSpice includes `datafusion-functions-json` for querying JSON stored as strings:\n\n```sql\n-- Extract values\nSELECT json_get_str(metadata, 'name') AS name FROM items;\nSELECT json_get_int(payload, 'count') AS cnt FROM events;\n\n-- Operators (-> returns json value, ->> returns text)\nSELECT metadata->>'color' AS color FROM products;\nSELECT metadata->'nested'->'key' FROM products;\n\n-- Check key existence\nSELECT * FROM items WHERE metadata ? 'status';\n-- or\nSELECT * FROM items WHERE json_contains(metadata, 'status');\n```\n\n> **Note:** JSON functions only work during DataFusion (Arrow) execution. They may not work on federated sources that do not accelerate locally.\n\n### Spark-compatible functions\n\nSpice includes `datafusion-functions-spark`: `array()`, `bit_get()`, `date_add()`, `like()`, `parse_url()`, and others following [Spark SQL semantics](https:\u002F\u002Fspark.apache.org\u002Fdocs\u002Flatest\u002Fapi\u002Fsql\u002Findex.html).\n\n## Error Recovery (Retry with Feedback)\n\nSpice's `\u002Fv1\u002Fnsql` endpoint retries up to 10 times when generated SQL fails. It feeds back the failed query and error message so the model avoids repeating the same mistake. Use the same pattern:\n\n```\nThe following SQL query failed. Fix it.\n\nsql: `SELECT * FROM \"spice.public.orders\" LIMIT 1`\nerror: `Error during planning: table 'spice.public.spice.public.orders' not found`\n\nDo not repeat the same mistake. Return only corrected SQL.\n```\n\nCommon mistakes the model makes (and the fix to include in retry context):\n\n- **Double-qualifying table names**: `\"catalog.schema.table\"` instead of `\"catalog\".\"schema\".\"table\"` — tables with schemas and catalogs use separate quoted identifiers\n- **Using unsupported syntax**: `LATERAL`, `~`, `DATEADD` — reference the dialect rules\n- **Wrong column names**: the model hallucinated a column — re-include the schema\n\n## Prompt Template\n\nUse this template when sending schema + question to your LLM. Replace placeholders with actual introspected data. Only include the search\u002FAI sections if confirmed in `spicepod.yaml`.\n\n```\nYou are a SQL expert. Generate a single SQL query for Apache DataFusion (PostgreSQL dialect) running in Spice.ai.\n\n## Rules\n- DataFusion SQL, PostgreSQL dialect. No MySQL or T-SQL syntax.\n- Use CAST(x AS type) or x::type for type conversion.\n- Timestamps are Timestamp(Nanosecond, None). Use INTERVAL for date math (e.g. now() - INTERVAL '7 days').\n- No DATEADD\u002FDATEDIFF. No ~ regex operator — use regexp_like(). LIKE is case-sensitive; use ILIKE for case-insensitive.\n- String concat: || or concat(). Split: split_part(s, delim, 1-based-index).\n- No UPDATE, DELETE, MERGE, PIVOT, LATERAL, stored procedures.\n- INSERT INTO is the only DML.\n- Every non-aggregated SELECT column must be in GROUP BY.\n- Use COALESCE for NULL-safe defaults. Use IS NULL, never = NULL.\n- Double-quote reserved-word identifiers. Single-quote string literals.\n- For tables with schemas and catalogs: '\"catalog\".\"schema\".\"table\"' NOT '\"catalog.schema.table\"'.\n- Columns with capitals must be quoted.\n- Window functions: ROW_NUMBER(), RANK(), LAG(), LEAD(), etc. with OVER().\n- QUALIFY clause is supported.\n- JSON: use ->> for text extraction, -> for nested access, json_get_str\u002Fint\u002Ffloat\u002Fbool for typed access.\n{%- if has_search %}\n- vector_search(table, 'query') for semantic search. text_search(table, 'query', column) for keyword search.\n- rrf(vector_search(...), text_search(...), join_key => 'id') for hybrid search.\n{%- endif %}\n{%- if has_ai %}\n- ai('prompt') or ai('prompt', 'model_name') for LLM text generation in SQL.\n{%- endif %}\n\n## Schema\n{schema}\n\n## Column Descriptions\n{column_descriptions}\n\n## Sample Data\n{sample_rows}\n\n## Distinct Values\n{distinct_values}\n\n{%- if failed_attempts %}\n## Previous Failed Attempts\nAvoid repeating these mistakes:\n{failed_attempts}\n{%- endif %}\n\n## Question\n{user_question}\n\nRespond with ONLY the SQL query. No explanation.\n```\n\n## Example Workflow\n\n````python\nimport openai\n\n# 0. Read spicepod.yaml to know what's configured (models, embeddings, search)\n#    This determines which functions are available in prompts.\n\n# 1. Introspect schema (via Spice SDK or Flight SQL)\nschema_info = spice_client.query(\"\"\"\n  SELECT table_name, column_name, data_type, is_nullable\n  FROM information_schema.columns\n  WHERE table_schema = 'public'\n\"\"\")\n\n# 2. Random sample (as Spice's nsql does internally)\nsample = spice_client.query(\"SELECT * FROM orders LIMIT 3\")\n\n# 3. Distinct values for key columns (as Spice's nsql does internally)\ndistinct_status = spice_client.query(\"SELECT DISTINCT status FROM orders LIMIT 3\")\n\n# 4. Build prompt with schema + sample + distinct values\nprompt = f\"\"\"You are a SQL expert. Generate a single SQL query for Apache DataFusion (PostgreSQL dialect) running in Spice.ai.\n\n## Rules\n- DataFusion SQL, PostgreSQL dialect.\n- Timestamps are Timestamp(Nanosecond, None). Use INTERVAL for date math.\n- No DATEADD\u002FDATEDIFF. Use regexp_like() not ~. LIKE is case-sensitive; use ILIKE for insensitive.\n- Every non-aggregated SELECT column must be in GROUP BY.\n- No UPDATE, DELETE, MERGE, PIVOT, LATERAL.\n- For tables with schemas: '\"catalog\".\"schema\".\"table\"' NOT '\"catalog.schema.table\"'.\n- Columns with capitals must be quoted.\n\n## Schema\n{schema_info}\n\n## Sample Data\n{sample}\n\n## Distinct Values\nstatus: {distinct_status}\n\n## Question\n{user_question}\n\nRespond with ONLY the SQL query.\"\"\"\n\n# 5. Generate SQL\nresponse = openai.chat.completions.create(\n    model=\"gpt-5\",\n    messages=[{\"role\": \"user\", \"content\": prompt}],\n    temperature=0\n)\nsql = response.choices[0].message.content.strip().removeprefix(\"```sql\").removesuffix(\"```\").strip()\n\n# 6. Execute — on failure, retry with error feedback (up to N retries)\nfor attempt in range(3):\n    try:\n        result = spice_client.query(sql)\n        break\n    except Exception as e:\n        sql = retry_with_error_feedback(prompt, sql, str(e))\n````\n\n## Troubleshooting\n\n| Error                                      | Cause                           | Fix                                                                    |\n| ------------------------------------------ | ------------------------------- | ---------------------------------------------------------------------- |\n| `column X must appear in GROUP BY`         | Non-aggregated column in SELECT | Add missing column to GROUP BY or wrap in aggregate                    |\n| `Cannot cast Utf8 to Timestamp`            | Implicit cast failed            | Use explicit `CAST('...' AS TIMESTAMP)` or `::TIMESTAMP`               |\n| `This feature is not implemented: LATERAL` | Unsupported syntax              | Rewrite with correlated subquery or CTE                                |\n| `No function matches regex_operator ~`     | Wrong regex syntax              | Use `regexp_like(col, pattern)`                                        |\n| `Table not found`                          | Wrong name or schema            | Check with `SHOW TABLES`. Use fully qualified `schema.table` if needed |\n| `Arrow error: Cast error`                  | Type mismatch in operation      | Check types with `arrow_typeof()`, add explicit CAST                   |\n| `JSON function not supported`              | Querying federated source       | Accelerate the dataset locally (`acceleration.enabled: true`)          |\n| `ai() function not found`                  | No model configured             | Add `models:` section to spicepod.yaml                                 |\n| `vector_search: no embedding column`       | No embeddings on column         | Add `embeddings:` to the column in spicepod.yaml                       |\n| `text_search: column not indexed`          | Full-text search not enabled    | Add `full_text_search: enabled: true` to column config                 |\n\n## Documentation\n\n- [Spice SQL Reference](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql)\n- [DataFusion SQL Reference](https:\u002F\u002Fdatafusion.apache.org\u002Fuser-guide\u002Fsql\u002Findex.html)\n- [Spice Data Types](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fdatatypes)\n- [AI Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fai)\n- [Search Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fsearch)\n- [JSON Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fjson)\n- [Scalar Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Fscalar_functions)\n- [Aggregate Functions](https:\u002F\u002Fspiceai.org\u002Fdocs\u002Freference\u002Fsql\u002Faggregate_functions)\n",{"name":5,"description":7},"main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Fspiceai__skills__skills__spice-text-to-sql","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add shenyimings\u002Fskillet --skill spice-text-to-sql",{"tool":38,"command":39},"bunx","bunx skills add shenyimings\u002Fskillet --skill spice-text-to-sql",{"tool":41,"command":42},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill spice-text-to-sql","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Fspiceai__skills__skills__spice-text-to-sql\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"evals\u002Fevals.json","REFERENCE","参考文档",3409,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Fspiceai__skills__skills__spice-text-to-sql\u002Fevals\u002Fevals.json",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]