跳至主要内容

6 篇文章 含有標籤「Generative AI」

檢視所有標籤

TechSummary 2025-09-02

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

🚀 AI 驅動的規範式開發:GitHub 開源工具包 Spec Kit 入門

Source: https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/

  • 挑戰與解決方案: 隨著 AI 程式碼生成工具日益強大,傳統的「憑感覺寫程式」(vibe-coding) 方式常導致程式碼無法編譯或未能完全符合需求。GitHub 提出「規範式開發」(Spec-driven development),將規範視為活生生的可執行文件,作為工具與 AI 代理生成、測試、驗證程式碼的單一事實來源。
  • Spec Kit 工具包: GitHub 開源工具包 Spec Kit 旨在將規範式開發引入 AI 程式碼生成工作流程,支援 GitHub Copilot、Claude Code 和 Gemini CLI 等工具。
  • 四階段開發流程:
    1. Specify (規範): 提供高層次的「是什麼」和「為什麼」,AI 生成詳細的用戶旅程和預期成果規範。
    2. Plan (規劃): 提供技術棧、架構和限制,AI 生成全面的技術實作計劃。
    3. Tasks (任務): AI 將規範與計劃分解為可單獨實作與測試的小型任務。例如,從「建置認證」變成「創建驗證電子郵件格式的用戶註冊端點」。
    4. Implement (實作): AI 根據任務逐一生成程式碼,開發者審查針對特定問題的精確變更。
  • 核心優勢:
    • 意圖即真理: 從「程式碼是真理來源」轉變為「意圖是真理來源」,使規範可執行並自動轉化為工作程式碼。
    • 減少猜測: 明確的規範、技術計劃和任務提供 AI 更高清晰度,提高其效率。
    • 適用場景: 適用於從零開始的新專案 (Greenfield)、現有系統的功能擴展 (Feature work) 及遺留系統現代化 (Legacy modernization)。
    • 大規模應用: 組織的安全政策、合規規則、設計系統限制等要求可直接整合到規範和計劃中,供 AI 使用。
  • Spec Kit 使用範例 (CLI):
    • 初始化專案:
      uvx --from git+https://github.com/github/spec-kit.git specify init <PROJECT_NAME>
    • 生成規範:
      /specify "Build a new e-commerce product catalog with search functionality."
    • 生成技術計劃:
      /plan "Use Python, FastAPI, PostgreSQL, and integrate with Stripe for payments."
    • 分解任務並實作:
      /tasks

TechSummary 2025-08-20

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

🌍 誰將維護未來?為新一代重新思考開源領導力

Source: https://github.blog/open-source/maintainers/who-will-maintain-the-future-rethinking-open-source-leadership-for-a-new-generation/

  • 開源社群「老齡化」問題: 根據 Tidelift 2024 年維護者調查,46-65 歲維護者的比例自 2021 年以來翻了一倍,而 26 歲以下貢獻者則從 25% 下降到 10%。這揭示了開源社群面臨的傳承危機和潛在的知識流失。
  • Gen Z 貢獻者「Sam」視角: 文章引入一位 23 歲 Gen Z 貢獻者「Sam」的人格設定,他們渴望為有意義的氣候科技專案貢獻,透過 YouTube 自學程式碼,擅長線上社群管理,但對公開儲存庫感到畏懼。他們尋求目標、彈性及歸屬感。
  • 「參與之山」框架: 為了幫助像 Sam 這樣的貢獻者茁壯成長,文章提出一個包含六個階段的框架:「參與之山」——發現、首次接觸、參與、持續參與、網絡參與、領導力。
  • 針對 Gen Z 需求調整傳統最佳實踐:
    • 發現階段: Gen Z 透過 TikTok、Discord 和 YouTube 發現專案,他們希望在 README 中直接看到專案宗旨,並偏好行動裝置學習。專案需在 Gen Z 活躍的平台露面。
    • 首次接觸: 需提供行動友善、視覺優先的登陸體驗,以及像 Discord 這樣輕鬆開放的聊天頻道,讓新手可以潛水觀察。
    • 參與階段: Gen Z 偏好即時回饋、沙盒環境進行嘗試,以及提供允許學習而非僅限展示的空間,例如 FreeCodeCamp 和 Kubernetes 的貢獻者遊樂場模式。
    • 持續參與: 重視可分享的認可(徽章、提及、作品集),更關注影響力而非層級晉升。
    • 網絡參與: 偏好具名的、可分享的角色(如 Discord 版主、社群嚮導),非正式交流,以及同儕主導的領導模式(如 Rust 的共識驅動治理)。
    • 領導階段: 期望共同管理而非自上而下的控制,並尋求補償或專業成長,例如 TensorFlow 的貢獻者階梯。
  • 具體行動建議: 將 README 轉化為 60 秒解說影片、建立首次貢獻者的沙盒空間、啟動 Discord 或非主題頻道以培養歸屬感、明確並公開專案使命。

