Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions prompts/coding/code_004_code_explainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "code-004",
"title": "Code Explainer",
"category": "coding",
"goal": "How code works in simple terms",
"prompt": "Explain the functionality of following {language} code step by step as it is for a beginner..\\n\\nCode:\\n```\\n{code}\\n```",
"variables": ["language","code"],
"tags": ["explanation","learning"],
"models_tested": ["gpt-5","gemini-2.5","claude-3"],
"responses": {
"gpt-5": "# Step-by-step beginner explanation (Python)\n\nCode:\n\n```python\nfor i in range(3):\n print(i)\n```\n\n1. **`range(3)` — makes a sequence of numbers**\n\n * `range(3)` produces the numbers `0, 1, 2`.\n * Important: it **starts at 0** and goes up to **but does not include** 3.\n\n2. **`for i in range(3):` — starts a loop**\n\n * `for` tells Python to repeat a block of code for every item in the sequence.\n * `i` is the loop variable. On each iteration `i` takes the next value from the sequence (`0`, then `1`, then `2`).\n * The colon `:` marks the start of the loop body.\n\n3. **Indentation — groups the loop body**\n\n * The indented line(s) under the `for` are the actions run each iteration. Python uses indentation to define blocks.\n\n4. **`print(i)` — action run each time**\n\n * On each loop iteration Python runs `print(i)`, which outputs the current value of `i`, then moves to the next line.\n\n5. **What actually happens (iteration-by-iteration trace)**\n | Iteration | `i` value | Output printed |\n |---:|---:|---|\n | 1 | 0 | `0` |\n | 2 | 1 | `1` |\n | 3 | 2 | `2` |\n\nFinal console output:\n\n```\n0\n1\n2\n```\n\n6. **Why it runs 3 times**\n\n * Because `range(3)` contains three numbers (0,1,2) — one loop iteration per number.\n\n7. **Common variations**\n\n * `range(5)` → prints `0` through `4`.\n * `range(1,4)` → prints `1, 2, 3` (start and stop).\n * Multi-line loop body:\n\n ```python\n for i in range(3):\n doubled = i * 2\n print(i, doubled)\n ```\n\n8. **Common beginner mistakes**\n\n * Forgetting the colon `:` after the `for` line → SyntaxError.\n * Not indenting the body correctly → IndentationError or unexpected behavior.\n * Expecting `range(3)` to include `3` — remember it stops *before* the stop value.\n\n9. **Quick exercise**\n\n * Change to `for i in range(4): print(\"Hello\", i)` — what prints? (Answer: `Hello 0` ... `Hello 3`)\n\nWould you like a visual trace (step table) as code output, or an explanation of how to loop over other collections like lists and strings?",

"gemini-2.5": "Of course! This code is a fundamental concept in Python called a **for loop**. It's used to repeat a block of code a specific number of times.\n\nHere's a step-by-step breakdown of `for i in range(3): print(i)`:\n\n### 1. `for i in ...`\n\nThis part starts the loop. Think of it as saying, \"For each item in the following sequence, I want you to do something.\"\n\n * `for`: This is the keyword that begins the loop.\n * `i`: This is a **variable**. You can name it almost anything (like `number`, `x`, etc.), but `i` (short for index) is a common convention. Its job is to hold the current item from the sequence as the loop runs.\n\n### 2. `range(3)`\n\nThis part creates the sequence of numbers that the loop will go through.\n\n * `range(3)` is a function that generates a sequence of numbers starting from **0** up to, but **not including**, the number in the parentheses.\n * So, `range(3)` produces the numbers: **0, 1, 2**.\n\nIt's like telling Python, \"I need a sequence of 3 numbers, please start at 0.\"\n\n### 3. `:` and `print(i)`\n\nThis is the \"do something\" part of the loop.\n\n * The colon `:` at the end of the first line tells Python, \"Okay, here comes the block of code I want you to repeat.\"\n * `print(i)` is the action to be repeated. The `print()` function displays whatever is inside its parentheses on the screen. In this case, it will print the current value of the variable `i`.\n\n### How It Executes ▶️\n\nThe code runs through the sequence generated by `range(3)` one number at a time.\n\n * **Iteration 1:** The loop starts. The first number from `range(3)` is **0**. Python assigns this value to `i`. So, `i` is now `0`. The code inside the loop runs: `print(i)` prints **0**.\n * **Iteration 2:** The loop goes to the next number in the sequence, which is **1**. Python assigns this value to `i`. So, `i` is now `1`. The code `print(i)` prints **1**.\n * **Iteration 3:** The loop goes to the last number in the sequence, which is **2**. Python assigns this value to `i`. So, `i` is now `2`. The code `print(i)` prints **2**.\n\nAfter printing 2, the loop sees there are no more numbers in the sequence from `range(3)`, so it stops.\n\n### Final Output\n\nThe final output on the screen will be:\n\n```\n0\n1\n2\n```",

"claude-3": "# Understanding the Python Code\nLet me break down this simple but important Python code step by step:\n\n```python\nfor i in range(3):\n print(i)\n```\n\n**What this code does:** It prints the numbers 0, 1, and 2 on separate lines.\n\n## Step-by-Step Breakdown\n\n**1. The `for` loop**\nThe word `for` tells Python that we want to repeat something multiple times. It's a way to do the same action over and over without writing the code multiple times.\n\n**2. The variable `i`**\nThis is a variable (a container that holds a value) that will change each time the loop repeats. Think of it as a counter that keeps track of which repetition we're on.\n\n**3. The `range(3)` part**\n`range(3)` means \"give me a sequence of numbers starting from 0 up to (but not including) 3.\" So it creates: 0, 1, 2. That's three numbers total, which is why we use `range(3)`.\n\n**4. The colon `:`**\nThe colon tells Python \"here comes the code I want to repeat.\"\n\n**5. The `print(i)` line**\nThis is the code that repeats. The `print()` function displays whatever is inside the parentheses. So it will print the current value of `i`.\n\n## How It Executes\n\n- **First repetition:** `i` becomes 0 → `print(0)` → displays \"0\"\n- **Second repetition:** `i` becomes 1 → `print(1)` → displays \"1\"\n- **Third repetition:** `i` becomes 2 → `print(2)` → displays \"2\"\n- **Loop ends:** No more numbers in `range(3)`, so the loop stops\n\n**Output:**\n```\n0\n1\n2\n```\n\nThis is a fundamental pattern in programming—repeating code a specific number of times without having to write it out each time!"
},
"last_updated": "2025-10-13"
}
17 changes: 17 additions & 0 deletions prompts/coding/code_005_bug_finder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "code-005",
"title": "Bug Finder",
"category": "coding",
"goal": "Identify errors and bugs in code",
"prompt": "Find and explain the errors and bugs in the following {language} code.Suggest the fixed code.\\n\\nCode:\\n```\\n{code}\\n```",
"variables": ["language","code"],
"tags": ["bugs","error","debugging","fix"],
"models_tested": ["gpt-5","gemini-2.5","claude-3"],
"responses": {
"gpt-5": "Let's analyze your code carefully.\n\n---\n\n### 🧩 Original Code\n\n```python\nfor i in range(5)\n print(\"Number:\", i)\n```\n\n---\n\n### ❌ Errors & Bugs\n\n1. **Missing Colon (`:`)**\n In Python, a `for` loop **must** end with a colon (`:`) to indicate the start of an indented block.\n → Error: `SyntaxError: expected ':'`\n\n2. **Indentation Issue** (only relevant if the first error is fixed)\n Python uses indentation to define code blocks. The `print()` statement must be indented to belong to the loop.\n\n---\n\n### ✅ Fixed Code\n\n```python\nfor i in range(5):\n print(\"Number:\", i)\n```\n\n---\n\n### 💡 Explanation\n\n* `range(5)` generates numbers from `0` to `4`.\n* The loop prints each number with the text `\"Number:\"`.\n\n**Output:**\n\n```\nNumber: 0\nNumber: 1\nNumber: 2\nNumber: 3\nNumber: 4\n```\n\n---\n\nWould you like me to include a version that uses list comprehension or a `while` loop alternative too?",

"gemini-2.5": "Of course. The provided Python code has two common syntax errors that are crucial for beginners to understand.\n\nHere are the errors and the corrected code:\n\n### The Errors 🐞\n\n1. **Missing Colon (`:`)** — In Python, the line that starts a loop (like `for` or `while`) or a conditional statement (like `if`) must always end with a **colon (`:`)**. This tells Python that a new block of code is about to begin.\n2. **Indentation Error** — Python uses indentation (spaces) to group statements together. The code you want to run inside the `for` loop must be indented beneath it. Since the `print()` statement isn't indented, Python will raise an `IndentationError`.\n\n---\n\n### ✅ Corrected Code\n\n```python\n# Added colon and indented the loop body\nfor i in range(5):\n print(\"Number:\", i)\n```\n\n**Explanation:**\n\n* The `for` loop iterates over numbers `0` through `4`.\n* Each time, it prints the word `'Number:'` followed by the current number.\n\n**Output:**\n```\nNumber: 0\nNumber: 1\nNumber: 2\nNumber: 3\nNumber: 4\n```",
"claude-3": "# Error Analysis: Python Code\n\n## The Code with Errors\n```python\nfor i in range(5)\n print(\"Number:\", i)\n```\n\n---\n\n## Error Found\n\n**Missing Colon (`:`) after the `for` statement**\n\n**Location:** End of line 1\n\n**Explanation:** In Python, all control structures like `for` loops, `if` statements, and `while` loops must end with a colon (`:`). The colon tells Python that you're about to define a block of code that belongs to that statement. Without it, Python doesn't know where the loop declaration ends and the loop body begins.\n\n**Error Message You'd See:**\n```\nSyntaxError: expected ':'\n```\n\n---\n\n## Fixed Code\n\n```python\nfor i in range(5):\n print(\"Number:\", i)\n```\n\n**What changed:** Added a colon (`:`) at the end of the `for` statement.\n\n---\n\n## How the Fixed Code Works\n\nOnce corrected, this code will:\n1. Loop through numbers 0 to 4 (five iterations total)\n2. Print each number with the label \"Number:\"\n\n**Output:**\n```\nNumber: 0\nNumber: 1\nNumber: 2\nNumber: 3\nNumber: 4\n```\n\n---\n\n## Key Takeaway\n\n**Always remember:** In Python, `for` loops, `if` statements, `while` loops, function definitions (`def`), and class definitions (`class`) all require a colon at the end of their declaration line. This is followed by an indented block of code that belongs to that structure."
},
"last_updated": "2025-10-15"
}
17 changes: 17 additions & 0 deletions prompts/coding/code_006_feature_documentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"id": "code-006",
"title": "Feature Documentation",
"category": "coding",
"goal": "Document the features for end users",
"prompt": "Document the following {feature} for end users. Include a short description, step-by-step instructions, input/output, and a usage example.\\n\\nFeature Name: {feature_name}\\n\\nFeature Details:\\n```\\n{feature_details}\\n```",
"variables": ["feature","feature_name","feature_details"],
"tags": ["documentation","feature","user guide","instructions"],
"models_tested": ["gpt-5","gemini-2.5","claude-3"],
"responses": {
"gpt-5": "## 🔐 Feature Name: Password Reset\n\n### 📖 Description\nThe Password Reset feature helps users regain access to their account if they forget their password. It allows users to request a password reset link via their registered email address directly from the login screen.\n\n### 🪜 Step-by-Step Instructions\n1. **Open the Login Page** – Navigate to the app’s or website’s login screen.\n2. **Click “Forgot Password?”** – Below the login fields, select the Forgot Password link.\n3. **Enter Registered Email** – Type your registered email address in the provided field.\n4. **Submit the Request** – Click Send Reset Link (or Submit) to receive an email.\n5. **Check Your Email Inbox** – Look for an email from the app with the subject line like 'Password Reset Request.'\n6. **Open the Reset Link** – Click on the link in the email. It will open a secure password reset page.\n7. **Set a New Password** – Enter your new password, confirm it, and click Save or Reset Password.\n8. **Login Again** – Return to the login page and sign in using your new password.\n\n### 🧾 Input / Output\n| Type | Description |\n|------|--------------|\n| **Input** | Registered email address, new password |\n| **Output** | Password reset confirmation and ability to log in with new password |\n\n### 💡 Example Usage\n**Scenario:** User forgot their account password and cannot log in.\n\n**Steps Taken:**\n1. Clicked 'Forgot Password?' on the login screen.\n2. Entered email: `user@example.com`.\n3. Received an email with a reset link.\n4. Clicked the link and entered a new password: `MyNewPass@123`.\n5. Successfully logged in using the new password.\n\n**Result:** Password successfully updated and access to account restored.",
"gemini-2.5": "## **Password Reset**\n\nThis feature helps you securely reset your account password if you've forgotten it. By providing your registered email address, you'll receive a special link to create a new password and regain access to your account.\n\n---\n\n### **How to Reset Your Password** 🔑\n\n1. **Navigate to the Login Page**: Open the application and go to the login screen.\n2. **Find the Link**: Click on the 'Forgot Password?' or 'Reset Password' link, usually located near the password field.\n3. **Enter Your Email**: Type the registered email address in the provided box.\n4. **Submit Your Request**: Click the 'Send Reset Link' button.\n5. **Check Your Email**: Open your inbox and look for a message titled 'Password Reset Request.'\n6. **Click the Reset Link**: Tap the reset link provided in the email.\n7. **Create a New Password**: Enter and confirm your new password on the page that opens.\n8. **Login Again**: Use your new password to log in successfully.\n\n---\n\n### **Input and Output**\n\n* **Input**: Registered email address.\n* **Output**: Password reset link sent to the email and successful password update after confirmation.\n\n---\n\n### **Usage Example**\n\nPriya forgot her password, so she clicks 'Forgot Password?' on the login page, enters her email 'priya.sharma@email.com,' and receives a reset link. She opens it, sets a new password, and logs in successfully with the new credentials.",
"claude-3": "# Password Reset Feature - User Guide\n\n## Description\n\nThe Password Reset feature allows you to regain access to your account if you've forgotten your password. This secure process sends a password reset link to your registered email address, enabling you to create a new password without needing to contact support.\n\n**Availability:** Login screen \n**Requirements:** Valid registered email address\n\n---\n\n## Step-by-Step Instructions\n\n### How to Reset Your Password\n\n1. **Navigate to the Login Screen** \n Go to the application login page\n\n2. **Click \"Forgot Password?\"** \n Look for the 'Forgot Password?' or 'Reset Password' link below the login form and click on it.\n\n3. **Enter Your Email Address** \n Type the email address associated with your account.\n\n4. **Submit the Request** \n Click the 'Send Reset Link' button.\n\n5. **Check Your Email** \n Open your email inbox (check spam/junk folders if needed) and find the password reset email.\n\n6. **Click the Reset Link** \n Open the email and click the reset link (valid for 24 hours).\n\n7. **Create Your New Password** \n Enter and confirm your new password following security guidelines.\n\n8. **Save and Log In** \n Click 'Reset Password' to complete and log in with your new password.\n\n---\n\n## Input/Output\n\n### Input Required\n- **Email Address:** Registered and verified email\n\n### Output/Result\n- **Success:** Password reset email sent successfully\n- **Errors:**\n - 'Email address not found'\n - 'Invalid email format'\n - 'Please try again later'\n\n---\n\n## Usage Example\n\n### Scenario\nSarah forgot her password and needs to regain access.\n\n**Steps:**\n1. She clicks 'Forgot Password?' on the login page.\n2. Enters her email `sarah.johnson@email.com`.\n3. Clicks 'Send Reset Link'.\n4. Receives an email titled 'Password Reset Request'.\n5. Clicks 'Reset Your Password'.\n6. Creates a new password `SecurePass2024!`.\n7. Confirms and logs in successfully.\n\n---\n\n## Tips & Best Practices\n\n✓ Use a strong password (uppercase, lowercase, numbers, special characters). \n✓ Check spam/junk folders for reset emails. \n✓ Reset links expire in 24 hours. \n✓ Keep your registered email secure. \n✓ Avoid multiple reset requests simultaneously.\n\n---\n\n## Troubleshooting\n\n**Problem:** Didn't receive reset email → Check spam folder or retry. \n**Problem:** Link expired → Request a new reset link. \n**Problem:** Email not recognized → Verify correct email or create new account.\n\n---\n\n## Need Help?\n\nIf issues persist, contact support with your registered email for further assistance."
},

"last_updated": "2025-10-15"
}
Loading