Add C# development instruction in Japanese (#228)

* Add C# instruction in Japanese

* change title

* update README
This commit is contained in:
Yuta Matsumura 2025-09-09 08:54:21 +09:00 committed by GitHub
parent 643419852e
commit cb7d93724e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 115 additions and 0 deletions

View File

@ -30,6 +30,7 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for
| [Conventional Commit](instructions/conventional-commit.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconventional-commit.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconventional-commit.prompt.md) | Prompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation. | | [Conventional Commit](instructions/conventional-commit.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconventional-commit.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconventional-commit.prompt.md) | Prompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation. |
| [Convert Spring JPA project to Spring Data Cosmos](instructions/convert-jpa-to-spring-data-cosmos.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconvert-jpa-to-spring-data-cosmos.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconvert-jpa-to-spring-data-cosmos.instructions.md) | Step-by-step guide for converting Spring Boot JPA applications to use Azure Cosmos DB with Spring Data Cosmos | | [Convert Spring JPA project to Spring Data Cosmos](instructions/convert-jpa-to-spring-data-cosmos.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconvert-jpa-to-spring-data-cosmos.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fconvert-jpa-to-spring-data-cosmos.instructions.md) | Step-by-step guide for converting Spring Boot JPA applications to use Azure Cosmos DB with Spring Data Cosmos |
| [Copilot Process tracking Instructions](instructions/copilot-thought-logging.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcopilot-thought-logging.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcopilot-thought-logging.instructions.md) | See process Copilot is following where you can edit this to reshape the interaction or save when follow up may be needed | | [Copilot Process tracking Instructions](instructions/copilot-thought-logging.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcopilot-thought-logging.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcopilot-thought-logging.instructions.md) | See process Copilot is following where you can edit this to reshape the interaction or save when follow up may be needed |
| [C# アプリケーション開発](instructions/csharp-ja.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp-ja.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp-ja.instructions.md) | C# アプリケーション構築指針 by @tsubakimoto |
| [C# 코드 작성 규칙](instructions/csharp-ko.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp-ko.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp-ko.instructions.md) | C# 애플리케이션 개발을 위한 코드 작성 규칙 by @jgkim999 | | [C# 코드 작성 규칙](instructions/csharp-ko.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp-ko.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp-ko.instructions.md) | C# 애플리케이션 개발을 위한 코드 작성 규칙 by @jgkim999 |
| [C# Development](instructions/csharp.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp.instructions.md) | Guidelines for building C# applications | | [C# Development](instructions/csharp.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcsharp.instructions.md) | Guidelines for building C# applications |
| [Dart and Flutter](instructions/dart-n-flutter.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fdart-n-flutter.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fdart-n-flutter.instructions.md) | Instructions for writing Dart and Flutter code following the official recommendations. | | [Dart and Flutter](instructions/dart-n-flutter.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fdart-n-flutter.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fdart-n-flutter.instructions.md) | Instructions for writing Dart and Flutter code following the official recommendations. |

View File

@ -0,0 +1,114 @@
---
description: 'C# アプリケーション構築指針 by @tsubakimoto'
applyTo: '**/*.cs'
---
# C# アプリケーション開発
## C# の指針
- 常に最新の C# を使用します。現在は C# 13 の機能です。
- 各関数に対して明確で簡潔なコメントを書きます。
## 全般ガイドライン
- コード変更のレビューでは、確信度の高い提案のみを行います。
- なぜその設計判断をしたのかという理由を含むコメントなど、保守性の高い実践に沿ってコードを書きます。
- エッジケースに対応し、明確な例外処理を書きます。
- ライブラリや外部依存については、用途と目的をコメントで明記します。
## 命名規則
- コンポーネント名、メソッド名、公開メンバーには PascalCase を使用します。
- プライベートフィールドとローカル変数には camelCase を使用します。
- インターフェイス名は "I" を接頭辞にします(例: IUserService
## フォーマット
- `.editorconfig` で定義されたコードフォーマットスタイルを適用します。
- ファイルスコープの namespace 宣言と 1 行の using ディレクティブを推奨します。
- 任意のコード ブロックif、for、while、foreach、using、try など)の開始波括弧の前に改行を入れます。
- メソッドの最終 return 文は独立した行に配置します。
- 可能な限りパターンマッチングと switch 式を使用します。
- メンバー名参照には文字列リテラルではなく `nameof` を使用します。
- すべての公開 API に XML ドキュメントコメントを作成します。可能であれば `<example>``<code>` も含めます。
## プロジェクトのセットアップと構成
- 適切なテンプレートで新規 .NET プロジェクトを作成する手順を案内します。
- 生成される各ファイルとフォルダーの目的を説明し、プロジェクト構造の理解を助けます。
- フィーチャーフォルダーやドメイン駆動設計DDDによる整理方法を示します。
- モデル、サービス、データ アクセス層による責務分離を示します。
- ASP.NET Core 9 における Program.cs と構成システム、そして環境別設定を説明します。
## Nullable 参照型
- 変数は非 null で宣言し、エントリポイントで `null` を検査します。
- `== null``!= null` ではなく、常に `is null` または `is not null` を使用します。
- C# の null 注釈を信頼し、型システムが値の非 null を保証している場合は不要な null チェックを追加しません。
## データ アクセス パターン
- Entity Framework Core を用いたデータアクセス層の実装を案内します。
- 開発および本番における選択肢SQL Server、SQLite、In-Memoryを説明します。
- リポジトリパターンの実装と、それが有効となる場面を示します。
- データベースマイグレーションとデータシーディングの実装方法を示します。
- 一般的なパフォーマンス問題を避ける効率的なクエリパターンを説明します。
## 認証と認可
- JWT ベアラートークンを用いた認証の実装を案内します。
- ASP.NET Core に関連する OAuth 2.0 および OpenID Connect の概念を説明します。
- ロールベースおよびポリシーベースの認可の実装方法を示します。
- Microsoft Entra ID旧 Azure ADとの統合を示します。
- コントローラーベース API と Minimal API の双方を一貫して保護する方法を説明します。
## 検証とエラー処理
- データ注釈と FluentValidation を用いたモデル検証の実装を案内します。
- 検証パイプラインと、検証応答のカスタマイズ方法を説明します。
- ミドルウェアを用いたグローバル例外処理戦略を示します。
- API 全体で一貫したエラー応答を作成する方法を示します。
- 標準化されたエラー応答のための Problem DetailsRFC 7807の実装を説明します。
## API のバージョニングとドキュメント
- API バージョニング戦略の実装とその解説を案内します。
- 適切なドキュメントを伴う Swagger / OpenAPI の実装を示します。
- エンドポイント、パラメーター、応答、認証の文書化方法を示します。
- コントローラーベース API と Minimal API の双方でのバージョニングを説明します。
- 利用者に役立つ有意義な API ドキュメントの作成を案内します。
## ロギングと監視
- Serilog などを用いた構造化ロギングの実装を案内します。
- ログレベルと、それぞれを使用すべき場面を説明します。
- テレメトリ収集のための Application Insights との統合を示します。
- リクエスト追跡のためのカスタムテレメトリと相関 ID の実装方法を示します。
- API のパフォーマンス、エラー、利用パターンの監視方法を説明します。
## テスト
- アプリケーションの重要な経路には必ずテストケースを含めます。
- 単体テストの作成を案内します。
- "Act"、"Arrange"、"Assert" のコメントは記述しません。
- 近傍ファイルの既存スタイル(テストメソッド名や大文字/小文字)に合わせます。
- API エンドポイントの統合テスト手法を説明します。
- 効率的なテストのために依存関係をモックする方法を示します。
- 認証および認可ロジックのテスト方法を示します。
- API 開発に適用するテスト駆動開発TDDの原則を説明します。
## パフォーマンス最適化
- キャッシュ戦略(インメモリ、分散、レスポンスキャッシュ)の実装を案内します。
- 非同期プログラミングパターンと、それが API のパフォーマンスにおいて重要である理由を説明します。
- 大規模データセット向けのページング、フィルタリング、ソートを示します。
- 圧縮などのパフォーマンス最適化の実装方法を示します。
- API パフォーマンスの測定とベンチマーク方法を説明します。
## デプロイと DevOps
- .NET の組み込みコンテナーサポート(`dotnet publish --os linux --arch x64 -p:PublishProfile=DefaultContainer`)を用いた API のコンテナー化を案内します。
- 手動で Dockerfile を作成する方法と、.NET のコンテナー公開機能の違いを説明します。
- .NET アプリケーション向け CI/CD パイプラインを説明します。
- Azure App Service、Azure Container Apps、その他のホスティングオプションへのデプロイを示します。
- ヘルスチェックと Readiness Probe の実装方法を示します。
- 各デプロイ段階における環境固有の構成を説明します。