跳至主要内容

18 篇文章 含有標籤「GitHub Copilot」

檢視所有標籤

TechSummary 2025-10-15

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

Copilot:更快、更智能,並為您現在的工作方式而生 🚀​

Source: https://github.blog/ai-and-ml/github-copilot/copilot-faster-smarter-and-built-for-how-you-work-now/

  • GitHub Copilot 已從單純的程式碼自動完成進化為多模式、多模型 AI 助理,能理解專案並推動進度。
  • 至今已接受超過 30 億次程式碼建議,每月協助進行數百萬次程式碼審查並貢獻 120 萬個 Pull Request。
  • Copilot 深度整合於 GitHub 平台,透過 GitHub MCP Server 連結現有程式碼、Pull Request、審查和測試等工作流程,提供代理能力。
  • 主要新功能亮點:
    • Agent mode: 處理跨檔案任務、執行命令、重構模組、建議終端操作。
    • Coding agent: 自動為 Issue 起草包含程式碼、測試和上下文的 Pull Request。
    • Next-edit suggestions: 預測下一個變更並提供行內建議。
    • Low-latency completions: 大部分回應在 400 毫秒內呈現。
    • Copilot CLI: 將 AI 智慧帶入終端機,無需切換視窗即可進行設置、偵錯和編寫腳本。
    • Multi-model routing: 提供來自領先 AI 公司的多種大型語言模型。
  • 擴展工作流程的特性:
    • JetBrains + VS Code + CLI parity: 在不同開發環境中提供一致體驗。
    • Custom instructions: 透過 .copilot-instructions.md 檔案教導 Copilot 命名慣例、測試框架等。
    • GitHub MCP Server: 讓任何 AI 工具安全地訪問 GitHub 上下文。
  • 提升程式碼品質與安全性:
    • Copilot Autofix: 自動偵測並修補漏洞(今年修復超過百萬個漏洞)。
    • Code review: 在 Pull Request 中總結差異、標記邏輯錯誤並建議修復。
    • Improved model reasoning: 生成更具可讀性、通過測試且錯誤更少的程式碼。
    • CodeQL integration: 與 GitHub Advanced Security、Dependabot 和 GitHub Actions 整合,確保供應鏈安全。
    • Built-in privacy: 提供企業級隔離、審計日誌和租戶級控制。
  • Copilot 旨在幫助開發者更快地提交程式碼,而非追逐待辦事項,並將於 GitHub Universe 2025 揭露更多智慧代理工作流程、多模型整合和下一代安全功能。

TechSummary 2025-10-14

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

💻 GitHub Copilot 與 AI 代理如何拯救傳統系統​

