From odin
Performs AST-based structural code search, refactoring, linting, and analysis using ast-grep across languages like TypeScript.
npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odinThis skill uses the workspace's default tool permissions.
ast-grep is a fast and polyglot tool for code searching, linting, and rewriting based on Abstract Syntax Trees (AST). It excels at structural search and replace where regex fails.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
ast-grep is a fast and polyglot tool for code searching, linting, and rewriting based on Abstract Syntax Trees (AST). It excels at structural search and replace where regex fails.
foo with 2 arguments") regardless of whitespace.# Search (pattern must be in single quotes)
ast-grep -p '$A + $B' --lang ts
# Rewrite (dry run)
ast-grep -p '$A != null' --rewrite '$A' --lang ts
# Interactive Rewrite
ast-grep -p 'var $A = $B' --rewrite 'const $A = $B' --interactive
$VAR matches any single node.$$$ARGS matches zero or more nodes (list of items).$_ matches any node (non-capturing).$$ matches any list of nodes (non-capturing).See Pattern Syntax for details.
Understanding Named vs Unnamed nodes and Matching Strictness is crucial for precise patterns.
identifier, function_definition (matched by $VAR).(, ), ; (skipped by default in smart mode).smart, cst, ast, relaxed, signature).See Core Concepts for details.
For complex tasks, use YAML configuration files.
id: no-console-log
language: TypeScript
rule:
pattern: console.log($$$ARGS)
inside:
kind: function_declaration
stopBy: end
fix: '' # Remove the log
See Rule Configuration for details.
ast-grep supports complex transformations (regex replace, case conversion) and rewriters for sub-node transformation.
See Rewriting & Transformations for details.
For larger projects, organize rules and tests using sgconfig.yml.
ast-grep new projectsgconfig.yml defines rule and test directories.valid and invalid cases to ensure rule accuracy.See Project Setup & Testing for details.
Reuse logic with local or global utility rules. Enables recursive matching.
utils:
is-literal:
any: [{kind: string}, {kind: number}]
rule:
matches: is-literal
See Utility Rules for details.
Full reference for YAML fields (id, severity, files, ignores) and supported languages.
See Configuration Reference for details.
Common commands: scan, run, new, test, lsp.
See CLI Reference for details.