create-ai-project 1.22.1 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.claude/agents-en/code-reviewer.md +9 -53
  2. package/.claude/agents-en/code-verifier.md +3 -22
  3. package/.claude/agents-en/document-reviewer.md +14 -69
  4. package/.claude/agents-en/integration-test-reviewer.md +6 -0
  5. package/.claude/agents-en/quality-fixer-frontend.md +47 -31
  6. package/.claude/agents-en/quality-fixer.md +40 -25
  7. package/.claude/agents-en/task-decomposer.md +31 -0
  8. package/.claude/agents-en/task-executor-frontend.md +64 -15
  9. package/.claude/agents-en/task-executor.md +59 -19
  10. package/.claude/agents-en/technical-designer-frontend.md +32 -9
  11. package/.claude/agents-en/technical-designer.md +0 -9
  12. package/.claude/agents-en/ui-analyzer.md +313 -0
  13. package/.claude/agents-en/ui-spec-designer.md +3 -1
  14. package/.claude/agents-en/work-planner.md +26 -1
  15. package/.claude/agents-ja/code-reviewer.md +9 -53
  16. package/.claude/agents-ja/code-verifier.md +3 -22
  17. package/.claude/agents-ja/document-reviewer.md +14 -69
  18. package/.claude/agents-ja/integration-test-reviewer.md +6 -0
  19. package/.claude/agents-ja/quality-fixer-frontend.md +47 -31
  20. package/.claude/agents-ja/quality-fixer.md +40 -25
  21. package/.claude/agents-ja/task-decomposer.md +31 -0
  22. package/.claude/agents-ja/task-executor-frontend.md +66 -17
  23. package/.claude/agents-ja/task-executor.md +60 -20
  24. package/.claude/agents-ja/technical-designer-frontend.md +32 -9
  25. package/.claude/agents-ja/technical-designer.md +0 -9
  26. package/.claude/agents-ja/ui-analyzer.md +313 -0
  27. package/.claude/agents-ja/ui-spec-designer.md +3 -1
  28. package/.claude/agents-ja/work-planner.md +26 -1
  29. package/.claude/commands-en/build.md +9 -7
  30. package/.claude/commands-en/design.md +70 -44
  31. package/.claude/commands-en/front-build.md +9 -7
  32. package/.claude/commands-en/front-design.md +87 -58
  33. package/.claude/commands-ja/build.md +9 -7
  34. package/.claude/commands-ja/design.md +69 -43
  35. package/.claude/commands-ja/front-build.md +9 -7
  36. package/.claude/commands-ja/front-design.md +95 -64
  37. package/.claude/skills-en/documentation-criteria/references/design-template.md +1 -1
  38. package/.claude/skills-en/documentation-criteria/references/plan-template.md +16 -4
  39. package/.claude/skills-en/documentation-criteria/references/task-template.md +11 -1
  40. package/.claude/skills-en/subagents-orchestration-guide/SKILL.md +4 -2
  41. package/.claude/skills-ja/documentation-criteria/references/design-template.md +1 -1
  42. package/.claude/skills-ja/documentation-criteria/references/plan-template.md +16 -4
  43. package/.claude/skills-ja/documentation-criteria/references/task-template.md +11 -1
  44. package/.claude/skills-ja/subagents-orchestration-guide/SKILL.md +4 -2
  45. package/CHANGELOG.md +29 -0
  46. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Execute from requirement analysis to frontend design document creation
2
+ description: Execute from codebase analysis to frontend design document creation
3
3
  ---
4
4
 
5
5
  **Command Context**: This command is dedicated to the frontend design phase.
@@ -9,35 +9,42 @@ description: Execute from requirement analysis to frontend design document creat
9
9
  **Core Identity**: "I am an orchestrator." (see subagents-orchestration-guide skill)
10
10
 
11
11
  **Execution Protocol**:
