From 33e0eddee65cd6da0da84a8a06ba9fda384de848 Mon Sep 17 00:00:00 2001 From: Jonathan Porter Date: Thu, 20 Jun 2024 11:11:05 -0700 Subject: [PATCH 1/3] Added the 'create_coding_project' directory. Added README.md. Added system.md (prompt). --- patterns/create_coding_project/README.md | 0 patterns/create_coding_project/system.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 patterns/create_coding_project/README.md create mode 100644 patterns/create_coding_project/system.md diff --git a/patterns/create_coding_project/README.md b/patterns/create_coding_project/README.md new file mode 100644 index 0000000..e69de29 diff --git a/patterns/create_coding_project/system.md b/patterns/create_coding_project/system.md new file mode 100644 index 0000000..e69de29 From ad70c01c1482224627a718d85afe64e042342b85 Mon Sep 17 00:00:00 2001 From: Jonathan Porter Date: Thu, 20 Jun 2024 11:57:58 -0700 Subject: [PATCH 2/3] Added create_coding_project pattern --- patterns/create_coding_project/README.md | 95 ++++++++++++++++++++++++ patterns/create_coding_project/system.md | 42 +++++++++++ 2 files changed, 137 insertions(+) create mode 100644 patterns/create_coding_project/README.md create mode 100644 patterns/create_coding_project/system.md diff --git a/patterns/create_coding_project/README.md b/patterns/create_coding_project/README.md new file mode 100644 index 0000000..4cae344 --- /dev/null +++ b/patterns/create_coding_project/README.md @@ -0,0 +1,95 @@ +# Create Coding Project + +Generate wireframes and starter code for any coding ideas that you have. + +## Usage + +```bash +echo "INSERT_YOUR_IDEA" | fabric -p create_coding_project +``` + +## Example + +### Input: +```bash +echo "I want to create a project that can generate shell scripts from yaml files then upload them to a Jamf Pro server via the Jamf Pro API." | fabric -p create_coding_project +``` +### Output: +PROJECT: + +Automate shell script generation from YAML files and upload to Jamf Pro server using Jamf Pro API. + +SUMMARY: + +This project converts YAML configurations into shell scripts and uploads them to a Jamf Pro server via its API, enabling automated script management and deployment. + +STEPS: + +1. Parse YAML file. +2. Convert YAML to shell script. +3. Authenticate with Jamf Pro API. +4. Upload shell script to Jamf Pro server. +5. Verify upload success. +6. Log upload details. + +STRUCTURE: +```css +jamf-script-generator/ +├── src/ +│ ├── __init__.py +│ ├── yaml_parser.py +│ ├── script_generator.py +│ ├── jamf_api.py +│ └── main.py +├── config/ +│ └── example.yaml +├── logs/ +│ └── upload.log +├── tests/ +│ ├── test_yaml_parser.py +│ ├── test_script_generator.py +│ ├── test_jamf_api.py +│ └── test_main.py +├── requirements.txt +└── README.md +``` + +DETAILED EXPLANATION: + +- src/__init__.py: Initializes the src module. +- src/yaml_parser.py: Parses YAML files. +- src/script_generator.py: Converts YAML data to shell scripts. +- src/jamf_api.py: Handles Jamf Pro API interactions. +- src/main.py: Main script to run the process. +- config/example.yaml: Example YAML configuration file. +- logs/upload.log: Logs upload activities. +- tests/test_yaml_parser.py: Tests YAML parser. +- tests/test_script_generator.py: Tests script generator. +- tests/test_jamf_api.py: Tests Jamf API interactions. +- tests/test_main.py: Tests main script functionality. +- requirements.txt: Lists required Python packages. +- README.md: Provides project instructions. + +CODE: +``` +Outputs starter code for each individual file listed in the structure above. +``` +SETUP: +``` +Outputs a shell script that can be run to create the project locally on your machine. +``` +TAKEAWAYS: + +- YAML files simplify script configuration. +- Automating script uploads enhances efficiency. +- API integration requires robust error handling. +- Logging provides transparency and debugging aid. +- Comprehensive testing ensures reliability. + +SUGGESTIONS: + +- Add support for multiple YAML files. +- Implement error notifications via email. +- Enhance script generation with conditional logic. +- Include detailed logging for API responses. +- Consider adding a GUI for ease of use. \ No newline at end of file diff --git a/patterns/create_coding_project/system.md b/patterns/create_coding_project/system.md new file mode 100644 index 0000000..4bd5c31 --- /dev/null +++ b/patterns/create_coding_project/system.md @@ -0,0 +1,42 @@ +# IDENTITY and PURPOSE + +You are an elite programmer. You take project ideas in and output secure and composable code using the format below. You always use the latest technology and best practices. + +Take a deep breath and think step by step about how to best accomplish this goal using the following steps. + +# OUTPUT SECTIONS + +- Combine all of your understanding of the project idea into a single, 20-word sentence in a section called PROJECT:. + +- Output a summary of how the project works in a section called SUMMARY:. + +- Output a step-by-step guide with no more than 15 words per point into a section called STEPS:. + +- Output a directory structure to display how each piece of code works together into a section called STRUCTURE:. + +- Output the purpose of each file as a list with no more than 15 words per point into a section called DETAILED EXPLANATION:. + +- Output the code for each file seperately along with a short description of the code's purpose into a section called CODE:. + +- Output a script that creates the entire project into a section called SETUP:. + +- Output a list of takeaways in a section called TAKEAWAYS:. + +- Output a list of suggestions in a section called SUGGESTIONS:. + +# OUTPUT INSTRUCTIONS + +- Create the output using the formatting above. +- Output numbered lists, not bullets for the STEPS and TAKEAWAY sections. +- Do not output warnings or notes—just the requested sections. +- Do not repeat items in the output sections. +- Do not start items with the same opening words. +- Keep each file separate in the CODE section. +- Be open to suggestions and output revisions on the project. +- Output code that has comments for every step. +- Output a README.md with detailed instructions on how to configure and use the project. +- Do not use deprecated features. + +# INPUT: + +INPUT: From 896223985f345e0d3e51075d2ed46ae3ff37e4ea Mon Sep 17 00:00:00 2001 From: Jonathan Porter Date: Thu, 20 Jun 2024 12:05:01 -0700 Subject: [PATCH 3/3] fixed readme --- patterns/create_coding_project/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patterns/create_coding_project/README.md b/patterns/create_coding_project/README.md index 4cae344..f445b40 100644 --- a/patterns/create_coding_project/README.md +++ b/patterns/create_coding_project/README.md @@ -5,7 +5,7 @@ Generate wireframes and starter code for any coding ideas that you have. ## Usage ```bash -echo "INSERT_YOUR_IDEA" | fabric -p create_coding_project +echo "INSERT_YOUR_IDEA_HERE" | fabric -p create_coding_project ``` ## Example