Schema & Routing
Tools for understanding the edges of your system — routes in, data out.
code_route
Section titled “code_route”Find the handler for an HTTP route.
code_route(route="/api/users")code_route(route="/api/orders", method="POST")Returns the controller function and file location.
code_route_trace
Section titled “code_route_trace”Full end-to-end trace of an HTTP request: router → controller → service → DB.
code_route_trace(route="/api/orders", method="POST")Output:
POST /api/orders └─ OrderController.create (src/controllers/order.ts:14) └─ OrderService.checkout (src/services/order.ts:42) └─ PaymentService.charge (src/services/payment.ts:18) └─ stripe.charges.create (external) └─ db.query → orders_table (postgres)code_schema
Section titled “code_schema”Database schema from Drizzle or Prisma definitions.
code_schema(table="users")code_schema() # all tablesReturns columns, types, relations, and indexes.
code_env
Section titled “code_env”Environment variable definitions and where they’re read.
code_env(name="STRIPE_SECRET_KEY")code_env() # all env varsShows where the var is defined (.env, config files) and every read site in the codebase.
code_type
Section titled “code_type”TypeScript type or interface definition.
code_type(name="UserDTO")code_type(name="ApiResponse")code_type_usages
Section titled “code_type_usages”Every place a TypeScript type is used.
code_type_usages(name="UserDTO", usage_kind="all")code_type_usages(name="UserDTO", usage_kind="parameter")code_type_usages(name="ApiResponse", usage_kind="return")code_type_usages(name="BaseEntity", usage_kind="definition")usage_kind | Finds |
|---|---|
"all" | Every reference |
"parameter" | Used as function parameter |
"return" | Used as return type |
"definition" | Extended or implemented |