dot_claude/skills/sg/SKILL.md
Use when searching or replacing code structures (functions, calls, blocks) across a codebase using tree-sitter patterns instead of regex.
npx skillsauth add nijaru/dotfiles sgInstall 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.
sg when you need to match code structures (functions, classes, blocks) rather than text patterns.sg only operates on syntactically valid code. Fix syntax errors before running.--interactive or verify with sg scan before applying sg rewrite.| Task | Command | Purpose |
| :--- | :--- | :--- |
| Search | sg run -p 'pattern' | Search for a specific syntax pattern. |
| Scan | sg scan | Find patterns based on project-wide YAML rules. |
| Rewrite | sg run -p 'pattern' -r 'replacement' | Structural search and replace. |
| Help | sg help | View full CLI options. |
$$$ for matching multiple nodes (like function arguments).$ followed by a name (e.g., $FUNC) to capture specific nodes.sg run -l python -p '...'.sg run.sg scan.| Excuse | Reality |
| :--- | :--- |
| "Grep is faster" | Grep is faster to type but slower and riskier for complex code changes. |
| "I'll use regex" | Regex doesn't understand syntax blocks. sg does. |
| "Pattern is simple" | Simple patterns often have hidden edge cases that sg handles natively. |
development
Use after completing a bug fix, feature, refactor, or tk task when the first implementation taught enough context to replace it with a simpler, cleaner, or more coherent version before finalizing.
development
Use when writing, migrating, or reviewing Zig code across recent stable versions (0.14-0.16), especially to correct stale syntax or stdlib, build.zig, allocator, formatting, or runtime API knowledge.
documentation
Use when reviewing or revising text (prose, docs, commits) to remove AI patterns and improve voice/clarity.
content-media
Use when fetching X/Twitter post content by URL, or searching for recent X posts.