Codigocode.ai Post-Migration Agent
" The Codigocode transformation, I have sensed. Ready to review anomalies and guide the next steps"
CodigoCodeAgent is an AI engineering agent for VS Code that assists developers after a codebase has been transformed by Codigocode.ai (Revitalize). It focuses on detecting, understanding, and fixing anomalies locally while preserving full historical context from Codigocode.ai.
🎯 Core Objective
CodigoCodeAgent's primary goal is to:
- Load the full history of a Codigocode.ai transformation run
- Understand detected anomalies and architectural decisions
- Guide and apply fixes directly in the local VS Code workspace
- Close the feedback loop by reporting fixes back to Codigocode.ai
CodigoCodeAgent does not re-run the full migration. It works only on post-migration refinement and correction.
🚀 Features
🧠 Intelligent Anomaly Detection
- Retrieves anomalies from Codigocode.ai transformation runs
- Performs local code analysis for additional issues
- Classifies anomalies by type and severity
- Provides contextual fix suggestions
🗂️ Vector Database Integration
- Connects to Codigocode.ai Vector Databases
- Retrieves migration decisions and historical context
- Learns from previous fixes and rejected solutions
- Provides semantic search for relevant information
🔧 Smart Fix Application
- Proposes fixes with confidence levels
- Shows detailed reasoning for each suggestion
- Applies fixes incrementally with user confirmation
- Validates fixes against historical patterns
📊 Rich VS Code Integration
- Anomalies View: Organized by severity with detailed tooltips
- History View: Shows migration decisions and applied fixes
- Command Palette: Quick access to all CodigoCodeAgent functions
- Webview Panels: Detailed fix analysis and recommendations
📋 Prerequisites
- Codigocode.ai Transformation: Your project must have been processed by Codigocode.ai
- Context File: A
.codigocode/context.json file must exist in your workspace
- API Access: Valid API credentials for Codigocode.ai services
🛠️ Installation
Install from VSIX (when available):
code --install-extension codigocode-agent-1.0.0.vsix
Development Setup:
cd codigocode-agent
npm install
npm run compile
Configure Settings:
- Open VS Code Settings
- Search for "CodigoCodeAgent"
- Configure API URLs and credentials
⚙️ Configuration
Required Settings
{
"codigocode.codigocodeApiUrl": "https://api.codigocode.ai",
"codigocode.vectorDbUrl": "https://vector.codigocode.ai",
"codigocode.apiKey": "your-api-key-here"
}
Optional Settings
{
"codigocode.autoFixMode": false,
"codigocode.debugMode": false
}
🎮 Usage
1. Automatic Activation
CodigoCodeAgent automatically activates when it detects a .codigocode/context.json file in your workspace.
2. Manual Activation
- Open Command Palette (
Ctrl+Shift+P)
- Run
Codigocode: Activate Agent
3. Load Context
- Run
Codigocode: Load Context
- The agent will read your transformation history
4. Detect Anomalies
- Run
Codigocode: Detect Anomalies
- View results in the Anomalies panel
5. Fix Anomalies
- Click on any anomaly in the panel
- Review the suggested fix
- Apply or customize the solution
6. View History
- Run
Codigocode: Show Migration History
- Explore past decisions and fixes
📁 Context File Format
CodigoCodeAgent expects a .codigocode/context.json file with this structure:
{
"projectId": "your-project-id",
"runId": "your-run-id",
"sessionId": "your-session-id",
"repository": {
"originalStack": "legacy-framework",
"targetStack": "modern-framework",
"commitHash": "abc123..."
},
"transformationDate": "2025-01-01T00:00:00Z",
"metadata": {
"projectName": "My Project",
"version": "1.0.0"
}
}
🔍 Anomaly Types
CodigoCodeAgent detects and categorizes these types of anomalies:
- 🐛 Functional Bug: Issues that affect functionality
- 🏗️ Architectural Violation: Deviations from intended architecture
- ⚡ Performance Issue: Code that may impact performance
- 🔒 Security Concern: Potential security vulnerabilities
- 👃 Code Smell: Maintainability and readability issues
🎯 Severity Levels
- 🔴 Critical: Must be fixed immediately
- 🟠 High: Should be fixed soon
- 🟡 Medium: Should be addressed when convenient
- 🟢 Low: Nice to have fixes
🤖 Agent Behavioral Principles
The agent follows best practices:
- Be wise, not verbose: Clear, actionable guidance
- Never hallucinate: Always query Codigocode.ai for missing context
- Prefer explanation over authority: Guide the developer, don't replace them
- When unsure: "Certain, I am not. Consult the Codigocode Holocron, I must."
🔄 Feedback Loop
After fixing anomalies, CodigoCodeAgent sends structured feedback to Codigocode.ai:
- Anomaly ID and files changed
- Diff summary and rationale
- Test results and confidence level
- Timestamp and metadata
This feedback helps improve future migrations and anomaly detection.
🛠️ Development
Building
npm run compile
Testing
npm test
Packaging
vsce package
📝 Commands
| Command |
Description |
codigocode.activate |
Activate Codigocode Agent |
codigocode.loadContext |
Load Codigocode Context |
codigocode.detectAnomalies |
Detect Anomalies |
codigocode.fixAnomaly |
Fix Selected Anomaly |
codigocode.showHistory |
Show Migration History |
codigocode.sendFeedback |
Send Feedback to Codigocode.ai |
🎨 Views
Anomalies View
- Organized by severity level
- Click to see fix suggestions
- Auto-fixable items marked with ✅
History View
- Migration decisions and rationale
- Applied fixes and their outcomes
- Conversation history with context
🔧 Troubleshooting
Common Issues
"Context not loaded"
- Ensure
.codigocode/context.json exists
- Check file format and required fields
"Failed to connect to API"
- Verify API URLs in settings
- Check API key validity
- Ensure network connectivity
"No anomalies detected"
- Run
Codigocode: Detect Anomalies manually
- Check if project was processed by Codigocode.ai
- Verify project ID and run ID
Debug Mode
Enable debug mode in settings to see detailed logs:
{
"codigocode.debugMode": true
}
📄 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
📞 Support
For support and questions:
"Excellence in code transformation." - Codigocode.ai
May the Force be with your code! 🌟