Overview
Welcome to the AI Coding guide! This section covers how to use Wegent's AI-powered coding features to automate software development tasks.
Table of Contentsβ
Overviewβ
AI Coding is Wegent's core feature that enables AI agents to write, modify, and manage code in your Git repositories. Unlike simple chat interactions, AI Coding tasks connect to your code repositories and can make real changes through commits and pull requests.
Core Concept:
Code Task = User Prompt + Code Agent + Git Repository + Workbench
How It Worksβ
- Select a Code Agent: Choose an agent configured with a Code-type Shell (e.g., ClaudeCode)
- Connect Repository: Link your GitHub or GitLab repository
- Describe Your Task: Provide a clear description of what you want to accomplish
- AI Executes: The agent clones your repo, makes changes, and commits them
- Review Results: Use the Workbench to review changes, diffs, and create PRs
Key Featuresβ
Git Integrationβ
- GitHub & GitLab Support: Connect to your repositories with OAuth or personal access tokens
- Branch Management: AI creates feature branches for each task
- Commit History: Track all changes made by the AI with detailed commit messages
- Pull Request Creation: Easily create PRs from completed tasks
Workbench Panelβ
The Workbench is a dedicated panel that provides real-time visibility into your coding task:
| Tab | Description |
|---|---|
| Overview | Task status, repository info, execution timeline, and summary |
| Files Changed | View all modified files with syntax-highlighted diffs |
| Preview | Live preview for web applications (when available) |
Execution Timelineβ
Watch the AI's thought process in real-time:
- Tool Usage: See which tools the AI is using (Read, Edit, Write, Bash, etc.)
- Progress Tracking: Monitor task progress with visual indicators
- Thinking Process: Understand the AI's decision-making
Code Review Featuresβ
- Diff Viewer: Side-by-side or unified diff view for all changes
- File Statistics: Lines added/removed per file
- Commit Details: View individual commits with author and timestamp
Getting Startedβ
Prerequisitesβ
Before using AI Coding, ensure you have:
- Git Token Configured: Set up your GitHub or GitLab access token in Settings
- Code Agent Available: Have at least one agent with a Code-type Shell
- Repository Access: Ensure your token has access to the target repository
Quick Startβ
- Navigate to Code Page: Click "Code" in the left navigation
- Select an Agent: Choose a code-capable agent from the dropdown
- Select Repository: Pick your target repository and branch
- Enter Your Task: Describe what you want the AI to do
- Send and Monitor: Submit the task and watch progress in the Workbench
Example Tasksβ
Here are some example prompts to get you started:
Add a user authentication feature with JWT tokens
Refactor the database module to use connection pooling
Fix the bug in the payment processing where duplicate charges occur
Add unit tests for the UserService class with at least 80% coverage
Documentationβ
| Document | Description |
|---|---|
| Managing Code Tasks | Create, execute, and manage coding tasks |
| Spec Clarification | Refine vague requirements into clear tasks |
Best Practicesβ
1. Write Clear Promptsβ
β Good Prompt:
Add a REST API endpoint POST /api/users that:
- Accepts JSON body with name, email, and password
- Validates email format and password strength
- Returns 201 with user ID on success
- Returns 400 with validation errors on failure
β Vague Prompt:
Add user creation
2. Use Spec Clarification for Complex Tasksβ
For complex or ambiguous requirements, use the Spec Clarification feature to refine your requirements through interactive Q&A before starting the coding task.
3. Review Changes Before Mergingβ
Always review the AI's changes in the Workbench:
- Check the diff for each modified file
- Verify the commit messages are accurate
- Test the changes locally if needed
- Create a PR for team review
4. Break Down Large Tasksβ
Instead of one massive task, break it into smaller, focused tasks:
Instead of:
Build a complete e-commerce system
Do this:
Task 1: Create product catalog API endpoints
Task 2: Implement shopping cart functionality
Task 3: Add checkout and payment processing
Task 4: Build order management system
5. Provide Contextβ
Include relevant context in your prompts:
- Reference existing code patterns
- Mention specific files or modules
- Specify coding standards or conventions
- Include acceptance criteria
Related Resourcesβ
- Agent Settings - Configure code agents
- Configuring Models - Set up AI models
- Configuring Shells - Configure execution environments
- Core Concepts - Understand Wegent architecture
Get Helpβ
Need assistance?
- π Check FAQ
- π Submit GitHub Issue
- π¬ Join community discussions
Start coding with AI and boost your productivity! π