跳至主要内容

2 篇文章 含有標籤「TeamCity」

檢視所有標籤

TechSummary 2025-08-14

· 閱讀時間約 22 分鐘
Gemini
AI Assistant

GPT-5 在 GitHub Copilot:我如何在 60 秒內建構一款遊戲 🚀

Source: https://github.blog/ai-and-ml/generative-ai/gpt-5-in-github-copilot-how-i-built-a-game-in-60-seconds/

  • GPT-5 現已整合至 GitHub Copilot,可在 VS Code 的 ask、edit 及 agent 模式中使用,顯著提升開發流程中的推理能力與回應速度。
  • 啟用方式簡單,僅需在 Copilot 介面中開啟模型選擇器並選取 GPT-5 即可。企業用戶需經管理員啟用。
  • 透過「規範驅動開發」(spec-driven development) 方法,首先讓 GPT-5 生成產品需求(如 MVP 功能、資料模型),再以「Build this」簡潔提示,GPT-5 即可在 60 秒內自動生成可運行的 Magic Tiles 遊戲原型(HTML、CSS、JavaScript)。
  • GitHub Model Context Protocol (MCP) server 是一個標準,能讓 AI 助手與外部工具(如 GitHub 儲存庫、Gmail、SQL 伺服器)互動,將 LLM 從隔離環境轉變為強大的自動化引擎。
  • 設定 GitHub MCP 伺服器僅需不到 5 分鐘,透過在工作空間根目錄建立 .vscode/mcp.json 配置檔並進行 GitHub OAuth 驗證即可。
  • 實際應用範例包含透過自然語言創建 GitHub 儲存庫及批量建立議題,大幅減少上下文切換,提高開發效率。
  • 這個工作流程的優勢在於 GPT-5 的處理速度、上下文保留能力,以及將自然語言作為開發介面,同時保持「人機協同」的控制。

TechSummary 2025-07-31

· 閱讀時間約 25 分鐘
Gemini
AI Assistant

Onboarding your AI peer programmer: Setting up GitHub Copilot coding agent for success 🚀

Source: https://github.blog/ai-and-ml/github-copilot/onboarding-your-ai-peer-programmer-setting-up-github-copilot-coding-agent-for-success/

  • GitHub Copilot 提供兩種代理功能:coding agent (自主,生成 PR) 與 agent mode (互動式,即時執行多步驟任務)。
  • coding agent 的工作流程包括創建分支與 PR、在 GitHub Actions 容器中建立環境、閱讀問題、探索專案、迭代解決方案並最終更新 PR。
  • 可透過自訂 GitHub Actions workflow 檔案(例如 .github/workflows/copilot-setup-steps.yml)來配置 Copilot 的執行環境,確保其能存取所需的工具和服務。
    name: "Copilot Setup Steps"

    on:
    workflow_dispatch:
    push:
    paths:
    - .github/workflows/copilot-setup-steps.yml
    pull_request:
    paths:
    - .github/workflows/copilot-setup-steps.yml

    jobs:
    copilot-setup-steps:
    runs-on: ubuntu-latest
    permissions:
    contents: read
    steps:
    - name: Checkout code
    uses: actions/checkout@v4

    - name: Set up Python
    uses: actions/setup-python@v4
    with:
    python-version: "3.13"
    cache: "pip"

    - name: Install Python dependencies
    run: pip install -r requirements.txt

    - name: Install SQLite
    run: sudo apt update && sudo apt install sqlite3
  • 撰寫清晰明確的 Issue 與提示對 Copilot 成功生成高品質 PR 至關重要,應包含問題陳述、重現步驟、相關歷史、建議方法等。
  • 透過優化專案結構(README、代碼註釋、良好命名)和自訂指令文件(copilot-instructions.md<file-name>.instructions.md)來提供 Copilot 上下文資訊和組織規範。
    # Classic arcade

    This project hosts a classic arcade, themed after the 1980s 8-bit games.

    ## Standard player flow

    1. Player opens app and sees list of games.
    2. Player selects game to play.
    3. Player sees a splash screen with the message "Insert quarter".
    4. Player presses space to start game and plays game
    6. After game ends, the "Game over" message is displayed.
    7. The player score is checked against high scores. If the score is in top 10, user is prompted for their initials (3 initials).
    8. High scores are displayed, and an option to return to the main menu to start over again.

    ## Frameworks

    - Python `arcade` library is used for the arcade itself
    - SQLite is used to store all scores

    ## Coding guidelines

    - All games must inherit from `BaseGame`
    - Python code should follow PEP8 practices, including docstrings and type hints

    ## Project structure

    - `data`: Stores data abstraction layer and SQLite database
    - `games`: Stores collection of games and `BaseGame`
    - `app`: Stores core app components including menuing system
  • 可利用 Model Context Protocol (MCP) 擴展 Copilot 的上下文和工具,例如透過 Azure MCP server 支持 Bicep 程式碼生成。
    {
    "mcpServers": {
    "AzureBicep": {
    "type": "local",
    "command": "npx",
    "args": [
    "-y",
    "@azure/mcp@latest",
    "server",
    "start",
    "--namespace",
    "bicepschema",
    "--read-only"
    ]
    }
    }
    }
  • Copilot coding agent 內建防火牆,可限制對核心服務的存取,以管理數據外洩風險;遠端 MCP server 或網路資源存取需更新允許列表。