Let's make a prompt library for Cursor & Streamlit

Whereas Cursor + LLMs is really good at writing code, we can make .md files to reuse prompts to make the coding process faster.

See this video: x.com

Example <make_requirements.md> :

Create a `requirements.txt` file for this Streamlit app that will be deployed on Streamlit Community Cloud. Include the following instructions:

1. List only the external libraries required for this app to function.
2. Specify the latest stable version for each library using the `==` operator.
3. Do not include Streamlit itself, as it's provided by the Streamlit Cloud environment.
5. Add any other libraries necessary for the app's specific functionality.
6. Place each library on a separate line.
7. Ensure the file is named exactly "requirements.txt" (all lowercase).

Example format for each line:
library_name==X.Y.Z


Please add your often-used prompts to this thread.

3 Likes

<make_app_look_better.md>:

Enhance the visual appeal and user experience of this Streamlit app by implementing the following improvements:

1. Add a favicon:
   - Choose a relevant icons.
   - Implement it as the app's favicon using Streamlit's page configuration.

2. Improve the app title:
   - Create a catchy, professional title for the app.
   - Update the browser tab title to reflect this new app name.

3. Enhance the sidebar:
   - Add a logo or relevant image at the top of the sidebar.
   - Include icons next to navigation options for better visual cues.

4. Implement a color scheme:
   - Choose a cohesive color palette appropriate for a medical app.
   - Apply these colors to various elements (background, buttons, headers) using custom CSS.

5. Improve typography:
   - Select and apply appropriate fonts for headers and body text.
   - Ensure text is easily readable and professional-looking.

6. Add visual elements to main pages:
   - Include relevant icons or small illustrations for each main section.
   - Use these visual elements consistently across the app.

7. Enhance button and input field styling:
   - Style buttons to be more visually appealing and clearly clickable.
   - Improve the appearance of input fields and selectors.

8. Implement responsive design:
   - Ensure the app looks good and functions well on both desktop and mobile devices.

9. Add subtle animations or transitions:
   - Consider adding minimal animations for page transitions or when displaying new information.

10. Improve error and success messages:
    - Style error and success messages to be more noticeable and user-friendly.

Implement these improvements in this Streamlit app, focusing on both functionality and aesthetic appeal.
2 Likes

This is a fantastic idea. I love it.

Write pytest tests for every methods or functions, covering both main use cases and edge cases.

  • For testing API calls, use mocks to avoid real API requests.
  • Ensure tests include coverage for expected failures and error cases