Code Search Ast Lookup

Use the provided script to find definitions without wasting context. Use when this capability is needed.

tomevault-io 02ea105 2 files · 1.8 KB Updated

File contents

Skill: Smart Code Search

When to use

  • You see an import from .models import UserProfile and need to know where UserProfile is defined.
  • You need to find a function logic but don't know the file name.
  • Goal: Avoid opening random files with view_file.

How to use

Run the ast_lookup.py script provided in the kit.

Command

python3 scripts/ast_lookup.py <SymbolName> <RootPath>

Example

User Request: "Update the calculate_total function." Agent Action: "I don't know where that function is. I will search for it."

python3 scripts/ast_lookup.py calculate_total .

Output: ./sales/utils.py:42 [FunctionDef]

Next Step: Now you can confidently run: view_file ./sales/utils.py (focusing on line 42).


Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/tgalioautomation--ai-agent-control-kit-for-django-premium-ui--code-search commit 02ea105def

Frequently asked questions

npx skillmds@latest add tomevault-io/code-search-ast-lookup