TechSummary 2025-08-19

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

Agents panel: Launch Copilot coding agent tasks anywhere on GitHub 🚀

Source: https://github.blog/news-insights/product-news/agents-panel-launch-copilot-coding-agent-tasks-anywhere-on-github/

  • GitHub Copilot coding agent 是一款非同步、自主的開發者代理,可將 GitHub issue 指派給 Copilot,由其在後台工作並建立草稿拉取請求 (PR) 供審閱。
  • 新推出的 Agents panel 允許開發者從 GitHub.com 上的任何頁面快速將任務委託給 Copilot,並追蹤其進度而無需中斷工作流程。
  • Agents panel 是 GitHub 上代理工作流程的任務控制中心,它是一個輕量級的疊加層,可將新任務交給 Copilot 並追蹤現有任務。
  • 可用的功能包括:無需切換頁面即可分配後台任務、實時監控運行中的任務、以及在準備好審閱時跳轉到拉取請求。
  • 支援從 GitHub.com、GitHub Mobile、Copilot Chat、VS Code 或支援 MCP 的工具發起任務。
  • Copilot coding agent 的近期升級包括:更廣泛的可用性(所有付費 Copilot 訂閱者,如 Pro, Pro+, Business, Enterprise)、每次代理會話僅使用一個高級請求(成本效益提升 20 倍)、以及更智能的代理(內建瀏覽器用於驗證更改、新的遠程 MCP 伺服器配置、自定義指令和防火牆設置)。
  • 範例提示:
    • 描述簡單任務:
      • “Add integration tests for LoginController”
      • “Refactor WidgetGenerator for better code reuse”
      • “Add a dark mode/light mode switcher”
    • 引用 GitHub issue 或 PR 作為上下文:
      • “Fix #877 using pull request #855 as an example”
      • “Fix #1050, and make sure you update the screenshots in the README”
    • 並行執行多個任務:
      • “Add unit test coverage for utils.go” + “Add unit test coverage for helpers.go”

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-08-12

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

🔗 為何 GitHub 開源 MCP 伺服器,以及這對您的意義

Source: https://github.blog/open-source/maintainers/why-we-open-sourced-our-mcp-server-and-what-it-means-for-you/

  • 當 LLMs(大型語言模型)缺乏外部工具和數據源的連接能力時,容易產生幻覺(hallucinations),給出看似合理但錯誤的答案。
  • Model Context Protocol (MCP) 是一個開放協議,旨在標準化 LLM 應用程式如何連接並使用外部工具和數據源,其角色類似於程式語言伺服器協議 (LSP) 之於程式語言,可以視為「LLM 的 LSP」。
  • GitHub 已開源其 MCP 伺服器,作為 GitHub 平台與任何 LLM 之間的「真相來源」介面,有助於減少幻覺並啟用新的自動化工作流程。
  • GitHub 的 MCP 伺服器允許使用者以自然語言發出請求(例如「列出所有開放的議題」),這些請求會被自動轉換為結構化、語義豐富的 API 調用,從而獲取 GitHub 上的即時數據。
  • 該架構概念上簡單但功能強大,將語言模型、用戶體驗和數據/工具訪問分離,使每一層都模組化、可測試和可替換。
  • 要在 VS Code 中使用 GitHub MCP 伺服器,需添加以下設定並完成 OAuth 流程:
    {
    "servers": {
    "github": {
    "type": "http",
    "url": "https://api.githubcopilot.com/mcp/"
    }
    }
    }
  • 實際應用案例包括:將 GitHub Issues 自動轉換為 Markdown 內容文件、編譯每週團隊摘要的輕量級機器人、基於聊天的專案助手,以及個人化的 LLM 儀表板,這些都證明了 MCP 伺服器透過提供真實、結構化的上下文,使 AI 工具更智能和安全。

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 或網路資源存取需更新允許列表。