ast-query

Query TypeScript ASTs to locate definitions and call relationships.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/tylermorganme/crop_plan_2025 --skill ast-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ast-query
Source: https://github.com/tylermorganme/crop_plan_2025/tree/main/.claude/skills/ast-query
Command: npx skills add https://github.com/tylermorganme/crop_plan_2025 --skill ast-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill helps engineers understand a TypeScript codebase by querying and mapping code structure, definitions, and relationships without manually inspecting files.

Core Features & Use Cases

  • Explore type and interface definitions: locate where a type, interface, or class is defined and what it contains.
  • Trace usage and call relationships: discover which functions call a given function and how types interrelate.
  • Use Case: When refactoring, quickly answer "where is X defined?" and "what uses Y?" to guide changes.

Quick Start

Example: Run the AST query script to locate a symbol, e.g., node crop-api/scripts/ast-query.js 'Plan'

Frequently Asked Questions about ast-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find where a TypeScript interface or type is defined in a large codebase?

To find where a TypeScript interface or type is defined, you can query the codebase using an AST traversal script to parse source files and return the exact location and structure of the definition.

What is the best way to trace function callers and usage relationships in TypeScript?

Tracing function callers and usage relationships in TypeScript is done by generating a call graph from the AST, which maps out how functions interrelate and what calls a specific function.

How do I map TypeScript code structure to prepare for a refactoring task?

Mapping TypeScript code structure for refactoring involves querying definitions and relationships across the codebase to identify dependent types and functions, ensuring safe modifications.

Can I query TypeScript code structure without manually inspecting source files?

Yes, you can query TypeScript code structure without manual inspection by running a script that parses source files, traverses ASTs, and returns structured results for definitions and call relationships.

Does AST querying work for identifying relationships between classes and types in TypeScript?

AST querying works for identifying relationships between classes and types in TypeScript by traversing the syntax tree to map how different types interrelate and locate their definitions.

What are the limitations of using AST queries to explore a TypeScript codebase?

Limitations of using AST queries to explore a TypeScript codebase include relying on static analysis of source files, meaning it parses code structure without executing runtime behavior or dynamic types.