12
- 1. **Delegate all work** to sub-agents — your role is to invoke sub-agents, pass data between them, and report results
13
- 2. **Follow the frontend design flow below** (this command covers medium/large frontend; UI Spec is created before codebase analysis so that component structure informs the technical design):
14
- - Execute: requirement-analyzer → ui-spec-designercodebase-analyzer → technical-designer-frontend → code-verifier → document-reviewer → design-sync
12
+ 1. **Delegate all work** to sub-agents — your role is to invoke sub-agents, pass data between them, and report results. The one exception is the Step 1 scope bootstrap, a recipe-local orchestrator task limited to locating seed files.
13
+ 2. **Run the frontend design flow below in order** (this command covers medium/large frontend) a fixed linear sequence, no branches:
14
+ - Execute: scope bootstrap → codebase-analyzer → [Stop: Scope confirmation] → ui-analyzerui-spec-designer → technical-designer-frontend → code-verifier → document-reviewer → design-sync
15
+ - technical-designer-frontend creates a prerequisite ADR when the design involves an architecture decision (per documentation-criteria); the ADR never replaces the Design Doc — the flow always continues through Design Doc creation and the full verification chain
15
16
  - **Stop at every `[Stop: ...]` marker** → Wait for user approval before proceeding
16
17
  3. **Scope**: Complete when design documents receive approval
17
18
 
18
- **CRITICAL**: Execute document-reviewer, design-sync, and all stopping points defined in subagents-orchestration-guide skill flows each serves as a quality gate. Skipping any step risks undetected inconsistencies.
19
+ **subagents-orchestration-guide usage**: Reference the guide for orchestration principles and the Scale Determination table. This command defines its own start order; the guide's requirement-analyzer-origin flow does not apply here.
20
+
21
+ **CRITICAL**: Execute document-reviewer, design-sync (for Design Docs), and all stopping points — each serves as a quality gate. Skipping any step risks undetected inconsistencies.
19
22
 
20
23
  ## Workflow Overview
21
24
 
22
25
  ```
23
- Requirements → requirement-analyzer → [Stop: Scale determination]
24
-
25
- ui-spec-designer → [Stop: UI Spec approval]
26
-
27
- codebase-analyzertechnical-designer-frontend
28
-
29
- code-verifier → document-reviewer
30
-
31
- design-sync[Stop: Design approval]
26
+ Requirements → scope bootstrap → codebase-analyzer → [Stop: Scope confirmation]
27
+
28
+ ui-analyzer
29
+
30
+ ui-spec-designer[Stop: UI Spec approval]
31
+
32
+ technical-designer-frontend
33
+
34
+ code-verifierdocument-reviewer
35
+
36
+ design-sync → [Stop: Design approval]
32
37
  ```
33
38
 
34
39
  ## Scope Boundaries
35
40
 
36
41
  **Included in this command**:
37
- - Requirement analysis with requirement-analyzer
38
- - Codebase analysis with codebase-analyzer (before technical design)
42
+ - Scope bootstrap: locating seed files so codebase-analyzer receives a populated input
43
+ - Codebase analysis with codebase-analyzer (entry point of the frontend design phase)
44
+ - Scope confirmation with the user, grounded in codebase-analyzer findings
45
+ - UI fact gathering with ui-analyzer
39
46
  - UI Specification creation with ui-spec-designer (prototype code inquiry included)
40
- - ADR creation (if architecture changes, new technology, or data flow changes)
47
+ - ADR creation as a prerequisite to the Design Doc, when architecture changes, new technology, or data flow changes are involved
41
48
  - Design Doc creation with technical-designer-frontend
42
49
  - Design Doc verification with code-verifier (before document review)
43
50
  - Document review with document-reviewer
@@ -45,26 +52,53 @@ Requirements → requirement-analyzer → [Stop: Scale determination]
45
52
 
46
53
  **Responsibility Boundary**: This command completes with frontend design document (UI Spec/ADR/Design Doc) approval. Work planning and beyond are outside scope.
47
54
 
55
+ ## Execution Flow
56
+
48
57
  Requirements: $ARGUMENTS
49
58
 
