prompt_generator 2.1.1
prompt_generator: ^2.1.1 copied to clipboard
Generate Project code for Claude, ChatGPT, Gemini, Grok and others AI
PromptGenerator #
Stop asking teammates for context. Stop being afraid of unfamiliar codebases. Let AI understand your Flutter project instantly.
A Flutter package that bridges the gap between your codebase and AI assistants by intelligently collecting and formatting your Flutter project code for Claude, ChatGPT, DeepSeek, Grok, and other AI tools.
Why PromptGenerator? #
Ever joined a new project and felt lost? Got a task from a senior developer but felt embarrassed to ask "simple" questions? Wanted to discuss your architecture decisions with an expert without bothering your team?
PromptGenerator solves this. It extracts your project's relevant code into a single AI-ready format that you can paste directly into any AI assistant. No more manual file searching, no more incomplete context, no more embarrassment.
What It Does #
- Instant AI Context: Create a complete snapshot of your codebase in seconds
- Smart Selection: Precisely configure which files and folders matter
- AI-Optimized: Outputs in a format AI assistants understand perfectly
- Privacy First: Automatically skips generated files (.g.dart, .freezed.dart) and sensitive data
- Zero Setup: Simple YAML configuration, launch with a single command
Who It's For #
- 🆕 Joining Unfamiliar Projects - Understand architecture without bothering teammates
- 🤖 AI-Assisted Development - Get expert-level advice on your own codebase
- 📚 Code Reviews - Share context-rich code snippets with AI for analysis
- 🏗️ Architecture Discussion - Discuss refactoring strategies with full project context
- 📖 Documentation - Generate comprehensive overviews of your codebase
- 👥 Team Collaboration - Share project structure with new developers
- 🔍 Code Analysis - Let AI identify patterns, issues, or improvement opportunities
Getting Started #
Add prompt_generator to your pubspec.yaml:
dev_dependencies:
prompt_generator: ^latest_version
Usage #
1. Create a Configuration File #
Create a prompt_generator.yaml file in your project root:
server: true
port: 2101
skipFiles: [
'.freezed.dart',
'.g.dart',
'.gr.dart',
'.config.dart',
'/.',
]
includePaths: [
lib/presentation,
lib/domain,
]
2. Start the Server #
Run this command in your project directory:
dart run prompt_generator:generate
Server mode (server: true): Starts a localhost HTTP server. Every request re-reads the YAML, collects the latest code, and copies it to clipboard automatically.
One-time mode (server: false): Runs once, copies to clipboard, and exits. No server started.
3. Trigger via Browser Bookmark #
The fastest way to use server mode is a browser bookmark. Save the script below as a bookmark:
javascript:void((async()=>{const toast=(msg,ok)=>{const d=document.createElement('div');d.textContent=msg;d.style.cssText=`position:fixed;top:20px;right:20px;z-index:99999;padding:12px 20px;border-radius:8px;font-size:14px;font-weight:500;color:#fff;background:${ok?'#22c55e':'#ef4444'};box-shadow:0 4px 12px rgba(0,0,0,.3);transition:opacity .5s`;document.body.appendChild(d);setTimeout(()=>{d.style.opacity='0';setTimeout(()=>d.remove(),500)},2000)};try{await fetch('http://localhost:2101/api/prompt',{mode:'no-cors'})}catch(e){toast('❌ Local server ishlamayapti!',false);return}toast('✅ Clipboard ga nusxalandi!',true)})())
How to add in Chrome:
- Right-click the bookmarks bar → Add page
- Set any
Name, e.g.⚡ Prompt - Clear the
URLfield entirely and paste the script above - Click Save
Now while on any AI site (Claude, ChatGPT, etc.), click the bookmark — your code is instantly copied to clipboard. A ✅ toast appears on success, or ❌ if the local server is not running.
4. Share with AI #
Paste directly from your clipboard into Claude, ChatGPT, DeepSeek, Grok, or any other AI assistant. Now you can:
- Ask architecture questions about YOUR project
- Request refactoring suggestions based on YOUR actual code
- Get implementation help that understands YOUR context
- Debug issues with full project awareness
Configuration Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
server |
bool | true |
true = HTTP server mode, false = one-time clipboard copy |
port |
int | 2101 |
Port for the HTTP server (only used when server: true) |
skipFiles |
list | — | File patterns to exclude |
includePaths |
list | — | Files and folders to include in the output |
Note: Paths in
skipFilesandincludePathscan be written with or without quotes (lib/main.dartor'lib/main.dart') — both work.
Configuration Examples #
One-time clipboard copy:
server: false
skipFiles: ['.g.dart', '.freezed.dart']
includePaths: [lib/main.dart]
Server on custom port:
server: true
port: 3000
skipFiles: ['.g.dart', '.freezed.dart']
includePaths: [lib/presentation, lib/domain]
Feature-Focused:
server: false
skipFiles: [
'.freezed.dart',
'.g.dart',
'.gr.dart',
'_test.dart',
]
includePaths: [
lib/features/auth,
lib/features/profile,
]
Full Project:
server: false
skipFiles: [
'.freezed.dart',
'.g.dart',
'.gr.dart',
'.config.dart',
'/.',
'.html',
'.png',
'.jpg',
'.jpeg',
firebase_options.dart,
]
includePaths: [
lib/presentation,
lib/domain,
lib/data,
lib/core,
]
Real-World Scenarios #
Scenario 1: New to the Team
You joined a project with complex state management. Instead of bothering the tech lead, generate the prompt, paste it into Claude, and ask: "Explain this project's state management architecture and where I should add a new feature."
Scenario 2: Stuck on a Task
A senior dev assigned you a refactoring task in an unfamiliar module. Generate the prompt for that specific path, ask AI: "How should I refactor this according to clean architecture principles?"
Scenario 3: Preparing for Code Review
Before submitting a PR, generate your feature code, ask AI: "Review this implementation for potential issues, edge cases, and best practice violations."
Scenario 4: Rapid Iteration
Keep
server: truerunning in the background. UpdateincludePathsin the YAML, click the bookmark on any AI site — fresh context in clipboard instantly, no restarts needed.
Features #
- Single-command code collection
- Flexible path configuration
- Smart file filtering
- Automatic clipboard copy
- HTTP server mode for repeated generation
- One-time mode for quick, single-use runs
- One-click browser bookmark trigger
- Works with all AI assistants
Tips for Best Results #
- Be Specific: Include only relevant folders for your question
- Clean First: Skip generated and test files to reduce noise
- Ask Clearly: Frame your question with context when pasting into AI
- Iterate: Regenerate with different paths for different questions
- Use the Bookmark: Click once on any AI site — the fastest possible workflow
- Combine Tools: Use alongside your AI assistant's other capabilities for maximum benefit
Contributing #
Contributions are welcome! Feel free to submit issues and pull requests.
Stop hesitating. Start shipping. Let AI be your senior developer, architect, and code reviewer — all with full knowledge of YOUR project.