Stop Context Switching: How I Built a Tool to Generate Elite AI Prompts Inside VS Code

Published: (January 9, 2026 at 01:52 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

The Problem: Context Switching

We all know the struggle. You’re deep in the flow state, writing a complex Python function or debugging a PHP script, and suddenly you hit a wall—you need AI assistance.

The old workflow

  1. Alt + Tab to Chrome.
  2. Open ChatGPT or Claude.
  3. Write a lazy prompt like “fix this code” (because you’re tired).
  4. Get a mediocre answer.
  5. Argue with the AI to get the context right.
  6. Alt + Tab back to VS Code.

The constant switching breaks concentration and kills productivity.


Introducing fnPrompt

fnPrompt is an ecosystem that brings elite prompt engineering directly to the IDE and the terminal. It’s more than a prompt library; it’s an “AI Architect” engine.

How it works

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 transform that idea into a perfectly structured System Prompt containing:

  • Persona – e.g., Senior QA Engineer
  • Objective – specific goals
  • Context – background information
  • Constraints – do’s and don’ts
  • Output Format – code only, JSON, Markdown, etc.

The engine is available across four platforms: Web, Chrome, CLI, and VS Code.

VS Code Extension

The extension lets you stay inside the editor:

  1. Highlight any code snippet or comment.
  2. Right‑click → fnPrompt: Refactor.
  3. A professional prompt is generated in seconds and opens in a side panel, ready to copy or refine.

You can then feed the structured prompt to Copilot, ChatGPT, Gemini, or any other model—no more lazy prompting, no more hallucinations caused by missing context.

Check it out on the VS Code Marketplace →

CLI Tool

If you prefer the terminal, fnPrompt also provides a CLI:

fnprompt gen "Create a docker-compose for LAMP stack"

The command returns a ready‑to‑use prompt that you can pipe into your favorite model.

Tech Stack

  • Backend: PHP (vanilla) + MySQL
  • Frontend: Tailwind CSS + vanilla JavaScript
  • VS Code Extension: TypeScript
  • AI Engine: OpenAI API (GPT‑4o) for prompt generation
  • Authentication: Google OAuth (Web) & token‑based (CLI/VS Code)

Try It Out (Free)

I’d love to hear your feedback, especially on the VS Code extension. Does it fit your workflow? What features are missing?

  • Web: https://fnprompt.com
  • VS Code: Download the extension from the Marketplace
  • Chrome: Web Store (coming soon)
Back to Blog

Related posts

Read more »

Hello, Newbie Here.

Hi! I'm falling back into the realm of S.T.E.M. I enjoy learning about energy systems, science, technology, engineering, and math as well. One of the projects I...