50
- ## Execution Flow
59
+ ### Step 1: Scope Bootstrap
60
+ codebase-analyzer requires a populated `requirement_analysis.affectedFiles`. Build that seed with a lightweight, orchestrator-local pass — locating files only, with no deep reading and no design decisions:
61
+
62
+ 1. Extract candidate keywords from the user requirements (feature names, domain nouns, identifiers).
63
+ 2. Search the repository with Bash (`rg`, or `grep` when `rg` is unavailable) for files matching those keywords.
64
+ 3. Collect the matched file paths as the seed `affectedFiles`.
65
+ 4. **When the search returns no files**: ask the user which files or modules the design targets (AskUserQuestion), and use that answer as `affectedFiles`. If the user confirms no related code exists, report that codebase-grounded design does not apply and confirm with the user how to proceed.
66
+ 5. **When the search returns more than ~20 files**: the keywords are too broad. Present the most relevant candidates to the user (AskUserQuestion) and confirm the seed `affectedFiles` before proceeding.
67
+
68
+ This step locates seed files only. Reading files in full, tracing dependencies, and analysis remain codebase-analyzer's responsibility.
69
+
70
+ ### Step 2: Codebase Analysis
71
+ - Invoke **codebase-analyzer** using Agent tool
72
+ - `subagent_type: "codebase-analyzer"`, `description: "Codebase analysis"`
73
+ - `prompt`: include `requirements` (the user requirements verbatim) and `requirement_analysis` — a JSON object with `affectedFiles` (Step 1 seed), `purpose` (the user requirements), `scale` (provisional value from the Scale Determination table applied to the seed file count), `technicalConsiderations` (`{ constraints: [], risks: [], dependencies: [] }`). Analyze the existing codebase for frontend design guidance.
74
+
75
+ ### Step 3: Scope Confirmation
76
+ After codebase-analyzer returns, confirm the design scope with the user before any design work. Use AskUserQuestion.
77
+
78
+ Present, sourced from the codebase-analyzer JSON:
79
+ - **Target files/modules**: `analysisScope.filesAnalyzed` and the modules they belong to
80
+ - **Affected layers**: layers touched, derived from `analysisScope.categoriesDetected` and `focusAreas`
81
+ - **Unknowns/assumptions**: `limitations` plus any assumptions codebase-analyzer recorded
82
+ - **Questions before design**: open points that need a user answer before design proceeds
83
+
84
+ Ask the user to choose one:
85
+ - **Proceed to design with this scope** — continue to Step 4
86
+ - **Correct the scope and re-run** — return to Step 1 with the corrected scope; when the user names the corrected files or modules, use those directly as the Step 1 seed
87
+ - **Hold additional hearing, then proceed** — gather the missing answers, then continue to Step 4
51
88
 
52
- ### Step 1: Requirement Analysis Phase
53
- Considering the deep impact on design, first engage in dialogue to understand the background and purpose of requirements:
54
- - What problems do you want to solve?
55
- - Expected outcomes and success criteria
56
- - Relationship with existing systems
89
+ After the user confirms the scope, count the confirmed target files and set the scale from the Scale Determination table. This confirmed scale supersedes the Step 2 provisional value.
57
90
 
58
- Once the user has answered the three dialogue questions above, execute the process below within design scope. Follow subagents-orchestration-guide Call Examples for codebase-analyzer and code-verifier invocations.
91
+ **[STOP]**: Wait for the user's choice before proceeding.
59
92
 
60
- - Invoke **requirement-analyzer** using Agent tool
61
- - `subagent_type: "requirement-analyzer"`
62
- - `description: "Requirement analysis"`
63
- - `prompt: "Requirements: [user requirements] Execute requirement analysis and scale determination"`
64
- - **[STOP]**: Review requirement analysis results and address question items
93
+ ### Step 4: UI Fact Gathering
94
+ - Invoke **ui-analyzer** using Agent tool
95
+ - `subagent_type: "ui-analyzer"`, `description: "UI fact gathering"`
96
+ - `prompt`: include `requirements` (the user requirements) and `requirement_analysis` — a JSON object with `affectedFiles` (the union of `analysisScope.filesAnalyzed`, `analysisScope.tracedDependencies`, and the `focusAreas[].relatedFiles` paths from the Step 2 codebase-analyzer output), `purpose` (the user requirements), `scale` (the Step 3 confirmed scale), `technicalConsiderations` (`{ constraints: [], risks: [], dependencies: [] }`). ui-analyzer reads the project-context External Resources section, fetches external UI sources via the declared access methods, and analyzes the existing UI codebase.
65
97
 
66
- ### Step 2: UI Specification Phase
67
- After requirement analysis approval, ask the user about prototype code:
98
+ The codebase-analyzer JSON (Step 2) and the ui-analyzer JSON (Step 4) are reused by ui-spec-designer and technical-designer-frontend.
99
+
100
+ ### Step 5: UI Specification Phase
101
+ Ask the user about prototype code.
68
102
 
69
103
  **Ask the user**: "Do you have prototype code for this feature? If so, please provide the path to the code. The prototype will be placed in `docs/ui-spec/assets/` as reference material for the UI Spec."
70
104
 
@@ -72,44 +106,39 @@ After requirement analysis approval, ask the user about prototype code:
72
106
 
