summaryrefslogtreecommitdiff
path: root/.github/instructions
diff options
context:
space:
mode:
Diffstat (limited to '.github/instructions')
-rw-r--r--.github/instructions/documentation.instructions.md15
-rw-r--r--.github/instructions/python.instructions.md17
-rw-r--r--.github/instructions/tests.instructions.md17
3 files changed, 49 insertions, 0 deletions
diff --git a/.github/instructions/documentation.instructions.md b/.github/instructions/documentation.instructions.md
new file mode 100644
index 0000000..9203f57
--- /dev/null
+++ b/.github/instructions/documentation.instructions.md
@@ -0,0 +1,15 @@
+---
+applyTo: "doc/**/*.md,README.md,config.example.toml"
+---
+
+# Documentation and configuration instructions
+
+- 文書と実装を一致させる。要件は`doc/Specifications.md`、責務と処理方式は`doc/Design.md`、
+ TOML仕様は`doc/config.md`、MCP公開契約は`doc/mcp.md`へ記載する。
+- 設定キー、既定値、enum、CLI、Tool schemaを変更した場合は、すべての表とコード例を検索して同期する。
+- `config.example.toml`はコピーして編集できる有効な例に保つ。ただし実モデル名、秘密情報、利用者固有の
+ 絶対パスを追加しない。
+- MCPに公開しない設定を`doc/mcp.md`のTool入力へ追加しない。
+- 推奨値とシステムが自動適用する値を混同しない。特にLCMのstep数とCFGは推奨例に留める。
+- 日本語で簡潔かつ具体的に書き、コード上の識別子、コマンド、設定値はバッククォートで囲む。
+- 実行確認していない機能を動作済みと記載しない。
diff --git a/.github/instructions/python.instructions.md b/.github/instructions/python.instructions.md
new file mode 100644
index 0000000..d34bcc7
--- /dev/null
+++ b/.github/instructions/python.instructions.md
@@ -0,0 +1,17 @@
+---
+applyTo: "src/**/*.py,script/**/*.py"
+---
+
+# Python implementation instructions
+
+- Python 3.11の型構文を使用し、公開境界と複雑な内部処理には具体的な型を付ける。
+- 既存方針どおり`dataclass`、`tomllib`、明示的validationを優先し、目的のないフレームワークや
+ 依存パッケージを追加しない。
+- MCP層、Service層、モデル管理、Diffusers pipeline構築の責務境界を維持する。
+- Tool関数は薄いadapterに保ち、モデルロードやscheduler分岐を置かない。
+- ファイルパスは設定済みの用途別ディレクトリ内へ安全に解決し、MCP入力から任意パスを受け取らない。
+- CUDA OOMと既知の利用者エラーを分類し、内部例外やパスをクライアントへそのまま返さない。
+- GPU推論を同期的に並列実行しない。既存の単一ジョブ制御を保つ。
+- DiffusersやPyTorchのAPI対応を変更する場合は、利用中バージョンまたは公式文書でconstructorと
+ config継承の挙動を確認する。
+- 実装変更には同じ変更で再発を防ぐテストを追加する。
diff --git a/.github/instructions/tests.instructions.md b/.github/instructions/tests.instructions.md
new file mode 100644
index 0000000..64985c3
--- /dev/null
+++ b/.github/instructions/tests.instructions.md
@@ -0,0 +1,17 @@
+---
+applyTo: "tests/**/*.py"
+---
+
+# Test instructions
+
+- テストフレームワークはpytestとpytest-asyncioを使用する。
+- GPU不要の自動テストを標準とし、Diffusers、モデル、CUDAは小さなfakeまたはmonkeypatchで分離する。
+- 設定変更では、有効値、既定値、省略、旧値、未知値、境界値を必要に応じて表形式のparameterized testで
+ 検証する。
+- MCP変更ではTool数、名前、required/optional、enum、公開してはいけないプロパティ、返却contentを
+ 検証する。
+- pipeline構築変更では選択される実装クラス、`from_config`へ渡す元config、追加optionを検証する。
+- Service変更では全routing、単一ジョブ直列化、既知エラー分類、内部エラーのsanitizeを検証する。
+- 一時ファイルにはpytestの`tmp_path`を使用し、`data/`へfixtureや生成物を追加しない。
+- 時刻、ネットワーク、実モデルの有無に依存する不安定なテストを通常のテストスイートへ入れない。
+- バグ修正では、修正前に失敗し修正後に成功する回帰テストを追加する。