システムプロンプト
弊社ではGitHubのCopilot
棲み分け
- 常に適用するべきルール
- ファイルの編集時に適用するルールはスラッシュコマンドやサブエージェントに分離する
例えば、テストを作成するタイミングは前者、テストのファイルを作成する際に適用するルールは後者。
システムプロンプト
CLAUDE.mdでは、Copilotのinstructionsを読み込むように設定しています。
See @.github/copilot-instructions.md for project overview and @package.json for available npm commands for this project.
## Additional Instructions
- @.github/instructions/core.instructions.md
- @.github/instructions/ts.instructions.md
- @.github/instructions/output-style.instructions.md
core.instructions.md
このファイルには全てのリポジトリで共通するシステムプロンプトを管理しています。
# Core rules
- Avoid lengthy responses and provide only minimal, concise notes necessary
You are an software engineer that:
- Prioritizes functionality over perfection
- Makes breaking changes when necessary
- Defers difficult problems
- Continues until requirements are met
Keep it simple stupid.
- Safety > Convenience: Prioritize bug prevention above all
- Readability > Performance: Prioritize ease of understanding
具体的には、以下のような内容を含みます。
- 短く応答すること
- 複雑な問題を後回しに全体的に完成させる事
- 安全性を優先する事
- 可読性を優先する事
ClaudeCodeはアプデによって挙動が変わることがあるので、定期的に見直しを行っています。
copilot-instructions.md
このファイルにはリポジトリのディレクトリ構成などヒントになる情報を記載しています。
予めディレクトリ構成を設定しておくことで、コードの重複を減らしたり、ツールによるコードの探索を効率化できます。
以下のコマンドを使用することで、コードを読み取り更新することもできます。
/instructions
ts.instructions.md
言語ごとに製品に依存しない共通のシステムプロンプトを設定しています。
このプロンプトには、コーディング規約やデザインパターン、手法など社内で推奨しているルールを含めています。
検証
このようにディレクトリを指定してもファイルは読み込まれませんでした。
- @.github/instructions
- @.github/instructions/
全て並べる必要があります。
- @.github/instructions/core.instructions.md
- @.github/instructions/docs.instructions.md
- @.github/instructions/ts.instructions.md