guides / ai-tools-integration
๐ค AI Tools Integration Guide
This document explains how VibeCodex integrates with various AI coding tools and how to extend or modify these integrations.
๐ ๏ธ Supported AI Tools
VibeCodex currently supports the following AI tools:
- v0 by Vercel - https://v0.dev/chat
- Bolt - https://bolt.new/
- Lovable - https://lovable.dev/
- Replit - https://replit.com/
- New Tool Name - https://new-tool-url.com
๐๏ธ Integration Architecture
The integration with AI tools is primarily handled through:
- Tool Configuration: Defined in
lib/mock-data.ts
undertoolsMockData
- Prompt Templates: Stored in
lib/mock-data.ts
under each project's phases - Tool-specific URL Handling: Implemented in
app/projects/[id]/[tool]/page.tsx
โ๏ธ Tool Configuration
Each tool is configured with the following properties:
{
id: string; // Unique identifier for the tool
name: string; // Display name
description: string; // Short description of the tool's strengths
linkPattern: string; // Base URL for the tool
}
๐ Prompt Templates
Each project phase contains tool-specific prompts:
prompts: {
[toolId]: {
content: string; // The actual prompt text
tooltips: { // Optional tooltips for parts of the prompt
text: string; // Text to highlight
explanation: string; // Explanation for the tooltip
highlightColor: string; // Color for the highlight
}[]
}
}
๐ URL Handling
The getToolUrl()
function in app/projects/[id]/[tool]/page.tsx
handles tool-specific URL generation:
const getToolUrl = () => {
if (tool.id === "v0") {
// Encode the prompt for v0
const encodedPrompt = encodeURIComponent(prompt.content);
return `${tool.linkPattern}?q=${encodedPrompt}`;
} else if (tool.id === "new-tool-id") {
// New tool-specific URL handling
return `${tool.linkPattern}/special-path?param=${encodeURIComponent(prompt.content)}`;
}
return tool.linkPattern;
};
โ Adding a New AI Tool
To add a new AI tool:
- Add the tool configuration to
toolsMockData
inlib/mock-data.ts
:
{
id: "new-tool-id",
name: "New Tool Name",
description: "Description of the new tool",
linkPattern: "https://new-tool-url.com",
}
- Add tool-specific prompts for each project phase:
prompts: {
"new-tool-id": {
content: "Prompt for the new tool...",
tooltips: []
}
}
- Update the
getToolUrl()
function if the new tool requires special URL handling:
const getToolUrl = () => {
if (tool.id === "v0") {
// Existing v0 handling
} else if (tool.id === "new-tool-id") {
// New tool-specific URL handling
return `${tool.linkPattern}/special-path?param=${encodeURIComponent(prompt.content)}`;
}
return tool.linkPattern;
};
- Add the tool logo to the
public
directory and update theToolLogo
component if needed.
๐งช Testing Tool Integrations
When testing a new tool integration:
- Verify that the tool logo displays correctly
- Check that the prompt is properly formatted for the tool
- Ensure the "Open in [Tool]" button correctly navigates to the tool with the prompt
- Test the copy functionality to ensure the prompt can be manually copied if needed
๐ง Troubleshooting
Common issues with tool integrations:
- URL Encoding Issues: Ensure special characters in prompts are properly encoded
- CORS Issues: Some tools may block embedding or direct linking
- Authentication Requirements: Some tools may require authentication before accepting prompts
For any issues, please open a GitHub issue with detailed reproduction steps at https://github.com/jalcantarab/v0-vibecodex/issues.
๐ Related Documentation
- Project Structure - Understanding the codebase organization
- Implementation Notes - Detailed implementation guidelines
- Contributing Guide - How to contribute to the project
Last updated: Recently