このディレクトリは、AI支援開発を SDD (Specification-Driven Development) と TDD (Test-Driven Development) で運用するためのテンプレート群です。
対象スタックは Next.js + React + TypeScript + Supabase で、Next.js/Supabase 関連作業は MCP 経由を前提にします。
- agents/: 実行主体の役割定義(誰が何を担当するか)
- instructions/: 全体ルール・禁止事項・品質基準(守るべき規約)
- prompts/: タスク入力テンプレート(毎回の依頼フォーマット)
- skills/: 再利用可能な手順パッケージ(標準作業手順)
役割分担の原則:
- agents は「実行責務」を定義
- instructions は「逸脱不可ルール」を定義
- prompts は「入力/出力契約」を定義
- skills は「手順の再利用」を定義
.github/
agents/
discovery-facilitator.agent.md
requirements-analyst.agent.md
specification-writer.agent.md
research-analyst.agent.md
feature-planner.agent.md
test-designer.agent.md
feature-implementer.agent.md
quality-reviewer.agent.md
release-orchestrator.agent.md
instructions/
discovery.requirements.instructions.md
project.guardrails.instructions.md
sdd.workflow.instructions.md
tdd.quality-gates.instructions.md
prompts/
discovery-wall-batting.prompt.md
requirements-definition.prompt.md
specification-from-requirements.prompt.md
research-from-codebase.prompt.md
plan-from-research.prompt.md
implement-from-approved-plan.prompt.md
review-against-criteria.prompt.md
skills/
discovery-to-research-handoff/
SKILL.md
feature-delivery/
SKILL.md
mcp-preflight/
SKILL.md
test-evidence-mapping/
SKILL.md
- discovery-facilitator.agent.md
壁打ちで課題・価値仮説・制約・未確定事項を構造化します。 - requirements-analyst.agent.md
discovery成果を要求仕様/要件定義(ACC付き)へ落とし込みます。 - specification-writer.agent.md
要件から実装可能な仕様を作成し、Researchへ引き継ぎます。 - research-analyst.agent.md
調査専任。research.mdを作成し、仮説と検証タスクを定義します(実装は禁止)。 - feature-planner.agent.md
調査結果からplan.md/todo.mdを生成します(実装は禁止)。 - test-designer.agent.md
plan.md/todo.mdから TDD 用テスト設計(test-plan.md)を作ります。 - feature-implementer.agent.md
承認済み plan/todo を実装。TDD順序、MCP制約、型安全、hotfix例外ルールを適用します。 - quality-reviewer.agent.md
受け入れ観点で品質判定(ゲート合否、重大度別指摘、対応アクション)。 - release-orchestrator.agent.md
CI結果と証跡に基づき Go/No-Go 判定、監視/ロールバック観点を整理します。
- discovery.requirements.instructions.md
壁打ち→要件定義→仕様化→Research引き継ぎまでの運用ルール。 - project.guardrails.instructions.md
全体ガードレール(SDD/TDD順序、MCP必須、セキュリティ、品質ゲート、hotfix例外)。 - sdd.workflow.instructions.md
仕様駆動フロー(research/plan/todo の品質要件と完了条件)。 - tdd.quality-gates.instructions.md
TDD契約、証跡契約、CI閾値、失敗時ポリシー。
- discovery-wall-batting.prompt.md
壁打ちで論点を引き出しdiscovery.mdを作るテンプレ。 - requirements-definition.prompt.md
discovery.mdからrequirements.mdを作るテンプレ。 - specification-from-requirements.prompt.md
requirements.mdからspec.mdを作り Research へ接続するテンプレ。 - research-from-codebase.prompt.md
深い調査を指示してresearch.mdを作るテンプレ。 - plan-from-research.prompt.md
承認済み調査からplan.md/todo.mdを作るテンプレ。 - implement-from-approved-plan.prompt.md
承認済み計画を実装し、証跡まで返すテンプレ。 - review-against-criteria.prompt.md
受け入れ基準と品質ゲートに対するレビュー用テンプレ。
- discovery-to-research-handoff/SKILL.md
壁打ち〜仕様化を進め、Researchへ引き継ぐ標準手順。 - feature-delivery/SKILL.md
Research→Plan→Implement を TDD付きで進める標準手順。 - mcp-preflight/SKILL.md
MCP接続/権限/運用モードの事前診断手順。 - test-evidence-mapping/SKILL.md
受け入れ基準とテスト証跡のトレーサビリティ作成手順。
ここでは「アパレルブランドECサイトの新機能: 春コレクション特集ページ + お気に入り保存」を例に、どの順番で何を使うかを示します。
- 壁打ち(Discovery)
- 使用:
discovery-facilitator.agent.md+discovery-wall-batting.prompt.md - 目的: 誰の何を改善するかを明確化(例: 回遊率・お気に入り登録率の改善)
- 出力:
docs/sdd/discovery.md
- 要求仕様・要件定義
- 使用:
requirements-analyst.agent.md+requirements-definition.prompt.md - 目的: 機能要件/非機能要件/ACCを確定
- 出力:
docs/sdd/requirements.md
- 仕様化(Research前の契約化)
- 使用:
specification-writer.agent.md+specification-from-requirements.prompt.md - 目的: ユースケース、認可、エラーパス、MCP制約を仕様として固定
- 出力:
docs/sdd/spec.md
- Research連携
- 使用:
discovery-to-research-handoffskill +research-analyst.agent.md+research-from-codebase.prompt.md - 目的: 仕様で定義した調査対象をコードベース調査へ接続
- 出力:
docs/sdd/research.md
- Plan作成
- 使用:
feature-planner.agent.md+plan-from-research.prompt.md - 目的: 実装計画とタスク分解を確定
- 出力:
docs/sdd/plan.md,docs/sdd/todo.md
- Test設計(TDD前提)
- 使用:
test-designer.agent.md - 目的: ACCとTSを対応づけ、失敗系を先に定義
- 出力:
docs/sdd/test-plan.md(必要に応じて追加運用)
- Implement / Review / Release判定
- 使用:
feature-implementer.agent.md→quality-reviewer.agent.md→release-orchestrator.agent.md - 目的: Red→Green→Refactorで実装し、品質ゲートでGo/No-Goを判断
sequenceDiagram
autonumber
participant U as Product/Dev
participant DF as discovery-facilitator
participant RAQ as requirements-analyst
participant SW as specification-writer
participant RH as discovery-to-research-handoff
participant RS as research-analyst
participant FP as feature-planner
participant TD as test-designer
participant FI as feature-implementer
participant QR as quality-reviewer
participant RO as release-orchestrator
participant CI as CI/Quality Gates
U->>DF: 春コレ特集 + お気に入り機能の課題を共有
DF-->>U: discovery.md(課題/価値仮説/制約/未確定)
U->>RAQ: discovery.mdを入力
RAQ-->>U: requirements.md(FR/NFR/ACC)
U->>SW: requirements.mdを入力
SW-->>U: spec.md(ユースケース/認可/エラーパス)
U->>RH: specからResearch引き継ぎ整理
RH-->>RS: 調査対象と仮説を連携
RS-->>U: research.md(コード実態/リスク/検証)
U->>FP: research承認後に計画依頼
FP-->>U: plan.md + todo.md
U->>TD: ACCを入力してテスト設計
TD-->>U: test-plan + TS対応
U->>FI: 承認済みplan/todoで実装依頼
FI->>CI: Red->Green->Refactor + 継続検証
CI-->>FI: lint/type/unit/integration/security結果
FI-->>U: 実装差分 + 証跡 + todo更新
U->>QR: 受け入れレビュー依頼
QR-->>U: 合否判定 + 是正事項
U->>RO: リリース候補を判定依頼
RO-->>U: Go/No-Go + 監視/ロールバック観点
- Next.js / Supabase 関連作業は MCP 経由で実行する
docs/sdd/配下の6ドキュメントを1機能ごとに更新する- ACC採番規則(例:
ACC-001)を先に決める
- lint
- typecheck
- unit tests
- integration tests
- security checks
- 事故レベル対応時のみ
- Tech Lead on-call + Security on-call の二者承認
- 緊急ミニプラン作成後に実装
- 24時間以内に不足証跡を追補
ACC-*→TS-*→ CI結果 の対応表を維持- 証跡不足の場合は No-Go
- discovery / requirements / spec / research / plan / todo の各ファイルでチェックボックス管理
- 完了条件は各ファイル内の Status Checklist を基準とする
- 失敗: 季節キャンペーン要件を固める前に実装開始
回避: discovery と requirements のチェックボックス完了まで実装禁止 - 失敗: 商品公開条件とRLSを後回しにして手戻り
回避: spec段階で認可ルールを先に固定し、Researchで実装実態を検証 - 失敗: ACCとテスト証跡が分離してレビュー差し戻し
回避: test-evidence-mapping で ACC/TS/CI の紐づけを先に作成
discovery-wall-batting.prompt.mdでdocs/sdd/discovery.mdを作成requirements-definition.prompt.mdでdocs/sdd/requirements.mdを作成specification-from-requirements.prompt.mdでdocs/sdd/spec.mdを作成research-from-codebase.prompt.mdでdocs/sdd/research.mdを作成plan-from-research.prompt.mdでdocs/sdd/plan.md/docs/sdd/todo.mdを作成feature-implementerとquality-reviewerで実装・判定
この順序を守ることで、壁打ちから実装までの判断が一貫し、手戻りを抑制できます。
- 新作特集ページの閲覧導線を強化し、回遊率を上げる
- ログインユーザーがお気に入り登録し、後で購入検討できる
ACC-001: 特集ページに対象商品だけが表示されるACC-002: ログインユーザーはお気に入り登録/解除できるACC-003: 未ログイン時はお気に入り操作が拒否されるACC-004: 在庫切れ商品の表示ルールが仕様通り適用される
docs/sdd/discovery.mdにキャンペーン背景、KPI仮説、制約を記載docs/sdd/requirements.mdに FR/NFR と ACC を確定docs/sdd/spec.mdに商品表示条件、認可、エラーパスを記載docs/sdd/research.mdで既存商品取得APIとRLSを調査docs/sdd/plan.md/docs/sdd/todo.mdで実装順序を固定
docs/sdd/discovery.mddocs/sdd/requirements.mddocs/sdd/spec.mddocs/sdd/research.mddocs/sdd/plan.mddocs/sdd/todo.md
1機能につき、上から順に更新します。
discovery-wall-batting.prompt.md+discovery-facilitator.agent.mdで discovery を確定requirements-definition.prompt.md+requirements-analyst.agent.mdで requirements を確定specification-from-requirements.prompt.md+specification-writer.agent.mdで spec を確定discovery-to-research-handoffskill で調査引き継ぎを生成research-from-codebase.prompt.md+research-analyst.agent.mdで research 開始
各段階は、各ドキュメントの Status Checklist(チェックボックス)完了を進行条件とします。