跳至主要内容

2 篇文章 含有標籤「GPU Acceleration」

檢視所有標籤

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 功能,能大幅提升開發效率,讓團隊無論身在何處都能應對挑戰。