← ClaudeAtlas

bonsai-firstlisted

Redirects structural code operations on Python and TypeScript files to the correct bonsai AST tool. Use before reaching for sed, grep, awk, or find on .py/.ts/.tsx files. Covers renaming, moving, finding references, signature changes, and dead-code detection across both languages.
ValentinFigue/aether · ★ 0 · AI & Automation · score 71
Install: claude install-skill ValentinFigue/aether
# Bonsai-first: use AST tools, not text tools `sed`, `awk`, `grep`, and `find` on `.py`/`.ts`/`.tsx` files are discouraged. Use the bonsai tool that matches the intent: | Intent | Python | TypeScript | |---|---|---| | Rename a symbol | `pyrename` | `tsrename` | | Move a file | `pymove` | `tsmove` | | Move a symbol to another module | `pymovesymbol` | `tsmovesymbol` | | Find all usages of a symbol | `pyfindrefs` | `tsfindrefs` | | Find only call sites | `pycallers` | `tsfindrefs` (filter by kind) | | Change a function signature | `pysignature` | `tssignature` | | Detect dead code / unused imports | `pyfindunused` | — | | Text search (non-structural) | `pygrep` | `pygrep` | ## Why not sed/grep/find for code operations? - **False matches**: `grep 'save'` hits local variables, string literals, comments, and unrelated methods with the same name. - **Missed sites**: imports, re-exports, decorator references, and type annotations are invisible to text search. - **Import paths not updated**: moving a file with `mv` + `grep`/`sed` leaves stale import paths. `pymove`/`tsmove` rewrites them all. - **No type awareness**: `grep 'User.save'` can't distinguish `User.save` from `Document.save`. `tsfindrefs` can. ## Dry-run first All mutating bonsai tools (`pyrename`, `pymove`, `pymovesymbol`, `pysignature`, `tsrename`, `tsmove`, `tsmovesymbol`, `tssignature`) accept `dry_run=True`. Always preview the blast radius before applying.