📦 PackagePal

Your AI-Powered Migration Assistant

💡 Inspiration

The idea was born during my own journey migrating a Node.js e-commerce backend to Go. As I began rewriting the codebase to learn the new language, I constantly hit a specific bottleneck: "What is the Go equivalent of this Node package?"

Every time I encountered a dependency, I had to stop coding, switch to the browser, and spend valuable time researching the best standard library or third-party package to use in Go. After the fourth or fifth time this happened, I realized I wasn't just migrating syntax; I was translating an ecosystem. I decided to build the tool I wished I had—one that answers the "what do I use instead?" question instantly, without ever making me leave my editor.

🚀 What it does

PackagePal is an AI-powered VS Code extension designed to help developers migrate codebases from one language to another (e.g., Node.js → Go, Python → Rust) by identifying package dependencies and finding their best equivalents in the target language.

  • Scans your active file and detects imported packages.
  • Leverages Google's Gemini AI to understand the context of the library.
  • Suggests the top 3 best alternatives in your chosen target language.
  • Delivers descriptions, usage snippets, and documentation links directly in the IDE.

🛠️ How we built it

We utilized the VS Code Extension API to create a seamless integration into the developer's workflow.

  • Gemini Integration: We implemented a GeminiService using the @google/generative-ai SDK to communicate with the gemini-3-flash-preview model. We engineered a specific prompt to ensure the AI returns structured JSON data containing package names, descriptions, and code snippets.
  • Sidebar Provider: We built a custom Package Sidebar Provider that scans the active file using regex patterns optimized for 10+ languages (Python, Go, Rust, Java, etc.) to extract imported packages.
  • Hover Provider: We implemented a HoverProvider that detects when a user hovers over an import statement and fetches AI suggestions on demand, displaying them in a rich Markdown tooltip.
  • Status Bar: A dynamic StatusBarItem allows users to quickly toggle between Source and Target languages.

🚧 Challenges we ran into

  • Prompt Engineering: Getting the AI to return consistently formatted JSON without Markdown backticks or extra conversational text required several iterations of prompt refinement.
  • Latency: Balancing the speed of the extension with the time required for an LLM to process and return an answer was tricky. We implemented caching for common packages to speed up repeated lookups.

🏆 Accomplishments that we're proud of

  • Seamless Workflow: We successfully reduced the "search time" for package alternatives from minutes of Googling to seconds inside the editor.
  • Functional Migration Assistant: Seeing the extension correctly identify a complex Node.js stack and map it to a robust Go architecture for the first time was a major win.
  • Developer Experience: Building a tool that we actually wanted to use ourselves for our own learning journey from Node to Go.

🧠 What we learned

  • VS Code Extension API: We gained a deep understanding of the VS Code extension architecture, specifically how to manage webviews and interact with the editor's text documents.
  • Caching Strategy: We learned the importance of implementing a caching layer in GeminiService to prevent redundant API calls for the same package, improving performance and saving quota.

🔮 What's next for PackagePal

  • API-Level Logic Migration: Moving beyond high-level package recommendations to suggest specific, function-level alternatives for the code already in use. For example, instead of just suggesting a Go package for environment variables, the tool would identify dotenv.config() in the Node.js code and provide the exact Go snippet, such as godotenv.Load().
  • Community Database: Implementing a voting system where users can upvote specific package alternatives, creating a community-verified mapping layer on top of the AI suggestions.
Share this project:

Updates