Skip to content

Commit 52c84fb

Browse files
authored
Merge pull request #18 from makotan/feature/improved-agent-integration
各コマンドの初期処理をagentに変更
2 parents b353000 + 692233b commit 52c84fb

19 files changed

+313
-67
lines changed

agents/symbol-searcher.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
name: symbol-searcher
3+
description: Use this agent when you need to search for specific symbols (classes, methods, functions, variables, etc.) across the codebase and retrieve detailed information about their locations and types. This agent is particularly useful for code navigation, refactoring preparation, or understanding code structure. Examples:\n\n<example>\nContext: The user wants to find all occurrences of a specific method across the codebase.\nuser: "Find all instances of the 'createTodo' method in the project"\nassistant: "I'll use the symbol-searcher agent to locate all occurrences of the 'createTodo' method across the codebase."\n<commentary>\nSince the user wants to find specific symbols in the code, use the Task tool to launch the symbol-searcher agent.\n</commentary>\n</example>\n\n<example>\nContext: The user needs to understand where a class is defined and used.\nuser: "Where is the TodoController class defined and what methods does it have?"\nassistant: "Let me search for the TodoController class symbol to find its definition and methods."\n<commentary>\nThe user is asking about a specific class symbol, so use the symbol-searcher agent to find its location and details.\n</commentary>\n</example>
4+
tools: Glob, Grep, LS, Read, NotebookRead, WebFetch, TodoWrite, WebSearch, mcp__ide__getDiagnostics
5+
model: haiku
6+
color: green
7+
---
8+
9+
You are an expert code symbol analyzer specializing in searching and identifying symbols across codebases. Your primary responsibility is to locate specific symbols (classes, methods, functions, variables, interfaces, types, etc.) and provide comprehensive information about their locations and characteristics.
10+
11+
When searching for symbols, you will:
12+
13+
1. **Search Strategy**:
14+
- Use appropriate tools to scan files for the requested symbol names
15+
- Consider partial matches and case variations when appropriate
16+
- Search across all relevant file types in the project
17+
- Prioritize definition locations over usage locations unless specified otherwise
18+
19+
2. **Symbol Classification**:
20+
- Accurately identify the symbol type: class, method, function, variable, interface, type, enum, constant, etc.
21+
- For methods/functions, include whether they are static, async, private/public
22+
- For classes, note if they are abstract, extend other classes, or implement interfaces
23+
- Include descriptive context that helps understand the symbol's purpose
24+
25+
3. **Information Extraction**:
26+
For each symbol found, you must provide:
27+
- **Symbol Name**: The exact name with descriptive context (e.g., 'createTodo - async method for creating new todo items')
28+
- **Type**: The specific symbol type (class, method, function, variable, etc.)
29+
- **File Path**: The relative path from the project root
30+
- **Location**: Line number and, if possible, column number
31+
- **Context**: Brief description of what the symbol does based on its name and surrounding code
32+
33+
4. **Output Format**:
34+
Present your findings in a structured format:
35+
```
36+
Symbol: [Name with description]
37+
Type: [Symbol type]
38+
File: [Relative path]
39+
Location: Line [X], Column [Y]
40+
Context: [Brief functional description]
41+
```
42+
43+
5. **Search Completeness**:
44+
- Always search the entire codebase unless instructed to limit scope
45+
- Group results by symbol type when multiple matches are found
46+
- If a symbol has multiple definitions (overloads, implementations), list all occurrences
47+
- Distinguish between declarations, definitions, and usages when relevant
48+
49+
6. **Edge Cases**:
50+
- If no symbols are found, suggest similar symbol names that exist in the codebase
51+
- Handle minified or obfuscated code by noting when symbol names might be transformed
52+
- For ambiguous requests, search for all possible interpretations
53+
- Consider language-specific naming conventions (camelCase, snake_case, etc.)
54+
55+
7. **Quality Assurance**:
56+
- Verify that the symbol at the reported location matches the search criteria
57+
- Ensure file paths are correct and relative to the project root
58+
- Double-check symbol type classification
59+
- Include enough context in descriptions to make the symbol's purpose clear
60+
61+
Remember: Your goal is to provide developers with precise, actionable information about code symbols that helps them navigate and understand the codebase efficiently. Always prioritize accuracy and completeness in your symbol analysis.

