aiskillstore/marketplace / skills/0xdarkmatter/structural-search
structural-search
VerifiedSearch code by AST structure using ast-grep. Find semantic patterns like function calls, imports, class definitions instead of text patterns. Triggers on: find all calls to X, search for pattern, refactor usages, find where function is used, structural search, ast-grep, sg.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.1 KB |
| assets/rule-template.yaml | config | 736 B |
| references/advanced-usage.md | markdown | 4.3 KB |
| references/go-rust-patterns.md | markdown | 3.2 KB |
| references/js-ts-patterns.md | markdown | 2.4 KB |
| references/python-patterns.md | markdown | 2.3 KB |
| references/security-patterns.md | markdown | 3.1 KB |
| scripts/.gitkeep | other | 0 B |
| skill-report.json | config | 53.8 KB |
skill-report.json
View on GitHub{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-07-12T09:30:53.712Z",
"slug": "0xdarkmatter-structural-search",
"source_url": "https://github.com/0xDarkMatter/claude-mods/tree/main/skills/structural-search",
"source_ref": "main",
"model": "codex",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "d38682316d95f34bedbc7673a259af50a6bc01fb0115e0cc79d8f167c8b7fc34",
"tree_hash": "5a1364b01131399301b7a928f12d527f3df8f22e52bf059ce2c1c894252ba106",
"provenance": {
"model_effective": "codex",
"fallback_chain": [
{
"agent": "codex",
"outcome": "success"
}
],
"analysis_version": "3.0.0"
}
},
"skill": {
"name": "structural-search",
"description": "Search and refactor code by AST structure with ast-grep patterns for JavaScript, TypeScript, Python, Go, and Rust.",
"summary": "Find semantic code patterns and prepare precise refactors with ast-grep.",
"icon": "📦",
"version": "1.0.2",
"author": "0xDarkMatter",
"license": "MIT",
"category": "coding",
"tags": [
"ast-grep",
"structural-search",
"code-search",
"refactoring",
"static-analysis"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": [
"network",
"external_commands",
"scripts",
"env_access"
]
},
"security_audit": {
"risk_level": "safe",
"is_blocked": false,
"safe_to_publish": true,
"analysis_status": "ok",
"summary": "All 57 static findings are false positives caused by documented ast-grep search patterns, Markdown formatting, or fixed command examples. No executable skill scripts, credential access, malicious network behavior, prompt injection, or unsafe deserialization implementation was found.",
"remediation": [],
"risk_factor_evidence": [
{
"factor": "network",
"evidence": [
{
"file": "assets/rule-template.yaml",
"line_start": 36,
"line_end": 36
},
{
"file": "references/advanced-usage.md",
"line_start": 31,
"line_end": 31
},
{
"file": "references/advanced-usage.md",
"line_start": 119,
"line_end": 119
},
{
"file": "references/js-ts-patterns.md",
"line_start": 15,
"line_end": 15
},
{
"file": "references/js-ts-patterns.md",
"line_start": 18,
"line_end": 18
}
]
},
{
"factor": "external_commands",
"evidence": [
{
"file": "references/advanced-usage.md",
"line_start": 212,
"line_end": 212
},
{
"file": "references/advanced-usage.md",
"line_start": 34,
"line_end": 34
},
{
"file": "references/advanced-usage.md",
"line_start": 37,
"line_end": 37
},
{
"file": "references/advanced-usage.md",
"line_start": 40,
"line_end": 40
},
{
"file": "references/advanced-usage.md",
"line_start": 43,
"line_end": 43
},
{
"file": "references/advanced-usage.md",
"line_start": 239,
"line_end": 239
},
{
"file": "references/go-rust-patterns.md",
"line_start": 171,
"line_end": 171
},
{
"file": "references/security-patterns.md",
"line_start": 76,
"line_end": 76
},
{
"file": "references/security-patterns.md",
"line_start": 79,
"line_end": 79
},
{
"file": "references/security-patterns.md",
"line_start": 69,
"line_end": 69
},
{
"file": "references/security-patterns.md",
"line_start": 77,
"line_end": 77
},
{
"file": "references/security-patterns.md",
"line_start": 78,
"line_end": 78
},
{
"file": "references/security-patterns.md",
"line_start": 74,
"line_end": 74
},
{
"file": "references/security-patterns.md",
"line_start": 71,
"line_end": 71
},
{
"file": "references/security-patterns.md",
"line_start": 13,
"line_end": 18
},
{
"file": "SKILL.md",
"line_start": 19,
"line_end": 19
},
{
"file": "SKILL.md",
"line_start": 25,
"line_end": 25
},
{
"file": "SKILL.md",
"line_start": 26,
"line_end": 26
},
{
"file": "SKILL.md",
"line_start": 27,
"line_end": 27
},
{
"file": "SKILL.md",
"line_start": 31,
"line_end": 68
},
{
"file": "SKILL.md",
"line_start": 68,
"line_end": 74
},
{
"file": "SKILL.md",
"line_start": 74,
"line_end": 75
},
{
"file": "SKILL.md",
"line_start": 75,
"line_end": 76
},
{
"file": "SKILL.md",
"line_start": 76,
"line_end": 77
},
{
"file": "SKILL.md",
"line_start": 77,
"line_end": 78
},
{
"file": "SKILL.md",
"line_start": 78,
"line_end": 79
},
{
"file": "SKILL.md",
"line_start": 79,
"line_end": 80
},
{
"file": "SKILL.md",
"line_start": 80,
"line_end": 81
},
{
"file": "SKILL.md",
"line_start": 81,
"line_end": 82
},
{
"file": "SKILL.md",
"line_start": 82,
"line_end": 96
},
{
"file": "SKILL.md",
"line_start": 96,
"line_end": 97
},
{
"file": "SKILL.md",
"line_start": 97,
"line_end": 98
},
{
"file": "SKILL.md",
"line_start": 98,
"line_end": 99
},
{
"file": "SKILL.md",
"line_start": 99,
"line_end": 100
},
{
"file": "SKILL.md",
"line_start": 100,
"line_end": 101
}
]
},
{
"factor": "scripts",
"evidence": [
{
"file": "references/js-ts-patterns.md",
"line_start": 62,
"line_end": 62
},
{
"file": "references/js-ts-patterns.md",
"line_start": 65,
"line_end": 65
},
{
"file": "references/security-patterns.md",
"line_start": 30,
"line_end": 30
},
{
"file": "references/security-patterns.md",
"line_start": 155,
"line_end": 155
},
{
"file": "references/security-patterns.md",
"line_start": 33,
"line_end": 33
},
{
"file": "references/security-patterns.md",
"line_start": 24,
"line_end": 24
},
{
"file": "references/security-patterns.md",
"line_start": 155,
"line_end": 155
},
{
"file": "references/security-patterns.md",
"line_start": 36,
"line_end": 36
},
{
"file": "references/security-patterns.md",
"line_start": 39,
"line_end": 39
},
{
"file": "references/security-patterns.md",
"line_start": 69,
"line_end": 69
},
{
"file": "references/security-patterns.md",
"line_start": 77,
"line_end": 77
},
{
"file": "SKILL.md",
"line_start": 57,
"line_end": 57
},
{
"file": "SKILL.md",
"line_start": 58,
"line_end": 58
}
]
},
{
"factor": "env_access",
"evidence": [
{
"file": "references/security-patterns.md",
"line_start": 52,
"line_end": 52
},
{
"file": "references/security-patterns.md",
"line_start": 53,
"line_end": 53
}
]
}
],
"static_findings": [
{
"id": "network:assets/rule-template.yaml:36:hardcoded-url",
"category": "network",
"severity": "low",
"pattern": "Hardcoded URL",
"file": "assets/rule-template.yaml",
"line_start": 36,
"line_end": 36,
"snippet": "# - https://example.com/docs"
},
{
"id": "external_commands:references/advanced-usage.md:212:shell-command-substitution",
"category": "external_commands",
"severity": "medium",
"pattern": "Shell command substitution",
"file": "references/advanced-usage.md",
"line_start": 212,
"line_end": 212,
"snippet": "if [ $(jq '.diagnostics | length' ast-grep-results.json) -gt 0 ]; then"
},
{
"id": "external_commands:references/advanced-usage.md:34:xargs-command-can-execute-arbitrary-commands",
"category": "external_commands",
"severity": "medium",
"pattern": "xargs command (can execute arbitrary commands)",
"file": "references/advanced-usage.md",
"line_start": 34,
"line_end": 34,
"snippet": "fd -e ts | xargs sg -p 'useState($_)'"
},
{
"id": "external_commands:references/advanced-usage.md:37:xargs-command-can-execute-arbitrary-commands",
"category": "external_commands",
"severity": "medium",
"pattern": "xargs command (can execute arbitrary commands)",
"file": "references/advanced-usage.md",
"line_start": 37,
"line_end": 37,
"snippet": "sg -p 'console.log($_)' -l | fzf | xargs code"
},
{
"id": "external_commands:references/advanced-usage.md:40:xargs-command-can-execute-arbitrary-commands",
"category": "external_commands",
"severity": "medium",
"pattern": "xargs command (can execute arbitrary commands)",
"file": "references/advanced-usage.md",
"line_start": 40,
"line_end": 40,
"snippet": "fd -e ts -e tsx | xargs -P 4 sg -p 'useEffect($_)'"
},
{
"id": "external_commands:references/advanced-usage.md:43:xargs-command-can-execute-arbitrary-commands",
"category": "external_commands",
"severity": "medium",
"pattern": "xargs command (can execute arbitrary commands)",
"file": "references/advanced-usage.md",
"line_start": 43,
"line_end": 43,
"snippet": "rg -l 'useState' | xargs sg -p 'const [$_, $_] = useState($_)'"
},
{
"id": "external_commands:references/advanced-usage.md:239:xargs-command-can-execute-arbitrary-commands",
"category": "external_commands",
"severity": "medium",
"pattern": "xargs command (can execute arbitrary commands)",
"file": "references/advanced-usage.md",
"line_start": 239,
"line_end": 239,
"snippet": "find . -name \"*.ts\" -print0 | xargs -0 -P 4 sg -p 'pattern'"
},
{
"id": "network:references/advanced-usage.md:31:fetch-api-call",
"category": "network",
"severity": "low",
"pattern": "Fetch API call",
"file": "references/advanced-usage.md",
"line_start": 31,
"line_end": 31,
"snippet": "sg -p 'fetch($_)' --json | jq '.matches[].file'"
},
{
"id": "network:references/advanced-usage.md:119:hardcoded-url",
"category": "network",
"severity": "low",
"pattern": "Hardcoded URL",
"file": "references/advanced-usage.md",
"line_start": 119,
"line_end": 119,
"snippet": "- https://example.com/rule-explanation"
},
{
"id": "external_commands:references/go-rust-patterns.md:171:process-spawn",
"category": "external_commands",
"severity": "high",
"pattern": "Process spawn",
"file": "references/go-rust-patterns.md",
"line_start": 171,
"line_end": 171,
"snippet": "sg -p 'tokio::spawn($_)' --lang rust"
},
{
"id": "scripts:references/js-ts-patterns.md:62:dynamic-import-expression",
"category": "scripts",
"severity": "medium",
"pattern": "Dynamic import() expression",
"file": "references/js-ts-patterns.md",
"line_start": 62,
"line_end": 62,
"snippet": "sg -p 'import($_)'"
},
{
"id": "scripts:references/js-ts-patterns.md:65:dynamic-require-with-variable",
"category": "scripts",
"severity": "medium",
"pattern": "Dynamic require with variable",
"file": "references/js-ts-patterns.md",
"line_start": 65,
"line_end": 65,
"snippet": "sg -p 'require($_)'"
},
{
"id": "network:references/js-ts-patterns.md:15:fetch-api-call",
"category": "network",
"severity": "low",
"pattern": "Fetch API call",
"file": "references/js-ts-patterns.md",
"line_start": 15,
"line_end": 15,
"snippet": "sg -p 'fetch($_)'"
},
{
"id": "network:references/js-ts-patterns.md:18:fetch-api-call",
"category": "network",
"severity": "low",
"pattern": "Fetch API call",
"file": "references/js-ts-patterns.md",
"line_start": 18,
"line_end": 18,
"snippet": "sg -p 'await fetch($_)'"
},
{
"id": "scripts:references/security-patterns.md:30:dynamic-code-evaluation-with-eval",
"category": "scripts",
"severity": "high",
"pattern": "Dynamic code evaluation with eval()",
"file": "references/security-patterns.md",
"line_start": 30,
"line_end": 30,
"snippet": "sg -p 'eval($_)'"
},
{
"id": "scripts:references/security-patterns.md:155:dynamic-code-evaluation-with-eval",
"category": "scripts",
"severity": "high",
"pattern": "Dynamic code evaluation with eval()",
"file": "references/security-patterns.md",
"line_start": 155,
"line_end": 155,
"snippet": "for pattern in 'eval($_)' '$_.innerHTML = $_' 'password = \"$_\"'; do"
},
{
"id": "scripts:references/security-patterns.md:33:document-write-injection",
"category": "scripts",
"severity": "high",
"pattern": "document.write injection",
"file": "references/security-patterns.md",
"line_start": 33,
"line_end": 33,
"snippet": "sg -p 'document.write($_)'"
},
{
"id": "scripts:references/security-patterns.md:24:innerhtml-assignment-xss-risk",
"category": "scripts",
"severity": "medium",
"pattern": "innerHTML assignment (XSS risk)",
"file": "references/security-patterns.md",
"line_start": 24,
"line_end": 24,
"snippet": "sg -p '$_.innerHTML = $_'"
},
{
"id": "scripts:references/security-patterns.md:155:innerhtml-assignment-xss-risk",
"category": "scripts",
"severity": "medium",
"pattern": "innerHTML assignment (XSS risk)",
"file": "references/security-patterns.md",
"line_start": 155,
"line_end": 155,
"snippet": "for pattern in 'eval($_)' '$_.innerHTML = $_' 'password = \"$_\"'; do"
},
{
"id": "scripts:references/security-patterns.md:36:outerhtml-assignment-xss-risk",
"category": "scripts",
"severity": "medium",
"pattern": "outerHTML assignment (XSS risk)",
"file": "references/security-patterns.md",
"line_start": 36,
"line_end": 36,
"snippet": "sg -p '$_.outerHTML = $_'"
},
{
"id": "scripts:references/security-patterns.md:39:insertadjacenthtml-xss-risk",
"category": "scripts",
"severity": "medium",
"pattern": "insertAdjacentHTML (XSS risk)",
"file": "references/security-patterns.md",
"line_start": 39,
"line_end": 39,
"snippet": "sg -p '$_.insertAdjacentHTML($_, $_)'"
},
{
"id": "scripts:references/security-patterns.md:69:python-exec-function",
"category": "scripts",
"severity": "high",
"pattern": "Python exec() function",
"file": "references/security-patterns.md",
"line_start": 69,
"line_end": 69,
"snippet": "sg -p 'exec($_)' --lang python"
},
{
"id": "scripts:references/security-patterns.md:77:python-exec-function",
"category": "scripts",
"severity": "high",
"pattern": "Python exec() function",
"file": "references/security-patterns.md",
"line_start": 77,
"line_end": 77,
"snippet": "sg -p 'exec($_)'"
},
{
"id": "external_commands:references/security-patterns.md:76:node-js-child-process-module",
"category": "external_commands",
"severity": "high",
"pattern": "Node.js child_process module",
"file": "references/security-patterns.md",
"line_start": 76,
"line_end": 76,
"snippet": "# Find child_process in Node.js"
},
{
"id": "external_commands:references/security-patterns.md:79:process-spawn",
"category": "external_commands",
"severity": "high",
"pattern": "Process spawn",
"file": "references/security-patterns.md",
"line_start": 79,
"line_end": 79,
"snippet": "sg -p 'spawn($_)'"
},
{
"id": "external_commands:references/security-patterns.md:69:process-exec",
"category": "external_commands",
"severity": "high",
"pattern": "Process exec",
"file": "references/security-patterns.md",
"line_start": 69,
"line_end": 69,
"snippet": "sg -p 'exec($_)' --lang python"
},
{
"id": "external_commands:references/security-patterns.md:77:process-exec",
"category": "external_commands",
"severity": "high",
"pattern": "Process exec",
"file": "references/security-patterns.md",
"line_start": 77,
"line_end": 77,
"snippet": "sg -p 'exec($_)'"
},
{
"id": "external_commands:references/security-patterns.md:78:synchronous-process-execution",
"category": "external_commands",
"severity": "high",
"pattern": "Synchronous process execution",
"file": "references/security-patterns.md",
"line_start": 78,
"line_end": 78,
"snippet": "sg -p 'execSync($_)'"
},
{
"id": "external_commands:references/security-patterns.md:74:python-subprocess-run",
"category": "external_commands",
"severity": "high",
"pattern": "Python subprocess.run",
"file": "references/security-patterns.md",
"line_start": 74,
"line_end": 74,
"snippet": "sg -p 'subprocess.run($$$, shell=True)' --lang python"
},
{
"id": "external_commands:references/security-patterns.md:71:python-subprocess-call",
"category": "external_commands",
"severity": "high",
"pattern": "Python subprocess.call",
"file": "references/security-patterns.md",
"line_start": 71,
"line_end": 71,
"snippet": "sg -p 'subprocess.call($_)' --lang python"
},
{
"id": "external_commands:references/security-patterns.md:13:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "references/security-patterns.md",
"line_start": 13,
"line_end": 18,
"snippet": "sg -p 'query(`$$$${$_}$$$`)'"
},
{
"id": "env_access:references/security-patterns.md:52:generic-api-secret-keys",
"category": "env_access",
"severity": "high",
"pattern": "Generic API/secret keys",
"file": "references/security-patterns.md",
"line_start": 52,
"line_end": 52,
"snippet": "sg -p 'API_KEY = \"$_\"'"
},
{
"id": "env_access:references/security-patterns.md:53:generic-api-secret-keys",
"category": "env_access",
"severity": "high",
"pattern": "Generic API/secret keys",
"file": "references/security-patterns.md",
"line_start": 53,
"line_end": 53,
"snippet": "sg -p 'api_key: \"$_\"'"
},
{
"id": "obfuscation:references/security-patterns.md:127:python-pickle-deserialization-rce-risk",
"category": "obfuscation",
"severity": "critical",
"pattern": "Python pickle deserialization (RCE risk)",
"file": "references/security-patterns.md",
"line_start": 127,
"line_end": 127,
"snippet": "sg -p 'pickle.loads($_)' --lang python"
},
{
"id": "blocker:references/security-patterns.md:61:system-reconnaissance",
"category": "blocker",
"severity": "low",
"pattern": "System reconnaissance",
"file": "references/security-patterns.md",
"line_start": 61,
"line_end": 61,
"snippet": "sg -p 'aws_access_key_id = \"$_\"'"
},
{
"id": "scripts:SKILL.md:57:dynamic-code-evaluation-with-eval",
"category": "scripts",
"severity": "high",
"pattern": "Dynamic code evaluation with eval()",
"file": "SKILL.md",
"line_start": 57,
"line_end": 57,
"snippet": "sg -p 'eval($_)' # Security risk"
},
{
"id": "scripts:SKILL.md:58:innerhtml-assignment-xss-risk",
"category": "scripts",
"severity": "medium",
"pattern": "innerHTML assignment (XSS risk)",
"file": "SKILL.md",
"line_start": 58,
"line_end": 58,
"snippet": "sg -p '$_.innerHTML = $_' # XSS vector"
},
{
"id": "external_commands:SKILL.md:19:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 19,
"line_end": 19,
"snippet": "| ast-grep | `sg -p 'pattern'` | AST-aware code search |"
},
{
"id": "external_commands:SKILL.md:25:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 25,
"line_end": 25,
"snippet": "| `$NAME` | Named identifier | `function $NAME() {}` |"
},
{
"id": "external_commands:SKILL.md:26:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 26,
"line_end": 26,
"snippet": "| `$_` | Any single node | `console.log($_)` |"
},
{
"id": "external_commands:SKILL.md:27:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 27,
"line_end": 27,
"snippet": "| `$$$` | Zero or more nodes | `function $_($$$) {}` |"
},
{
"id": "external_commands:SKILL.md:31:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 31,
"line_end": 68,
"snippet": "```bash"
},
{
"id": "external_commands:SKILL.md:68:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 68,
"line_end": 74,
"snippet": "```"
},
{
"id": "external_commands:SKILL.md:74:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 74,
"line_end": 75,
"snippet": "| Find pattern | `sg -p 'pattern'` |"
},
{
"id": "external_commands:SKILL.md:75:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 75,
"line_end": 76,
"snippet": "| Specific language | `sg -p 'pattern' --lang python` |"
},
{
"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": 77,
"snippet": "| Replace (preview) | `sg -p 'old' -r 'new'` |"
},
{
"id": "external_commands:SKILL.md:77:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 77,
"line_end": 78,
"snippet": "| Replace (apply) | `sg -p 'old' -r 'new' --rewrite` |"
},
{
"id": "external_commands:SKILL.md:78:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 78,
"line_end": 79,
"snippet": "| Show context | `sg -p 'pattern' -A 3` |"
},
{
"id": "external_commands:SKILL.md:79:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 79,
"line_end": 80,
"snippet": "| JSON output | `sg -p 'pattern' --json` |"
},
{
"id": "external_commands:SKILL.md:80:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 80,
"line_end": 81,
"snippet": "| File list only | `sg -p 'pattern' -l` |"
},
{
"id": "external_commands:SKILL.md:81:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 81,
"line_end": 82,
"snippet": "| Count matches | `sg -p 'pattern' --count` |"
},
{
"id": "external_commands:SKILL.md:82:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 82,
"line_end": 96,
"snippet": "| Run YAML rules | `sg scan` |"
},
{
"id": "external_commands:SKILL.md:96:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 96,
"line_end": 97,
"snippet": "- `./references/js-ts-patterns.md` - JavaScript/TypeScript patterns"
},
{
"id": "external_commands:SKILL.md:97:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 97,
"line_end": 98,
"snippet": "- `./references/python-patterns.md` - Python patterns"
},
{
"id": "external_commands:SKILL.md:98:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 98,
"line_end": 99,
"snippet": "- `./references/go-rust-patterns.md` - Go and Rust patterns"
},
{
"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/security-patterns.md` - Security vulnerability detection"
},
{
"id": "external_commands:SKILL.md:100:ruby-shell-backtick-execution",
"category": "external_commands",
"severity": "medium",
"pattern": "Ruby/shell backtick execution",
"file": "SKILL.md",
"line_start": 100,
"line_end": 101,
"snippet": "- `./references/advanced-usage.md` - YAML rules and tool integration"
}
],
"finding_verdicts": [
{
"id": "network:assets/rule-template.yaml:36:hardcoded-url",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The URL is a commented example.com documentation placeholder in a YAML rule template. It cannot initiate a network request."
},
{
"id": "external_commands:references/advanced-usage.md:212:shell-command-substitution",
"verdict": "false_positive",
"confidence": 0.97,
"reason": "This is a documented CI shell example that reads the length of a local JSON result with jq. It contains no untrusted command construction."
},
{
"id": "external_commands:references/advanced-usage.md:34:xargs-command-can-execute-arbitrary-commands",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "The example passes TypeScript file names from fd to a fixed ast-grep command. No file content or other untrusted value becomes a command."
},
{
"id": "external_commands:references/advanced-usage.md:37:xargs-command-can-execute-arbitrary-commands",
"verdict": "false_positive",
"confidence": 0.93,
"reason": "The documented pipeline opens user-selected local search results with the fixed code command. It does not construct an executable command from the result."
},
{
"id": "external_commands:references/advanced-usage.md:40:xargs-command-can-execute-arbitrary-commands",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "The example passes local file names to a fixed parallel ast-grep search. It does not evaluate those names as shell code."
},
{
"id": "external_commands:references/advanced-usage.md:43:xargs-command-can-execute-arbitrary-commands",
"verdict": "false_positive",
"confidence": 0.95,
"reason": "The pipeline passes ripgrep file names as arguments to a fixed ast-grep pattern. There is no dynamic command evaluation."
},
{
"id": "external_commands:references/advanced-usage.md:239:xargs-command-can-execute-arbitrary-commands",
"verdict": "false_positive",
"confidence": 0.96,
"reason": "The null-delimited find and xargs example safely passes local TypeScript paths to a fixed ast-grep command. It is documentation, not hidden execution."
},
{
"id": "network:references/advanced-usage.md:31:fetch-api-call",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The text searches source code for fetch call syntax with ast-grep. It does not invoke fetch or make a network request."
},
{
"id": "network:references/advanced-usage.md:119:hardcoded-url",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The URL uses the reserved example.com domain as placeholder metadata in a sample rule. No request is performed."
},
{
"id": "external_commands:references/go-rust-patterns.md:171:process-spawn",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The command searches Rust source for tokio::spawn calls. It does not spawn a process itself."
},
{
"id": "scripts:references/js-ts-patterns.md:62:dynamic-import-expression",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "This is an ast-grep query for dynamic import syntax in inspected code. The skill does not execute the import expression."
},
{
"id": "scripts:references/js-ts-patterns.md:65:dynamic-require-with-variable",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "This is an ast-grep query that locates require calls. It neither loads a module nor executes a variable require."
},
{
"id": "network:references/js-ts-patterns.md:15:fetch-api-call",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The snippet is a structural search pattern for fetch calls, not a fetch invocation. It performs no network operation."
},
{
"id": "network:references/js-ts-patterns.md:18:fetch-api-call",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The snippet searches for awaited fetch calls in source code. It does not execute fetch or contact an endpoint."
},
{
"id": "scripts:references/security-patterns.md:30:dynamic-code-evaluation-with-eval",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The skill uses the eval expression only as an ast-grep pattern for vulnerability detection. No dynamic code is evaluated."
},
{
"id": "scripts:references/security-patterns.md:155:dynamic-code-evaluation-with-eval",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The quoted eval expression is iterated as search text in a security scanning example. It is passed to ast-grep and never evaluated."
},
{
"id": "scripts:references/security-patterns.md:33:document-write-injection",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The document.write expression is quoted search syntax used to locate unsafe code. The skill does not write to a document."
},
{
"id": "scripts:references/security-patterns.md:24:innerhtml-assignment-xss-risk",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The innerHTML assignment is an ast-grep pattern for detecting XSS vectors. It is not an executed DOM assignment."
},
{
"id": "scripts:references/security-patterns.md:155:innerhtml-assignment-xss-risk",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The innerHTML expression is quoted as search text in a scanning loop. It is not interpreted as JavaScript."
},
{
"id": "scripts:references/security-patterns.md:36:outerhtml-assignment-xss-risk",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The outerHTML assignment is a vulnerability search pattern. No browser code executes it."
},
{
"id": "scripts:references/security-patterns.md:39:insertadjacenthtml-xss-risk",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The insertAdjacentHTML call is quoted ast-grep syntax for finding XSS risks. It is not invoked by the skill."
},
{
"id": "scripts:references/security-patterns.md:69:python-exec-function",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The exec expression is a quoted Python search pattern passed to ast-grep. Python exec is never called."
},
{
"id": "scripts:references/security-patterns.md:77:python-exec-function",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The exec expression is documented search text for locating command injection risks. It is not executable skill code."
},
{
"id": "external_commands:references/security-patterns.md:76:node-js-child-process-module",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The line is a comment introducing patterns that search for Node.js process APIs. It neither imports child_process nor runs a command."
},
{
"id": "external_commands:references/security-patterns.md:79:process-spawn",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The spawn expression is an ast-grep query for risky source code. It does not spawn any process."
},
{
"id": "external_commands:references/security-patterns.md:69:process-exec",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The exec expression is quoted as a Python ast-grep search pattern. No process execution occurs."
},
{
"id": "external_commands:references/security-patterns.md:77:process-exec",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The exec expression is a literal ast-grep query for Node.js code review. It is not a process call in the skill."
},
{
"id": "external_commands:references/security-patterns.md:78:synchronous-process-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The execSync expression is quoted search syntax used to find risky calls. The skill does not execute it."
},
{
"id": "external_commands:references/security-patterns.md:74:python-subprocess-run",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The subprocess.run expression is a quoted ast-grep pattern for detecting shell usage. It is not run by Python."
},
{
"id": "external_commands:references/security-patterns.md:71:python-subprocess-call",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The subprocess.call expression is a quoted Python search pattern. No subprocess is launched."
},
{
"id": "external_commands:references/security-patterns.md:13:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks are JavaScript template literal syntax inside a quoted SQL injection search pattern. They are not shell command substitution."
},
{
"id": "env_access:references/security-patterns.md:52:generic-api-secret-keys",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "API_KEY appears as a metavariable search pattern for locating hardcoded credentials. The skill does not read an environment variable or contain a secret."
},
{
"id": "env_access:references/security-patterns.md:53:generic-api-secret-keys",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The api_key text is an ast-grep pattern for credential detection. It is neither a real key nor environment access."
},
{
"id": "obfuscation:references/security-patterns.md:127:python-pickle-deserialization-rce-risk",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The pickle.loads expression is quoted as an ast-grep pattern for finding unsafe deserialization. The skill never imports pickle or deserializes data."
},
{
"id": "blocker:references/security-patterns.md:61:system-reconnaissance",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The AWS credential name is quoted search syntax for finding exposed keys. It performs no system or cloud reconnaissance."
},
{
"id": "scripts:SKILL.md:57:dynamic-code-evaluation-with-eval",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The command searches a codebase for eval calls as a security risk. It does not evaluate code."
},
{
"id": "scripts:SKILL.md:58:innerhtml-assignment-xss-risk",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The command searches for innerHTML assignments as potential XSS vectors. It does not execute a DOM write."
},
{
"id": "external_commands:SKILL.md:19:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks are Markdown code formatting around an ast-grep example. They do not cause shell execution."
},
{
"id": "external_commands:SKILL.md:25:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format an ast-grep metavariable and example as inline Markdown code. Nothing is executed."
},
{
"id": "external_commands:SKILL.md:26:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format pattern syntax and a console.log example in Markdown. They are not a shell construct here."
},
{
"id": "external_commands:SKILL.md:27:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks delimit inline Markdown examples of ast-grep syntax. They cannot execute a command."
},
{
"id": "external_commands:SKILL.md:31:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks open a fenced Bash documentation block. They are Markdown delimiters, not command substitution."
},
{
"id": "external_commands:SKILL.md:68:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "The backticks close a fenced Bash documentation block. They do not execute its contents automatically."
},
{
"id": "external_commands:SKILL.md:74:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a fixed ast-grep search command in a Markdown reference table. They are not executable syntax."
},
{
"id": "external_commands:SKILL.md:75:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a fixed language-specific search example in Markdown. They do not invoke a shell."
},
{
"id": "external_commands:SKILL.md:76:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format an ast-grep replacement preview command. The command is documentation and does not use shell substitution."
},
{
"id": "external_commands:SKILL.md:77:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.98,
"reason": "Backticks format a documented rewrite command rather than shell substitution. The command changes files only when explicitly run with --rewrite."
},
{
"id": "external_commands:SKILL.md:78:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format an ast-grep context command in Markdown. They do not execute the command."
},
{
"id": "external_commands:SKILL.md:79:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a JSON output command in a Markdown table. No shell substitution or automatic execution occurs."
},
{
"id": "external_commands:SKILL.md:80:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a file-list search command as inline code. They do not execute it."
},
{
"id": "external_commands:SKILL.md:81:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a match-count command in Markdown. They are not shell execution markers in this context."
},
{
"id": "external_commands:SKILL.md:82:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format the fixed sg scan command in a Markdown table. They cannot invoke the command."
},
{
"id": "external_commands:SKILL.md:96:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a relative reference file path in Markdown. The path is not executed."
},
{
"id": "external_commands:SKILL.md:97:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a relative Python pattern reference path. They have no shell semantics in Markdown."
},
{
"id": "external_commands:SKILL.md:98:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a relative Go and Rust reference path. No command is present."
},
{
"id": "external_commands:SKILL.md:99:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a relative security pattern reference path. The line does not execute anything."
},
{
"id": "external_commands:SKILL.md:100:ruby-shell-backtick-execution",
"verdict": "false_positive",
"confidence": 0.99,
"reason": "Backticks format a relative advanced usage reference path. They are Markdown notation, not shell execution."
}
],
"semantic_findings": [],
"critical_findings": [],
"high_findings": [],
"medium_findings": [],
"low_findings": [],
"dangerous_patterns": [],
"files_scanned": 8,
"total_lines": 1007,
"audit_model": "codex",
"audited_at": "2026-07-12T09:30:53.712Z",
"agent_auto_install_policy": "allowed",
"manual_install_policy": "allowed"
},
"content": {
"user_title": "Search Code by AST Structure",
"value_statement": "Text searches miss semantic relationships and produce noisy matches. This skill uses ast-grep patterns to locate code structures and prepare focused refactors.",
"seo_keywords": [
"Claude",
"Codex",
"Claude Code",
"ast-grep",
"structural code search",
"AST search",
"semantic code search",
"code refactoring",
"security pattern detection",
"static analysis"
],
"actual_capabilities": [
"Builds ast-grep patterns for functions, calls, imports, hooks, and language-specific structures.",
"Searches JavaScript, TypeScript, Python, Go, and Rust source by syntax tree shape.",
"Previews and applies structural replacements with ast-grep rewrite options.",
"Creates reusable YAML rules with conditions, context, messages, and optional fixes.",
"Provides patterns for locating common security risks and error-prone constructs.",
"Explains output, context, file filters, CI integration, and rule testing."
],
"limitations": [
"Requires the ast-grep sg command to be installed.",
"Patterns must match the target language syntax and may need project-specific refinement.",
"Security matches require human review because structural patterns do not prove exploitability.",
"Rewrite mode changes files and should be previewed before use."
],
"use_cases": [
{
"title": "Map API Usage",
"description": "Locate every call, import, or method shape before changing a shared interface.",
"target_user": "Application developers"
},
{
"title": "Prepare Large Refactors",
"description": "Preview structural replacements across a repository before applying controlled edits.",
"target_user": "Staff engineers and maintainers"
},
{
"title": "Create Security Checks",
"description": "Turn risky syntax patterns into reusable ast-grep rules for local and CI scans.",
"target_user": "Security engineers"
}
],
"prompt_templates": [
{
"title": "Find a Function Call",
"prompt": "Find every call to [function name] in [directory]. Show the ast-grep command and summarize matching files.",
"scenario": "Beginner search for direct usages"
},
{
"title": "Search a Language Pattern",
"prompt": "Create an ast-grep pattern for [code structure] in [language]. Include context flags and explain each metavariable.",
"scenario": "Language-specific structural search"
},
{
"title": "Preview a Refactor",
"prompt": "Find [old structure] and preview a replacement with [new structure]. Do not apply changes. Report edge cases requiring review.",
"scenario": "Controlled repository refactoring"
},
{
"title": "Design a CI Rule Set",
"prompt": "Create tested ast-grep YAML rules for [policy]. Include valid examples, invalid examples, severity, CI commands, and false-positive review guidance.",
"scenario": "Advanced reusable policy enforcement"
}
],
"output_examples": [
{
"input": "Find React effects with an empty dependency list.",
"output": "A focused ast-grep search command, a list of matching files, and a note that each match needs behavioral review."
},
{
"input": "Plan a var-to-const migration without changing files.",
"output": [
"A structural search and replacement preview.",
"A summary of candidate matches by file.",
"A review list for declarations that are reassigned."
]
}
],
"best_practices": [
"Start with a narrow directory and explicit language before expanding the search.",
"Preview every replacement and review representative matches before enabling rewrite mode.",
"Test reusable YAML rules with valid and invalid fixtures before adding them to CI."
],
"anti_patterns": [
"Do not treat every security pattern match as a confirmed vulnerability.",
"Do not apply repository-wide rewrites before reviewing the preview and version control status.",
"Do not use a generic pattern when language-specific syntax is required."
],
"faq": [
{
"question": "What is structural search?",
"answer": "Structural search matches syntax tree shapes instead of raw text, so it can find code constructs despite formatting differences."
},
{
"question": "Which languages are covered?",
"answer": "The included references cover JavaScript, TypeScript, Python, Go, and Rust."
},
{
"question": "Does this skill install ast-grep?",
"answer": "No. Install the sg command separately with a supported package manager before running searches."
},
{
"question": "Can it modify source files?",
"answer": "Yes. Ast-grep can apply replacements with rewrite mode, but the skill recommends previewing changes first."
},
{
"question": "Can it find security vulnerabilities?",
"answer": "It can locate syntax associated with common risks. A human must confirm data flow, reachability, and exploitability."
},
{
"question": "Can I use rules in CI?",
"answer": "Yes. The skill documents YAML rules, tests, result handling, and a GitHub Actions integration pattern."
}
]
},
"file_structure": [
{
"name": "assets",
"type": "dir",
"path": "assets",
"children": [
{
"name": "rule-template.yaml",
"type": "file",
"path": "assets/rule-template.yaml",
"lines": 37
}
]
},
{
"name": "references",
"type": "dir",
"path": "references",
"children": [
{
"name": "advanced-usage.md",
"type": "file",
"path": "references/advanced-usage.md",
"lines": 241
},
{
"name": "go-rust-patterns.md",
"type": "file",
"path": "references/go-rust-patterns.md",
"lines": 192
},
{
"name": "js-ts-patterns.md",
"type": "file",
"path": "references/js-ts-patterns.md",
"lines": 138
},
{
"name": "python-patterns.md",
"type": "file",
"path": "references/python-patterns.md",
"lines": 132
},
{
"name": "security-patterns.md",
"type": "file",
"path": "references/security-patterns.md",
"lines": 164
}
]
},
{
"name": "scripts",
"type": "dir",
"path": "scripts",
"children": [
{
"name": ".gitkeep",
"type": "file",
"path": "scripts/.gitkeep",
"lines": 0
}
]
},
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 102
}
]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |