Merged
Conversation
- Issue番号必須ルールを明文化 - feature/fix/hotfixの命名パターン例示 - 禁止パターンと命名ガイドラインを記載 理由: 暗黙的に使われていた規則を明文化し、新規参加者が迷わないようにする。 ブランチ↔Issue↔PRの紐付けを明確にすることで、レビューコストを削減。
Neon-straySheep
added a commit
that referenced
this pull request
Feb 18, 2026
## 概要 ユーザーの外部サービス活動実績とポートフォリオを元に、 LLMを使用してエンジニアランク(0-9)を判定する機能を実装。 概念実証を優先し、まずは動くことを重視。 ## 実装内容 ### 1. プロンプトテンプレート拡張 - `app/core/prompts.py`: RANK_ANALYSIS_TEMPLATEを詳細化 - 評価基準を明確に定義 - 10段階ランクマッピング定義 - JSON出力形式を厳密に指定 ### 2. サービス層実装 - `app/services/rank_service.py`: analyze_user_rank関数 - LLMへのプロンプト送信 - JSONパースとエラーハンドリング - デフォルト値フォールバック ### 3. APIスキーマ定義 - `app/schemas/analyze.py`: RankAnalysisRequest/Response - 入力値のバリデーション(max_length制限) - 出力形式の定義 - Swagger UIのExample付き ### 4. APIエンドポイント実装 - `app/api/endpoints/analyze.py`: POST /api/v1/analyze/rank - リクエスト受け取り - サービス呼び出し - エラーハンドリング ### 5. ルーター登録 - `app/api/api.py`: analyzeルーターを登録 ### 6. テスト実装 - `tests/test_services/test_rank_service.py`: 正常系・エラー系テスト - `tests/test_api/test_analyze.py`: APIエンドポイントテスト - LLM呼び出しをモック化してCI環境対応 ### 7. 設定ファイル - `.env.example`: 環境変数テンプレート更新 - OPENAI_API_KEY、ANTHROPIC_API_KEYの設定例 ## MVP制限(概念実証優先) - ❌ GitHub API統合なし:ユーザー入力の文字列のみで判定 - ❌ DB保存なし:APIレスポンス返却のみ -⚠️ 判定精度は問わない:プロンプト調整は後続Issue ## セキュリティ考慮 - Request Bodyサイズ制限(portfolio_text: 5KB) - LLMレスポンスのサニタイズ(JSONパースエラー時のフォールバック) - エラーメッセージの安全な返却 ## テスト要件 - モック使用でAPI キー不要(CI環境対応) - 正常系・エラー系を網羅 ## 完了条件(DoD) - [x] POST /analyze/rank実装完了 - [x] テスト2件以上全パス(モック使用) - [x] スキーマ定義とバリデーション実装 - [x] エラーハンドリング実装 ## 依存 - Issue #32(AI基盤セットアップ)✅ ## 次のステップ(後続Issue) - Issue #37: GitHub API統合(リポジトリ情報取得) - Issue #38: ランク判定の精度向上(プロンプトエンジニアリング) - Issue #39: DB保存機能(Profileテーブル、User.rank更新)
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
理由:
暗黙的に使われていた規則を明文化し、新規参加者が迷わないようにする。
ブランチ↔Issue↔PRの紐付けを明確にすることで、レビューコストを削減。
実装の概要
技術的な意思決定と「なぜ」
セキュリティに関する自己評価
レビュワー(人間)への申し送り事項