Community程式設計與開發github.com

github/generate-custom-instructions-from-codebase

遷移與程式碼演化指令產生器,專為 GitHub Copilot 設計。分析兩個專案版本(分支、提交或發行版)之間的差異,建立精確指令,讓 Copilot 在技術遷移、重大重構或框架版本升級時保持一致性。

generate-custom-instructions-from-codebase 是什麼?

此技能旨在為 GitHub Copilot 自動生成自訂指令,以確保在專案重大變更(如技術遷移、框架升級或大規模重構)期間,程式碼風格與模式的一致性。它透過分析兩個專案版本(例如不同分支、提交或發行標籤)之間的差異,識別變更模式與慣例,進而輸出結構化的`.github/copilot-instructions.md`檔案。此檔案包含 Copilot 可遵循的明確規則、偏好與範例,從而引導其產生符合新規範的程式碼。支援的平台包括 GitHub Copilot(搭配 GitHub CLI 或 Actions)以及其他相容工具如 Cline/Roo Code。使用方式靈活:可透過 GitHub CLI 直接執行,或作為 GitHub Actions 中的自動化步驟運行。最終產生的指令可協助 AI 代理在長期的遷移過程中保持專案風格一致性。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/github/awesome-copilot/tree/main/skills/generate-custom-instructions-from-codebase

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

generate-custom-instructions-from-codebase 是做什麼的?

遷移與程式碼演化指令產生器,專為 GitHub Copilot 設計。分析兩個專案版本(分支、提交或發行版)之間的差異,建立精確指令,讓 Copilot 在技術遷移、重大重構或框架版本升級時保持一致性。

功能

  • 分析兩個 Git 參考(分支、標籤、提交 SHA)之間的差異
  • 自動產生 .github/copilot-instructions.md 檔案
  • 支援對已存在的指令檔案進行增量更新
  • 可透過 GitHub CLI 在本地執行,或做為 GitHub Actions 中的自動化步驟
  • 使用 git diff 與 LLM(預設使用 Anthropic Claude)分析變更模式

使用方法

使用 GitHub CLI(本地)

# 分析目前分支與 main 分支的差異
github/generate-custom-instructions-from-codebase --base main --head HEAD

# 指定特定的參考版本
github/generate-custom-instructions-from-codebase --base v1.0.0 --head v2.0.0

# 將產生的指令寫入自訂檔案路徑
github/generate-custom-instructions-from-codebase --base main --head feature-branch --output .github/copilot-instructions.md

使用 GitHub Actions

建立一個工作流程檔案 .github/workflows/generate-instructions.yml:

name: 產生 Copilot 指令
on:
  pull_request:
    types: [closed]
    branches:
      - main

jobs:
  generate:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: read
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: 產生遷移指令
        uses: github/generate-custom-instructions-from-codebase@v1
        with:
          base: ${{ github.event.pull_request.base.sha }}
          head: ${{ github.event.pull_request.head.sha }}
      - name: 提交指令
        run: |
          git config user.name "GitHub Actions"
          git config user.email "[email protected]"
          git add .github/copilot-instructions.md
          git commit -m "更新 Copilot 遷移指令"
          git push

輸出

此技能會產生一個 .github/copilot-instructions.md 檔案,包含:

  • 規則:Copilot 應遵循的明確程式碼模式與慣例
  • 偏好:特定 API 使用方式、命名慣例或架構決策
  • 範例:展示變更前與變更後程式碼的程式碼片段
  • 背景脈絡:遷移或重構作業的描述

支援的平台

  • GitHub Copilot(主要目標)
  • GitHub CLI(本地執行)
  • GitHub Actions(自動化 CI/CD)
  • Cline / Roo Code(透過 .clinerules 輸出格式)

環境變數

變數描述必要
GITHUB_TOKEN用於存取儲存庫的 GitHub 令牌是
ANTHROPIC_API_KEY用於 Claude 分析的 API 金鑰使用 Anthropic 時為必要

授權條款

MIT

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

github/acquire-codebase-knowledge

Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.

github/add-educational-comments

Add educational comments to the file specified, or prompt asking for file to comment if one is not provided.

github/agent-governance

Patterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)

github/agentic-eval

Patterns and techniques for evaluating and improving AI agent outputs. Use this skill when: - Implementing self-critique and reflection loops - Building evaluator-optimizer pipelines for quality-critical generation - Creating test-driven code refinement workflows - Designing rubric-based or LLM-as-judge evaluation systems - Adding iterative improvement to agent outputs (code, reports, analysis) - Measuring and improving agent response quality

github/agent-owasp-compliance