73
107
  Then create the UI Specification:
74
108
  - Invoke **ui-spec-designer** using Agent tool
75
- - `subagent_type: "ui-spec-designer"`
76
- - `description: "UI Spec creation"`
77
- - If PRD exists and prototype provided: `prompt: "Create UI Spec from PRD at [path]. Prototype code is at [user-provided path]. Place prototype in docs/ui-spec/assets/{feature-name}/"`
78
- - If PRD exists and no prototype: `prompt: "Create UI Spec from PRD at [path]. No prototype code available."`
79
- - If no PRD (medium scale): `prompt: "Create UI Spec based on the following requirements: [pass requirement-analyzer output]. No PRD available."` (add prototype path if provided)
109
+ - `subagent_type: "ui-spec-designer"`, `description: "UI Spec creation"`
110
+ - Build the prompt by including: the source (an existing PRD in `docs/prd/` when one exists for this feature; otherwise the user requirements with the Step 2 codebase-analyzer JSON and the Step 3 confirmed scope), `ui_analysis` (ui-analyzer JSON from Step 4), and the prototype path when provided. Place prototype in `docs/ui-spec/assets/{feature-name}/`.
80
111
  - Invoke **document-reviewer** to verify UI Spec
81
112
  - `subagent_type: "document-reviewer"`, `description: "UI Spec review"`, `prompt: "doc_type: UISpec target: [ui-spec path] Review for consistency and completeness"`
82
113
  - **[STOP]**: Present UI Spec for user approval
83
114
 
84
- ### Step 3: Design Document Creation Phase
85
- First, analyze the existing codebase:
86
- - Invoke **codebase-analyzer** using Agent tool
87
- - `subagent_type: "codebase-analyzer"`, `description: "Codebase analysis"`, `prompt: "requirement_analysis: [JSON from Step 1]. requirements: [user requirements]. Analyze existing codebase for frontend design guidance."`
88
-
89
- Create appropriate design documents according to scale determination. technical-designer-frontend presents at least two architecture alternatives (technology selection, data flow design) with trade-offs for each:
90
- - Invoke **technical-designer-frontend** using Agent tool
91
- - For ADR: `subagent_type: "technical-designer-frontend"`, `description: "ADR creation"`, `prompt: "Create ADR for [technical decision]. Present at least two alternatives with trade-offs."`
92
- - For Design Doc: `subagent_type: "technical-designer-frontend"`, `description: "Design Doc creation"`, `prompt: "Create Design Doc based on requirements. Codebase analysis: [JSON from codebase-analyzer]. UI Spec is at [ui-spec path]. Inherit component structure and state design from UI Spec. Present at least two architecture alternatives with trade-offs."`
93
- - **(Design Doc only)** Invoke **code-verifier** to verify Design Doc against existing code. Skip for ADR.
115
+ ### Step 6: Design Document Creation Phase
116
+ - Invoke **technical-designer-frontend** using Agent tool to create the design documentation. Per documentation-criteria it produces a Design Doc; when the design involves an architecture decision (architecture change, new technology, or data flow change) it first creates the prerequisite ADR.
117
+ - `subagent_type: "technical-designer-frontend"`, `description: "Design documentation creation"`, `prompt: "Create the design documentation for this requirement. Per documentation-criteria, produce a Design Doc; when the design involves an architecture decision, first create the prerequisite ADR. Requirements: [user requirements verbatim]. Codebase analysis: [codebase-analyzer JSON from Step 2]. UI analysis: [ui-analyzer JSON from Step 4]. UI Spec is at [ui-spec path]. Inherit component structure and state design from UI Spec. Present at least two architecture alternatives with trade-offs."`
118
+ - Invoke **code-verifier** to verify the Design Doc against existing code.
94
119
  - `subagent_type: "code-verifier"`, `description: "Design Doc verification"`, `prompt: "doc_type: design-doc document_path: [Design Doc path] mode: pre-implementation (code_paths omitted — verifier discovers scope from document). Verify Design Doc against existing code."`
