"Treating your prompts as first-class code, step by step, prompt by prompt."
Prompt by Prompt (PbP) is a VS Code extension that brings Prompt Engineering into your development workflow. It allows you to manage, version, and execute prompts with the same care you give to your code.
- Prompt as Code: store prompts in the
.prompts/directory using YAML. - Tree View: browse and run prompts directly from the VS Code sidebar.
- CRUD Operations: create, edit, and delete prompts inside the extension.
- Team Library: load shared read-only prompts from synced team policy packs.
- Workspace + Global + Team Rules: resolve rules from local files, global storage, and team packs.
- Rule v2: support Markdown rules with YAML frontmatter metadata such as
ruleId,canonicalKey,kind,priority, andrequired. - Profiles: switch active rule profiles and bind projects to team policy packs.
- Explainable Preview: inspect effective policy, preferences, guardrails, environment context, editor context, and final payload before dispatch.
- Execution Envelope: internally separate task, policy, and context instead of flattening everything into appended prompt text.
- Segmented Delivery: format payloads by target agent while keeping a structured internal model.
- Context Engine: capture selection, file path, language, project, cursor position, and more.
- Handlebars Templates: use variables like
{{selection}},{{filepath}}, and{{project_name}}.
- Team Policy Packs: sync shared prompts and rules from local folders or git sources.
- Team Policies View: inspect sync sources, workspace binding, and installed packs in a dedicated sidebar panel.
- Workspace Binding: bind a project to a pack/profile via
.pbp/policy.json. - Sync-first Git: use clone/pull based team sync without exposing full Git workflow complexity.
- Optional Compatibility Layer: generate
AGENTS.md-style files for agents that automatically read project rule files. - Safe Overwrite: only overwrite files previously generated by Prompt by Prompt unless the user explicitly opts out.
- Projection Formats: support
.pbp/compiled/AGENTS.mdand rootAGENTS.mdstyle outputs. - Commands: rebuild and open the projected rule file directly from the extension.
- Multi-Agent Support: send prompts to Cline, Roo Code, GitHub Copilot Chat, Continue, Cursor, Codex, Gemini, Tongyi, and more.
- Clipboard and File Fallbacks: always have a portable delivery option.
- Smart Detection: automatically detect installed agent extensions.
- Localized UI: supports English, Simplified Chinese (
zh-cn), Japanese (ja), Spanish (es), and Korean (ko) based on VS Code display language.
git clone https://github.com/Aknirex/prompt-by-prompt.git
cd prompt-by-prompt
pnpm install
pnpm run compileThis repository is pinned with Volta, so node and pnpm versions are resolved automatically once Volta is installed and active.
Then press F5 in VS Code to launch the extension.
- Configure an agent in VS Code settings.
- Create a prompt, or connect a Team Policy source.
- Open
Team Policiesand sync shared prompts/rules. - Preview a prompt to inspect the effective policy and execution envelope.
- Optionally enable passive rule projection and generate a project
AGENTS.md-style file.
An official reference pack is maintained locally in:
.local/official-team-policy-pack/
It demonstrates:
- shared prompts
- team profiles
- Rule v2 Markdown rules with frontmatter
- passive projection friendly policies
That folder is intentionally excluded from the published extension package so it can be maintained and published as a separate Git repository.
| Variable | Description |
|---|---|
{{selection}} |
Selected text in the editor |
{{filepath}} |
Relative file path |
{{file_content}} |
Full file content |
{{lang}} |
Programming language |
{{project_name}} |
Workspace folder name |
{{git_commit_diff}} |
Git diff of changes |
Version 1.13.0 adds:
- structured rule envelope preview and dispatch assembly
- Rule v2 frontmatter support for Markdown rules
- Team Policies view and team pack based prompt/rule governance
- passive rule projection with rebuild/open commands
Contributions are welcome! Please see CONTRIBUTING.md for development guidelines.
GPL v3 License - see LICENSE for details.
Your Prompts, Your Data - Nothing touches our servers.