skills_all/sql-research/SKILL.md
Guide for researching SQL syntax and behavior for database backends. Use when you need to research how a SQL function, command, or feature works in a specific database before implementing it in dbplyr.
npx skillsauth add activer007/ordinary-claude-skills sql-researchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when researching SQL syntax and behavior for any database backend before implementing translations or features in dbplyr.
SQL correctness is paramount in dbplyr. You MUST complete research and documentation BEFORE implementing any SQL-related code.
Use WebSearch to find official documentation for "{dialect} {function/command}":
Create research/{dialect}-{command}.md with the following structure:
# {Dialect} - {Function/Command}
## Summary
[1-2 sentence summary focused on R-to-SQL translation]
## Syntax
[Minimal syntax examples from official sources]
## Key behaviors
[Only behaviors that matter for dbplyr translation]
## Limitations
[Only restrictions that affect dbplyr usage]
## Sources
- [Source name](URL)
- [Source name](URL)
Documentation guidelines:
Cross-reference multiple sources when:
Best practices:
Only after completing research and documentation should you:
# PostgreSQL - POSITION
## Summary
Returns the starting position of a substring within a string (1-indexed).
## Syntax
POSITION(substring IN string)
## Key behaviors
- Returns integer position (1-indexed)
- Returns 0 if substring not found
- Case-sensitive by default
- NULL if any argument is NULL
## Sources
- [PostgreSQL String Functions](https://www.postgresql.org/docs/current/functions-string.html)
# SQL Server - STRING_AGG
## Summary
Concatenates string values with a specified separator, optionally ordering results.
## Syntax
STRING_AGG(expression, separator) [WITHIN GROUP (ORDER BY order_expression)]
## Key behaviors
- Available in SQL Server 2017+ (compatibility level 110+)
- Returns NULL for empty groups
- Separator must be a literal or variable, not an expression
- WITHIN GROUP clause is optional but commonly used for deterministic ordering
- Maximum output length is 2GB
## Limitations
- Not available in SQL Server 2016 or earlier
- Cannot use with DISTINCT (use subquery instead)
- Separator cannot be a computed expression
## Sources
- [SQL Server STRING_AGG](https://docs.microsoft.com/en-us/sql/t-sql/functions/string-agg-transact-sql)
- [Compatibility requirements](https://docs.microsoft.com/en-us/sql/t-sql/functions/string-agg-transact-sql#compatibility-support)
Before completing SQL research:
research/{dialect}-{function}.mdtools
Generate typed TypeScript SDKs for AI agents to interact with MCP servers. Converts verbose JSON-RPC curl commands to clean function calls (docs.createDocument() vs curl). Auto-detects MCP tools from server modules, generates TypeScript types and client methods, creates runnable example scripts. Use when: building MCP-enabled applications, need typed programmatic access to MCP tools, want Claude Code to manage apps via scripts, eliminating manual JSON-RPC curl commands, validating MCP inputs/outputs, or creating reusable agent automation.
testing
Generate structured task lists from specs or requirements. IMPORTANT: After completing ANY spec via ExitSpecMode, ALWAYS ask the user: "Would you like me to generate a task list for this spec?" Use when user confirms or explicitly requests task generation from a plan/spec/PRD.
tools
Create compelling story-format summaries using UltraThink to find the best narrative framing. Support multiple formats - 3-part narrative, n-length with inline links, abridged 5-line, or comprehensive via Foundry MCP. USE WHEN user says 'create story explanation', 'narrative summary', 'explain as a story', or wants content in Daniel's conversational first-person voice.
testing
Navigate through the original three-world shamanic technology. Deploy when soul retrieval, power animal guidance, or journey between realms emerges. Deeply respectful of Tungus, Buryat, Yakut, Evenki traditions. Use for consciousness navigation, NOT cultural appropriation.