Verdent Docs
This is archived Verdent 1.0 documentation. For current product documentation, see Verdent.

Writing New Code

Using Verdent to write and generate code effectively

Learn how to write effective prompts, use @-mentions for context, and select the right model preset for code generation.

What You'll Learn

  • Compose effective prompts for code generation
  • Use @-mentions to provide context
  • Leverage Desktop-specific features for parallel development
  • Review generated code with Code Review

Prompt Composition

Effective Prompt Structure

For straightforward code generation:

Create a function that [does X]

Example:

Create a function that validates email addresses using regex

For multi-step or complex code:

I need to [goal]. The context is [background].
Requirements:
- [Requirement 1]
- [Requirement 2]

Consider [constraints or preferences]

Example:

I need to build a user authentication system. We're using Express.js with PostgreSQL.
Requirements:
- JWT-based authentication
- Refresh token support
- Password hashing with bcrypt

Follow the existing patterns in our auth middleware

Do:

  • Be specific about desired behavior
  • Mention relevant files or patterns
  • Specify error handling expectations
  • Include edge cases to handle

Don't:

  • Use vague language ("make it better")
  • Assume context from previous sessions
  • Leave out important constraints
  • Request multiple unrelated changes

Iterative Development

Build features incrementally:

Start Simple

Request the basic structure or core functionality first

Review and Refine

Review generated code, request specific improvements

Add Complexity

Layer in error handling, edge cases, validation

Test and Polish

Request tests, documentation, or final polish


Using @-Mentions

@-mentions provide context by referencing specific files, folders, or symbols.

Syntax

MentionScopeExample
@filenameSingle file@userService.ts
@folder/Directory@src/components/

When to Use @-Mentions

Look at @authMiddleware.ts and create a similar middleware for rate limiting
Refactor @userController.ts to use the patterns from @productController.ts
Search @src/utils/ for any duplicate utility functions

Desktop-Specific Code Writing

Parallel Feature Development

Build unrelated features simultaneously in separate workspaces:

Create First Workspace

Click New Workspace in the Top Bar to create an isolated workspace for your first feature

Name the Workspace

Give the workspace a descriptive name (e.g., "feature-auth")

Start a Task

In the input box, describe what you want to build and send your message to start a new task

Create Additional Workspaces

Repeat the above steps for each additional feature you want to work on

Work in Parallel

Each agent works independently in its own workspace without conflicts

Review Changes

When a feature is complete, review changes

Rebase to main branch

Click Workspace Actions → Rebase to main branch to apply changes

Example: Build an authentication system in one workspace while another agent builds the dashboard UI in a separate workspace.

Fix urgent bugs without interrupting ongoing feature development:

Continue Feature Work

Keep your current feature work running in its workspace

Create Bug Fix Workspace

Click New Workspace in the Top Bar to create a separate workspace for the bug fix

Name the Workspace

Name the workspace descriptively (e.g., "fix-login-error")

Describe the Bug

In the input box, describe the bug and how to fix it to start a new task

Parallel Work

The bug fix agent works independently while your feature agent continues

Ship the Fix

When the fix is ready, click Workspace Actions → Rebase to main branch to ship the fix

Resume Feature Work

Your feature workspace continues uninterrupted with the fix now in master

Benefit: Ship critical fixes immediately without pausing feature development or losing context.

Try risky refactors or experimental approaches without affecting stable code:

Create Experiment Workspace

Click New Workspace in the Top Bar to create an isolated workspace for your experiment

Name the Workspace

Name it clearly (e.g., "experiment-new-architecture")

Describe the Experiment

In the input box, describe the experimental approach you want to try to start a new task

Let Agent Explore

Let the agent explore and implement the changes freely

Review Results

Review the results to see all modifications

Keep or Discard

If successful, click Workspace Actions → Rebase to main branch to keep changes. If failed, click Delete Workspace in the Workspace Bar to discard all changes.

Benefit: Your base workspace remains stable and unchanged regardless of experimental outcomes.

Plan Mode for Complex Features

For complex code generation:

  1. Press Shift+Tab or Ctrl+. to switch to Plan Mode
  2. Describe the feature you want to build
  3. Review the plan Verdent creates
  4. Refine with follow-up questions
  5. Switch to Agent Mode to execute the plan

Benefit: Review approach before consuming credits on execution.

Reviewing Generated Code

After Verdent generates code, use Code Review for quality assurance:

View Code Review

After Verdent completes changes, the Code Review panel appears inline within the chat

Address Critical Issues

Review Must Fix items first, these are security, performance, or stability issues

Consider Suggestions

Review Suggestions for recommended improvements you may want to apply

Request Fixes

Ask Verdent to fix any issues by describing what needs to change in the input box

View Diff

Click Task Changes in the middle panel to see all file modifications

Code Review analyzes:

CategoryFocus
SecurityVulnerability scanning, injection risks, credential exposure
AccessibilityAccessibility compliance and best practices
PerformanceAlgorithmic complexity, resource usage
Call-chain ImpactDownstream effects on dependent code

Enable Auto Generate Code Review in Settings → Chat to automatically generate reviews after every change.


FAQs

How do I get more accurate code generation?
  1. Be specific - Include exact requirements
  2. Provide context - Use @-mentions for relevant files
  3. Specify patterns - Reference existing code as examples
  4. Iterate - Build incrementally rather than all at once
Should I use Plan Mode for all code writing?

Use Plan Mode for:

  • Complex multi-file changes
  • Unfamiliar patterns or codebases
  • When you want to review approach first

Skip Plan Mode for:

  • Simple, straightforward tasks
  • Well-understood changes
  • Quick iterations
Can I work on multiple features at the same time?

Yes. Create separate workspaces for each feature by clicking New Workspace in the Top Bar. Each workspace has its own agent working in isolation.

How do I undo changes Verdent made?

You don't need to delete the entire workspace to undo changes. You have several options:

  • Rollback: Hover over any message in the chat and click Rollback to this point to revert to an earlier state.
  • Use Source Control: Open Source Control (Ctrl+Shift+G / Cmd+Shift+G) to view changed files and revert specific changes.
  • Delete workspace: Click Delete Workspace in the Workspace Bar to discard all changes in that workspace. Your base workspace remains unaffected.
Does Code Review use credits?

Yes. Code reviews consume credits based on the amount of code analyzed. Disable auto-review in Settings → Chat if you want to save credits.

Can Verdent generate tests for my code?

Yes. Ask Verdent to write tests by describing what to test and referencing files with @-mentions (e.g., "Write tests for @userService.ts").


See Also