95
- - Invoke **document-reviewer** to verify consistency (pass code-verifier results for Design Doc; omit for ADR)
96
- - `subagent_type: "document-reviewer"`, `description: "Document review"`, `prompt: "doc_type: DesignDoc target: [document path] mode: composite code_verification: [JSON from code-verifier] (Design Doc only). Review for consistency and completeness."`
120
+ - Invoke **document-reviewer** for each document technical-designer-frontend produced the Design Doc, and the ADR when one was created.
121
+ - Design Doc: `subagent_type: "document-reviewer"`, `description: "Document review"`, `prompt: "doc_type: DesignDoc target: [Design Doc path] mode: composite codebase_analysis: [codebase-analyzer JSON from Step 2] code_verification: [JSON from code-verifier]. Review for consistency and completeness."`
122
+ - ADR (when created): `subagent_type: "document-reviewer"`, `description: "ADR review"`, `prompt: "doc_type: ADR target: [ADR path] mode: composite. Review for consistency and completeness."`
123
+ - When the ADR review requires changes, technical-designer-frontend(update) revises the ADR and re-aligns the Design Doc with the corrected ADR — the Design Doc must not stand on an unreviewed or superseded ADR. When this re-alignment changes the Design Doc, re-run code-verifier and the Design Doc document-reviewer on the updated Design Doc so its verification reflects the final content.
97
124
 
98
- ### Step 4: Design Consistency Verification
99
- - Invoke **design-sync** using Agent tool
125
+ ### Step 7: Design Consistency Verification
126
+ - Invoke **design-sync** using Agent tool.
100
127
  - `subagent_type: "design-sync"`, `description: "Design consistency check"`, `prompt: "Check consistency across all Design Docs in docs/design/. Report conflicts and overlaps."`
101
- - **[STOP]**: Present design documents and design-sync results, obtain user approval
128
+ - **[STOP]**: Present the design document, plus design-sync results for a Design Doc, and obtain user approval
102
129
 
103
130
  ## Completion Criteria
104
131
 
105
- - [ ] Executed requirement-analyzer and determined scale
106
- - [ ] Executed codebase-analyzer and passed results to technical-designer-frontend
107
- - [ ] Created UI Specification with ui-spec-designer (when applicable)
108
- - [ ] Created appropriate design document (ADR or Design Doc) with technical-designer-frontend
109
- - [ ] Executed code-verifier on Design Doc and passed results to document-reviewer (skip for ADR-only)
110
- - [ ] Executed document-reviewer and addressed feedback
132
+ - [ ] Built the Step 1 scope bootstrap seed (or obtained target files from the user when the search returned none)
133
+ - [ ] Executed codebase-analyzer with a populated `requirement_analysis`
134
+ - [ ] Confirmed the design scope with the user and set the scale from the confirmed target files
135
+ - [ ] Executed ui-analyzer; codebase-analyzer (Step 2) and ui-analyzer (Step 4) outputs reused by ui-spec-designer and technical-designer-frontend
136
+ - [ ] Created the UI Specification with ui-spec-designer
137
+ - [ ] Created the Design Doc with technical-designer-frontend, preceded by a prerequisite ADR when the design involved an architecture decision
138
+ - [ ] Executed code-verifier on the Design Doc and passed results to document-reviewer
139
+ - [ ] Executed document-reviewer on each produced document (Design Doc, and ADR when created) and addressed feedback
111
140
  - [ ] Executed design-sync for consistency verification
112
- - [ ] Obtained user approval for design document
141
+ - [ ] Obtained user approval for the design document
113
142
 
114
143
  ## Output Example
115
144
  Frontend design phase completed.
@@ -179,13 +179,15 @@ Escalate when the required fix or investigation falls outside that scope.
179
179
 
180
180
  タスクファイルを削除できない場合(ファイルシステムエラー)、失敗を報告するが完了レポートをブロックしない。
181
181
 
182
- ## 出力例
183
- 実装フェーズが完了しました。
184
- - タスク分解: docs/plans/tasks/ 配下に生成
185
- - 実装されたタスク: [タスク数]件
186
- - 品質チェック: すべて通過
187
- - コミット: [コミット数]件作成
188
- - クリーンアップ: docs/plans/tasks/ からタスクファイルを削除済み
182
+ ## 完了レポートコントラクト
183
+
184
+ 最終レポートには以下を含めること:
185
+ - タスク分解のステータス
186
+ - 実装したタスク数
187
+ - 品質チェック結果
188
+ - コミット数
189
+ - クリーンアップ結果
190
+ - エスカレーションまたはブロッキングの要約(あれば)
189
191
 
190
192
  **責務境界**:
191
193
  - スコープ内: タスク分解から実装完了まで
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: 要件分析から設計書作成まで実行
2
+ description: コードベース分析から設計書作成まで実行
3
3
  ---
