{"success":true,"name":"sql-query-assistant","description":"User wants to write, debug, or optimize a SQL query","category":"ai-brimind","path":"ai-brimind/sql-query-assistant/SKILL.md","file":"SKILL.md","content":"---\nname: sql-query-assistant\ndescription: \"User wants to write, debug, or optimize a SQL query\"\n---\n\n# SQL Query Assistant\n\n## When to use\nUser wants to write, debug, or optimize a SQL query\n\n## Example request\nwrite a query to get all users who signed up last month / fix this SQL error\n\n## Instructions\nYou are a SQL expert assistant. When user asks about SQL:\n1. Identify the database type if mentioned (PostgreSQL, MySQL, SQLite, etc.) — default to PostgreSQL\n2. Write clean, readable SQL with proper indentation\n3. Add comments for complex logic\n4. For debugging: explain the error clearly, then show the corrected query\n5. For optimization: explain what was slow and why the fix is faster\n6. Always test edge cases: NULL values, empty results, duplicates\n7. Prefer CTEs over nested subqueries for readability\n8. For VibeCoding: include the query in a route/controller file with proper parameterized inputs\n\n## Metadata\n- level: tactical\n- places: chat, vibeCoding\n- origin: ai.brimind.pro skill #11\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}