commands/auto-debug.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
テストエラーを解消して。
2+
最初に全テストケースの確認をタスク実行してテストケースのエラーをtodoにセットして
3+
各対象毎に以下の作業を実施して
4+
  - タスクで詳細にテストのエラー原因を調る
5+
 - 新たなタスクで /tdd-green を使って修正する
6+
最後に全体のテストの成功率を確認してレポートして
7+
ゴールはテストケースの成功数を上げること
8+
NEVER: テストのスキップ
9+
NEVER: 既存でテストケースの削除
10+
#ultrathink

commands/direct-setup.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ DIRECTタスクの設定作業を実行します。設計文書に基づいて
1313
## 実行内容
1414

1515
1. **設計文書の確認**
16-
- `docs/design/{要件名}/architecture.md` を確認
17-
- `docs/design/{要件名}/database-schema.sql` を確認
18-
- その他関連する設計文書を確認
16+
- @agent-symbol-searcher で関連設計文書や設定パターンを検索し、見つかったファイルをReadツールで読み込み
17+
- `docs/design/{要件名}/architecture.md` をReadツールで読み込み
18+
- `docs/design/{要件名}/database-schema.sql` をReadツールで読み込み
19+
- その他関連する設計文書をReadツールで読み込み
1920

2021
2. **設定作業の実行**
22+
- @agent-symbol-searcher で既存の設定ファイルや環境変数を検索し、見つかったファイルをReadツールで読み込み
2123
- 環境変数の設定
2224
- 設定ファイルの作成・更新
2325
- 依存関係のインストール

commands/direct-verify.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ DIRECTタスクで実行した設定作業の動作確認とテストを行い
1515
**【重要】**: direct-setupで作成されたファイルについて、コンパイルエラーや構文エラーが見つかった場合は自動的に解決を試行します。
1616

1717
1. **設定の確認**
18+
- @agent-symbol-searcher で関連設定や検証パターンを検索し、見つかったファイルをReadツールで読み込み
19+
- `docs/implements/{TASK-ID}/setup-report.md` をReadツールで読み込み、設定作業の結果を確認
1820
- 環境変数の確認
1921
- 設定ファイルの内容確認
2022
- 依存関係のインストール状況確認
@@ -27,6 +29,7 @@ DIRECTタスクで実行した設定作業の動作確認とテストを行い
2729
- 最低限のコンパイルエラー解消
2830

2931
3. **動作テストの実行**
32+
- @agent-symbol-searcher で既存のテストケースや検証スクリプトを検索し、見つかったファイルをReadツールで読み込み
3033
- 基本的な動作確認
3134
- 接続テスト
3235
- 権限の確認

commands/kairo-design.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
- 🔴 **赤信号**: EARS要件定義書・設計文書にない推測の場合
2020

2121
1. **要件の分析**
22-
- 要件定義書を読み込む
22+
- @agent-symbol-searcher で要件定義書を検索し、見つかったファイルをReadツールで読み込み
23+
- @agent-symbol-searcher で関連する既存設計文書を確認し、見つかったファイルをReadツールで読み込み
2324
- 機能要件と非機能要件を整理する
2425
- システムの境界を明確にする
2526

@@ -212,6 +213,7 @@ CREATE INDEX idx_users_email ON users(email);
212213

213214
## 実行後の確認
214215

216+
- @agent-symbol-searcher で作成した設計と既存システムとの整合性を確認
215217
- 作成したファイルの一覧を表示
216218
- 設計の主要なポイントをサマリーで表示
217219
- ユーザに確認を促すメッセージを表示

commands/kairo-implement.md

Lines changed: 103 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
- 🔴 **赤信号**: EARS要件定義書・設計文書にない推測の場合
2222

