> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codealive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Example Workflows

> Real-world patterns for using CodeAlive with AI coding agents

Discover how developers use CodeAlive to accelerate their daily work. Each workflow shows a realistic scenario with step-by-step instructions and example prompts you can copy directly into your AI agent.

## Workflows

> [tab] Onboard to a Codebase
>
> > [!NOTE]
> >
> > **Scenario:** You just joined a team and need to understand a large, unfamiliar project quickly.
>
> **1. Index the repository**
>
> Add the project repository in your [CodeAlive dashboard](https://app.codealive.ai) and wait for indexing to complete.
>
> **2. Ask about architecture**
>
> Start with broad questions to understand the overall structure:
>
> ```
> "What is the high-level architecture of this project?"
> "What frameworks and libraries does this codebase use?"
> "How is the code organized — what are the main modules?"
> ```
>
> **3. Find entry points**
>
> Narrow down to the most important files:
>
> ```
> "Where is the main entry point of the application?"
> "Show me the API route definitions"
> "Where is the database schema defined?"
> ```
>
> **4. Explore patterns and conventions**
>
> Understand how the team writes code:
>
> ```
> "How is error handling done in this project?"
> "What patterns are used for authentication?"
> "Show me how services communicate with each other"
> ```
>
> > [!TIP]
> >
> > Start with `semantic_search` and `grep_search` for evidence gathering, then switch to `chat` only when you need synthesized architecture-level analysis.

> [tab] Cross-Repo Search
>
> > [!NOTE]
> >
> > **Scenario:** You need to find how a shared library or API is used across multiple services in a microservices architecture.
>
> **1. Set up a workspace**
>
> In your CodeAlive dashboard, group related repositories into a workspace (e.g., "platform-services").
>
> **2. Search across repositories**
>
> Use semantic search to find usage patterns across all repos:
>
> ```
> "Search for usage of the UserService API across all repositories"
> "Find all implementations of the PaymentGateway interface"
> "Show me how the shared auth library is imported and used"
> ```
>
> **3. Compare implementations**
>
> Look for inconsistencies or patterns:
>
> ```
> "Compare how error handling is done in the order-service vs payment-service"
> "Are there any services not using the latest version of the shared client?"
> "Find all places where the deprecated createUser method is still called"
> ```
>
> > [!TIP]
> >
> > Use `get_data_sources` first to see all available repositories and workspaces — pass your task as the `query` argument to get only the relevant ones. Scope searches with workspace names for faster, more relevant results.

> [tab] AI Code Review
>
> > [!NOTE]
> >
> > **Scenario:** You need to review a pull request with full awareness of how the changes affect the broader codebase.
>
> **1. Understand the change context**
>
> Ask CodeAlive about the code being modified:
>
> ```
> "Explain how the authentication middleware works in this project"
> "What calls the handlePayment function and what depends on its return value?"
> ```
>
> **2. Check for pattern consistency**
>
> Verify the PR follows existing conventions:
>
> ```
> "How do other API endpoints in this project handle validation?"
> "Show me how similar services are structured in this codebase"
> "What error handling pattern is used in the controller layer?"
> ```
>
> **3. Analyze for risks**
>
> Look for potential issues:
>
> ```
> "What other code would break if the User model schema changes?"
> "Find all callers of this function to check if the new parameter is handled"
> "Are there existing tests that cover this authentication flow?"
> ```
>
> > [!TIP]
> >
> > Use `semantic_search` and `grep_search` to find related code quickly, then `chat` to get a synthesized analysis of how the changes fit into the broader architecture.

> [tab] Build Following Patterns
>
> > [!NOTE]
> >
> > **Scenario:** You need to add a new API endpoint (or service, component, etc.) that matches the team's existing conventions.
>
> **1. Find similar implementations**
>
> Search for existing patterns to follow:
>
> ```
> "Show me an example API endpoint with full CRUD operations"
> "How are controllers structured in this project?"
> "Find a service that handles database transactions"
> ```
>
> **2. Analyze the pattern**
>
> Ask CodeAlive to extract the conventions:
>
> ```
> "What is the standard structure for a new API endpoint in this project?"
> "What middleware is applied to protected routes?"
> "How are request validation and error responses handled?"
> ```
>
> **3. Generate matching code**
>
> Use the patterns as context for code generation:
>
> ```
> "Create a new /api/orders endpoint following the same patterns as /api/products"
> "Generate a service class for OrderService matching the structure of ProductService"
> "Write tests for the OrderController using the same testing patterns as ProductController"
> ```
>
> > [!TIP]
> >
> > The search-then-generate flow produces much better results than asking for code from scratch. The AI sees your actual conventions, not generic best practices.

> [tab] Debug Across Files
>
> > [!NOTE]
> >
> > **Scenario:** You're tracking down a bug that spans multiple files or services and need to trace the execution path.
>
> **1. Search for error context**
>
> Start from the error message or symptom:
>
> ```
> "Search for where 'PaymentProcessingError' is thrown"
> "Find all places where the order status is updated to 'failed'"
> "Show me the error handling chain for payment webhooks"
> ```
>
> **2. Trace the data flow**
>
> Follow the execution path through the codebase:
>
> ```
> "Trace the flow from when a payment webhook arrives to when the order status is updated"
> "What functions call processPayment and what happens with the return value?"
> "Show me the middleware chain that runs before the payment endpoint"
> ```
>
> **3. Find the root cause**
>
> Narrow down to the issue:
>
> ```
> "Are there any race conditions in the payment processing flow?"
> "Compare the error handling in processPayment with similar functions — is anything missing?"
> "What happens if the database connection drops during a payment transaction?"
> ```
>
> > [!TIP]
> >
> > Use `grep_search` with specific error messages or function names for fast, targeted lookups and `semantic_search` for broader retrieval. Switch to `chat` only when you need the AI to reason about execution flow after search.

> [tab] Multi-Agent Workflow
>
> > [!NOTE]
> >
> > **Scenario:** You want to research in one AI agent and implement in another — with both sharing the same codebase context.
>
> **1. Research in your preferred agent**
>
> Use CodeAlive in Cursor, VS Code, or any connected agent to explore:
>
> ```
> "How does the notification system work?"
> "What would need to change to add email notifications?"
> "Show me the existing notification channels and their implementations"
> ```
>
> **2. Switch agents for implementation**
>
> Open Claude Code (or any other agent) — CodeAlive provides the same context:
>
> ```
> "Search for the NotificationService implementation"
> "Create an EmailNotificationChannel following the pattern of SlackNotificationChannel"
> ```
>
> Both agents query the same indexed codebase, so your research carries over naturally.
>
> **3. Verify across agents**
>
> Use any connected agent to verify the changes fit:
>
> ```
> "Does the new EmailNotificationChannel follow the same interface as other channels?"
> "What tests exist for notification channels that I should replicate?"
> ```
>
> > [!TIP]
> >
> > CodeAlive acts as a shared knowledge layer. Index once, query from any agent. This is especially useful when different agents have different strengths — use Cursor for exploration and Claude Code for implementation, for example.

## What's Next

> [card] [Tips & Tricks](https://docs.codealive.ai/tips-and-tricks.md)
>
> Get the most out of CodeAlive with practical tips

> [card] [MCP Integration](https://docs.codealive.ai/integrations/mcp.md)
>
> Set up CodeAlive with your AI agent


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.