4
4
 
5
5
  **コマンドコンテキスト**: このコマンドは設計フェーズ専用です。
@@ -9,46 +9,36 @@ description: 要件分析から設計書作成まで実行
9
9
  **コアアイデンティティ**: 「私は作業者ではない。オーケストレーターである。」(subagents-orchestration-guideスキル参照)
10
10
 
11
11
  **実行プロトコル**:
12
- 1. **全作業をAgentツールでサブエージェントに委譲** — サブエージェントの呼び出し、データの受け渡し、結果の報告(許可ツール: subagents-orchestration-guideスキル「オーケストレーターの許可ツール」参照)
13
- 2. **subagents-orchestration-guideスキルの設計フローに厳密に従う**:
14
- - 実行: requirement-analyzer → codebase-analyzer → technical-designer → code-verifier → document-reviewer → design-sync
15
- - **ADRのみの場合**: codebase-analyzerとcode-verifierはスキップ(Design Docにのみ適用)
12
+ 1. **全作業をAgentツールでサブエージェントに委譲** — サブエージェントの呼び出し、データの受け渡し、結果の報告(許可ツール: subagents-orchestration-guideスキル「オーケストレーターの許可ツール」参照)。唯一の例外はStep 1のスコープブートストラップで、シードファイルの特定に限定したレシピ内オーケストレータータスク。
13
+ 2. **以下の設計フローを順に実行** — 分岐のない固定の線形シーケンス:
14
+ - 実行: スコープブートストラップ → codebase-analyzer → [停止: スコープ確認] → technical-designer → code-verifier → document-reviewer → design-sync
15
+ - technical-designerは、設計にアーキテクチャ決定が伴う場合(documentation-criteriaに従う)に前提となるADRを作成する。ADRはDesign Docを置き換えない — フローは常にDesign Doc作成と検証チェーン全体を通過する
16
16
  - **`[停止: ...]`マーカーで必ず停止** → 次に進む前にユーザー承認を待つ
17
17
  3. **スコープ**: 設計書が承認されたら完了
18
18
 
19
- **重要**: document-reviewer、design-sync、subagents-orchestration-guideスキルで定義された停止ポイントは必ず実行する。
19
+ **subagents-orchestration-guideの利用**: オーケストレーション原則(Delegation Boundary、Decision precedence、許可ツール)とScale Determination表を参照する。このコマンドは独自の開始順序を定義する — ガイドのrequirement-analyzer起点フローはここでは適用しない。
20
+
21
+ **重要**: document-reviewer、design-sync(Design Docの場合)、停止ポイントは決してスキップしない — 各々が品質ゲートとして機能する。
20
22
 
21
23
  ## ワークフロー概要
22
24
 
23
25
  ```
24
- 要件 → requirement-analyzer → [停止: 規模判定]
25
-
26
- codebase-analyzer → technical-designer
27
-
28
- code-verifier → document-reviewer
29
-
30
- design-sync → [停止: 設計承認]
26
+ 要件 → スコープブートストラップ → codebase-analyzer → [停止: スコープ確認]
27
+
28
+ technical-designer
29
+
30
+ code-verifier → document-reviewer
31
+
32
+ design-sync → [停止: 設計承認]
31
33
  ```
32
34
 
33
- 要件: $ARGUMENTS
34
-
35
- 設計への影響を深く考慮し、まず要件の背景と目的を理解するため対話を行い:
36
- - どのような問題を解決したいか
37
- - 期待される成果と成功基準
38
- - 既存システムとの関係性
39
-
40
- 適度に要件が明確になったら、requirement-analyzerで分析し、規模に応じた適切な設計書を作成します。
41
-
42
- 設計の代替案とトレードオフを明確に提示します。
43
-
44
- subagents-orchestration-guideのCall Examplesに従い、codebase-analyzerとcode-verifierを呼び出す。
45
-
46
35
  ## スコープ境界
47
36
 
48
37
  **実行内容**:
49
- - requirement-analyzerによる要件分析
50
- - codebase-analyzerによるコードベース分析(技術設計の前に実施)
51
- - ADR作成(アーキテクチャ変更、新技術、データフロー変更がある場合)
38
+ - スコープブートストラップ: codebase-analyzerが値の入った入力を得られるようシードファイルを特定する
39
+ - codebase-analyzerによるコードベース分析(設計フェーズの入口)
40
+ - codebase-analyzerの所見に基づくユーザーとのスコープ確認
41
+ - ADR作成(アーキテクチャ変更、新技術、データフロー変更が伴う場合、Design Docの前提として)
52
42
  - technical-designerによるDesign Doc作成