2323
1. **タスクの選択**
24+
- @agent-symbol-searcher で指定されたタスクIDを検索し、見つかったタスクファイルをReadツールで読み込み
2425
- ユーザが指定したタスクIDを確認
2526
- 指定がない場合は、依存関係に基づいて次のタスクを自動選択
2627
- 選択したタスクの詳細を表示
2728

2829
2. **依存関係の確認**
30+
- @agent-symbol-searcher で依存タスクの状態を検索し、見つかったタスクファイルをReadツールで読み込み
2931
- 依存タスクが完了しているか確認
3032
- 未完了の依存タスクがある場合は警告
3133

@@ -41,42 +43,78 @@
4143

4244
### A. **TDDプロセス**(コード実装タスク用)
4345

44-
a. **要件定義** (`tdd-requirements.md`)
45-
- タスクの詳細要件を記述
46-
- 受け入れ基準を明確化
47-
48-
b. **テストケース作成** (`tdd-testcases.md`)
49-
- 単体テストケースを作成
50-
- エッジケースを考慮
51-
52-
c. **テスト実装** (`tdd-red.md`)
53-
- 失敗するテストを実装
54-
- テストが失敗することを確認
55-
56-
d. **最小実装** (`tdd-green.md`)
57-
- テストが通る最小限の実装
58-
- 過度な実装を避ける
59-
60-
e. **リファクタリング** (`tdd-refactor.md`)
61-
- コードの品質向上
62-
- 保守性の改善
63-
64-
f. **品質確認** (`tdd-verify-complete.md`)
65-
- 実装の完成度を確認
66-
- 不足があれば c-f を繰り返す
46+
a. **要件定義** - `@task general-purpose tdd-requirements.md`
47+
```
48+
Task実行: TDD要件定義フェーズ
49+
目的: タスクの詳細要件を記述し、受け入れ基準を明確化する
50+
コマンド: tdd-requirements.md
51+
実行方式: 個別Task実行
52+
```
53+
54+
b. **テストケース作成** - `@task general-purpose tdd-testcases.md`
55+
```
56+
Task実行: TDDテストケース作成フェーズ
57+
目的: 単体テストケースを作成し、エッジケースを考慮する
58+
コマンド: tdd-testcases.md
59+
実行方式: 個別Task実行
60+
```
61+
62+
c. **テスト実装** - `@task general-purpose tdd-red.md`
63+
```
64+
Task実行: TDDレッドフェーズ
65+
目的: 失敗するテストを実装し、テストが失敗することを確認する
66+
コマンド: tdd-red.md
67+
実行方式: 個別Task実行
68+
```
69+
70+
d. **最小実装** - `@task general-purpose tdd-green.md`
71+
```
72+
Task実行: TDDグリーンフェーズ
73+
目的: テストが通る最小限の実装を行い、過度な実装を避ける
74+
コマンド: tdd-green.md
75+
実行方式: 個別Task実行
76+
```
77+
78+
e. **リファクタリング** - `@task general-purpose tdd-refactor.md`
79+
```
80+
Task実行: TDDリファクタリングフェーズ
81+
目的: コードの品質向上と保守性の改善を行う
82+
コマンド: tdd-refactor.md
83+
実行方式: 個別Task実行
84+
```
85+
86+
f. **品質確認** - `@task general-purpose tdd-verify-complete.md`
87+
```
88+
Task実行: TDD品質確認フェーズ
89+
目的: 実装の完成度を確認し、不足があればc-fを繰り返す
90+
コマンド: tdd-verify-complete.md
91+
実行方式: 個別Task実行
92+
```
6793

6894
### B. **直接作業プロセス**(準備作業タスク用)
6995