Source: https://github.blog/ai-and-ml/github-copilot/how-github-copilot-and-ai-agents-are-saving-legacy-systems/

  • 挑戰與機遇: 傳統 COBOL 系統(65年歷史,支援銀行、保險等關鍵業務)面臨開發者短缺問題。GitHub Copilot 及自主 AI 代理提供現代化解決方案,無需掌握 COBOL 即可進行系統更新。
  • 微軟 Julia Kordick 的三步驟框架:
    1. 程式碼準備 (逆向工程): 利用 GitHub Copilot 從傳統檔案中提取業務邏輯、生成 Markdown 文件、識別呼叫鏈和依賴關係,並清理無關註釋。
      # Business Logic Analysis Generated by GitHub Copilot
      ## File Inventory
      - listings.cobol: List management functionality (~100 lines)
      - mainframe-example.cobol: Full mainframe program (~10K lines, high complexity)

      ## Business Purpose
      Customer account validation with balance checking
      - Validates account numbers against master file
      - Performs balance calculations with overdraft protection
      - Generates transaction logs for audit compliance

      ## Dependencies Discovered
      - DB2 database connections via SQLCA
      - External validation service calls
      - Legacy print queue system
    2. 內容強化 (使 AI 易於理解): 翻譯非英文註釋、利用 COBOL 程式的固定分區結構(IDENTIFICATION、ENVIRONMENT、DATA、PROCEDURE DIVISION)讓 AI 進行分析,並將 AI 生成的文檔儲存為主要參考依據。
      "Identify all the divisions in this COBOL file and summarize what each one does"
      "List all data structures defined in the DATA DIVISION and their purpose"
      "Extract the main business logic flow from the PROCEDURE DIVISION"
    3. 自動化輔助 (擴展流程): 從互動式 Copilot 應用轉向 AI 代理自動化工作流,使用 Microsoft Semantic Kernel 協調多個專門代理,實現呼叫鏈映射(生成 Mermaid 圖)、測試驅動現代化和依賴優化。
  • 局限性與實際應用: AI 並非萬靈丹,人類專家仍需參與驗證。微軟開源了 Azure Samples 框架 (aka.ms/cobol),包含專門代理、成本追蹤及人工驗證點,幫助開發者快速啟動現代化進程。
    git clone https://github.com/Azure-Samples/Legacy-Modernization-Agents
    cd Legacy-Modernization-Agents
    ./doctor.sh setup
    ./doctor.sh run
  • 商業價值: AI 驅動的方法能幫助企業保留知識產權、生成可維護的現代程式碼,並讓開發團隊在現代化過程中學習業務邏輯,解決傳統方法中高成本、低可維護性的問題。

TechSummary 2025-10-08

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

🚀 隨時隨地透過 GitHub Copilot 程式碼代理和行動裝置完成緊急修復​

Source: https://github.blog/developer-skills/github/completing-urgent-fixes-anywhere-with-github-copilot-coding-agent-and-mobile/

  • 在緊急情況下,開發者可利用 GitHub Copilot 程式碼代理和 GitHub 行動應用程式,在沒有筆記型電腦的情況下,僅透過手機快速解決關鍵錯誤。
  • 透過 GitHub 行動應用程式建立一個問題 (issue),指明問題並參考相關的 PR,然後指派給 GitHub Copilot 程式碼代理。Copilot 會在數分鐘內生成一個修復的 PR,可直接在手機上審查、測試並批准部署。
  • 關鍵要點 1:利用指示文件 (.github/copilot-instructions.md)。這些文件提供 Copilot 關於專案目的、技術棧、架構限制、程式碼標準等背景資訊,顯著提升建議的品質和相關性。
    # Copilot Instructions

    - Use Next.js App Router with React and TypeScript across the project.
    - Use pnpm for all package management commands (not npm or yarn).
    - Use Tailwind CSS v4 with a mobile-first approach; enhance with sm:/md:/lg:/xl: as needed.
    - Prefer server components by default; add "use client" only when needed (event handlers, browser APIs).
  • 關鍵要點 2:熟悉 Copilot 程式碼代理。將 Copilot 視為團隊成員,指派問題、審查其創建的 PR,並追蹤其工作會話,了解其能力。建立問題時,請務必提供清晰、具體且定義明確的上下文指示。
  • 關鍵要點 3:建立最佳實踐和自動化流程。利用 IssueOps 將 GitHub Issues 轉化為自動化的指令介面,並結合 GitHub Actions 觸發工作流程。透過預設的 Issue 模板可以節省時間並確保提供 Copilot 所需的詳細資訊。
    name: "Bug (Copilot Coding Agent-ready)"
    description: "Report a bug with details so Copilot can propose a fix via PR."
    title: "[Bug]: <short summary>"
    labels: ["bug", "triage", "copilot-coding-agent"]
    projects:
    - "my-org/1234"
    assignees: []
    body:
    - type: markdown
    attributes:
    value: |
    Thanks for reporting a bug! This template collects the details Copilot’s coding agent needs to propose a fix.
  • 結合這些 GitHub 功能,能大幅提升開發效率,讓團隊無論身在何處都能應對挑戰。

TechSummary 2025-10-07

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

🤖 GitHub Copilot如何提升無障礙治理流程效率​

