Asoba Zorora Documentation

Code Generation Guide

Generate code with Codestral specialist model.

Overview

Zorora includes dedicated code generation capabilities using the Codestral specialist model. This allows you to generate code, refactor existing code, and implement algorithms with high-quality output.

Code Generation Example Screenshot
(Placeholder - Add screenshot showing code generation in action)

Using Code Generation

Terminal Interface

Automatic Detection:

[1] ⚙ > Write a Python function to validate email addresses

The system automatically detects code generation intent and routes to Codestral.

Force Code Generation:

[2] ⚙ > /code create a REST API endpoint for user authentication

Code Generation Examples

Functions:

/code write a function to parse JSON files with error handling

Classes:

/code create a User class with authentication methods

Scripts:

/code write a script to backup files to S3

Refactoring:

/code refactor this function to use async/await

Codestral Models

Local Model

Model: qwen/qwen3-vl-4b

Characteristics:

When to use:

HuggingFace Model

Model: Qwen2.5-Coder-32B-Instruct

Characteristics:

When to use:

Code Generation Workflow

Step 1: Request Code

/code write a function to validate email addresses using regex

Step 2: Review Generated Code

Codestral generates:

Step 3: Save Code (Optional)

> /save email_validator.py
Saved to: email_validator.py

Best Practices

Writing Code Prompts

Be Specific:

Include Requirements:

Specify Language/Framework:

Code Quality

Review Generated Code:

Iterate:

Saving Code

Use Descriptive Filenames:

/save email_validator.py
/save user_auth_api.py
/save data_processor.py

Organize Files:

Advanced Usage

Code Refactoring

/code refactor this function to use async/await and add error handling

Algorithm Implementation

/code implement quicksort algorithm in Python with detailed comments

Testing Code

/code write unit tests for the email validator function

Documentation

/code add docstrings and type hints to this function

Integration with Development Workflow

Using /develop

For multi-file changes, use /develop:

/develop Add user authentication to my Flask app

This workflow:

  1. Explores codebase
  2. Plans changes
  3. Gets approval
  4. Executes with Codestral
  5. Lints and validates

Combining Commands

# Research then code
/search latest Python async patterns
/code implement async pattern from research

# Code then develop
/code create user model
/develop add authentication using this model

Troubleshooting

Code Generation Fails

Problem: Codestral model not responding

Solution:

Low Quality Code

Problem: Generated code is poor quality

Solution:

Code Not Saving

Problem: /save command not working

Solution:

See Also