aiskillstore/marketplace / skills/0xdarkmatter/sql-patterns
sql-patterns
VerifiedQuick reference for common SQL patterns, CTEs, window functions, and indexing strategies. Triggers on: sql patterns, cte example, window functions, sql join, index strategy, pagination sql.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.5 KB |
| references/indexing-strategies.md | markdown | 7.0 KB |
| references/window-functions.md | markdown | 6.9 KB |
| skill-report.json | config | 40.5 KB |
skill-report.json
View on GitHub{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-07-06T00:44:04.123Z",
"slug": "0xdarkmatter-sql-patterns",
"source_url": "https://github.com/0xDarkMatter/claude-mods/tree/main/skills/sql-patterns",
"source_ref": "main",
"model": "codex",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "6a742fdb475af5a695755a30d1dae025d9cb1c726fa4c862cf5a220fbc6ded8a",
"tree_hash": "8bffd5d004d74203fc16475c7a7a628e081ac6c21ea176eaf472ee59984483f8",
"provenance": {
"model_requested": "gpt-5.5:high",
"model_effective": "codex:gpt-5.5:high",
"fallback_chain": [
{
"agent": "codex",
"model": "gpt-5.5",
"effort": "high",
"outcome": "success"
}
],
"analysis_version": "3.0.0"
}
},
"skill": {
"name": "sql-patterns",
"description": "Quick SQL reference for CTEs, joins, pagination, window functions, and indexing strategies, with concise examples for query design and review.",
"summary": "Find practical SQL patterns for analytical queries, pagination, joins, and index design.",
"icon": "📦",
"version": "1.0.0",
"author": "0xDarkMatter",
"license": "MIT",
"tags": [
"sql",
"query-optimization",
"window-functions",
"indexing",
"database-design"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": [
"external_commands"
],
"category": "data"
},
"security_audit": {
"risk_level": "low",
"is_blocked": false,
"safe_to_publish": true,
"analysis_status": "ok",
"summary": "All static command-execution and reconnaissance alerts were false positives from Markdown SQL examples, inline SQL function names, and database indexing terminology. I found no prompt-injection text, data-exfiltration intent, or real shell execution. The only semantic issue is overbroad Write permission in SKILL.md for a read-only SQL reference skill.",
"remediation": [
{
"issue": "The skill grants Write tool access even though it is a read-only SQL reference.",
"suggestion": "Change allowed-tools to Read unless a documented editing workflow is added.",
"severity": "low"
}
],
"risk_factor_evidence": [
{
"factor": "external_commands",
"evidence": [
{
"file": "SKILL.md",
"line_start": 13,
"line_end": 20
},
{
"file": "SKILL.md",
"line_start": 20,
"line_end": 24
},
{
"file": "SKILL.md",
"line_start": 24,
"line_end": 36
},
{
"file": "SKILL.md",
"line_start": 36,
"line_end": 42
},
{
"file": "SKILL.md",
"line_start": 42,
"line_end": 43
},
{
"file": "SKILL.md",
"line_start": 43,
"line_end": 44
},
{
"file": "SKILL.md",
"line_start": 44,
"line_end": 45
},
{
"file": "SKILL.md",
"line_start": 45,
"line_end": 46
},
{
"file": "SKILL.md",
"line_start": 46,
"line_end": 47
},
{
"file": "SKILL.md",
"line_start": 47,
"line_end": 48
},
{
"file": "SKILL.md",
"line_start": 48,
"line_end": 50
},
{
"file": "SKILL.md",
"line_start": 50,
"line_end": 57
},
{
"file": "SKILL.md",
"line_start": 57,
"line_end": 63
},
{
"file": "SKILL.md",
"line_start": 63,
"line_end": 64
},
{
"file": "SKILL.md",
"line_start": 64,
"line_end": 65
},
{
"file": "SKILL.md",
"line_start": 65,
"line_end": 66
},
{
"file": "SKILL.md",
"line_start": 66,
"line_end": 70
},
{
"file": "SKILL.md",
"line_start": 70,
"line_end": 76
},
{
"file": "SKILL.md",
"line_start": 76,
"line_end": 91
},
{
"file": "SKILL.md",
"line_start": 91,
"line_end": 92
},
{
"file": "SKILL.md",
"line_start": 92,
"line_end": 92
},
{
"file": "SKILL.md",
"line_start": 93,
"line_end": 93
},
{
"file": "SKILL.md",
"line_start": 99,
"line_end": 100
}
]
}
],
"static_findings": [
{
"id": "blocker:references/indexing-strategies.md:82:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 82,
"line_end": 82,
"snippet": "WHERE user_id = 123 -- ✓"
},
{
"id": "blocker:references/indexing-strategies.md:83:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 83,
"line_end": 83,
"snippet": "WHERE user_id = 123 AND status = 'pending' -- ✓"
},
{
"id": "blocker:references/indexing-strategies.md:84:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 84,
"line_end": 84,
"snippet": "WHERE user_id = 123 AND status = 'pending' AND created_at > '2024-01-01' -- ✓"
},
{
"id": "blocker:references/indexing-strategies.md:85:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 85,
"line_end": 85,
"snippet": "WHERE user_id = 123 AND created_at > '2024-01-01' -- Partial (user_id only)"
},
{
"id": "blocker:references/indexing-strategies.md:86:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 86,
"line_end": 86,
"snippet": "WHERE status = 'pending' -- ✗ (user_id not present)"
},
{
"id": "blocker:references/indexing-strategies.md:96:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 96,
"line_end": 96,
"snippet": "-- If status has few values, but user_id is selective:"
},
{
"id": "blocker:references/indexing-strategies.md:102:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 102,
"line_end": 102,
"snippet": "Include columns to avoid table lookup:"
},
{
"id": "blocker:references/indexing-strategies.md:233:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 233,
"line_end": 233,
"snippet": "SELECT * FROM orders WHERE user_id = 123 AND status != 'pending'"
},
{
"id": "blocker:references/indexing-strategies.md:292:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/indexing-strategies.md",
"line_start": 292,
"line_end": 292,
"snippet": "| Avoid table access | Covering index with INCLUDE |"
},
{
"id": "blocker:references/window-functions.md:286:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/window-functions.md",
"line_start": 286,
"line_end": 286,
"snippet": "PARTITION BY user_id ORDER BY timestamp"
},
{
"id": "blocker:references/window-functions.md:294:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/window-functions.md",
"line_start": 294,
"line_end": 294,
"snippet": "PARTITION BY user_id ORDER BY timestamp"
},
{
"id": "blocker:references/window-functions.md:295:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/window-functions.md",
"line_start": 295,
"line_end": 296,
"snippet": ") as session_id"
},
{
"id": "blocker:references/window-functions.md:306:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/window-functions.md",
"line_start": 306,
"line_end": 307,
"snippet": "PARTITION BY user_id"
},
{
"id": "blocker:references/window-functions.md:319:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/window-functions.md",
"line_start": 319,
"line_end": 319,
"snippet": "4. **Avoid nested windows** - Use CTEs instead"
},
{
"id": "external_commands:SKILL.md:13:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 13,
"line_end": 20,
"snippet": "```sql"
},
{
"id": "external_commands:SKILL.md:20:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 20,
"line_end": 24,
"snippet": "```"
},
{
"id": "external_commands:SKILL.md:24:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 24,
"line_end": 36,
"snippet": "```sql"
},
{
"id": "external_commands:SKILL.md:36:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 36,
"line_end": 42,
"snippet": "```"
},
{
"id": "external_commands:SKILL.md:42:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 42,
"line_end": 43,
"snippet": "| `ROW_NUMBER()` | Unique sequential numbering |"
},
{
"id": "external_commands:SKILL.md:43:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 43,
"line_end": 44,
"snippet": "| `RANK()` | Rank with gaps (1, 2, 2, 4) |"
},
{
"id": "external_commands:SKILL.md:44:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 44,
"line_end": 45,
"snippet": "| `DENSE_RANK()` | Rank without gaps (1, 2, 2, 3) |"
},
{
"id": "external_commands:SKILL.md:45:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 45,
"line_end": 46,
"snippet": "| `LAG(col, n)` | Previous row value |"
},
{
"id": "external_commands:SKILL.md:46:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 46,
"line_end": 47,
"snippet": "| `LEAD(col, n)` | Next row value |"
},
{
"id": "external_commands:SKILL.md:47:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 47,
"line_end": 48,
"snippet": "| `SUM() OVER` | Running total |"
},
{
"id": "external_commands:SKILL.md:48:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 48,
"line_end": 50,
"snippet": "| `AVG() OVER` | Moving average |"
},
{
"id": "external_commands:SKILL.md:50:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 50,
"line_end": 57,
"snippet": "```sql"
},
{
"id": "external_commands:SKILL.md:57:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 57,
"line_end": 63,
"snippet": "```"
},
{
"id": "external_commands:SKILL.md:63:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 63,
"line_end": 64,
"snippet": "| `INNER JOIN` | Only matching rows |"
},
{
"id": "external_commands:SKILL.md:64:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 64,
"line_end": 65,
"snippet": "| `LEFT JOIN` | All left + matching right |"
},
{
"id": "external_commands:SKILL.md:65:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 65,
"line_end": 66,
"snippet": "| `RIGHT JOIN` | All right + matching left |"
},
{
"id": "external_commands:SKILL.md:66:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 66,
"line_end": 70,
"snippet": "| `FULL JOIN` | All rows, NULL where no match |"
},
{
"id": "external_commands:SKILL.md:70:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 70,
"line_end": 76,
"snippet": "```sql"
},
{
"id": "external_commands:SKILL.md:76:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 76,
"line_end": 91,
"snippet": "```"
},
{
"id": "external_commands:SKILL.md:91:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 91,
"line_end": 92,
"snippet": "| `SELECT *` | List columns explicitly |"
},
{
"id": "external_commands:SKILL.md:92:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 92,
"line_end": 92,
"snippet": "| `WHERE YEAR(date) = 2024` | `WHERE date >= '2024-01-01'` |"
},
{
"id": "external_commands:SKILL.md:93:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 93,
"line_end": 93,
"snippet": "| `NOT IN` with NULLs | Use `NOT EXISTS` |"
},
{
"id": "external_commands:SKILL.md:99:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 99,
"line_end": 100,
"snippet": "- `./references/window-functions.md` - Complete window function patterns"
},
{
"id": "blocker:SKILL.md:31:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "SKILL.md",
"line_start": 31,
"line_end": 32,
"snippet": "FROM orders GROUP BY user_id"
},
{
"id": "blocker:SKILL.md:35:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "SKILL.md",
"line_start": 35,
"line_end": 35,
"snippet": "LEFT JOIN user_orders o ON u.id = o.user_id;"
},
{
"id": "blocker:SKILL.md:72:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "SKILL.md",
"line_start": 72,
"line_end": 72,
"snippet": "SELECT * FROM products ORDER BY id LIMIT 20 OFFSET 40;"
},
{
"id": "blocker:SKILL.md:75:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "SKILL.md",
"line_start": 75,
"line_end": 75,
"snippet": "SELECT * FROM products WHERE id > 42 ORDER BY id LIMIT 20;"
},
{
"id": "blocker:SKILL.md:85:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "SKILL.md",
"line_start": 85,
"line_end": 85,
"snippet": "| Covering | Avoid table lookup |"
}
],
"finding_verdicts": [
{
"id": "blocker:references/indexing-strategies.md:82:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:references/indexing-strategies.md:83:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:references/indexing-strategies.md:84:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:references/indexing-strategies.md:85:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:references/indexing-strategies.md:86:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:references/indexing-strategies.md:96:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:references/indexing-strategies.md:102:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "The phrase describes database table lookup or table access in indexing documentation. It does not instruct system enumeration or reconnaissance."
},
{
"id": "blocker:references/indexing-strategies.md:233:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:references/indexing-strategies.md:292:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "The phrase describes database table lookup or table access in indexing documentation. It does not instruct system enumeration or reconnaissance."
},
{
"id": "blocker:references/window-functions.md:286:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is SQL documentation for window functions using user_id as an example partition key. It is not host or network system reconnaissance."
},
{
"id": "blocker:references/window-functions.md:294:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is SQL documentation for window functions using user_id as an example partition key. It is not host or network system reconnaissance."
},
{
"id": "blocker:references/window-functions.md:295:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is SQL documentation for window functions using user_id as an example partition key. It is not host or network system reconnaissance."
},
{
"id": "blocker:references/window-functions.md:306:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is SQL documentation for window functions using user_id as an example partition key. It is not host or network system reconnaissance."
},
{
"id": "blocker:references/window-functions.md:319:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is SQL documentation for window functions using user_id as an example partition key. It is not host or network system reconnaissance."
},
{
"id": "external_commands:SKILL.md:13:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:20:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:24:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:36:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:42:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:43:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:44:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:45:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:46:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:47:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:48:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:50:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:57:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:63:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:64:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:65:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:66:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:70:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:76:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a Markdown SQL code fence delimiter, not Ruby backtick execution. The surrounding SKILL.md content is SQL reference text with no shell command invocation."
},
{
"id": "external_commands:SKILL.md:91:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:92:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:93:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line uses inline Markdown code formatting for SQL functions or query terms. It does not execute Ruby, shell, or any external command."
},
{
"id": "external_commands:SKILL.md:99:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This line lists a local Markdown reference file for the skill to read. It is not a shell command or dynamic command execution path."
},
{
"id": "blocker:SKILL.md:31:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:SKILL.md:35:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:SKILL.md:72:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:SKILL.md:75:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "This is a static SQL query example using sample user_id and table names. It does not inspect the host, filesystem, network, or environment."
},
{
"id": "blocker:SKILL.md:85:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "This is an index quick-reference row explaining covering indexes. The phrase table lookup is database terminology, not system reconnaissance."
}
],
"semantic_findings": [
{
"title": "Unnecessary Write Tool Permission",
"description": "SKILL.md declares allowed-tools: Read Write, but the skill content only provides SQL reference material and asks users to load Markdown references. This grants file write capability without a demonstrated need.",
"severity": "low",
"locations": [
{
"file": "SKILL.md",
"line_start": 4,
"line_end": 4
}
],
"confidence": 0.86,
"confidence_reasoning": "The frontmatter explicitly includes Write, while the reviewed SKILL.md content is read-only reference documentation with no editing workflow."
}
],
"critical_findings": [],
"high_findings": [],
"medium_findings": [],
"low_findings": [
{
"title": "Unnecessary Write Tool Permission",
"description": "SKILL.md declares allowed-tools: Read Write, but the skill content only provides SQL reference material and asks users to load Markdown references. This grants file write capability without a demonstrated need.",
"locations": [
{
"file": "SKILL.md",
"line_start": 4,
"line_end": 4
}
],
"review_kind": "security",
"source_category": "semantic",
"source_severity": "low",
"confidence": 0.86,
"confidence_reasoning": "The frontmatter explicitly includes Write, while the reviewed SKILL.md content is read-only reference documentation with no editing workflow."
}
],
"dangerous_patterns": [],
"files_scanned": 3,
"total_lines": 733,
"audit_model": "codex",
"audited_at": "2026-07-06T00:44:04.123Z",
"agent_auto_install_policy": "allowed",
"manual_install_policy": "allowed"
},
"content": {
"user_title": "Apply Practical SQL Query Patterns",
"value_statement": "SQL teams often need reliable examples for common query patterns and performance decisions. This skill provides concise references for CTEs, window functions, joins, pagination, and indexes.",
"seo_keywords": [
"Claude",
"Codex",
"Claude Code",
"SQL patterns",
"CTE examples",
"window functions",
"SQL joins",
"indexing strategies",
"pagination SQL",
"query optimization"
],
"actual_capabilities": [
"Shows CTE examples, including chained CTEs for staged aggregation.",
"Summarizes core window functions such as ROW_NUMBER, LAG, LEAD, SUM OVER, and AVG OVER.",
"Compares common JOIN types and when their row sets differ.",
"Provides offset and keyset pagination examples for product queries.",
"Explains B-tree, hash, GIN, GiST, composite, covering, partial, and expression indexes.",
"Lists common SQL anti-patterns with safer query alternatives."
],
"limitations": [
"It does not connect to databases or inspect live schemas.",
"Examples are generic and may need syntax changes for each SQL engine.",
"It does not benchmark query plans or measure production performance.",
"It does not validate security controls such as row-level access policies."
],
"use_cases": [
{
"title": "Design analytical queries",
"description": "Build rankings, running totals, session detection, and deduplication with window function examples.",
"target_user": "Data analysts"
},
{
"title": "Review application SQL",
"description": "Compare joins, pagination choices, and anti-pattern fixes during code review.",
"target_user": "Backend developers"
},
{
"title": "Plan index changes",
"description": "Choose index types and column order before proposing database migrations.",
"target_user": "Database engineers"
}
],
"prompt_templates": [
{
"title": "Find a basic pattern",
"scenario": "Beginner",
"prompt": "Use the sql-patterns skill to show a simple CTE pattern for filtering active users. Explain when to use it."
},
{
"title": "Compare query choices",
"scenario": "Intermediate",
"prompt": "Use the sql-patterns skill to compare offset pagination and keyset pagination for a product list."
},
{
"title": "Improve an analytical query",
"scenario": "Advanced",
"prompt": "Use the sql-patterns skill to suggest window function patterns for ranking, running totals, and deduplication in a sales report."
},
{
"title": "Plan indexing strategy",
"scenario": "Expert",
"prompt": "Use the sql-patterns skill to review a query with filters, sorting, and joins. Recommend index types and column order."
}
],
"output_examples": [
{
"input": "I need the latest order per user without duplicate rows.",
"output": "A response explains row-number deduplication, partitioning by user, sorting by update time, and filtering to the first row."
},
{
"input": "My product list uses high offset pagination and is slow.",
"output": "A response compares offset pagination with keyset pagination and recommends a stable sort column for large result sets."
},
{
"input": "Which index helps filters on status and created date?",
"output": "A response discusses selectivity, equality filters, range filters, and composite index column order."
}
],
"best_practices": [
"Share the database engine and version before asking for syntax guidance.",
"Include table sizes, filter columns, sort columns, and join keys when requesting index advice.",
"Ask for tradeoffs when choosing between readability, portability, and performance."
],
"anti_patterns": [
"Treating the examples as production-ready without adapting names, types, and constraints.",
"Requesting index advice without sharing the query shape or expected cardinality.",
"Using SELECT star in examples that need stable, reviewed column lists."
],
"faq": [
{
"question": "Does this skill run SQL queries?",
"answer": "No. It provides reference patterns and explanations. It does not connect to a database."
},
{
"question": "Which SQL engines are covered?",
"answer": "The examples focus on common SQL concepts and include PostgreSQL-style indexing notes."
},
{
"question": "Can it help with performance reviews?",
"answer": "Yes. It can point to indexing, pagination, and anti-pattern checks for human review."
},
{
"question": "Can it replace a database expert?",
"answer": "No. It supports analysis but cannot inspect workload, data distribution, or production constraints."
},
{
"question": "Does it include window function examples?",
"answer": "Yes. It covers ranking, navigation functions, running totals, session detection, and deduplication."
},
{
"question": "Can Claude Code or Codex use it in repositories?",
"answer": "Yes. Claude Code and Codex can use the references while reviewing SQL files."
}
]
},
"file_structure": [
{
"name": "references",
"type": "dir",
"path": "references",
"children": [
{
"name": "indexing-strategies.md",
"type": "file",
"path": "references/indexing-strategies.md",
"lines": 298
},
{
"name": "window-functions.md",
"type": "file",
"path": "references/window-functions.md",
"lines": 334
}
]
},
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 101
}
]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |