テストケースに基づいて実装を行うスキル。test-first-developmentスキルで作成されたテストケースをパスする実装を行う。実装完了後はテスト実行のためtest-first-developmentスキルを呼び出し、テストパス後はcode-reviewerスキルを呼び出す。使用タイミング:(1) test-first-developmentからの実装依頼、(2)...
テストケースに基づいて実装を行うスキル。
以下のファイル/情報を確認:
output_interface_design.yaml: インターフェース設計src/
├── domain/ # ドメインロジック
│ ├── models/ # エンティティ、値オブジェクト
│ └── services/ # ドメインサービス
├── application/ # アプリケーション層
│ ├── usecases/ # ユースケース
│ └── dto/ # データ転送オブジェクト
├── infrastructure/ # インフラ層
│ ├── repositories/# リポジトリ実装
│ └── external/ # 外部サービス連携
└── interfaces/ # インターフェース層
├── api/ # API エンドポイント
└── cli/ # CLIコマンド
| 対象 | 規則 | 例 |
|---|---|---|
| クラス | PascalCase | UserService |
| メソッド | camelCase/snake_case | getUser/get_user |
| 定数 | UPPER_SNAKE_CASE | MAX_RETRY_COUNT |
| 変数 | camelCase/snake_case | userName/user_name |
可読性 > パフォーマンス(早期最適化を避ける)
| 種類 | 対応 |
|---|---|
| バリデーションエラー | 400系エラー、詳細メッセージ |
| ビジネスルール違反 | カスタム例外、ログ記録 |
| システムエラー | 500系エラー、アラート |
| 外部サービスエラー | リトライ、フォールバック |
BaseException
├── ValidationException
├── BusinessException
│ ├── NotFoundExeption
│ └── ConflictException
└── InfrastructureException
├── DatabaseException
└── ExternalServiceException
実装完了後、test-first-development スキルを呼び出し:
# test-first-development スキルへの引き継ぎ情報
implementation_result:
status: "completed"
implemented_components:
- interface: "UserService"
file: "src/domain/services/user_service.py"
methods:
- name: "create_user"
status: "implemented"
- name: "get_user"
status: "implemented"
changes:
- file: "src/domain/services/user_service.py"
type: "created"
- file: "src/domain/models/user.py"
type: "created"
request: "テスト実行と結果確認"
code-reviewer スキル呼び出しtest-first-development スキル呼び出しテストパス後、以下の改善を検討:
| パターン | 適用場面 |
|---|---|
| Extract Method | 長いメソッド |
| Extract Class | 大きすぎるクラス |
| Rename | 不明確な命名 |
| Replace Magic Number | ハードコードされた値 |
| Introduce Parameter Object | 多すぎるパラメータ |
| スキル | 呼び出しタイミング |
|---|---|
| test-first-development | 実装完了後、テスト実行依頼 |
| code-reviewer | 全テストパス後、レビュー依頼 |