Made with o1 Pro using Prompt Normalizer. Thanks to https://www.jointakeoff.com/prompts for the prompt library.
The Prompt Normalizer is a WPF-based application designed to streamline the process of generating custom prompts for AI-based .NET code generation and review. It enables you to browse and select .NET solution folders, skip unnecessary files or directories, and assemble your user question plus file snippets into a single AI-ready prompt.
This project was originally created to simplify AI prompt authoring for .NET coding tasks. It analyzes and includes selected code files from your chosen .NET solution, applying optional regex redactions and chunking for large files. It then merges them into a structured prompt that can be pasted into an LLM environment (like ChatGPT). Build it yourself, or grab the executable from https://promptnormalizer.com.
Why: As codebases grow, it’s cumbersome to assemble prompts that reference multiple files, partial line ranges, or specific disclaimers. Prompt Normalizer addresses this challenge by letting you:
bin
, obj
, node_modules
)Folder Browser & Skips
bin
, obj
, .git
, etc.Regex Redactions
(pattern) => replacement
.Line Chunking & Range
start-end
) to only include relevant code lines.Prompt Templates
Modern Flat UI
Auto Load
Token Estimation
Prerequisites
.csproj
.Cloning the Repo
git clone https://github.com/jshaust/PromptNormalizerApp.git
cd PromptNormalizerApp
Open in Visual Studio
PromptNormalizerApp.sln
to open the solution.Build & Run
dotnet build && dotnet run
from the CLI inside the project folder.Select Folder
Skip Folders
Metadata
(someRegex) => replacement
.Template
Include Directory Structure
Generate Prompt
Copy Prompt
Token Estimate
Core Components:
MainWindow.xaml
(plus .cs
code-behind): Handles UI layout and user interactions.TokenCounter.cs
: Integrates with SharpToken for token counting.DirectoryTree
: A TreeView
that is dynamically populated with checkboxes for each folder/file.ModernTheme.xaml
: Resource dictionary for the flat, modern UI styling.App.xaml
: Merges the chosen resource dictionary and sets StartupUri="MainWindow.xaml"
.Flow:
DirectoryTree
.PromptNormalizerApp.sln
-- The Visual Studio solution file.PromptNormalizerApp.csproj
-- Main project definition referencing .NET 8 WPF and SharpToken.MainWindow.xaml
-- Defines UI layout with DockPanels, Tabs, and GroupBoxes.MainWindow.xaml.cs
-- Contains code for folder loading, file selection, prompt generation, etc.ModernTheme.xaml
-- Applies a modern flat design to WPF controls.App.xaml
-- Merges ModernTheme.xaml
and sets StartupUri="MainWindow.xaml"
.TokenCounter.cs
-- Houses token estimation logic using SharpToken library.Other automatically generated or standard .NET files (e.g., AssemblyInfo.cs
, Properties/
, etc.) also exist, but the above are the main points of interest.
Add Patterns under "Regex Redaction Patterns," one rule per line, e.g.:
bash
Copy
(ApiKey=)(\S+) => $1[REDACTED]
This will convert any line containing ApiKey=someSecret
into ApiKey=[REDACTED]
.
Implementation uses Regex.Replace
at runtime to systematically remove or mask matched strings.
None -- Builds a default prompt containing:
Codegen Prompt -- Instructs the AI to implement steps from a plan.
Review Prompt -- Asks the AI to review or optimize code per the original plan.
Request Prompt -- Asks the AI to help build a project request specification from user input.
(These templates are defined as constant strings in MainWindow.xaml.cs
.)
Fork the repo and create your feature branch:
bash
Copy
git checkout -b feature/awesome-improvement
Commit your changes:
bash
Copy
git commit -am 'Add some awesome improvement'
Push to your branch:
bash
Copy
git push origin feature/awesome-improvement
Open a Pull Request describing your changes.
We welcome pull requests that enhance UI, improve code clarity, add new prompt templates, or optimize performance.
This project is licensed under the MIT License. You're free to modify, distribute, or incorporate this code into your own projects under the terms of MIT.