To get the best results from Codegen, treat it like a skilled teammate: provide clear, specific instructions and sufficient context. Vague requests lead to ambiguous outcomes.Documentation Index
Fetch the complete documentation index at: https://codegeninc-codegen-bot-add-rules-overview-and-hierarchy-cla.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The Core Principle: Specificity
Instead of “Fix the user service,” try:In theIf there are specific implementation details you want included, make sure to specify. For example:my-web-apprepo (PR #42), refactor theUserServiceclass insrc/services/user.tsto use theUserRepositorypattern shown inProductService/ProductRepository.
Ensure all tests intests/services/user.test.tspass and add new tests for the repository with 90%+ coverage. Update the diagram indocs/architecture/user-service.md.
Elements of a Strong Prompt
- Scope: What repository, branch, or files are involved? (e.g.,
my-web-apprepo,PR #42,src/services/user.ts) - Goal: What is the high-level objective? (e.g., Refactor
UserService, improve testability) - Tasks: What specific actions should the agent take? Use a numbered or bulleted list for clarity. (e.g., Extract logic to
UserRepository, use dependency injection, update tests, update diagram) - Context/Patterns: Are there existing patterns, examples, or documentation to reference? (e.g.,
ProductService,ProductRepository) - Success Criteria: How will you know the task is done correctly? (e.g., Tests pass, 90%+ coverage, diagram updated)
Clear, detailed prompts empower Codegen agents to deliver accurate results
faster, significantly streamlining your workflow.