53
43
  - code-verifierによるDesign Doc検証(ドキュメントレビューの前に実施)
54
44
  - document-reviewerによるドキュメントレビュー
@@ -58,25 +48,61 @@ subagents-orchestration-guideのCall Examplesに従い、codebase-analyzerとcod
58
48
 
59
49
  ## 実行フロー
60
50
 
61
- 1. requirement-analyzer → 要件分析
62
- 2. codebase-analyzer → コードベース分析(要件分析結果を入力)
63
- 3. technical-designer Design Doc作成(codebase-analyzer出力を入力)
64
- 4. code-verifier → Design Docを既存コードに対して検証
65
- 5. document-reviewer → 単一ドキュメント品質チェック(code-verifier結果を入力)
66
- 6. ユーザー承認(承認を待つ)
67
- 7. design-sync → Design Doc間整合性検証
51
+ 要件: $ARGUMENTS
52
+
53
+ ### Step 1: スコープブートストラップ
54
+ codebase-analyzerは値の入った`requirement_analysis.affectedFiles`を必要とする。そのシードを、軽量なオーケストレーター内タスクで構築する ファイルの特定のみで、深い読み込みや設計判断は行わない:
55
+
56
+ 1. ユーザー要件から候補キーワード(機能名、ドメイン名詞、識別子)を抽出する。
57
+ 2. Bash(`rg`、`rg`が使えない場合は`grep`)で、それらのキーワードに一致するファイルをリポジトリ内で検索する。
58
+ 3. 一致したファイルパスをシード`affectedFiles`として収集する。
59
+ 4. **検索結果が0件の場合**: 設計対象のファイルまたはモジュールをユーザーに確認し(AskUserQuestion)、その回答を`affectedFiles`とする。関連コードが存在しないとユーザーが確認した場合は、コードベース起点の設計が適用できない旨を報告し、進め方をユーザーと確認する。
60
+ 5. **検索結果が約20件を超える場合**: キーワードが広すぎる。最も関連性の高い候補をユーザーに提示し(AskUserQuestion)、シード`affectedFiles`を確認してから進む。
61
+
62
+ このステップはシードファイルの特定のみを行う。ファイルの全文読み込み、依存関係の追跡、分析はcodebase-analyzerの責務である。
63
+
64
+ ### Step 2: コードベース分析
65
+ - Agentツールで**codebase-analyzer**を呼び出す
66
+ - `subagent_type: "codebase-analyzer"`, `description: "コードベース分析"`
67
+ - `prompt`: `requirements`(ユーザー要件の原文)と`requirement_analysis`(`affectedFiles`(Step 1のシード)、`purpose`(ユーザー要件)、`scale`(シードファイル数にScale Determination表を当てた暫定値)、`technicalConsiderations`(`{ constraints: [], risks: [], dependencies: [] }`)を含むJSONオブジェクト)を含める
68
+
69
+ ### Step 3: スコープ確認
70
+ codebase-analyzerが返ったら、設計作業の前にユーザーとスコープを確認する。AskUserQuestionを使う。
71
+
72
+ codebase-analyzerのJSONを出典として以下を提示する:
73
+ - **対象ファイル/モジュール**: `analysisScope.filesAnalyzed`と、それらが属するモジュール
74
+ - **影響を受けるレイヤー**: `analysisScope.categoriesDetected`と`focusAreas`から導出される、影響を受けるレイヤー
75
+ - **不明点/前提**: `limitations`と、codebase-analyzerが記録した前提
76
+ - **設計前の質問事項**: 設計を進める前にユーザーの回答が必要な未解決点
77
+
78
+ ユーザーに以下から1つを選んでもらう:
79
+ - **このスコープで設計を進める** — Step 4へ進む
80
+ - **スコープを修正して再実行** — 修正したスコープでStep 1に戻る。ユーザーが修正後のファイルまたはモジュールを指定した場合は、検索で導出し直さず、それをStep 1のシードとして直接使う
81
+ - **追加ヒアリングののち進める** — 不足している回答を集めてからStep 4へ進む
82
+
83
+ ユーザーがスコープを確認したら、確認済みの対象ファイル数を数え、Scale Determination表から規模を設定する。この確認済みの規模はStep 2の暫定値に優先する。
84
+
85
+ **[停止]**: ユーザーの選択を待ってから進む。
86
+
87
+ ### Step 4: 設計書作成
88
+ 1. **technical-designer** → 設計書を作成する。ユーザー要件(原文)、codebase-analyzerのJSON、確認済みスコープを渡す。documentation-criteriaに従い、これはDesign Docであり、設計にアーキテクチャ決定が伴う場合は前提となるADRを先に作成する。少なくとも2つの設計選択肢をトレードオフとともに提示する。
89
+ 2. **code-verifier** → Design Docを既存コードに対して検証する。
90
+ 3. **document-reviewer** → technical-designerが作成した各ドキュメントの品質チェック。Design Docの場合: `doc_type: DesignDoc`、`codebase_analysis`(codebase-analyzerのJSON)とcode-verifier結果を渡す。ADR(作成された場合)の場合: `doc_type: ADR`、`codebase_analysis`を渡す。code-verifier結果はDesign Docにのみ適用する。ADRレビューで修正が必要になった場合、technical-designer(update)がADRを修正し、**かつ**修正後のADRに合わせてDesign Docを再整合させる — Design Docは未レビューまたは古いADRの上に立ってはならない。この再整合でDesign Docが変わった場合は、更新後のDesign Docに対してcode-verifierとDesign Docのdocument-reviewerを再実行し、検証が最終内容を反映するようにする。
91
+ 4. **design-sync** → Design Doc間整合性検証。
68
92
  - 矛盾あり → ユーザーに報告 → 修正指示待ち → technical-designer(update)で修正
