All Tutorials
ViAgen6

✨ Mastering ViAgen6 Prompts

Learn prompt engineering techniques to get better, more accurate code from ViAgen6.

15 min Intermediate

🎯 The Key Principles

ViAgen6 is trained to understand context and generate production-ready code. The quality of your output depends heavily on the quality of your input. Follow these principles for best results.

1. Be Specific About Requirements

❌ Vague

"Create a user form"

✅ Specific

"Create a React user registration form with email, password (min 8 chars), and confirm password fields. Use React Hook Form with Zod validation. Show inline errors."

2. Specify Your Tech Stack

Create a REST API endpoint for user authentication.

Tech Stack:
- Node.js with Express
- TypeScript
- Prisma ORM with PostgreSQL
- JWT for tokens
- bcrypt for password hashing

Include proper error handling and TypeScript types.

3. Provide Context

Tell ViAgen6 about your existing code structure:

I have an existing Next.js 14 app with:
- /app directory structure
- Tailwind CSS
- shadcn/ui components
- Zustand for state management

Add a dark mode toggle that persists to localStorage and 
respects system preferences on first load.

🔧 Advanced Techniques

📋 Request Specific Qualities

Tell ViAgen6 exactly what "good code" means for your use case:

Write this function with:
- Full TypeScript types (no 'any')
- JSDoc comments
- Error handling with custom error classes
- Unit tests using Vitest
- Edge case handling for null/undefined

🔄 Iterative Refinement

Build on previous responses to refine the code:

  • "Now add pagination support"
  • "Refactor to use async/await instead of callbacks"
  • "Add caching with a 5-minute TTL"
  • "Make it work with the existing UserService class"

🚫 Negative Constraints

Tell ViAgen6 what NOT to do:

Create a date picker component.

DO NOT:
- Use any external date libraries (no moment, date-fns)
- Use inline styles
- Use class components
- Hardcode any text (must support i18n)

📝 Provide Examples

Show ViAgen6 patterns you want to follow:

Create a new API route following this pattern:

// Existing pattern:
export async function GET(request: Request) {
  try {
    const data = await fetchData();
    return Response.json({ success: true, data });
  } catch (error) {
    return Response.json({ success: false, error: error.message }, { status: 500 });
  }
}

Now create a POST route for creating orders with the same pattern.

⚡ Quick Commands

Use these keyboard shortcuts in Vigthoria Coder:

Pro Tip

Select code before opening chat to automatically include it as context. ViAgen6 will understand you're asking about that specific code.

📚 Prompt Templates

Save these templates for common tasks:

Code Review Template:
Review this code for:
1. Security vulnerabilities
2. Performance issues
3. Best practice violations
4. Potential bugs

Suggest specific improvements with code examples.
Refactoring Template:
Refactor this code to:
- Improve readability
- Follow [React/Vue/Angular] best practices
- Extract reusable functions
- Add proper TypeScript types

Keep the same functionality but make it cleaner.
Bug Fix Template:
This code has a bug: [describe the issue]
Expected behavior: [what should happen]
Actual behavior: [what's happening]

Find the bug and fix it. Explain what was wrong.