From 21bcce4affbb689e9f562f5c71152fb9bdbabf4c Mon Sep 17 00:00:00 2001 From: zero-cool Date: Sun, 19 Jan 2025 10:21:21 -0500 Subject: [PATCH] initial uploads --- LICENSE | 21 ++++++ README.md | 31 ++++++++- prompt_generator.sh | 151 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 LICENSE create mode 100755 prompt_generator.sh diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e94a2d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) [Year] [Your Name] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 4e38235..4a6fd41 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,29 @@ -# prompt_generation -A new repository created via automation. +# Prompt Generator Script + +## Overview + +The **Prompt Generator Script** is a Bash tool designed to help you quickly create structured and actionable prompts for various use cases. It offers predefined templates for common roles and supports fully customizable inputs, saving generated prompts to a structured `outputs` directory. + +## Features + +- **Predefined Templates**: Quickly create prompts for roles like Culinary Innovator, Travel Planner, and more. +- **Custom Inputs**: Define custom roles, contexts, and instructions for unique use cases. +- **Output Management**: Saves prompts with timestamped filenames in the `outputs` directory. +- **User Interaction Guidance**: Includes `` sections in prompts to define what users should ask. +- **Expandable and Easy to Use**: Add more templates or modify the script as needed. + +## Usage + +### Prerequisites + +- Bash (installed by default on most Unix-like systems) + +### How to Run + +1. Clone the repository: + ```bash + git clone + cd + +chmod +x prompt_generator.sh +./prompt_generator.sh diff --git a/prompt_generator.sh b/prompt_generator.sh new file mode 100755 index 0000000..df45843 --- /dev/null +++ b/prompt_generator.sh @@ -0,0 +1,151 @@ +#!/bin/bash + +# Function to ask user for input with validation and optional default value +ask_question() { + local prompt="$1" + local default="$2" + local response + + while true; do + if [[ -n $default ]]; then + echo -n "$prompt [$default]: " + else + echo -n "$prompt: " + fi + read -r response + response="${response:-$default}" + + if [[ -n $response ]]; then + echo "$response" + break + else + echo "Input cannot be empty. Please try again." + fi + done +} + +# Function to offer a template for common roles +offer_templates() { + echo "Available templates:" + echo "1. Culinary Innovator" + echo "2. Travel Planner" + echo "3. Code Assistant" + echo "4. Fitness Coach" + echo "5. Career Advisor" + echo "6. Custom (you define everything)" + echo -n "Choose a template (1-6): " + read -r template_choice + + case $template_choice in + 1) + echo "Culinary Innovator" \ + "developing recipes" \ + "transform ingredients into creative, flavorful dishes" \ + "tips for substitutions, dietary accommodations, and presentation" + ;; + 2) + echo "Travel Planner" \ + "creating travel plans" \ + "design itineraries for exciting destinations" \ + "budget optimization, transportation tips, and cultural advice" + ;; + 3) + echo "Code Assistant" \ + "debugging and writing code" \ + "solve programming problems and provide explanations" \ + "best practices, examples, and optimization tips" + ;; + 4) + echo "Fitness Coach" \ + "creating personalized fitness plans" \ + "help users achieve their health and fitness goals" \ + "exercise modifications, progress tracking, and motivational advice" + ;; + 5) + echo "Career Advisor" \ + "offering professional development guidance" \ + "help users create résumés, prepare for interviews, and plan their careers" \ + "industry insights, networking tips, and personalized action plans" + ;; + 6) + echo "" + ;; + *) + echo "Invalid choice. Defaulting to Custom." + echo "" + ;; + esac +} + +# Initialize outputs directory +outputs_dir="outputs" +mkdir -p "$outputs_dir" + +# Start the script +echo "Welcome to the Enhanced Prompt Generator!" +echo "Would you like to use a predefined template or create a custom prompt?" +template_data=$(offer_templates) +if [[ -n $template_data ]]; then + IFS=" " read -r role specialization objectives additional_services <<< "$template_data" +else + role=$(ask_question "What is the role or expertise of the system" "") + specialization=$(ask_question "What is the system's specialization" "") + objectives=$(ask_question "What is the main role of the system" "") + additional_services=$(ask_question "What additional services should the system provide" "") +fi + +# Collect remaining details +context=$(ask_question "What is the context or goal for the prompt" "") +instructions=$(ask_question "Provide step-by-step instructions for the system" "1. Ask for inputs, 2. Provide a solution.") +constraints=$(ask_question "What constraints should the system follow" "Use accessible options and tailor to user needs.") +output_format=$(ask_question "What should the output format look like" "Structured sections with clear labels.") +reasoning=$(ask_question "What reasoning approach should the system use" "Creative thinking and logical problem-solving.") +user_input=$(ask_question "What should the system ask the user to begin the process" "Please provide [relevant details] to get started.") + +# Generate the prompt +prompt_output=$(cat < +You are a $role specializing in $specialization. Your role is to $objectives. Additionally, you provide $additional_services. + + + +$context + + + +$instructions + + + +$constraints + + + +$output_format + + + +$reasoning + + + +Reply with: "$user_input" + +EOL +) + +# Save the prompt to the outputs directory +timestamp=$(date +"%Y%m%d_%H%M%S") +output_file="$outputs_dir/prompt_$timestamp.txt" +echo "$prompt_output" > "$output_file" + +# Display the generated prompt +echo +echo "Here is your generated prompt:" +echo "--------------------------------------------------" +echo "$prompt_output" +echo "--------------------------------------------------" +echo "Prompt saved to $output_file" + +# Completion message +echo "Prompt generation complete! Copy and paste the above or use the saved file."