Part 2: Codebase Context Engineering — Repository Indexing, AST Graphs & Cursor Rules

Answer-first: Context engineering replaces brittle prompt engineering by constructing compiler-verified codebase index graphs that supply AI coding agents with high-precision architectural context. By extracting Abstract Syntax Tree symbol relationships, enforcing modular cursor rules, and pruning peripheral noise through Model Context Protocol servers, engineering teams eliminate AI hallucinations and ensure machine-generated code adheres strictly to established system boundaries. Prerequisite: Advanced understanding of compiler construction fundamentals, tree-sitter AST parsing, vector embedding dimensions, lexical search algorithms, and JSON-RPC 2.0 network protocols is required for this chapter. ...