70-
a. **準備作業の実行**
96+
a. **準備作業の実行** - `@task general-purpose direct-work-execute`
97+
```
98+
Task実行: 直接作業実行フェーズ
99+
目的: ディレクトリ作成、設定ファイル作成、依存関係のインストール、環境設定を行う
100+
作業内容:
71101
- ディレクトリ作成
72102
- 設定ファイル作成
73103
- 依存関係のインストール
74104
- 環境設定
75-
76-
b. **作業結果の確認**
105+
実行方式: 個別Task実行
106+
```
107+
108+
b. **作業結果の確認** - `@task general-purpose direct-work-verify`
109+
```
110+
Task実行: 直接作業確認フェーズ
111+
目的: 作業完了の検証と成果物確認を行う
112+
作業内容:
77113
- 作業完了の検証
78114
- 期待された成果物の確認
79115
- 次のタスクへの準備状況確認
116+
実行方式: 個別Task実行
117+
```
80118

81119
6. **タスクの完了処理**
82120
- タスクのステータスを更新(タスクファイルのチェックボックスにチェックを入れる)
@@ -154,6 +192,33 @@ $ claude code kairo-implement --status
154192

155193
****: プロジェクト初期化、データベース設定、開発環境設定
156194

195+
## 個別Task実行アプローチ
196+
197+
### Task実行の方針
198+
199+
各実装ステップを個別のTaskとして実行することで、以下のメリットが得られます:
200+
201+
1. **独立性**: 各ステップが独立して実行され、エラー発生時の切り分けが容易
202+
2. **再実行性**: 特定のステップのみ再実行が可能
203+
3. **並列性**: 依存関係のないステップは並列実行可能
204+
4. **追跡性**: 各ステップの実行状況と結果が明確に記録される
205+
206+
### Task実行パターン
207+
208+
```bash
209+
# TDDプロセスの場合
210+
@task general-purpose tdd-requirements.md
211+
@task general-purpose tdd-testcases.md
212+
@task general-purpose tdd-red.md
213+
@task general-purpose tdd-green.md
214+
@task general-purpose tdd-refactor.md
215+
@task general-purpose tdd-verify-complete.md
216+
217+
# 直接作業プロセスの場合
218+
@task general-purpose direct-work-execute
219+
@task general-purpose direct-work-verify
220+
```
221+
157222
## 実装時の注意事項
158223

159224
### TDDプロセス用
@@ -217,19 +282,23 @@ $ claude code kairo-implement --status
217282
### 各ステップ完了時(TDD)
218283

219284
```
220-
Step 1/6: 要件定義 完了
285+
Task 1/6: @task tdd-requirements 完了
221286
ファイル: /implementation/{要件名}/TASK-101/requirements.md
287+
Task実行結果: 要件定義書作成完了
222288
223-
🏃 Step 2/6: テストケース作成 実行中...
289+
🏃 Task 2/6: @task tdd-testcases 実行中...
290+
Task実行: TDDテストケース作成フェーズを開始
224291
```
225292

226293
### 各ステップ完了時(直接作業)
227294

228295
```
229-
Step 1/2: 準備作業実行 完了
296+
Task 1/2: @task direct-work-execute 完了
230297
作成ファイル: 8個、設定更新: 3個
298+
Task実行結果: 準備作業実行完了
231299
232-
🏃 Step 2/2: 作業結果確認 実行中...
300+
🏃 Task 2/2: @task direct-work-verify 実行中...
301+
Task実行: 直接作業確認フェーズを開始
233302
```
234303

235304
### タスク完了時(TDD)
@@ -241,7 +310,8 @@ $ claude code kairo-implement --status
241310
- [ ] **タスク完了** → [x] **タスク完了**
242311
243312
📊 実装サマリー:
244-
- 実装タイプ: TDDプロセス
313+
- 実装タイプ: TDDプロセス (個別Task実行)
314+
- 実行Taskステップ: 6個 (全て成功)
245315
- 作成ファイル: 12個
246316
- テストケース: 25個 (全て成功)
247317
- カバレッジ: 95%
@@ -263,7 +333,8 @@ $ claude code kairo-implement --status
263333
- [ ] **タスク完了** → [x] **タスク完了**
264334
265335
📊 実装サマリー:
266-
- 実装タイプ: 直接作業プロセス
336+
- 実装タイプ: 直接作業プロセス (個別Task実行)
337+
- 実行Taskステップ: 2個 (全て成功)
267338
- 作成ファイル: 8個
268339
- 設定更新: 3個
269340
- 環境確認: 正常

