← Back to Advanced

Custom Prompts

Learn how to craft effective prompts for better results.

Prompt Best Practices

Be Specific

Less Effective

> make an API

More Effective

> create a REST API with Express.js for user authentication with JWT tokens

Include Context

Less Effective

> fix the bug

More Effective

> fix the null pointer exception in UserService.getUser() that occurs when the user doesn't exist

Specify Technology

Less Effective

> write a web server

More Effective

> write a web server in Go using the Chi router with middleware for logging and CORS

Agent-Specific Tips

Coder Agent

  • Specify the language and framework
  • Mention coding standards or patterns to follow
  • Include error handling requirements

DevOps Agent

  • Specify the cloud provider (AWS, GCP, Azure)
  • Mention scaling requirements
  • Include security considerations

Security Agent

  • Specify what to scan (code, network, dependencies)
  • Mention specific vulnerability types to look for
  • Include compliance requirements if applicable

Example Prompts

Complex coding task:

> create a GraphQL API in TypeScript using Apollo Server with: - User authentication with JWT - Rate limiting middleware - Error handling with custom error classes - Input validation using Zod - Database integration with Prisma

DevOps task:

> create a Kubernetes deployment with: - 3 replicas with rolling updates - Resource limits (500m CPU, 512Mi memory) - Health checks (liveness and readiness probes) - ConfigMap for environment variables - HorizontalPodAutoscaler scaling to 10 pods

Planning task:

> plan a microservices architecture for an e-commerce platform with: - User service (authentication, profiles) - Product service (catalog, inventory) - Order service (cart, checkout, payments) - Notification service (email, SMS, push) Focus on scalability and data consistency