Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
9 changes: 5 additions & 4 deletions 01-course/module-02-fundamentals/module2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3103,10 +3103,11 @@
"### Next Steps\n",
"\n",
"Continue to **Module 3: Advanced Software Engineering Applications** where you'll learn:\n",
"- Building prompts for complex refactoring scenarios\n",
"- Creating systematic testing and QA workflows\n",
"- Designing effective debugging and performance optimization prompts\n",
"- Developing API integration and documentation helpers\n"
"- Implement prompts for code review, debugging, documentation, and refactoring\n",
"- Design reusable prompt templates for software engineering workflows\n",
"- Evaluate prompt effectiveness and output quality\n",
"- Refine templates based on feedback and edge cases\n",
"- Apply best practices for SDLC integration\n"
]
}
],
Expand Down
318 changes: 318 additions & 0 deletions 01-course/module-03-applications/3.1-setup-and-introduction.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Section 3.1: Setup & Introduction\n",
"\n",
"| **Aspect** | **Details** |\n",
"|-------------|-------------|\n",
"| **Goal** | Set up your environment and understand how to apply prompt engineering to SDLC tasks |\n",
"| **Time** | ~15-20 minutes |\n",
"| **Prerequisites** | Module 2 completion, Python 3.8+, IDE with notebook support, API access (GitHub Copilot, CircuIT, or OpenAI) |\n",
"| **Next Steps** | Continue to Section 3.2: Code Review Automation |\n",
"\n",
"---\n",
"\n",
"## 🚀 Ready to Start?\n",
"\n",
"<div style=\"margin-top:16px; color:#991b1b; padding:12px; background:#fee2e2; border-radius:6px; border-left:4px solid #ef4444;\">\n",
"<strong>⚠️ Important:</strong> <br><br>\n",
"This module builds directly on Module 2 techniques. Make sure you've completed Module 2 before starting.<br>\n",
"</div>\n",
"\n",
"## 📚 Module 3 Overview\n",
"\n",
"This module has 3 sections (~2 hours total):\n",
"\n",
"1. **Setup & Introduction** (this notebook) — 15 minutes \n",
" Get your environment ready\n",
"\n",
"2. **Code Review Automation** — 40 minutes \n",
" Build a template that reviews code for security, performance, and quality issues\n",
"\n",
"3. **Test Generation Automation** — 35 minutes \n",
" Create prompts that automatically generate unit tests\n",
"\n",
"4. **Test Generation Automation** — 35 minutes \n",
" Create prompts that automatically generate unit tests"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 🔧 Setup: Environment Configuration\n",
"\n",
"### Step 1: Install Required Dependencies\n",
"\n",
"Let's start by installing the packages we need for this tutorial.\n",
"\n",
"Run the cell below. You should see a success message when installation completes:\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Install required packages for Module 3\n",
"import subprocess\n",
"import sys\n",
"\n",
"def install_requirements():\n",
" try:\n",
" # Install from requirements.txt\n",
" subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"-q\", \"-r\", \"requirements.txt\"])\n",
" print(\"✅ SUCCESS! Module 3 dependencies installed successfully.\")\n",
" print(\"📦 Ready for: openai, anthropic, python-dotenv, requests\")\n",
" except subprocess.CalledProcessError as e:\n",
" print(f\"❌ Installation failed: {e}\")\n",
" print(\"💡 Try running: pip install openai anthropic python-dotenv requests\")\n",
"\n",
"install_requirements()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 2: Load Setup Utilities\n",
"\n",
"<div style=\"margin-top:16px; color:#15803d; padding:12px; background:#dcfce7; border-radius:6px; border-left:4px solid #22c55e;\">\n",
"<style>\n",
"code {\n",
" font-family: Consolas,\"courier new\";\n",
" color:rgb(238, 13, 13);\n",
" background-color: #f1f1f1;\n",
" padding: 2px;\n",
" font-size: 110%;\n",
"}\n",
"</style>\n",
"<strong>💡 New Approach:</strong> <br><br>\n",
"We've extracted all setup code into <code>setup_utils.py</code> - a reusable module! This means:\n",
"<ul>\n",
"<li>✅ Setup runs once, works everywhere</li>\n",
"<li>✅ Sections 3.2, 3.3, and 3.4 just import and go</li>\n",
"<li>✅ Includes helper functions for testing activities</li>\n",
"</ul>\n",
"</div>\n",
"\n",
"<div style=\"margin-top:16px; color:#78350f; padding:12px; background:#fef3c7; border-radius:6px; border-left:4px solid #f59e0b;\">\n",
"<strong>💡 Note:</strong> <br><br>\n",
"The code below runs on your local machine and connects to AI services over the internet.\n",
"</div>\n",
"\n",
"**Configure your AI provider:**\n",
"- **Option A: GitHub Copilot API (local proxy)** ⭐ **Recommended**\n",
" - Supports both Claude and OpenAI models\n",
" - No API keys needed\n",
" - Follow [GitHub-Copilot-2-API/README.md](../../GitHub-Copilot-2-API/README.md)\n",
" \n",
"- **Option B/C:** Edit `setup_utils.py` if using OpenAI API or CircuIT directly\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Load the setup utilities module\n",
"from setup_utils import *\n",
"\n",
"print(\"✅ Setup utilities loaded successfully!\")\n",
"print(f\"🤖 Provider: {PROVIDER.upper()}\")\n",
"print(f\"📝 Default model: {get_default_model()}\")\n",
"print()\n",
"\n",
"# Test the connection\n",
"print(\"🧪 Testing connection...\")\n",
"if test_connection():\n",
" print()\n",
" print(\"=\"*70)\n",
" print(\"🎉 Setup complete! You're ready to continue.\")\n",
" print(\"=\"*70)\n",
"else:\n",
" print()\n",
" print(\"⚠️ Connection test failed. Please check:\")\n",
" print(\" 1. Is GitHub Copilot proxy running on port 7711?\")\n",
" print(\" 2. Did you follow the setup instructions?\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style=\"margin-top:16px; color:#15803d; padding:12px; background:#dcfce7; border-radius:6px; border-left:4px solid #22c55e;\">\n",
"<style>\n",
"code {\n",
" font-family: Consolas,\"courier new\";\n",
" color:rgb(238, 13, 13);\n",
" background-color: #f1f1f1;\n",
" padding: 2px;\n",
" font-size: 110%;\n",
"}\n",
"</style>\n",
"<strong>💡 What's Available?</strong> <br><br>\n",
"The <code>setup_utils.py</code> module provides these functions: <br><br>\n",
"<strong>Core Functions:</strong>\n",
"<ul>\n",
"<li><code>get_chat_completion(messages)</code> - Send prompts to AI</li>\n",
"<li><code>get_default_model()</code> - Get current model name</li>\n",
"<li><code>test_connection()</code> - Test AI connection</li>\n",
"</ul>\n",
"\n",
"<strong>Activity Testing Functions:</strong>\n",
"<ul>\n",
"<li><code>test_activity(file, code, variables)</code> - Test any activity template</li>\n",
"<li><code>test_activity_3_2(code, variables)</code> - Quick test for Activity 3.2</li>\n",
"<li><code>test_activity_3_3(code, variables)</code> - Quick test for Activity 3.3</li>\n",
"<li><code>list_activities()</code> - Show available activities</li>\n",
"</ul>\n",
"\n",
"These will be used in Parts 2 and 3!\n",
"</div>\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 🎯 Applying Prompt Engineering to SDLC Tasks\n",
"\n",
"---\n",
"\n",
"### Introduction: From Tactics to Real-World Applications\n",
"\n",
"#### 🚀 Ready to Transform Your Development Workflow?\n",
"\n",
"You've successfully mastered the core tactics in Module 2. Now comes the exciting part - **applying these techniques to real-world software engineering challenges** that you face every day.\n",
"\n",
"Think of what you've accomplished so far as **learning individual martial arts moves**. Now we're going to **choreograph them into powerful combinations** that solve actual development problems.\n",
"\n",
"#### 👨‍💻 What You're About to Master\n",
"\n",
"In the next sections, you'll discover **how to combine tactics strategically** to build production-ready prompts for critical SDLC tasks:\n",
"\n",
"<div style=\"display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 20px 0;\">\n",
"\n",
"<div style=\"background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 8px; padding: 16px; text-align: center; color: #000000;\">\n",
"<strong>🔍 Code Review Automation</strong><br>\n",
"<em>Comprehensive review prompts with structured feedback</em>\n",
"</div>\n",
"\n",
"<div style=\"background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 8px; padding: 16px; text-align: center; color: #000000;\">\n",
"<strong>🧪 Test Generation Automation</strong><br>\n",
"<em>Smart test plans with coverage gap analysis</em>\n",
"</div>\n",
"\n",
"<div style=\"background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 8px; padding: 16px; text-align: center; color: #000000;\">\n",
"<strong>⚖️ Quality Validation</strong><br>\n",
"<em>LLM-as-Judge rubrics for output verification</em>\n",
"</div>\n",
"\n",
"<div style=\"background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 8px; padding: 16px; text-align: center; color: #000000;\">\n",
"<strong>📋 Reusable Templates</strong><br>\n",
"<em>Parameterized prompts for CI/CD integration</em>\n",
"</div>\n",
"\n",
"</div>\n",
"\n",
"<div style=\"margin-top:16px; color:#15803d; padding:12px; background:#dcfce7; border-radius:6px; border-left:4px solid #22c55e;\">\n",
"<strong>💡 Pro Tip:</strong> <br><br>\n",
"This module covers practical applications over 90 minutes across 3 parts. <strong>Take short breaks</strong> between parts to reflect on how each template applies to your projects. <strong>Make notes</strong> as you progress. The key skill is learning <strong>which tactic combinations solve which problems</strong>!\n",
"</div>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 🎨 Technique Spotlight: Strategic Combinations\n",
"\n",
"Here's how Module 2 tactics combine to solve real SDLC challenges:\n",
"\n",
"| **Technique** | **Purpose in SDLC Context** | **Prompting Tip** |\n",
"|---------------|----------------------------|-------------------|\n",
"| **Task Decomposition** | Break multifaceted engineering tasks into manageable parts | Structure prompt into numbered steps or XML blocks |\n",
"| **Role Prompting** | Align the model's persona with engineering expectations | Specify domain, experience level, and evaluation criteria |\n",
"| **Chain-of-Thought** | Ensure reasoning is visible, aiding traceability and auditing | Request structured reasoning before conclusions |\n",
"| **LLM-as-Judge** | Evaluate code changes or generated artifacts against standards | Provide rubric with weighted criteria and evidence requirement |\n",
"| **Few-Shot Examples** | Instill preferred review tone, severity labels, or test formats | Include short exemplars with both input and expected reasoning |\n",
"| **Prompt Templates** | Reduce prompt drift across teams and tools | Parameterize sections (`{{code_diff}}`, `{{requirements}}`) for reuse |\n",
"\n",
"#### 🔗 The Power of Strategic Combinations\n",
"\n",
"The real skill isn't using tactics in isolation—it's knowing **which combinations solve which problems**. Each section demonstrates a different combination pattern optimized for specific SDLC challenges.\n",
"\n",
"Ready to build production-ready solutions? Let's dive in! 👇\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## ✅ Setup Complete!\n",
"\n",
"<div style=\"background:#dcfce7; border-left:4px solid #22c55e; padding:20px; border-radius:8px; margin:24px 0; color:#000000;\">\n",
"<strong style=\"color:#166534;\">🎉 You're All Set!</strong><br><br>\n",
"\n",
"Your environment is configured and ready. Here's what you have:\n",
"\n",
"✅ **AI Connection** - Tested and working<br>\n",
"✅ **Setup Utilities** - Loaded and available<br>\n",
"✅ **Activity Helpers** - Ready for hands-on practice<br>\n",
"✅ **Understanding** - You know what's coming next<br>\n",
"</div>\n",
"\n",
"### ⏭️ Next Steps\n",
"\n",
"**Continue to Section 2:**\n",
"1. Open [`3.2-code-review-automation.ipynb`](./3.2-code-review-automation.ipynb)\n",
"2. The setup will already be loaded - just import from `setup_utils`!\n",
"3. Learn how to build production-ready code review templates\n",
"4. Complete Activity 3.2 in your own `.md` file\n",
"\n",
"**💡 Tip:** Keep this notebook open in case you need to troubleshoot the connection later.\n",
"\n",
"---\n",
"\n",
"### 🔗 Quick Links\n",
"\n",
"- **Next:** [Section 2: Code Review Automation](./3.2-code-review-automation.ipynb)\n",
"- **Activities:** [Browse Activities](./activities/README.md)\n",
"- **Solutions:** [View Solutions](./solutions/README.md)\n",
"- **Main README:** [Module 3 Overview](./README.md)\n",
"\n",
"---\n",
"\n",
"**Ready to continue?** [🚀 Open Section 2 now](./3.2-code-review-automation.ipynb)!\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading