Stop Context Switching: How I Built a Tool to Generate Elite AI Prompts Inside VS Code
We all know the struggle. 🛑
You are deep in the "flow state," writing a complex Python function or debugging a PHP script. Suddenly, you hit a wall. You need AI assistance.
The old workflow:
- Alt + Tab to Chrome.
- Open ChatGPT or Claude.
- Write a lazy prompt like "fix this code" (because you are tired).
- Get a mediocre answer.
- Argue with the AI to get the context right.
- Alt + Tab back to VS Code.
- Forget what you were doing. 🤯
Context switching is the enemy of productivity.
That's why I spent the last few months building fnPrompt – an ecosystem designed to bring "Elite Prompt Engineering" directly to where developers live: The IDE and the Terminal.
🏗️ What is fnPrompt?
fnPrompt isn't just a prompt library. It's an "AI Architect" engine.
You give it a raw, vague idea (e.g., "Explain this regex" or "Write a unit test for this login function").
It uses OpenAI's API to structurally engineer that idea into a perfect System Prompt containing:
- 🤖 Persona: (e.g., Senior QA Engineer)
- 🎯 Objective: (Specific goals)
- 🧠 Context: (Background info)
- 🚫 Constraints: (Do's and Don'ts)
- 📦 Output Format: (Code only, JSON, Markdown, etc.)
And it does this across 4 platforms: Web, Chrome, CLI, and VS Code.
⚡ The VS Code Workflow (My Favorite)
This is why I'm writing this post. As a developer, I wanted to stay in my editor.
I built a VS Code Extension that allows you to:
- Highlight any code snippet or comment.
- Right-Click -> Select
fnPrompt: Refactor. - Boom. A professional prompt is generated in seconds.
- It opens in a side panel, ready to copy or refine.
You can then use this perfectly structured prompt with Copilot, ChatGPT, or Gemini. No more lazy prompting, no more hallucinations due to lack of context.
👉 Check it out on VS Code Marketplace
💻 For the Terminal Junkies: The CLI
If you live in the terminal like me, I also built a CLI tool.
Example usage
$ fnprompt gen "Create a docker-compose for LAMP stack"
It generates the prompt and automatically copies it to your system clipboard. It feels like magic.
🛠️ The Tech Stack
For those curious about how it's built, here is the stack of this bootstrapped project:
Backend: PHP (Vanilla) + MySQL (Old school, fast, reliable).
Frontend: Tailwind CSS + Vanilla JS.
VS Code Ext: TypeScript.
AI Engine: OpenAI API (GPT-4o) for the logic processing.
Authentication: Google OAuth (Web) & Token-based (CLI/VS Code).
🚀 Try It Out (Free)
I built this tool to solve my own problem, and now I'm sharing it with the community. It is completely free to use.
I would love to hear your feedback, especially on the VS Code Extension. Does it fit your workflow? What features are missing?
Web: fnprompt.com
VS Code: Download Extension
Chrome: Web Store Coming Soon

Top comments (0)