How to Use the Code Agent in GetGenerative.ai: A Step-by-Step Guide
Last updated on :

How to Use the Code Agent in GetGenerative.ai: A Step-by-Step Guide

The Code Agent is a built-in component of the Build Agent, designed to accelerate Salesforce development with intelligent code generation, editing, testing, and deployment. It automatically activates when customization tasks are identified in your implementation workbook, such as Apex classes, triggers, Lightning Web Components (LWCs), test classes, Visualforce, and Aura components.

With deep integration into your user stories, solution workbooks, and org metadata, the Code Agent offers an AI-powered development environment that aligns with your best practices and existing codebase.

1. Getting Started with Code Agent

You don’t need to activate the Code Agent manually. It becomes visible as soon as the Build Agent detects customization elements in your Implementation Workbook. Navigate to the Codebase View within the Build Agent tab to begin.

AD 4nXen2a wH3fmR7XgFN5wcKSselI7wcr7CSGhlFghlkCb8tasvGeqRuMDVf8vQUQFDNI7G hdJVMM732ybHXdg2FTvkXPVth6DVbWQWUUcMkFlHvsbbL97sDJc0XW6RndAcuChTFZiw?key=CJ5Ps9LIHD fi 6DYAFJyg

To enable full functionality, connect your Salesforce org:

  • Go to Manage Connections
  • Enter your Salesforce URL, username, password, and security token
AD 4nXfaqR9b TURZCPbGSKL4IoZ3I8TCF9vv8OEbJpvEgQnNwnAwiqlAeU2U1u4WpZ2PCyU9EoJhfSMxlMzmpLHumY2zciy4W3wDIDm8j qLqy898QwnRB2LqtgWZm5y H7 Xytchw7Mw?key=CJ5Ps9LIHD fi 6DYAFJyg
  • Once authenticated, the system allows:
    • Real-time code deployment to sandboxes
    • Codebase extraction from your org for editing or syncing

2. Reviewing Customization Tasks

From the Implementation Workbook, the Code Agent pulls in user stories that require custom development. 

AD 4nXda7ojsjyvz87oYGolNT5eMS92 8yRutIaBwCOBO5ksS4VdDoTPK0m2A8XSBAjE iTlSqy0HOtBna3YPeYoM2kB4SZzvsPAfy f1ydrPtM898NyPQRH1yM91Hdk pao8JmbSIer A?key=CJ5Ps9LIHD fi 6DYAFJyg

For each:

  • The system categorizes the configuration (code vs point-and-click)
  • Generates a task entry with:
    • File type (e.g., Apex Trigger, LWC)
    • Task name and description
    • Linked user story and workbook reference
    • Developer notes and status

These tasks serve as the foundation for generating your code files.

3. Best Practice Configuration

Before coding begins, the platform prompts you to review or configure organizational best practices for code development. 

AD 4nXfGeHcIv9By5L8E1kzz JpyXdxIP9CB7yBrjovJeV kG9c4bqjU

These include:

  • Naming conventions for files, variables, classes
  • Structural patterns for Apex, LWCs, Aura, and VF
  • Security rules and documentation standards

These settings are respected throughout the code generation process, ensuring consistency with your enterprise guidelines.

4. Launching the Code Editor

Click Open Editor to enter the full AI-powered development workspace. You can also access the editor directly from individual files listed in the Codebase View.

AD 4nXflQ Ut8mMvZhCfGHdwvl OqMa2mYiZoMQCItQn 26FCKAahgTScr84uz8fCNFtKcYcS5h 9kzyZHB5WJu2NCQtMkwV3fqFL2PSfxyIj whpd7NaVXgBI8sVq9Ru

Inside the editor:

  • All customization files are visible on the left
  • Click on any file to view or modify it
  • The AI prompt is auto-filled with:
    • Linked user story and acceptance criteria
    • Developer notes from the workbook
    • Contextual technical details

Click Generate Code to begin.

5. Generating and Applying Code

Once you initiate code generation:

  • The Dev Assistant analyzes all contextual inputs
  • Selects the most relevant proprietary LLM (GPT-4o, Claude 3.5/3.7, Gemini 2.5 Pro)
AD 4nXcTpIpKlYZJ6 iNDIxI5n3R Ob4EKUG 7JGBJeqZZcvvhN
  • Writes production-ready code—aligned with best practices

When the code is ready:

  • Click Apply Code to insert it into the file
  • Use Apply All for multi-file operations
  • If a file already exists, the system:
    • Shows a diff view (old vs. new)
    • Lets you approve or reject changes 

You can continue interacting with the assistant via chat to:

  • Add validations
  • Optimize logic
  • Refactor code
  • Explain specific sections

6. Working with Test Classes

The Code Agent makes test class management seamless.

When working on an Apex class or trigger:

  • Click Actions → Create New Test Class
  • Enter a name and click Create