Source: https://github.blog/ai-and-ml/github-copilot/how-we-automated-accessibility-compliance-in-five-hours-with-github-copilot/

  • GitHub 推出無障礙治理計畫,但面臨服務擁有者延遲處理無障礙修復工作的挑戰。
  • 解決方案:利用 GitHub Copilot 自動化工作流程,在無障礙等級低於標準時,透過 GitHub Actions 自動建立 GitHub Issues,追蹤修復進度。
  • 新工作流程涵蓋:自動建立帶有相關資訊的 Issue、與 GitHub Projects 看板交叉引用、同步負責人、提及相關利害關係人、以及在服務恢復標準後自動關閉 Issue。
  • Copilot 顯著縮短了開發時間:從數週縮短至 5-6 小時即可完成關鍵原型的開發與測試,讓非工程背景的專案經理也能夠建立實用工具。
  • 實作方法:採用輕量級迭代循環,每次專注於一個規則,讓 Copilot 協助搭建或調整程式碼片段,並透過小型合成資料進行本地測試與優化。
  • 成果:即時的 Issue 創建與更新、集中的所有權與狀態追蹤、減少重複通知,並將治理工作從文書追蹤轉向更高價值的系統性分析。

TechSummary 2025-10-06

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

🧑‍💻 The developer role is evolving. Here’s how to stay ahead.​

Source: https://github.blog/ai-and-ml/the-developer-role-is-evolving-heres-how-to-stay-ahead/

  • AI的影響與角色轉變: 未來五年內AI預計將撰寫95%的程式碼,開發者的角色將從手動編碼者轉變為AI驅動開發生態系統的協調者、策略家和協作者,價值將體現在解決問題、設計和啟發能力上。
  • 技能一:提供更佳的AI情境: AI雖然快速,但需要明確的意圖、數據和任務目的來產生有意義的輸出。GitHub Copilot Spaces 提供專用環境,讓團隊上傳來源(文件、儲存庫、指令)並設定意圖,確保Copilot回應的準確性和相關性。
    • 設定GitHub Space的步驟:
      1. 前往 github.com/copilot/spaces 建立新空間。
      2. 上傳上下文資料(文件、範例檔案、整個儲存庫)。
      3. 開始聊天,讓Copilot根據提供的來源回答問題。
  • 技能二:提供洞察、判斷和策略: AI無法取代人類的洞察力、創造力和協作能力。成功的開發者將結合機器效率與人類判斷力及團隊合作。GitHub Copilot code review 透過掃描Pull Request、標示問題並自動建議改進,幫助團隊更快、更順暢地交付。
    • 試用Copilot Code Review:
      1. 開啟Pull Request並新增Copilot為審閱者。
      2. 審閱Copilot的意見回饋(評論、建議、內聯修改)。
      3. 精煉審閱:重新審閱、點讚/倒讚,或添加 .github/copilot-instructions.md 來自訂規則。
  • 技能三:持續學習: 技術技能的半衰期在AI時代變得更短。持續學習是保持領先的關鍵,這包括掌握新的AI技能集,並透過GitHub展示成果。
    • 在GitHub上提升AI技能的實用路線圖:
      1. 學習基本語言和框架:Python、Java、C++,以及TensorFlow、PyTorch、Scikit-learn。
      2. 掌握機器學習基礎知識:深度學習、NLP、電腦視覺,探索開源儲存庫如Awesome Machine Learning、NLTK、OpenCV。
      3. 在GitHub上展示技能:整理儲存庫、發布README、貢獻開源、建立傑出個人資料。
      4. 獲得GitHub Copilot認證。

TechSummary 2025-09-23

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

🚀 使用 GitHub Copilot 代理模式現代化 Java 專案的逐步指南​

