Skip to content

AI Navigation Guide

geoffrey fernald edited this page Jan 28, 2026 · 1 revision

AI Navigation Guide

A decision tree that helps AI agents pick the right Drift tools based on user intent. This is the "cheat sheet" for efficient tool selection.

Overview

With 50 MCP tools available, AI agents need guidance on which tools to use. The Navigation Guide provides:

  • Decision Tree β€” Match user keywords to tool sequences
  • Surgical Lookups β€” Quick Q&A mappings
  • Common Mistakes β€” What NOT to do

The Decision Tree

Code Generation Tasks

User Says Intent Tool Sequence Why
"add", "create", "implement", "build", "new feature" Generate new code drift_context β†’ drift_code_examples β†’ drift_validate_change Context gives patterns, examples show implementations, validate checks compliance
"modal", "dialog", "popup", "form", "component" Create UI component drift_context β†’ drift_similar β†’ drift_code_examples Find similar components first
"api", "endpoint", "route", "controller" Create API endpoint drift_context β†’ drift_typescript (routes) β†’ drift_code_examples Check existing routes first

Bug Fixing Tasks

User Says Intent Tool Sequence Why
"fix", "bug", "error", "broken", "not working" Fix a bug drift_context β†’ drift_file_patterns β†’ drift_callers Understand area, check conventions, find callers
"crash", "exception", "unhandled", "throw" Fix error handling drift_error_handling β†’ drift_callers β†’ drift_code_examples Find gaps, trace call chain, see patterns

Refactoring Tasks

User Says Intent Tool Sequence Why
"refactor", "restructure", "reorganize", "clean up" Refactor safely drift_impact_analysis β†’ drift_coupling β†’ drift_test_topology Check blast radius, find coupling, ensure tests
"move", "rename", "extract", "split" Move/rename code drift_impact_analysis β†’ drift_callers β†’ drift_imports Check impact, find usages, fix imports

Security Tasks

User Says Intent Tool Sequence Why
"security", "vulnerability", "audit", "sensitive" Security review drift_security_summary β†’ drift_reachability β†’ drift_env Overview, trace data, check secrets
"auth", "authentication", "authorization", "permission" Review auth drift_context (focus="auth") β†’ drift_middleware β†’ drift_patterns_list Auth patterns, middleware, all auth patterns

Understanding Code

User Says Intent Tool Sequence Why
"understand", "explain", "how does", "what does" Understand code drift_explain β†’ drift_callers β†’ drift_file_patterns Full explanation, usage, conventions
"who calls", "what calls", "used by", "dependencies" Find relationships drift_callers β†’ drift_impact_analysis Direct callers, full dependency tree
"data flow", "reaches", "access", "touches" Trace data drift_reachability β†’ drift_security_summary Forward/inverse data flow

Testing Tasks

User Says Intent Tool Sequence Why
"test", "coverage", "untested", "spec" Work with tests drift_test_topology β†’ drift_test_template Coverage status, generate scaffolding

Pattern Discovery

User Says Intent Tool Sequence Why
"pattern", "convention", "how do we", "standard" Find patterns drift_patterns_list β†’ drift_code_examples List patterns, see implementations
"similar", "like this", "example of", "show me" Find similar code drift_similar β†’ drift_code_examples Semantic search, pattern examples

Surgical Lookups

Quick answers to specific questions:

Question Tool Example
Who calls this function? drift_callers function: "handleSubmit"
What's this function's signature? drift_signature symbol: "createUser"
What type is this? drift_type type: "UserDTO"
How do I import X? drift_imports symbols: ["useState", "useEffect"], targetFile: "src/App.tsx"
What changed recently? drift_recent area: "src/api/"
What dependencies do we use? drift_dependencies search: "react"
What middleware exists? drift_middleware type: "auth"
What hooks exist? drift_hooks category: "fetch"
What errors can occur? drift_errors action: "types"
Generate a test template drift_test_template targetFile: "src/services/user.ts"
Validate my code drift_prevalidate code: "...", targetFile: "src/api/users.ts"

Common Mistakes

❌ DON'T

  1. Skip drift_context β€” It synthesizes multiple sources and saves tool calls
  2. Use drift_code_examples without drift_context first β€” You need pattern IDs
  3. Guess file paths β€” Use drift_files_list to find them
  4. Call language tools for general queries β€” Use drift_context instead
  5. Make multiple calls when one suffices β€” drift_context often has everything

βœ… DO

  1. Start with drift_context for any code generation task
  2. Use drift_callers for "who uses X" questions β€” it's fast and precise
  3. Use drift_similar when creating code similar to existing code
  4. Validate generated code with drift_validate_change or drift_prevalidate
  5. Check hints.nextActions in every response for guidance

Tool Selection Flowchart

User Request
     β”‚
     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Is this a code generation task?         β”‚
β”‚  (add, create, implement, build)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚ Yes                    β”‚ No
     β–Ό                        β–Ό
drift_context          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚                 β”‚  Is this a quick lookup?                 β”‚
     β–Ό                 β”‚  (signature, callers, type, imports)     β”‚
drift_code_examples    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚                      β”‚ Yes                    β”‚ No
     β–Ό                      β–Ό                        β–Ό
drift_validate_change  Use surgical tool      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                              β”‚  Is this analysis/understanding?         β”‚
                                              β”‚  (explain, impact, security)             β”‚
                                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚ Yes                    β”‚ No
                                                   β–Ό                        β–Ό
                                              Use analysis tool       drift_status
                                              (explain, impact,       (general health)
                                               security_summary)

MCP Tool: drift_capabilities

Get the full navigation guide programmatically:

drift_capabilities({})

Returns:

{
  "summary": "Drift provides 50 MCP tools for codebase intelligence",
  "agentNavigationGuide": {
    "decisionTree": [...],
    "surgicalLookups": [...],
    "commonMistakes": [...]
  },
  "layers": [...],
  "quickStart": {
    "steps": [
      "1. drift_status β†’ Get health overview",
      "2. drift_context β†’ Get curated context",
      "3. drift_code_examples β†’ See implementations",
      "4. Generate code following patterns",
      "5. drift_validate_change β†’ Verify compliance"
    ]
  }
}

Quick Reference Card

Starting a Task

drift_context β†’ drift_code_examples β†’ drift_validate_change

Understanding Code

drift_explain β†’ drift_callers β†’ drift_impact_analysis

Security Review

drift_security_summary β†’ drift_reachability β†’ drift_env

Refactoring

drift_impact_analysis β†’ drift_coupling β†’ drift_test_topology

Quick Lookups

drift_signature | drift_callers | drift_type | drift_imports

Next Steps

Clone this wiki locally