17 Vibe Coding

image.png ี‹ีฅึ€ีดีธึ‚ีฏ, ีฌีธึ‚ีฝีกีถีฏีกึ€ีซ ีฐีฒีธึ‚ีดีจ, ี€ีฅีฒีซีถีกีฏี Hrag Kosbekian

Open In Colab (ToDo)

Song reference - ToDo

๐Ÿ“Œ ี†ีฏีกึ€ีกีฃีซึ€

๐Ÿ“š ิฑีดีขีธีฒีปีกีฏีกีถ ีถีตีธึ‚ีฉีจ

๐Ÿ“บ ีีฅีฝีกีถีตีธึ‚ีฉีฅึ€

๐Ÿก ีีถีกีตีซีถ

๐Ÿ“š ี†ีตีธึ‚ีฉีจ

https://arstechnica.com/ai/2025/07/exhausted-man-defeats-ai-model-in-world-coding-championship/

https://x.com/FakePsyho/status/1945444118924272018

https://www.swebench.com/

https://t.me/hrantsbraindump/557

https://x.com/karpathy/status/1886192184808149383?lang=en

https://cursor.com/

# Install required libraries (run once):
# pip install pandas numpy matplotlib

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

df = pd.DataFrame({
    "x": np.arange(0, 10, 1),
    "y": np.random.randint(0, 10, 10)
})

print(df)

๐Ÿš€ AI-Powered Development with GitHub Copilot

Welcome to the world of AI-assisted coding! In this session, weโ€™ll explore how GitHub Copilot and other AI tools are revolutionizing software development.

๐ŸŽ“ Getting GitHub Copilot Free with University Email

Step-by-Step Guide:

1. Verify Your Student Status

  • Go to GitHub Education
  • Click on โ€œGet Student Benefitsโ€
  • Sign in with your GitHub account or create one

2. Apply for GitHub Student Developer Pack

  • Upload proof of enrollment (student ID, transcript, or enrollment letter)
  • Use your university email address (.edu, .ac.uk, etc.)
  • Wait for verification (usually 1-7 days)

3. Access GitHub Copilot

  • Once approved, go to GitHub Copilot
  • Click โ€œStart free trialโ€ or โ€œGet Copilot for freeโ€
  • Students get GitHub Copilot completely free!

4. Benefits Included:

  • GitHub Copilot (AI pair programmer)
  • GitHub Pro (unlimited private repositories)
  • Access to GitHub Codespaces
  • Various other developer tools and credits

Alternative Options:

  • GitLab Duo: Free tier available
  • Codeium: Free for individual developers
  • Tabnine: Free tier with limited features

๐Ÿค– Types of AI Coding Assistance

1. ASK - Conversational Programming ๐Ÿ’ฌ

Get answers to coding questions and explanations:

Use Cases: - โ€œHow do I implement a binary search in Python?โ€ - โ€œWhatโ€™s the difference between == and is in Python?โ€ - โ€œExplain this regex pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$โ€

Tools: - GitHub Copilot Chat - ChatGPT/Claude for coding - Stack Overflow integrated AI

2. EDIT - Code Transformation โœ๏ธ

Modify existing code with AI assistance:

Use Cases: - Refactor functions for better performance - Add error handling to existing code - Convert code between programming languages - Optimize algorithms - Add documentation and comments

Tools: - Cursor AI (excellent for editing) - GitHub Copilot inline suggestions - Codeium edit mode

3. AGENT - Autonomous Development ๐Ÿค–

AI that can work independently on larger tasks:

Use Cases: - Generate entire modules or classes - Create test suites automatically - Build complete features from requirements - Handle complex multi-file changes - Project scaffolding and setup

Emerging Tools: - GitHub Copilot Workspace - Devin (Cognition Labs) - GPT Engineer - AutoGPT for coding tasks