Source: https://github.blog/ai-and-ml/github-copilot/a-step-by-step-guide-to-modernizing-java-projects-with-github-copilot-agent-mode/

  • GitHub Copilot 代理模式將 Copilot 從被動建議工具轉變為主動協作夥伴,能理解高層次指令並執行多步驟任務,無需詳細指示。
  • 搭配 GitHub Copilot 應用現代化 VS Code 擴充功能,此工具組提供互動式、逐步指引,幫助開發者更快、更少錯誤地升級和遷移 Java 專案。
  • 現代化流程包括:分析專案、生成升級計畫、自動應用變更、修復建構問題、驗證測試、檢測並修復 CVEs,並提供完整的摘要報告。
  • 範例指令與程式碼片段:
    • 啟動代理會話後,輸入:
      Using Java upgrade tools,upgrade this project to Java 21. Analyze deprecated APIs, update Gradle dependencies, and propose a safe, testable migration plan.
    • 程式碼升級前後對比:
      // Before (deprecated constructor)
      View view = this.resolver.resolveViewName("intro", new Locale("EN"));

      // After Java 21 upgrade
      View view = this.resolver.resolveViewName("intro", Locale.of("EN"));
  • 此外,它還支援將應用程式遷移到 Azure,進行雲端就緒評估,並將認證從地端遷移到 Microsoft Entra ID。
  • 自動化 CVE 掃描是其關鍵安全功能,可智慧地提出安全版本替換或推薦替代函式庫,以維持安全合規。

TechSummary 2025-09-18

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

🚀 將 GitHub Copilot 編碼代理更深入地整合到您的工作流程的 5 種方法​

Source: https://github.blog/ai-and-ml/github-copilot/5-ways-to-integrate-github-copilot-coding-agent-into-your-workflow/

  • GitHub Copilot 編碼代理不僅限於基礎任務指派與 PR 審核,本教學將探討五種策略,將其更深入地整合到開發工作流程中。
  • 透過代理面板處理技術債務: 將重複但必要的任務(如依賴升級、小型重構)批次交給 Copilot 處理,讓開發者專注於功能開發。
    • 任務範例:
      “Update the extension manifest to support VS Code 1.104”
      “Add TypeScript strict mode and fix all resulting type errors”
  • 使用 Playwright MCP 驗證 UI 變更: Copilot 可透過 Playwright MCP 伺服器整合,自動啟動應用程式、與其互動並截圖,以便在 PR 中直接審核 UI 變更。
    • 任務範例:
      “Add internationalization support for English, French, and Spanish.”
  • 安全地試驗分支策略: Copilot 支援從任意分支作為起點建立 copilot/ 分支進行實驗,並開啟草稿 PR 供審閱與回饋,無需影響主分支。
  • 選擇正確的任務入口點: 針對不同情境選擇最適合的入口點,例如:代理面板適用於瀏覽 GitHub 時的臨時任務;GitHub Issues 適用於團隊追蹤工作;VS Code 適用於即時重構;GitHub Mobile 適用於離線小任務。
  • 使用 MCP 伺服器擴展 Copilot 編碼代理: 除了內建的 Playwright 和 GitHub MCP,還可透過自訂 MCP 伺服器(如 Notion MCP、Hugging Face MCP)提供更多上下文,提升 Copilot 的智慧,並可透過開源 MCP Registry 發現或發佈整合。

TechSummary 2025-09-03

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

🤖 撰寫 Copilot 自訂指令的 5 個技巧​