Check any AI agent codebase against the OWASP Agentic Security Initiative (ASI) Top 10 risks. Use this skill when: - Evaluating an agent system's security posture before production deployment - Running a compliance check against OWASP ASI 2026 standards - Mapping existing security controls to the 10 agentic risks - Generating a compliance report for security review or audit - Comparing agent framework security features against the standard - Any request like "is my agent OWASP compliant?", "check ASI compliance", or "agentic security audit"

github/ai-prompt-engineering-safety-review

Comprehensive AI prompt engineering safety review and improvement prompt. Analyzes prompts for safety, bias, security vulnerabilities, and effectiveness while providing detailed improvement recommendations with extensive frameworks, testing methodologies, and educational content.

github/appinsights-instrumentation

Instrument a webapp to send useful telemetry data to Azure App Insights

github/apple-appstore-reviewer

Serves as a reviewer of the codebase with instructions on looking for Apple App Store optimizations or rejection reasons.

github/architecture-blueprint-generator

Comprehensive project architecture blueprint generator that analyzes codebases to create detailed architectural documentation. Automatically detects technology stacks and architectural patterns, generates visual diagrams, documents implementation patterns, and provides extensible blueprints for maintaining architectural consistency and guiding new development.

github/arch-linux-triage

Triage and resolve Arch Linux issues with pacman, systemd, and rolling-release best practices.

github/arize-ai-provider-integration

Creates, reads, updates, and deletes Arize AI integrations that store LLM provider credentials used by evaluators and other Arize features. Supports any LLM provider (e.g. OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, Vertex AI, Gemini, NVIDIA NIM). Use when the user mentions AI integration, LLM provider credentials, create integration, list integrations, update credentials, delete integration, or connecting an LLM provider to Arize.

github/arize-annotation

Creates and manages annotation configs (categorical, continuous, freeform label schemas) and annotation queues (human review workflows) on Arize. Applies human annotations to project spans via the Python SDK. Use when the user mentions annotation config, annotation queue, label schema, human feedback, bulk annotate spans, update_annotations, labeling queue, annotate record, or human review.

github/arize-dataset

Creates, manages, and queries Arize datasets and examples. Covers dataset CRUD, appending examples, exporting data, and file-based dataset creation using the ax CLI. Use when the user needs test data, evaluation examples, or mentions create dataset, list datasets, export dataset, append examples, dataset version, golden dataset, or test set.

github/arize-evaluator

Handles LLM-as-judge evaluation workflows on Arize including creating/updating evaluators, running evaluations on spans or experiments, managing tasks, trigger-run operations, column mapping, and continuous monitoring. Use when the user mentions create evaluator, LLM judge, hallucination, faithfulness, correctness, relevance, run eval, score spans, score experiment, trigger-run, column mapping, continuous monitoring, or improve evaluator prompt.

github/arize-experiment

Creates, runs, and analyzes Arize experiments for evaluating and comparing model performance. Covers experiment CRUD, exporting runs, comparing results, and evaluation workflows using the ax CLI. Use when the user mentions create experiment, run experiment, compare models, model performance, evaluate AI, experiment results, benchmark, A/B test models, or measure accuracy.

github/arize-instrumentation

Adds Arize AX tracing to an LLM application for the first time. Follows a two-phase agent-assisted flow to analyze the codebase then implement instrumentation after user confirmation. Use when the user wants to instrument their app, add tracing from scratch, set up LLM observability, integrate OpenTelemetry or openinference, or get started with Arize tracing.

github/arize-link

Generates deep links to the Arize UI for traces, spans, sessions, datasets, labeling queues, evaluators, and annotation configs. Produces clickable URLs for sharing Arize resources with team members. Use when the user wants to link to or open a trace, span, session, dataset, evaluator, or annotation config in the Arize UI.

github/arize-prompt-optimization

Optimizes, improves, and debugs LLM prompts using production trace data, evaluations, and annotations. Extracts prompts from spans, gathers performance signal, and runs a data-driven optimization loop using the ax CLI. Use when the user mentions optimize prompt, improve prompt, make AI respond better, improve output quality, prompt engineering, prompt tuning, or system prompt improvement.

github/arize-trace

Downloads, exports, and inspects existing Arize traces and spans to understand what an LLM app is doing or debug runtime issues. Covers exporting traces by ID, spans by ID, sessions by ID, and root-cause investigation using the ax CLI. Use when the user wants to look at existing trace data, see what their LLM app is doing, export traces, download spans, investigate errors, or analyze behavior regressions.

github/aspire

Aspire skill covering the Aspire CLI, AppHost orchestration, service discovery, integrations, MCP server, VS Code extension, Dev Containers, GitHub Codespaces, templates, dashboard, and deployment. Use when the user asks to create, run, debug, configure, deploy, or troubleshoot an Aspire distributed application.

相關技能