AD 4nXcR1kzWyCTqeQR3nuDoSSn6wz0pH5 as junHxkM3JsT3sbvVH5geyXXdmUkjYvJ3NI034EDffB3u8X7mhraJXwupe1fpfPBRlLcpfokuS DKWgsOG5L kFc5

The system:

  • Auto-links the test class to its parent Apex file
  • Sends a prompt to the Dev Assistant to generate a test class based on the logic
  • Analyzes the Apex class to determine test methods, mocking, and coverage goals

Once generated:

  • Click Apply Code to save it into your codebase
  • Compile and deploy the test class to your sandbox
  • Click Run Test to execute it immediately

You can also view real-time test coverage reports:

  • See which lines and classes are covered
  • Drill into specific files from the report
  • Modify test classes using chat commands (e.g., “add more assertions,” “increase branch coverage”)
AD 4nXc0ztqwNzrs7u8yxdHXXqW9MsB FM4cjqhN2CFejlVbWaalMt6iA3woFIHPr7FUT2ac0lQy9zftF2cLt

AD 4nXfCDwu WI0TwmpHpRub9hg FfL9nqaApmIwQLxoFOLgbQSb 5LvurC a I gzAkelceqZE437a3BS emBVrytHbirD66SHVpqmRhhBq26eoDVDB5wI69Q i 0

7. Compile and Deploy

After code generation:

  • Click Compile to validate syntax and readiness
  • Errors are highlighted inline for quick resolution
  • Once ready, click Deploy to Org to push code to:
    • Developer Sandboxes
    • Scratch Orgs
    • Dev/Test environments

You can also deploy multiple files at once using bulk apply and deploy actions.

8. Syncing, Refreshing, and Saving Files

Stay aligned with your Salesforce org:

  • Refresh from Org to pull latest metadata and code files
  • Compare and merge with your in-progress edits
  • Save Locally to back up your code or transfer it externally

These actions ensure you’re never out of sync with other devs or environments.

9. Advanced AI Interactions

The Code Agent is more than a static generator—it’s a live coding assistant.

You can:

  • Ask open-ended queries like “Explain this method” or “Refactor this loop”
  • Target specific files without naming them—the system understands context
  • Use follow-up commands to improve, simplify, or document code

Example Prompts:

  • “Add field-level security check to this trigger”
  • “Optimize this SOQL query”
  • “Explain the logic behind this LWC controller”

10. Developer Workspace Features

  • Multi-tab editing – Open several files simultaneously
  • Dark mode toggle – Developer-friendly UI customization
AD 4nXdXXICU17Wg5m3tsLztG0TS5Agn2xR ihk1doCSc8U7L5fi0EUNx cDIXUqK7LpwBWRJ1c9XAzKa5EYDzUzLSM7tipAipK
  • Chat history clearing – Reset AI interactions as needed
  • Expand/collapse all sections – For easier navigation

The entire interface is built to feel like a natural extension of a Salesforce developer’s IDE, but with AI intelligence woven in.

Summary

The Code Agent transforms Salesforce development into a streamlined, intelligent workflow:

Feature

Description

Auto-activated

Kicks in when custom tasks are detected in Build Agent

Org Connection

Enables deployment, metadata sync, test execution

Context-Aware Coding

Based on user stories, config workbooks, and dev notes

Proprietary LLM Support

GPT-4o, Claude 3.5/3.7, Gemini 2.5 Pro

Full Dev Editor

Multi-file support, real-time generation, syntax validation

AI Chat Support

Refactor, debug, document code with natural language

Test Class Integration

Auto-generate, compile, run, and view coverage

Continuous Sync

Refresh from org or save locally for version control

FAQs

1. Can it modify existing files?

Yes. The Code Agent analyzes your current Salesforce org files and suggests either patch updates or full rewrites. It highlights all modified lines for easy review before applying any changes.

2. What types of files are supported?

It supports a full range of Salesforce development files, including:

  • Apex Classes
  • Apex Triggers
  • Lightning Web Components (JS, HTML, XML)
  • Aura Components
  • Visualforce Pages
  • Related metadata files

3. Which LLMs are available for code generation?

You can choose from multiple best-in-class models, including:

  • GPT-4o
  • Claude Sonnet 3.5 and 3.7
  • Gemini 2.5 Pro

Model selection can be customized per file or project.

4. Can it generate test classes and track coverage?

Yes. The Code Agent can:

  • Auto-generate complete test classes
  • Compile and deploy them
  • Execute tests directly in your sandbox
  • Display real-time test coverage

You can also use the Dev Assistant to improve coverage or add more test scenarios via natural language prompts.

5. What else can the Dev Assistant do?

The Dev Assistant supports a wide range of developer tasks:

  • Contextual file modifications
  • Intelligent code explanations
  • Validation and compilation
  • Deployment to Salesforce orgs
  • File syncing and multi-step bundle updates

All with support for conversational inputs and context awareness.