Home›GitHub Copilot›GitHub Copilot app 入門:Copilot にコードベースを理解させる方法

GitHub Copilot app 入門:Copilot にコードベースを理解させる方法GitHub Copilot app for Beginners: How to teach Copilot about your codebase

元記事を読むRead original articlegithub.blog(新しいタブで開きます)(opens in a new tab)
AI 要約AI summary

GitHub Copilot app 入門シリーズの最新回で、カスタム指示など4つの手法を紹介し、リポジトリ内に規約やスクリプトを置いて Copilot に自動で把握させる方法を解説する。毎回同じ説明を繰り返したくない開発者に役立つ。

This GitHub Copilot app beginner installment covers four ways, including custom instructions, to store conventions and scripts in a repo so Copilot learns them automatically, saving developers repeated explanations.

AI 生成の要約と解説(解説は要約と収集メタデータに基づく)で、元記事全文の転載・翻訳ではありません。日本語版と英語版は言語ごとに独立して生成しています。正確性は元記事 (github.blog) でご確認ください。AI-generated summary and explainer (the latter based on the summaries and collected metadata), not a copy or translation of the full source article. Generated independently for each language. Verify accuracy at the original source (github.blog).

GitHub Copilot app 入門シリーズの最新回は、Copilot にプロジェクト固有のルールを把握させる方法を扱っている。AI との作業では文脈が重要であり、規約やスクリプトをリポジトリ内に置いておけば、毎回同じ説明を繰り返さずに済むと説明されている。

コードベースごとの流儀

どのコードベースにも、その場所ならではのハウスルールがある。コンポーネントをどう構成するか、どのスクリプトを実行するか、フレームワークやファイルの種類ごとにどの規約が適用されるか、といったことだ。Copilot はプロジェクト全体にわたる変更を手伝えるが、こうしたルールを知っているときのほうがよく機能するとされる。

その知識の多くはリポジトリの中に置いておける。そうすれば Copilot が自動的に拾い上げるため、新しいタスクを始めるたびに同じ標準、スクリプト、ワークフローを人が説明し直す必要がなくなる。

4つの調整方法

今回の記事では、Copilot がプロジェクトに合わせて動く仕組みを整える方法として、4つの手法が紹介されている。そのうち、カスタム指示、エージェントスキル、カスタムエージェントの3つについて、役割の違いが次のように示されている。

指示・スキル・エージェント

カスタム指示は、Copilot が従うべき規約を伝えるためのものである。いわば、そのプロジェクトで守ってほしいルールを書き添えておく手段にあたる。

エージェントスキルは、繰り返し行う手順をひとまとめにするためのものとされる。毎回同じ流れで進めたい作業を、再利用できる形で用意しておく発想だ。

カスタムエージェントは、より大きなタスクに対して専門的なガイダンスをもたらす。規約を伝える、手順をまとめる、専門的な助言を加えるという形で、それぞれ異なる角度から Copilot の振る舞いを方向づけるものと整理できる。

Context matters with AI

This installment of the GitHub Copilot app for Beginners series looks at how to help Copilot understand a codebase. The source frames the problem simply: every project has its own house rules, and Copilot works best when it knows them.

According to the source, those rules include how components are structured, which scripts to run, and which conventions apply to different frameworks and file types. Copilot can help make changes across a project, but it is more effective when it has this knowledge in hand.

Rules that live in the repository

The central idea is that much of this knowledge can be stored inside the repository itself. Copilot can then pick it up automatically, rather than a developer having to explain the same standards, scripts, and workflows each time a new task begins. For anyone who finds themselves repeating the same background to Copilot, this is the practical benefit the article highlights.

Four ways to tailor Copilot

The article says it will cover four ways to tailor how Copilot works with a project. The source text describes three of them:

Custom instructions communicate the conventions Copilot should follow. In other words, they are the place to state a project's expected practices.

Agent skills package repeatable procedures. They suit work that follows the same steps more than once.

Custom agents bring specialized guidance to larger tasks. They are positioned for bigger pieces of work where focused direction helps.

The fourth method is not named in the material available here, so this explainer does not describe it.

What to take from it

The summary of the installment is that conventions and scripts can be kept in the repo so Copilot learns them without repeated prompting. The article is aimed at beginners using the GitHub Copilot app and is part of an ongoing series. Beyond the descriptions above, the source does not provide setup steps, file names, or examples, so the specifics of how each method is configured are left to the full installment.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPoko毎回同じ説明をしなくていいって書いてあったね。Copilotはどうやってルールを知るの?It says we don't have to repeat the same explanations every time. How does Copilot learn the rules?
  2. TECHガイドTECH Guide規約やスクリプトをリポジトリの中に置いておくと、Copilotが自動で拾ってくれる、という考え方だよ。The idea is to keep conventions and scripts inside the repository, so Copilot can pick them up automatically.
  3. ポコPokoチームの決まりごとを置いておけば、新しい作業のたびに説明し直さなくていいってこと? 手順も置けるのかな?So if we store our team's rules there, we skip re-explaining on each new task? Can procedures go in too?
  4. TECHガイドTECH Guideカスタム指示は守ってほしい規約を伝える役で、エージェントスキルは繰り返す手順をまとめる役だよ。Custom instructions communicate the conventions to follow, and agent skills package repeatable procedures.
  5. ポコPokoつまりプロジェクトの「家のルール」を先に置いておくと、Copilotが合わせやすくなるんだね。So we put our project's house rules in place first, and Copilot can work with them more easily.
  6. TECHガイドTECH Guideそうだね。ただ記事は「知識の多く」を置けると言っていて、全部とは言っていないよ。大きな作業にはカスタムエージェントも挙がってるね。Right. But the article says "much of" that knowledge can live in the repo, not all of it. Custom agents are mentioned for larger tasks.
記事情報・収集記録Article details & collection record
出典Source
GitHub Copilot Blog公式Official
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
ブログBlog
原文言語Source language
英語English
重要度の位置づけImportance in this lane
MediumMedium priority(GitHub Copilot 225件中、同等以上 189件)(189 of 225 GitHub Copilot entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
1.9 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
長期 (アーキテクチャ)Long-term (architecture)

🧠GitHub Copilot の他の記事More from GitHub Copilotもっと見る →View more →

ページ上部へScroll to top