Skip to main content

Common Use Cases for Codegen

Codegen is designed to streamline your development workflow and help you accomplish tasks more efficiently. Here are some common ways teams use Codegen:

Code Research and Understanding

@codegen How does the authentication flow work in our app?
Codegen will analyze the codebase, identify authentication-related files, and explain the flow with relevant code snippets and diagrams.
@codegen Show me examples of how we use the API client in our codebase
Codegen will search for and present examples of API client usage across your codebase, helping you understand patterns and conventions.
@codegen Trace the execution path of the processPayment function
Codegen will analyze the call graph to show you how the function is called, what dependencies it has, and what other functions it calls.

Code Modifications and Refactoring

@codegen Add input validation to the user registration form
Codegen will locate the registration form, implement appropriate validation logic, and create a PR with the changes.
@codegen Fix the issue where the dashboard doesn't load user data
Codegen will investigate the issue, identify the root cause, and implement a fix with appropriate error handling.
@codegen Refactor the UserService class to use dependency injection
Codegen will restructure the class to follow dependency injection patterns while maintaining functionality.
@codegen Update our React components to use the latest API
Codegen will identify components using deprecated APIs and update them to use the current recommended patterns.

Code Reviews and Quality

@codegen Review PR #123
Codegen will analyze the PR, provide feedback on code quality, suggest improvements, and identify potential issues.
@codegen Add unit tests for the PaymentProcessor class
Codegen will create comprehensive tests covering different scenarios and edge cases for the specified class.
@codegen Check our error handling in the API routes
Codegen will analyze error handling patterns, identify inconsistencies or gaps, and suggest improvements.

Documentation and Knowledge Sharing

@codegen Create documentation for our authentication API
Codegen will analyze the API and create comprehensive documentation with endpoints, parameters, and examples.
@codegen Explain the caching strategy in our app
Codegen will analyze the caching implementation and provide a clear explanation with diagrams and examples.
@codegen Create a guide for new developers on our project structure
Codegen will generate a comprehensive guide explaining the project’s architecture, key components, and conventions.

Project Management

@codegen Find all issues related to authentication
Codegen will search through Linear or GitHub issues to find and summarize authentication-related tasks.
@codegen Break down the task of implementing the new notification system
Codegen will analyze the requirements and create a detailed breakdown of subtasks needed to implement the feature.
@codegen What's the status of our API migration project?
Codegen will gather information from issues, PRs, and commits to provide a comprehensive status update.

Advanced Use Cases

@codegen Convert all our Promise-based code to use async/await
Codegen can help plan and execute large-scale code transformations across your codebase.
@codegen Analyze our microservice dependencies
Codegen will map out service dependencies, identify potential bottlenecks, and suggest architectural improvements.
@codegen Identify performance bottlenecks in our rendering logic
Codegen will analyze the code for performance issues and suggest optimizations with measurable impact.

Getting Started

To start using Codegen for these use cases:
  1. Install Codegen and connect it to your GitHub, Slack, and Linear accounts
  2. Mention @codegen in your Slack channel followed by your request
  3. Review Codegen’s response and provide feedback to help it improve
For more detailed information on Codegen’s capabilities, see the Capabilities page.