Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/silviotorre/AgilePrompt
Simplified ChatGPT Agile Prompt Builder
https://github.com/silviotorre/AgilePrompt
agile chatgpt prompt-toolkit
Last synced: about 1 month ago
JSON representation
Simplified ChatGPT Agile Prompt Builder
- Host: GitHub
- URL: https://github.com/silviotorre/AgilePrompt
- Owner: silviotorre
- License: mit
- Created: 2023-04-16T09:14:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-16T14:20:35.000Z (over 1 year ago)
- Last Synced: 2024-08-01T21:55:24.659Z (4 months ago)
- Topics: agile, chatgpt, prompt-toolkit
- Language: JavaScript
- Homepage: https://silviotorre.github.io/AgilePrompt/
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - silviotorre/AgilePrompt - Simplified ChatGPT Agile Prompt Builder (JavaScript)
README
# Agile Prompt Builder
## Overview
The Agile Prompt Builder is a simple and easy-to-use tool that helps you create customized prompts based on your specific needs. You can define the active user, action, expected result, conditions, and choose whether to include a code snippet in your prompt.
## Features
- User-friendly interface
- Customizable input fields
- Dynamic prompt generation
- Option to include a code snippet
- Responsive design for various screen sizes## Getting Started
### Prerequisites
- A modern web browser (e.g., Chrome, Firefox, Safari)
### Running the project
1. Clone the repository or download the source code as a ZIP file.
`git clone https://github.com/silviotorre/Agile-Prompt-Builder.git`
2. Navigate to the project folder and open the `index.html` file in your preferred web browser.
`cd Agile-Prompt-Builder`
3. Start using the Agile Prompt Builder by entering your desired values in the input fields and clicking the "Generate Prompt" button.
## File Structure
- `index.html`: The main HTML file that contains the structure of the web page.
- `styles.css`: The external CSS file that contains the styling for the web page.
- `script.js`: The external JavaScript file that handles the form submission and generates the prompt.## How Work
This code is creating a form in a web page and adding an event listener to the form submission. When the form is submitted, the event listener function is called.The function first prevents the default form submission behavior by calling `event.preventDefault()`. It then retrieves the values of several form elements using the `form.elements` object and stores them in variables.
Next, the function constructs a prompt message by concatenating the values of the form elements together using string interpolation. If the "add code" checkbox is checked, the message will also include a code snippet.
Finally, the function creates a new paragraph element and sets its text content to the prompt message. The paragraph element is then appended to the end of the document body.
### UML Diagram
Here's a UML diagram to illustrate the structure of this code:
+--------------------------+
| EventTarget |
+--------------------------+
| addEventListener() |
| removeEventListener() |
+--------------------------+
|
|
v
+--------------------------+
| Element |
+--------------------------+
| querySelector() |
| addEventListener() |
+--------------------------+
|
|
v
+--------------------------+
| HTMLFormElement |
+--------------------------+
| elements |
+--------------------------+
|
|
v
+--------------------------+
| Function |
+--------------------------+
| event.preventDefault() |
| form.elements[] |
| string interpolation |
| createElement() |
| textContent |
| appendChild() |
+--------------------------+## Contributing
We welcome contributions to this project. If you find a bug or want to suggest a new feature, please create an issue on the [GitHub repository](https://github.com/silviotorre/Agile-Prompt-Builder/issues).
## License
This project is licensed under the MIT License.
## Acknowledgments
- You all