Source: https://github.blog/ai-and-ml/github-copilot/5-tips-for-writing-better-custom-instructions-for-copilot/

  • Copilot 指令文件 (copilot-instructions.md) 至關重要,它能為 Copilot 提供專案的必要上下文,如同新人入職時的背景知識,有助於避免混淆和錯誤。
  • 專案概覽: 指令文件應以專案的「電梯簡報」開頭,簡潔描述應用程式的目標、受眾和主要功能。
    # Contoso Companions

    This is a website to support pet adoption agencies. Agencies are onboarded into the application, where they can manage their locations, available pets, and publicize events. Potential adoptors can search for pets available in their area, discover agencies, and submit adoption applications.
  • 技術棧識別: 明確列出專案使用的後端、前端技術、API 和測試套件,並可簡要說明其用途,幫助 Copilot 理解開發環境。
    ## Tech stack in use

    ### Backend

    - Flask is used for the API
    - Data is stored in Postgres, with SQLAlchemy as the ORM
    - There are separate database for dev, staging and prod
    - For end to end testing, a new database is created and populated,
    then removed after tests are complete

    ### Frontend

    - Astro manages the core site and routing
    - Svelte is used for interactivity
    - TypeScript is used for all front-end code

    ### Testing

    - Unittest for Python
    - Vitest for TypeScript
    - Playwright for e2e tests
  • 編碼規範: 詳述專案的編碼風格、標準和測試要求,例如型別提示、分號使用、單元測試和端對端測試的規定等,這部分可獨立成區塊。
    ## Project and code guidelines

    - Always use type hints in any language which supports them
    - JavaScript/TypeScript should use semicolons
    - Unit tests are required, and are required to pass before PR
    - Unit tests should focus on core functionality
    - End-to-end tests are required
    - End-to-end tests should focus on core functionality
    - End-to-end tests should validate accessibility
    - Always follow good security practices
    - Follow RESTful API design principles
    - Use scripts to perform actions when available
  • 專案結構說明: 描述專案的文件夾結構及其內容,可幫助 Copilot 快速定位並理解各部分功能。
    ## Project structure

    - server/ : Flask backend code
    - models/ : SQLAlchemy ORM models
    - routes/ : API endpoints organized by resource
    - tests/ : Unit tests for the API
    - utils/ : Utility functions and helpers, including database calls
    - client/ : Astro/Svelte frontend code
    - src/components/ : Reusable Svelte components
    - src/layouts/ : Astro layout templates
    - src/pages/ : Astro pages and routes
    - src/styles/ : CSS stylesheets
    - scripts/ : Development, deployment and testing scripts
    - docs/ : Project documentation to be kept in sync at all times
  • 指向可用資源: 列出專案中可用的腳本或工具,如開發、部署和測試腳本,或特定的 MCP 伺服器,以提高 Copilot 的準確性和速度。
    ## Resources

    - scripts folder
    - start-app.sh : Installs all libraries and starts the app
    - setup-env.sh : Installs all libraries
    - test-project.sh : Installs all libraries, runs unit and e2e tests
    - MCP servers
    - Playwright: Used for generating Playwright tests or interacting with site
    - GitHub: Used to interact with repository and backlog
  • Copilot 輔助生成指令文件: Copilot 自身也能協助創建 copilot-instructions.md 文件,提供標準化的提示範本,幫助開發者釐清專案目標。
    Your task is to "onboard" this repository to a coding agent by adding a .github/copilot-instructions.md file. It should contain information describing how the agent, seeing the repo for the first time, can work most efficiently.
    ...
    ## Guidance

    Ensure you include the following:

    - A summary of what the app does.
    - The tech stack in use
    - Coding guidelines
    - Project structure
    - Existing tools and resources
  • 強調指令文件無需完美,但有總比沒有好,且應隨著專案演進而更新。

TechSummary 2025-08-29

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

🚀 GitHub Copilot AI 模型進化與多模型架構​