Best Practices:

  • Start with ASK for learning and understanding
  • Use EDIT for improving existing code
  • Reserve AGENT for well-defined, larger tasks

โšก Slash Commands - Quick AI Actions

Slash commands provide quick access to common AI-powered development tasks:

Essential Slash Commands:

๐Ÿ“ Documentation & Explanation

  • /explain - Get detailed explanation of selected code
  • /doc - Generate documentation for functions/classes
  • /comment - Add inline comments to code
  • /summarize - Summarize what a file or function does

๐Ÿ”ง Code Improvement

  • /fix - Automatically fix bugs or errors
  • /optimize - Improve code performance
  • /refactor - Restructure code for better readability
  • /simplify - Make complex code more straightforward

๐Ÿงช Testing & Quality

  • /test - Generate unit tests for functions
  • /tests - Create comprehensive test suites
  • /review - Get code review suggestions
  • /lint - Check and fix code style issues

๐Ÿš€ Generation

  • /generate - Create new code from description
  • /scaffold - Generate boilerplate code structure
  • /api - Generate API endpoints or client code
  • /mock - Create mock data or functions

๐Ÿ” Search & Navigation

  • /find - Search for specific code patterns
  • /search - Semantic search across codebase
  • /goto - Navigate to definitions or implementations

How to Use:

  1. Select code or place cursor
  2. Type / followed by command name
  3. Add specific instructions if needed
  4. Press Enter to execute

Examples:

/explain this recursive function
/fix the memory leak in this code
/test this authentication function
/generate a REST API for user management

๐ŸŽฏ Adding Context - Making AI Smarter

๐Ÿ”Œ Model Context Protocol (MCP)

MCP is a standardized way for AI models to securely connect to external tools and data sources.

๐ŸŽฏ What is MCP?

Model Context Protocol is an open protocol developed by Anthropic that enables AI assistants to securely access and interact with external systems. Think of it as a โ€œuniversal translatorโ€ that allows AI models to:

  • Understand your development environment (files, databases, APIs)
  • Execute actions with proper permissions and security
  • Maintain persistent context across different tools and sessions
  • Work with live, real-time data instead of static information

๐Ÿ—๏ธ Architecture Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Assistant  โ”‚โ—„โ”€โ”€โ–บโ”‚   MCP Client    โ”‚โ—„โ”€โ”€โ–บโ”‚   MCP Server    โ”‚
โ”‚   (Claude, etc) โ”‚    โ”‚   (VS Code)     โ”‚    โ”‚ (File System)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                               โ”‚
                                               โ–ผ
                                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                       โ”‚  External Tool  โ”‚
                                       โ”‚ (Git, Database) โ”‚
                                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Components: - MCP Client: The application hosting the AI (VS Code, cursor, etc.) - MCP Server: Bridges AI requests to specific tools/services - Protocol: Standardized communication format (JSON-RPC)

๐Ÿ› ๏ธ Types of MCP Servers

1. File System Access

{
  "tools": [
    {
      "name": "read_file",
      "description": "Read contents of a file",
      "parameters": {
        "path": "string"
      }
    },
    {
      "name": "write_file", 
      "description": "Write content to a file",
      "parameters": {
        "path": "string",
        "content": "string"
      }
    }
  ]
}

2. Database Operations

# Example: PostgreSQL MCP Server
class PostgreSQLServer:
    def execute_query(self, query: str):
        """Execute SQL query and return results"""
        return self.connection.execute(query).fetchall()
    
    def get_schema(self):
        """Return database schema information"""
        return self.connection.execute(
            "SELECT table_name FROM information_schema.tables"
        ).fetchall()

3. Git Integration

# Git MCP Server capabilities:
git status          # Check repository status
git log --oneline   # View commit history
git diff           # Show changes
git checkout -b    # Create new branch
git commit -m      # Commit changes

๐Ÿ”ง Setting Up MCP in VS Code

Step 1: Install MCP Extension