69
- - 矛盾なし → 終了
93
+ - 矛盾なし → 次へ進む
94
+ 5. ユーザー承認 — Design Doc を design-sync の結果とともに提示し、承認を待つ。
70
95
 
71
96
  ## 完了条件
72
97
 
73
- - [ ] requirement-analyzerを実行し規模を判定した
74
- - [ ] codebase-analyzerを実行し結果をtechnical-designerに渡した
75
- - [ ] technical-designerで適切な設計書(ADRまたはDesign Doc)を作成した
76
- - [ ] code-verifierでDesign Docを検証し結果をdocument-reviewerに渡した(ADRのみの場合はスキップ)
77
- - [ ] document-reviewerを実行しフィードバックに対応した
98
+ - [ ] Step 1のスコープブートストラップのシードを構築した(または検索結果が0件のときユーザーから対象ファイルを取得した)
99
+ - [ ] 値の入った`requirement_analysis`でcodebase-analyzerを実行した
100
+ - [ ] ユーザーと設計スコープを確認し、確認済みの対象ファイルから規模を設定した
101
+ - [ ] technical-designerでDesign Docを作成した。設計にアーキテクチャ決定が伴う場合は前提となるADRを先に作成した
102
+ - [ ] Design Docに対してcode-verifierを実行し、結果をdocument-reviewerに渡した
103
+ - [ ] 作成した各ドキュメント(Design Doc、および作成された場合のADR)に対してdocument-reviewerを実行し、フィードバックに対応した
78
104
  - [ ] design-syncで整合性検証を実行した
79
- - [ ] ユーザーから設計書の承認を取得した
105
+ - [ ] 設計書のユーザー承認を取得した
80
106
 
81
107
  ## 出力例
82
108
  設計フェーズが完了しました。
@@ -160,10 +160,12 @@ Escalate when the required fix or investigation falls outside that scope.
160
160
 
161
161
  タスクファイルを削除できない場合(ファイルシステムエラー)、失敗を報告するが完了レポートをブロックしない。
162
162
 
163
- ## 出力例
164
- フロントエンド実装フェーズ完了。
165
- - タスク分解: docs/plans/tasks/ 配下に生成
166
- - 実装タスク: [件数] タスク
167
- - 品質チェック: 全てパス
168
- - コミット: [件数] コミット作成
169
- - クリーンアップ: docs/plans/tasks/ からタスクファイルを削除済み
163
+ ## 完了レポートコントラクト
164
+
165
+ 最終レポートには以下を含めること:
166
+ - タスク分解のステータス
167
+ - 実装したタスク数
168
+ - 品質チェック結果
169
+ - コミット数
170
+ - クリーンアップ結果
171
+ - エスカレーションまたはブロッキングの要約(あれば)