Source: https://github.blog/ai-and-ml/github-copilot/under-the-hood-exploring-the-ai-models-powering-github-copilot/

  • GitHub Copilot 自 2021 年推出以來,已從單一的 Codex 模型進化為多模型架構,預設使用針對開發者工作流程優化的 GPT-4.1。
  • 為了應對快速變化的 AI 環境,Copilot 採用多模型架構,讓開發者能根據任務需求選擇不同的 LLM,提供更高的靈活性。
  • 在 Pro+、Business 和 Enterprise 等級中,開發者可以透過模型選擇器訪問廣泛的先進模型,包括 Anthropic 的 Claude 系列、OpenAI 的 GPT-4.1、GPT-5 (預覽) 及 Google 的 Gemini 2.0 Flash、Gemini 2.5 Pro 等。
  • Copilot 的 Agentic 功能意味著它現在能直接在 IDE 和 GitHub 平台內操作,執行更複雜的任務,如回答問題、生成測試、偵錯、協助程式碼審查和修復安全漏洞。
  • 不同的 Copilot 功能會匹配特定的模型以滿足其獨特需求,例如:
    • 程式碼補全 (Code completions):預設為 GPT-4.1,針對速度、準確性和相關性進行優化。
    • Agent 模式 (Agent mode):預設為 GPT-4.1,但可選擇其他先進模型來處理多步驟複雜任務。
    • Copilot Chat:預設為 GPT-4.1,並可選擇 Claude 或 Gemini 等模型進行自然語言查詢。
    • Coding agent (新):將 Copilot 轉變為可委派任務的助手,處理問題分類、生成 Pull Request、修補漏洞等。
    • 程式碼審查 (Code review (新)):由 GPT-4.1 提供支援,並可選擇 Claude 等模型進行深度推理。
  • 最近的升級將 Copilot Chat、程式碼補全和 Pull Request 摘要都整合到 GPT-4.1,帶來約 40% 更快的響應速度和更大的上下文視窗。

TechSummary 2025-08-27

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

🚀 GitHub Copilot 網頁版:為進階使用者打造的強大指南​

Source: https://github.blog/ai-and-ml/github-copilot/how-to-use-github-copilot-on-github-com-a-power-users-guide/

  • 擴展 Copilot 用途:GitHub Copilot 不再僅限於 IDE 中的自動完成和程式碼建議,它在 github.com 上提供了全新的功能,專注於專案管理、團隊協調和快速原型開發。無需安裝擴充功能或進行設定,直接前往 github.com/copilot 即可開始使用。
  • 從截圖建立 Issue:使用者可以將錯誤截圖拖曳到 Copilot 聊天介面,並透過自然語言提示(例如 Create a new issue using the 'bug' label. Use this screenshot and describe the overlapping arrow icon. Apply the UI issue template from this repo.),讓 Copilot 自動生成帶有標籤和範本的 Issue 標題和描述。
  • 專案中心快速操作:在 github.com/copilot,您可以:
    • 跨多個 GitHub 儲存庫與 Copilot 聊天。
    • 建立和管理 Issue 與 Pull Request。
    • 啟動 GitHub Spark 進行程式碼片段或元件原型設計。
    • 指派 Copilot AI 代理執行自主任務。
    • 在對話中切換不同的 AI 模型。
  • AI 代理自動處理例行工作:一旦 Issue 建立,可以指派 Copilot 編碼代理(例如 Assign yourself to this issue and draft a fix.)分析程式碼庫、識別根本原因並提交草稿 Pull Request。適用於例行性錯誤修復、文件更新和依賴升級。
  • 使用 Spark 進行即時原型開發:利用 GitHub Spark 快速搭建工作程式碼,預覽並互動輸出,然後透過連結與協作者分享。
    • 範例提示:Create a feature comparison table for an API pricing page. Show Free, Pro, and Enterprise tiers with checkmarks for features.
  • 選擇最佳 AI 模型:GitHub Copilot 允許使用者切換不同的 AI 模型以適應特定任務:
    • GPT-4.1:通用編碼和推理。
    • Claude Sonnet 4:結構化寫作、重構、上下文密集型任務。
    • Opus 4:創造力、邊緣案例、提供替代觀點。
  • 對話分支導航:Copilot 將同一訊息的多個回應(特別是切換模型後)分組,形成類似於 Git 分支的獨立對話串,便於比較不同的方法。
  • 整合網頁與 IDE 工作流:網頁版 Copilot 處理協調和探索性工作,而 IDE 處理詳細實作。兩者結合可覆蓋完整的開發工作流程。