From aidlc
AI-DLC Construction Phase Stage 5: サブタスク単位でTDD実装を行う。コミットルールとスクリプト生成ファイルの分離を厳守する。
How this skill is triggered — by the user, by Claude, or both
Slash command
/aidlc:implementationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
サブタスク (=PR単位) の実装を行う。TDDベースで進め、意味のある単位でコミットする。
サブタスク (=PR単位) の実装を行う。TDDベースで進め、意味のある単位でコミットする。
Announce at start: 「サブタスク #N の実装を開始します: [サブタスク名]」
REQUIRED SUB-SKILL: aidlc:pr-strategy — コミット・PRルールに従うこと
git checkout -b feature/<feature-name>/<subtask-name>
命名規則: feature/<機能名>/<サブタスク名>
各機能単位で以下のサイクルを回す:
詳細なTDDガイダンスが必要な場合:
ecc:tdd-workflowスキルを参照。 テストパターン(Unit/Integration/E2E)、カバレッジ目標(80%+)、 モックパターン、アンチパターン等の具体例が含まれます。
data-testid やロールベースのセレクタを使用意味のある変更ごとにコミットする:
git add <specific-files>
git commit -m "feat: add order status validation
Co-Authored-By: Claude <[email protected]>"
# 1. スクリプトを実行
bin/rails generate migration AddStatusToOrders status:integer
# 2. 生成ファイルのみをコミット
git add db/migrate/YYYYMMDD_add_status_to_orders.rb
git commit -m "[scripts] rails generate migration AddStatusToOrders status:integer
Generated by: bin/rails generate migration AddStatusToOrders status:integer
Co-Authored-By: Claude <[email protected]>"
# 3. 手動で編集した内容は別コミット
git add db/migrate/YYYYMMDD_add_status_to_orders.rb
git commit -m "feat: add status column with default value and index
Co-Authored-By: Claude <[email protected]>"
実装中に変更行数を定期的に確認:
git diff --stat HEAD~N # またはブランチ分岐元との比較
±150行を超えそうな場合:
サブタスクの実装が完了したら:
「サブタスク #N の実装が完了しました。
- 変更ファイル数: X
- 追加/削除行数: +Y/-Z
- テスト結果: ALL PASS
PR作成に進みます。」
REQUIRED NEXT SKILL: aidlc:pr-creation
テストが失敗した場合:
サイズ超過の場合:
依存タスクの未完了:
npx claudepluginhub tatematsu-k/ai-development-skills --plugin aidlcTest-first implementation workflow with TDD guardrails. Runs in normal mode (plan + task) or quick mode (direct instruction). Generates tests, implements, refactors, checks coverage and quality.
Executes TDD DEV stage: verifies failing tests exist, reads tests and design, implements minimal code one test at a time until all pass, verifies build, commits.
Executes implementation from a PRD or set of issues using TDD at agreed seams, with typechecking, test file execution, and final review.