PromptFlow AI — VS Code Extension
Analyzes, validates, and optimizes prompts in the editor before they reach
Copilot or any other model. The rule engine (dedupe, filler-strip, token
counting, validation, scoring) runs in-process in the extension itself — no
external server, no Python, nothing to install separately. It's a TypeScript
port of apps/ide-mcp-server's original Python
implementation; see src/engine/.
This is a separate product from this repo's apps/api gateway. See
docs/03-ide-extension-product-brief.md
and docs/04-ide-extension-architecture.md.
Features (V1)
- Sidebar (activity bar → PromptFlow icon): paste a prompt and click
Optimize to run the full optimization pipeline — validate, analyze,
detect redundancy, optimize structure, reduce tokens, re-validate — with a
live animated progress view of every stage. Then see:
- a token comparison (original vs. optimized, exact tokenizer for GPT,
clearly-labeled estimates for other providers),
- an estimated LLM cost impact (before/after/savings, always labeled
as an estimate — there is no live billing integration),
- session savings accumulated across every optimize run this window,
- a polished summary card with a Send to AI Chat button that opens
the optimized prompt directly in VS Code's Chat view (falling back to
the clipboard on hosts without that command).
- Status bar: shows the last optimize result; click it to re-run Optimize.
- Commands (Command Palette):
PromptFlow: Optimize Prompt — runs the same pipeline against the active
selection (or whole document), reporting token/cost savings and a 0-100
quality score.
PromptFlow: Validate Prompt — flags missing objective/output format,
ambiguity, duplicate requirements, unsafe instructions (PromptFlow output channel).
PromptFlow: Compare Original vs Optimized — diff view of the last optimize result.
PromptFlow: Copy Optimized Prompt — sends the optimized (or current)
prompt to VS Code Chat, or copies it to the clipboard as a fallback.
- On activation, writes a
.vscode/mcp.json entry (if the workspace doesn't
already have one) so GitHub Copilot Agent mode can call the same tool set
directly, over a bundled standalone MCP server (node dist/mcp-server.js
— see src/mcpServerEntry.ts). This is the one part of the extension that
still needs an external process, since Copilot Agent mode connects
independently and can't share the extension's JS runtime; it requires
node on PATH. The sidebar and PromptFlow: commands don't use this path
at all — they call the engine in-process.
Contributing
See CONTRIBUTING.md for local setup, build, and test scripts.
| |