U_Agentix Agent Builder VS Code Extension
Visual agent creation and strategy development for AI trading
Build, test, and deploy intelligent trading agents directly from VS Code with drag-and-drop interface, battle simulation, and real-time performance tracking.
Features
Agent Explorer
- 57 Pre-Built Agents - Browse and customize legendary investor personas
- Category Organization - Agents grouped by strategy type (Value, Momentum, Quantitative, etc.)
- Performance Metrics - View win rates, Sharpe ratios, and battle history
- Quick Actions - Edit, duplicate, export, or delete agents with one click
Agent Creation
- Visual Wizard - Step-by-step agent creation with smart defaults
- 4 Strategy Templates - Momentum, Value, Contrarian, Quantitative
- Custom Configuration - Fine-tune risk management, execution, and indicators
- Code Generation - Export to TypeScript, Python, JSON, or Pine Script
Battle Simulator
- Local Testing - Run battles before deploying to production
- Multiple Scenarios - Bull, bear, sideways, volatile, or historical markets
- Real-Time Results - See live rankings, equity curves, and trade history
- Performance Analytics - Sharpe ratio, max drawdown, win rate, profit factor
- Export Results - Save battles as JSON, CSV, or PDF reports
Strategy Builder (Phase 2)
- Drag-and-Drop UI - Visual strategy design with components
- Real-Time Preview - See strategy logic as you build
- Backtest Integration - Test strategies on historical data
- Code Export - Generate production-ready agent code
MCP Integration
- Data Ops MCP - Load/save agent configurations and battle data
- VS Code MCP - Generate code components and templates
- Analytics MCP - Track performance and get ML recommendations
- Deployment MCP - Deploy agents to staging or production
Installation
Requirements
- VS Code 1.60.0 or higher
- Node.js 16.x or higher
- Git (for version control features)
Quick Install
Download Extension
cd /Users/haymanhymanb.t./Desktop/U_Agentix/u-agentix-agent-builder-extension
npm install
npm run build
npm run package:vsix
Install in VS Code
- Open VS Code
- Go to Extensions (Cmd+Shift+X)
- Click "..." menu > "Install from VSIX"
- Select
u-agentix-agent-builder-0.1.0.vsix
Verify Installation
- Look for "Agent Builder" icon in activity bar (left sidebar)
- Click to open Agent Explorer
Manual Setup
# Clone or navigate to extension directory
cd u-agentix-agent-builder-extension
# Install dependencies
npm install
# Build extension
npm run compile
# Run tests
npm test
# Package for distribution
npm run package:vsix
Quick Start
1. Create Your First Agent
Cmd+Shift+P > Agent Builder: Create New Agent
Follow the wizard:
- Enter agent name (e.g., "My Momentum Trader")
- Select strategy type (Momentum, Value, Contrarian, Quantitative)
- Choose category (Custom recommended for first agent)
- Add description
Your agent is created and appears in Agent Explorer!
2. Customize Agent Configuration
Option A: Visual Editor
- Right-click agent in tree view
- Select "Edit Agent Configuration"
- Modify JSON configuration
- Save changes
Option B: Strategy Builder (Coming Phase 2)
- Right-click agent
- Select "Open Strategy Builder"
- Drag-and-drop components
- Connect indicators to actions
3. Run a Battle Simulation
Cmd+Shift+P > Agent Builder: Run Battle Simulation
Steps:
- Select 2+ agents to compete
- Choose market scenario (Bull, Bear, Sideways, Volatile)
- Set duration (1 Hour, 1 Day, 1 Week, 1 Month)
- Watch battle run with progress bar
- View results with rankings and statistics
4. Export Agent to Code
Right-click agent > Export Strategy
Choose format:
- TypeScript Class - Full agent implementation
- Python Script - Python trading bot
- JSON Config - Agent configuration file
- Pine Script - TradingView strategy
Code opens in new editor ready to save and use!
Agent Explorer
Tree View Structure
Agent Builder
├── Legendary Investors (8)
│ ├── Value Oracle AI
│ ├── Growth Scout AI
│ ├── Fundamental Sage AI
│ └── ...
├── Modern Mavericks (8)
│ ├── Innovation Hunter AI
│ ├── Capital Maverick AI
│ └── ...
├── Quantitative Wizards (5)
│ ├── Quant Master AI
│ ├── Casino Quant AI
│ └── ...
├── Specialists (9)
├── Educational Personas (10)
└── Custom
└── Your custom agents
Agent Details Panel
Click any agent to view:
- Overview: Strategy, category, description
- Performance: Return, Sharpe, drawdown, win rate
- Risk Management: Position sizing, stop loss, take profit
- Execution: Order types, slippage, commission
- Backstory: Agent personality and approach
Right-click any agent:
- View Agent Details
- Edit Agent Configuration
- Duplicate Agent
- Export Strategy to Code
- Delete Agent
Battle Simulator
Running Battles
Select Participants
- Minimum 2 agents required
- Select from all 57 agents
- Can battle same strategy types
- Duplicate agents allowed
Choose Scenario
- Bull Market: Strong uptrend (2024-style)
- Bear Market: Downturn and decline
- Sideways: Range-bound trading
- Volatile: High volatility environment
- Historical: Use actual historical data
Set Duration
- 1 Hour: Quick test
- 1 Day: Standard battle
- 1 Week: Medium-term analysis
- 1 Month: Long-term performance
View Results
- Winner announcement
- Full rankings table
- Performance statistics
- Trade-by-trade history
Battle Results
Battle Results
Winner: Quant Master AI
Return: 12.5%
Sharpe Ratio: 1.85
Max Drawdown: 5.2%
Win Rate: 65.0%
Total Trades: 47
Rankings:
1. Quant Master AI - 12.5%
2. Momentum Mike AI - 10.2%
3. Value Oracle AI - 8.7%
4. Contrarian Prophet AI - 6.3%
Export Options
- JSON: Full battle data with trades
- CSV: Rankings and statistics
- PDF: Professional report (Phase 2)
Code Generation
TypeScript Agent Class
import { TradingAgent, Signal, MarketData } from '@u-agentix/core';
export class MyMomentumAgent extends TradingAgent {
name = 'My Momentum Trader';
strategy = 'momentum';
async analyzeMarket(data: MarketData): Promise<Signal> {
const rsi = this.calculateRSI(data, 14);
const macd = this.calculateMACD(data, 12, 26, 9);
if (rsi > 70 && macd.signal === 'buy') {
return {
action: 'buy',
quantity: this.calculatePositionSize(data),
reason: 'Strong momentum detected'
};
}
return { action: 'hold' };
}
// Full implementation included...
}
Python Trading Script
from trading_agent import TradingAgent, Signal, MarketData
class MyMomentumAgent(TradingAgent):
def __init__(self):
self.name = 'My Momentum Trader'
self.strategy = 'momentum'
async def analyze_market(self, data: MarketData) -> Signal:
rsi = self.calculate_rsi(data, 14)
macd = self.calculate_macd(data, 12, 26, 9)
if rsi > 70 and macd['signal'] == 'buy':
return Signal(
action='buy',
quantity=self.calculate_position_size(data),
reason='Strong momentum detected'
)
return Signal(action='hold')
Pine Script (TradingView)
//@version=5
indicator("My Momentum Trader", overlay=true)
// Strategy Parameters
fastMA = ta.sma(close, 10)
slowMA = ta.sma(close, 30)
rsi = ta.rsi(close, 14)
buySignal = ta.crossover(fastMA, slowMA) and rsi > 70
sellSignal = ta.crossunder(fastMA, slowMA) or rsi < 30
plotshape(buySignal, style=shape.triangleup, location=location.belowbar, color=color.green)
plotshape(sellSignal, style=shape.triangledown, location=location.abovebar, color=color.red)
Agent Templates
Momentum Strategy
Entry Conditions:
- RSI > 70 (strong momentum)
- MACD bullish crossover
- Volume > 1.5x average
Exit Conditions:
- RSI < 30 (momentum weakening)
- MACD bearish crossover
Risk Management:
- Stop Loss: 2%
- Take Profit: 5%
- Max Position: 10% of capital
Value Strategy
Entry Conditions:
- P/E < 15
- P/B < 1.5
- Dividend Yield > 3%
- 25% margin of safety
Exit Conditions:
- Price >= Intrinsic Value
- Fundamentals deteriorate
Risk Management:
- Stop Loss: 15%
- Take Profit: Fair value
- Position sizing based on discount
Contrarian Strategy
Entry Conditions:
- Fear & Greed Index < 20
- RSI < 30 (oversold)
- Price 10%+ below 50 MA
- High volatility
Exit Conditions:
- Fear & Greed Index > 80
- RSI > 70 (overbought)
- Price 10%+ above 50 MA
Risk Management:
- Stop Loss: 10%
- Conservative position sizing
- Scale in on dips
Quantitative Strategy
Entry Conditions:
- Multi-factor score > 2σ
- Statistical edge > 2%
- Positive momentum + mean reversion
Exit Conditions:
- Score < -2σ
- Edge disappears
Risk Management:
- Kelly Criterion position sizing
- Dynamic stop loss
- Probabilistic exits
MCP Integration
Data Ops MCP
// Load agent personas
const agents = await mcp.loadAgentPersonas({
includeStrategies: true,
includePerformance: true
});
// Get battle history
const battles = await mcp.getBattleHistory({
timeframe: 'last-30-days',
limit: 10
});
// Run battle simulation
const results = await mcp.simulateBattle({
agents: ['agent1', 'agent2'],
scenario: 'bull-market',
duration: '1-month'
});
VS Code MCP
// Generate agent code
await mcp.generateAgentCode({
name: 'MyAgent',
template: 'momentum',
includeTests: true
});
// Refactor existing code
await mcp.refactorAgentCode({
filePath: 'agents/MyAgent.ts',
refactorType: 'add-typescript'
});
Analytics MCP
// Get performance metrics
const performance = await mcp.getAgentPerformance({
agentId: 'quant_master_ai',
timeframe: 'all-time'
});
// Get strategy recommendations
const recommendations = await mcp.getRecommendedStrategies({
agentType: 'momentum',
maxResults: 5
});
Configuration
Extension Settings
Open VS Code Settings > Extensions > Agent Builder:
{
"agentBuilder.agentPersonasPath": "/path/to/agent-personas",
"agentBuilder.mcpDataOpsEnabled": true,
"agentBuilder.mcpVSCodeEnabled": true,
"agentBuilder.mcpAnalyticsEnabled": true,
"agentBuilder.autoSaveOnBuild": true,
"agentBuilder.showPerformanceMetrics": true,
"agentBuilder.defaultStrategy": "momentum",
"agentBuilder.battleSimulationDuration": "1-day"
}
Agent Configuration
{
"strategy": {
"type": "momentum",
"parameters": {
"rsiPeriod": 14,
"macdFast": 12,
"macdSlow": 26
},
"entryConditions": [
{ "indicator": "RSI", "operator": "gt", "value": 70 },
{ "indicator": "MACD", "operator": "cross-above", "value": 0 }
],
"exitConditions": [
{ "indicator": "RSI", "operator": "lt", "value": 30 }
]
},
"riskManagement": {
"maxPositionSize": 0.1,
"stopLoss": 0.02,
"takeProfit": 0.05,
"maxDrawdown": 0.2,
"positionSizing": "fixed"
},
"execution": {
"orderType": "market",
"timeInForce": "day",
"slippage": 0.001,
"commission": 0.001
}
}
Commands
Command Palette
Access via Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux):
Agent Builder: Create New Agent - Create agent with wizard
Agent Builder: Run Battle Simulation - Battle 2+ agents
Agent Builder: Open Strategy Builder - Visual strategy editor
Agent Builder: Export Strategy to Code - Generate code
Agent Builder: Import Strategy from File - Load JSON config
Agent Builder: Refresh Agent List - Reload all agents
Keyboard Shortcuts
No default shortcuts. Add your own in VS Code Keyboard Shortcuts:
{
"key": "cmd+shift+a",
"command": "agentBuilder.createAgent"
},
{
"key": "cmd+shift+b",
"command": "agentBuilder.runBattle"
}
Development
Build from Source
# Clone repository
git clone https://github.com/u-agentix/agent-builder-extension.git
cd agent-builder-extension
# Install dependencies
npm install
# Build TypeScript
npm run compile
# Watch mode for development
npm run watch
# Run tests
npm test
# Package extension
npm run package:vsix
Project Structure
u-agentix-agent-builder-extension/
├── src/
│ ├── extension.ts # Main entry point
│ ├── commands/
│ │ ├── createAgent.ts # Create agent wizard
│ │ ├── runBattle.ts # Battle simulator
│ │ └── exportStrategy.ts # Code generation
│ ├── providers/
│ │ ├── agentTreeProvider.ts # Agent tree view
│ │ └── ...
│ ├── services/
│ │ ├── mcpIntegration.ts # MCP client
│ │ ├── agentService.ts # Agent CRUD
│ │ ├── battleEngine.ts # Battle simulation
│ │ └── ...
│ ├── webviews/
│ │ ├── strategyBuilder.ts # Visual builder
│ │ ├── battleSimulator.ts # Battle UI
│ │ └── ...
│ └── types/
│ ├── agent.ts # Agent types
│ ├── strategy.ts # Strategy types
│ └── battle.ts # Battle types
├── templates/
│ ├── momentum-agent.template.ts
│ ├── value-agent.template.ts
│ ├── contrarian-agent.template.ts
│ └── quant-agent.template.ts
├── test/
│ └── extension.test.ts
├── package.json
├── tsconfig.json
├── webpack.config.js
└── README.md
Running Tests
# All tests
npm test
# Watch mode
npm run test:watch
# Coverage
npm run test:coverage
Adding New Templates
Create template file in templates/:
// templates/my-strategy.template.ts
import { TradingAgent } from '@u-agentix/core';
export class {{AGENT_CLASS_NAME}} extends TradingAgent {
// Your strategy logic
}
Add to export command in commands/exportStrategy.ts
Update README with strategy description
Troubleshooting
Extension not activating
Solution: Check VS Code version (must be 1.60.0+)
code --version
Agent tree not loading
Solution: Verify agent personas path in settings
{
"agentBuilder.agentPersonasPath": "/absolute/path/to/agent-personas"
}
Battle simulation fails
Solution: Ensure at least 2 agents selected
Solution: Check MCP Data Ops is running
Code generation errors
Solution: Verify VS Code MCP is enabled in settings
Solution: Check template files exist in templates/ directory
MCP integration not working
Solution: Verify MCP servers are running:
# Check MCP status
curl http://localhost:3100/health # Data Ops MCP
curl http://localhost:3101/health # VS Code MCP
Roadmap
Phase 1 (Current - v0.1.0) ✅
- [x] Agent Explorer with 57 agents
- [x] Create agent from template
- [x] Battle simulator (local)
- [x] Code export (TypeScript, Python, JSON, Pine Script)
- [x] Agent details panel
- [x] MCP integration skeleton
- [x] Basic testing
Phase 2 (v0.2.0) - Q1 2025
- [ ] Visual strategy builder with drag-and-drop
- [ ] Advanced battle scenarios
- [ ] Real-time backtesting
- [ ] Performance charts and visualizations
- [ ] Strategy marketplace
- [ ] Collaborative features
- [ ] Full MCP integration
Phase 3 (v0.3.0) - Q2 2025
- [ ] Machine learning strategy optimization
- [ ] Live trading integration
- [ ] Portfolio management
- [ ] Advanced analytics dashboard
- [ ] Community agent sharing
- [ ] Mobile companion app
Contributing
This extension is part of the U_Agentix platform. For contributions:
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature)
- Commit changes (
git commit -m 'Add amazing feature')
- Push to branch (
git push origin feature/amazing-feature)
- Open Pull Request
Code Style:
- TypeScript for all code
- ESLint + Prettier for formatting
- Jest for testing
- Document all public APIs
Support
License
Proprietary License — All Rights Reserved. See LICENSE file for details.
Acknowledgments
Version: 0.1.0
Last Updated: October 18, 2025
Status: Phase 1 Complete
Next Release: v0.2.0 (Visual Strategy Builder)
Made with ❤️ by the U_Agentix Spec Team