The Research Report
Prompts as Code: How Microsoft PromptKit Brings Engineering Discipline to AI Prompts
Your team writes prompts the way most shops wrote software in 1995. Scattered across documents, Slack messages, and sticky notes. Untested. Unversioned. Impossible to reuse.
Microsoft PromptKit flips that. It treats prompts as engineered components: composable, versioned, testable. The same rigor you apply to code, you apply to the prompts that drive your AI tools.
The Problem with Artisan Prompts
When a prompt works, nobody knows why. When it breaks, nobody knows what changed. Teams copy prompts from one project to another without tracking what actually moved. Someone edits a prompt in production and the change goes unnoticed for weeks.
This is exactly how teams treated code before version control. And it's exactly the problem PromptKit solves.
The Architecture: Five Layers, One Goal
PromptKit organizes its 157 components into five layers that snap together like building blocks.
Personas define who the AI is. Fifteen personas cover domains like systems engineer, electrical engineer, mechanical engineer, protocol architect. Each persona carries expertise, tone, and behavioral constraints. You don't tell the AI to "be more technical" — you load a persona that already is.
Protocols define how the AI reasons. Forty-eight protocols cover analysis methods, reasoning patterns, and guardrails. Need systematic memory safety checks? There's a protocol for that. Need threat modeling? One exists. Protocols are reusable reasoning scaffolds.
Formats define what the output looks like. Twenty-one formats specify document structures and rules. A code review format might require sections for findings, root cause, and remediation. A requirements doc format might mandate traceability tables. Formats enforce consistency across the team.
Taxonomies define classification schemes. Five taxonomies label findings by type, severity, and domain. When something surfaces a bug, the taxonomy tells you how to categorize it.
Templates compose all the above into task-specific prompts. Sixty-four templates cover workflows like bug investigation, design doc authoring, code review, requirements extraction, protocol evolution. Templates declare input and output contracts so they can chain together.
What Version-Controlled Prompts Look Like
The key insight: a prompt is not a blob of text. It is a structured assembly of components.
Here is what that looks like in practice.
┌────────────────────────────────────────────────────┐
│ Assembled Prompt │
├────────────────────────────────────────────────────┤
│ ┌──────────┐ │
│ │ Persona │ "You are a senior systems engineer │
│ └──────────┘ with expertise in C++ and memory..." │
│ ┌──────────┐ │
│ │ Protocol │ "Phase 1: Trace allocations..." │
│ │ Protocol │ "Phase 2: Map trust boundaries..." │
│ └──────────┘ │
│ ┌──────────┐ │
│ │ Format │ "Output MUST contain: Findings, │
│ └──────────┘ Root Cause, Remediation, Severity" │
│ ┌──────────┐ │
│ │ Template │ "Investigate the following bug: │
│ └──────────┘ {{problem_description}}" │
└────────────────────────────────────────────────────┘
The CLI assembles this from the manifest. You describe your task, and PromptKit selects the right persona, protocols, and format, then stitches them into a complete prompt.
The same component (say, a memory-safety protocol) can appear in bug investigation, code review, and security audit templates. You write the protocol once. It travels everywhere.
Three Workflows Cover the Engineering Lifecycle
PromptKit does not just give you components. It gives you workflows that use those components end to end.
Bootstrap scans a repository and extracts structured specifications: requirements, design decisions, validation plans. It reads the existing codebase and artifacts, then produces documents that follow your chosen formats. You start from what exists, not from a blank page.
Evolve handles requirements changes. You propose a change, and the workflow propagates it through specs and implementation. At each stage, adversarial alignment audits check that the new requirements actually match the new specs, and the new specs actually match the implementation. No drift slips through.
Maintain runs periodic drift detection. Over time, code and specs diverge. This workflow finds where they have separated, then corrects both. It catches the slow accumulation of technical debt before it becomes a crisis.
Pipelines Connect Tasks End to End
Individual templates chain into pipelines. The document lifecycle pipeline flows:
author-requirements-doc → author-design-doc → author-validation-plan → audit-traceability
Each step consumes the output of the previous step. Requirements feed into design. Design feeds into validation. Validation audits the whole chain for gaps.
The hardware lifecycle covers schematic review, PCB layout review, simulation validation, and BOM audits. The protocol engineering lifecycle handles RFC authoring and conflict analysis.
Every pipeline declares its input and output contracts. This means templates are composable by design, not by accident.
Why This Changes Team Collaboration
Before PromptKit, prompt knowledge lives in individual heads. When the person who wrote your code review prompt leaves, the knowledge leaves with them.
With version-controlled components, prompts become team assets. You can review prompt changes the same way you review code changes. You can branch a prompt for experimentation, then merge it back when it proves out. You can trace a prompt's history the same way you trace a file's history.
The bootstrap workflow also lowers the barrier to entry. New team members do not need to reverse-engineer existing prompts. They run the bootstrap, and PromptKit assembles the right prompt from the component library.
Getting Started
Install the CLI:
npx @alan-jowett/promptkit
The interactive mode auto-detects your LLM CLI. It works with GitHub Copilot CLI, Claude Code, and Codex CLI.
# Clone the repo for Copilot's skill support
git clone https://github.com/microsoft/PromptKit.git
cd promptkit
# Start a session — the /promptkit skill activates automatically
copilot
Or list components directly:
npx @alan-jowett/promptkit list --all
npx @alan-jowett/promptkit search "memory safety"
npx @alan-jowett/promptkit show review-cpp-code
The Shift
PromptKit represents a mindset change. Prompts are not artisanal creations. They are engineered artifacts with versions, components, and testable behavior.
If your team uses AI tools for code review, bug investigation, design doc writing, or protocol analysis, PromptKit gives those prompts the same rigor you already apply to your code. The investment is low. The return is prompts that actually do what you intend.
Citations
- Microsoft PromptKit GitHub: https://github.com/microsoft/PromptKit
- PromptKit v0.1.0 Release: https://github.com/microsoft/PromptKit/releases/tag/v0.1.0
- PromptKit Catalog: https://github.com/microsoft/PromptKit/blob/main/CATALOG.md
- PromptKit Examples: https://github.com/microsoft/PromptKit/blob/main/docs/examples.md
Notes
- Word count: 1,047 (body only)
- Suggested title: "Prompts as Code: How Microsoft PromptKit Treats AI Prompts Like Engineering Components"
- Alternative title: "The End of Artisan Prompts"
- Fact-check needed: Verify current component counts (157 components, 15 personas, 48 protocols, 21 formats, 5 taxonomies, 64 templates) match the latest release
- Note: PromptKit is from Microsoft but appears to be a personal project by Alan Jowett (@alan-jowett) — the repo is under microsoft org but maintained by one person. The article treats it as a Microsoft tool since it lives in that org.
- The three interactive workflows (Bootstrap, Evolve, Maintain) are the core abstraction — verify this framing matches the actual docs if accuracy matters.