Skip to content

sudeshmu/Prompt-Engineering-Refine-for-Cursor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Prompt Refine for Development

An iterative thought and planning tool powered by the Gemini API. This web application helps developers and teams refine their ideas, plans, and solutions through AI-assisted thinking.

🚀 Features

  • Secure API Key Management: No hardcoded API keys - users provide their own
  • Iterative Refinement: Start with an initial request and iteratively improve the AI's thoughts
  • Clean UI: Modern, responsive design built with Tailwind CSS
  • Real-time Processing: Immediate feedback and thought generation
  • Memory-only Storage: API keys are never saved to disk for maximum security

🔒 Security

This application prioritizes security:

  • No exposed API keys in source code
  • Password-protected input for API key entry
  • Memory-only storage - keys are never saved to localStorage or disk
  • Session-based security - keys are cleared when page is refreshed
  • Input field clearing after API key is set

🛠️ Setup and Usage

Prerequisites

  • A modern web browser
  • Python 3 (for local server)
  • A Gemini API key from Google AI Studio

Running the Application

  1. Clone or download this repository
  2. Start a local server:
    python3 -m http.server 8000
  3. Open your browser and navigate to:
    http://localhost:8000/cursorPrompt.html
    

Using the Tool

  1. Enter your Gemini API key in the secure input field
  2. Click "Set Key" to store it securely in memory
  3. Enter your initial request (e.g., "Plan a marketing campaign for a new coffee shop")
  4. Click "Think" to generate initial thoughts and plans
  5. Review the generated thoughts in the blue thought bubble
  6. Add refinements in the refinement box (e.g., "Focus more on social media")
  7. Click "Refine Thoughts" to improve and integrate your feedback

📋 How It Works

The tool follows a structured thinking process:

  1. Deconstruct the Request: Breaks down your request into core objectives
  2. Identify Key Assumptions: States any assumptions being made
  3. Formulate a Plan: Outlines clear, step-by-step actions
  4. Identify Potential Challenges: Notes complexities or edge cases
  5. Iterative Refinement: Incorporates your feedback to improve the plan

🏗️ Project Structure

prompt-engineering-refine-for-cursor/
├── cursorPrompt.html    # Main application file
└── README.md           # This file

🎨 Technical Details

  • Frontend: Pure HTML5, CSS3, and JavaScript
  • Styling: Tailwind CSS via CDN
  • Font: Inter font family for modern typography
  • API: Google Gemini 2.0 Flash model
  • Security: Client-side only, no backend required

🔧 Customization

The application can be easily customized:

  • Styling: Modify the Tailwind classes or add custom CSS
  • Prompts: Adjust the system prompts in the JavaScript for different use cases
  • UI Elements: Add new sections or modify the existing workflow

📝 Example Use Cases

  • Project Planning: "Plan a new mobile app development project"
  • Problem Solving: "How to improve team communication in remote work"
  • Strategy Development: "Create a content marketing strategy for a tech startup"
  • Process Design: "Design a code review process for our development team"

⚠️ Important Notes

  • API Costs: This tool uses the Gemini API which may incur charges based on usage
  • Internet Required: Requires internet connection to communicate with Gemini API
  • Session-based: API key and data are lost when the page is refreshed
  • No Data Persistence: Conversations are not saved between sessions

🤝 Contributing

Feel free to contribute improvements:

  1. Fork the repository
  2. Make your changes
  3. Test thoroughly
  4. Submit a pull request

📄 License

This project is open source. Please ensure you comply with Google's Gemini API terms of service when using this tool.

🆘 Troubleshooting

API Key Issues:

  • Ensure your API key starts with "AIza" and is at least 30 characters long
  • Verify your API key is active in Google AI Studio
  • Check that you have sufficient API credits

Connection Issues:

  • Ensure you have a stable internet connection
  • Check if the Gemini API service is operational
  • Verify CORS is not blocking the requests (use local server as shown above)

Browser Issues:

  • Use a modern browser (Chrome, Firefox, Safari, Edge)
  • Ensure JavaScript is enabled
  • Clear browser cache if experiencing issues

Happy developing! 🚀

About

This interact with Gemini API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages