Documentation menu

AI Assistance

Use this workflow when you want an AI assistant to help write, review, or refine Graph-sitter codemods.

This branch does not expose a standalone gs expert shell command. The expert page describes the AI-assistance workflow around the documented CLI commands.

  1. Initialize Graph-sitter in the target repository.
gs init
  1. Scaffold a codemod.
gs create rename-function .
  1. Ask your assistant to edit the generated codemod with Graph-sitter APIs such as Codebase, Function, Import, and commit().

  2. Run the codemod in check mode before applying changes.

gs run rename-function . --check
  1. Apply the codemod after reviewing the diff.
gs run rename-function . --write

What To Give The Assistant

  • The goal of the codemod.
  • The target repository path and language.
  • Any expected symbol names, import paths, or file patterns.
  • Whether the run should use the Python backend or the opt-in Rust backend.
  • The generated codemod file under .codegen/codemods/.
  • create: scaffold a codemod file.
  • run: execute a local codemod.
  • parse: inspect the codebase graph before editing.