commands/kairo-requirements.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
1. **要件の分析**
2222
- ユーザから提供された要件の概要を理解する
23+
- @agent-symbol-searcher で関連する既存要件・設計文書を検索し、見つかったファイルをReadツールで読み込み
2324
- 関連するドメイン知識を適用する
2425
- 不明確な点がある場合は、一般的なベストプラクティスに基づいて補完する
2526

@@ -342,6 +343,7 @@ journey
342343

343344
## 実行後の確認
344345

346+
- @agent-symbol-searcher で作成した要件との関連性を確認
345347
- 作成した3つのファイルのパスを表示
346348
- `docs/spec/{要件名}-requirements.md`
347349
- `docs/spec/{要件名}-user-stories.md`

commands/kairo-task-verify.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
- 🔴 **赤信号**: EARS要件定義書・設計文書にない推測の場合
2020

2121
1. **タスクファイルの確認**
22-
- `docs/tasks/{要件名}-tasks.md` を読み込み
22+
- @agent-symbol-searcher でタスクファイルを検索し、見つかったファイルをReadツールで読み込み
23+
- `docs/tasks/{要件名}-tasks.md` をReadツールで読み込み
2324

2425
2. **出力フォーマット例との比較**
25-
- kairo-tasksの出力フォーマット例を確認
26+
- @agent-symbol-searcher で関連するタスクフォーマットを検索し、見つかったファイルをReadツールで読み込み
27+
- kairo-tasksコマンドファイルをReadツールで読み込み、出力フォーマット例を確認
2628
- 作成されたタスクファイルに不足している情報を特定
2729

2830
3. **不足情報の追加**

commands/kairo-tasks.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
- 🔴 **赤信号**: EARS要件定義書・設計文書にない推測の場合
2121

2222
1. **設計文書の分析**
23-
- `docs/design/{要件名}/architecture.md` を確認
24-
- `docs/design/{要件名}/database-schema.sql` を確認
25-
- `docs/design/{要件名}/api-endpoints.md` を確認
26-
- `docs/design/{要件名}/interfaces.ts` を確認
27-
- `docs/design/{要件名}/dataflow.md` を確認
23+
- @agent-symbol-searcher で設計文書を検索し、見つかったファイルをReadツールで読み込み
24+
- `docs/design/{要件名}/architecture.md` をReadツールで読み込み
25+
- `docs/design/{要件名}/database-schema.sql` をReadツールで読み込み
26+
- `docs/design/{要件名}/api-endpoints.md` をReadツールで読み込み
27+
- `docs/design/{要件名}/interfaces.ts` をReadツールで読み込み
28+
- `docs/design/{要件名}/dataflow.md` をReadツールで読み込み
2829

2930
2. **既存タスクファイルの確認**
30-
- 既存の`docs/tasks/{要件名}-*.md`ファイルを確認
31+
- @agent-symbol-searcher で既存タスクIDを検索し、見つかったタスクファイルをReadツールで読み込み
32+
- 既存の`docs/tasks/{要件名}-*.md`ファイルをReadツールで読み込み
3133
- 使用済みタスク番号(TASK-0001形式)を抽出
3234
- 新規タスクで重複しない番号を割り当て
3335

@@ -358,6 +360,7 @@ gantt
358360
359361
## 実行後の確認
360362
363+
- @agent-symbol-searcher で作成したタスクと既存システムとの整合性を確認
361364
- 作成したファイルの一覧を表示
362365
- `docs/tasks/{要件名}-overview.md`: 全体概要とフェーズ一覧
363366
- `docs/tasks/{要件名}-phase1.md`: フェーズ1詳細

0 commit comments

Comments
 (0)