# Install VS Code MCP extension
code --install-extension anthropic.mcp

Step 2: Configure MCP Servers

Create mcp-settings.json:

{
  "servers": {
    "filesystem": {
      "command": "npx",
      "args": ["@anthropic/mcp-server-filesystem", "/path/to/project"],
      "env": {}
    },
    "git": {
      "command": "npx", 
      "args": ["@anthropic/mcp-server-git", "--repository", "."],
      "env": {}
    },
    "sqlite": {
      "command": "npx",
      "args": ["@anthropic/mcp-server-sqlite", "--db-path", "./data.db"],
      "env": {}
    }
  }
}

Step 3: Enable in VS Code Settings

{
  "mcp.servers": {
    "filesystem": {
      "command": "npx",
      "args": ["@anthropic/mcp-server-filesystem", "${workspaceFolder}"]
    }
  }
}

๐Ÿš€ Practical Examples

Example 1: AI Code Review with File Access

Human: "Review the authentication module in src/auth/"

AI Response: "I'll analyze your authentication module. Let me examine the files..."
[MCP reads src/auth/login.py, auth.py, middleware.py]

"I found several issues:
1. Password validation in login.py line 23 lacks complexity requirements
2. JWT tokens in auth.py don't have expiration handling
3. Missing rate limiting in middleware.py

Would you like me to fix these issues?"

Example 2: Database-Driven Development

Human: "Create a user management API based on our database schema"

AI Response: "Let me check your database structure first..."
[MCP queries database schema]

"I see you have users, roles, and permissions tables. I'll create:
1. User CRUD endpoints
2. Role assignment functionality  
3. Permission-based middleware

Shall I implement this in your existing Flask app structure?"

Example 3: Git Workflow Automation

Human: "Help me prepare this feature branch for review"

AI Response: "I'll help you prepare for review..."
[MCP executes: git status, git log, git diff]

"I see you have:
- 5 commits on feature/user-dashboard
- 2 modified files with uncommitted changes
- No conflicts with main branch

Let me:
1. Commit the pending changes
2. Squash related commits
3. Write a comprehensive PR description"

๐Ÿ”’ Security & Permissions

Sandboxed Execution

permissions:
  file_system:
    read: ["src/", "tests/", "docs/"]
    write: ["src/", "tests/"]
    exclude: [".env", "secrets/"]
  
  database:
    read: ["users", "products"] 
    write: ["logs", "analytics"]
    admin: false
  
  git:
    read: true
    commit: true
    push: false  # Requires explicit approval

๐ŸŽฏ Best Practices

1. Start Small

# Begin with read-only access
mcp_config = {
    "permissions": {
        "file_read": True,
        "file_write": False,
        "command_execution": False
    }
}

2. Use Specific Scopes

{
  "servers": {
    "project-files": {
      "command": "mcp-filesystem",
      "args": ["--root", "./src", "--readonly"]
    }
  }
}

3. Monitor AI Actions

# Log all MCP interactions
def log_mcp_action(action, params, result):
    logger.info(f"MCP Action: {action}")
    logger.info(f"Parameters: {params}")
    logger.info(f"Result: {result[:100]}...")  # Truncated

๐Ÿ”ฎ Future of MCP

Emerging Capabilities:

  • Multi-modal contexts: Images, audio, video analysis
  • Real-time collaboration: Multiple developers + AI
  • Cross-platform protocols: Universal tool integration
  • Advanced security: Zero-trust MCP networks

Industry Adoption:

  • GitHub Copilot Workspace: Deep repository integration
  • Cursor: Native MCP support for file operations
  • JetBrains: MCP plugins for IDEs
  • VS Code: Built-in MCP client capabilities

MCP represents the future where AI assistants become true development partners, not just code completion tools.

# add timer for 20 seconds
import time


time.sleep(10)
print("10 seconds have passed")
10 seconds have passed

๐ŸŽฒ 00

Flag Counter