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.
Codegen is based on Anthropic’s Claude 3.7. You can prompt it similarly to ChatGPT or other LLM-based assistants
Instead of “Fix the user service,” try:
In the
my-web-app
repo (PR #42), refactor theUserService
class insrc/services/user.ts
to use theUserRepository
pattern shown inProductService
/ProductRepository
.
If there are specific implementation details you want included, make sure to specify. For example:
Ensure all tests in
tests/services/user.test.ts
pass and add new tests for the repository with 90%+ coverage. Update the diagram indocs/architecture/user-service.md
.
my-web-app
repo, PR #42
, src/services/user.ts
)UserService
, improve testability)UserRepository
, use dependency injection, update tests, update diagram)ProductService
, ProductRepository
)Clear, detailed prompts empower Codegen agents to deliver accurate results faster, significantly streamlining your workflow.