Files
gh-allex-znews-cc-workflow-…/commands/list-tasks.md
2025-11-29 17:52:09 +08:00

262 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: タスク一覧と進捗を表示する
---
# タスク一覧の表示
現在の機能開発のタスク一覧と進捗状況を表示します。
## タスクファイルの確認
`.tasks.json` ファイルを読み込み、以下の情報を表示してください:
### 1. 機能情報
```
## 機能: [機能名]
作成日時: [作成日時]
最終更新: [最終更新日時]
```
### 2. 進捗サマリー
```
### 進捗サマリー
- 全タスク数: X件
- 完了: Y件 (Z%)
- 作業中: A件
- 未着手: B件
- ブロック中: C件
推定残り時間: D時間
```
### 3. タスク詳細
ステータス別にタスクを表示します:
```
### ワークフロータスク
✅ 1. 要件整理 (/new-feature)
完了日時: 2025-10-12 10:30
✅ 2. ドキュメント作成 (/create-docs)
完了日時: 2025-10-12 11:00
⏳ 3. テスト作成 (/create-tests)
状態: 作業中
⬜ 4. 実装 (/implement)
状態: 未着手
### 実装サブタスク
⬜ 5. ユーザーモデルの作成
状態: 未着手
推定: 2時間
親タスク: #4 (実装)
⬜ 6. 認証APIエンドポイントの実装
状態: 未着手
推定: 3時間
依存: #5
親タスク: #4 (実装)
🚫 7. データベースマイグレーション
状態: ブロック中
理由: データベーススキーマの確認待ち
```
### 4. アイコンの凡例
- ✅ 完了
- ⏳ 作業中
- ⬜ 未着手
- 🚫 ブロック中
## タスクが存在しない場合
`.tasks.json` ファイルが存在しない、または空の場合:
```
タスクが作成されていません。
以下のコマンドでワークフローを開始してください:
- `/new-feature [機能の説明]` - 新機能開発を開始
- `/create-tasks [機能名]` - サブタスクを作成
```
## 次のステップの提案
タスク状況を分析し、具体的な次のアクションを提案してください:
### 1. 作業中のタスクがある場合
```
### 📌 次のアクション
タスク「[タスク名]」が作業中です。
続行するには:
/resume
または
[対応するコマンド] (例: /create-docs)
```
### 2. 未着手のワークフロータスクがある場合
次に実行すべきワークフロータスク最も小さいIDのpendingタスクを提案
```
### 📌 次のアクション
次のステップ: [タスク名]
このタスクを開始するには:
/resume
または
[対応するコマンド] (例: /create-tests)
```
### 3. ブロックされたタスクがある場合
ブロックの理由と解決方法を提案:
```
### ⚠️ ブロック中のタスク
タスク「[タスク名]」がブロックされています。
理由: [ブロック理由]
解決方法:
1. [解決ステップ1]
2. [解決ステップ2]
ブロックを解除するには:
/update-task [タスクID] pending
```
### 4. サブタスクが残っている場合
実装サブタスクの状態を確認し、次のタスクを提案:
```
### 📌 次のアクション
実装サブタスクが残っています:
- [サブタスク名1] (状態: pending)
- [サブタスク名2] (状態: pending, 依存: #X)
実装を続行するには:
/implement
または特定のサブタスクを開始:
/update-task [タスクID] in_progress
```
### 5. すべて完了している場合
```
### 🎉 完了
すべてのタスクが完了しました!
次のステップ:
1. コードレビューを依頼
2. ドキュメントを最終確認
3. プルリクエストを作成 (該当する場合)
4. 本番環境へのデプロイを検討
新しい機能を開始するには:
/new-feature [機能の説明]
完了した作業の履歴を確認:
履歴は .tasks-history.json に保存されています
```
### 6. 依存関係で待機中の場合
依存タスクが未完了のサブタスクがある場合:
```
### 📌 次のアクション
以下のタスクは依存関係により待機中です:
- タスク #[ID]: [タスク名]
待機理由: タスク #[依存ID] ([依存タスク名]) が未完了
まず以下のタスクを完了してください:
- タスク #[依存ID]: [依存タスク名]
実行可能なタスク:
- [実行可能なタスク1]
- [実行可能なタスク2]
```
## アクション提案のロジック
```javascript
function suggestNextAction(tasks) {
// 1. ワークフローの作業中タスク
const inProgressWorkflow = tasks.find(t =>
t.type === 'workflow' && t.status === 'in_progress'
);
if (inProgressWorkflow) {
return {
action: 'resume',
task: inProgressWorkflow,
command: inProgressWorkflow.command
};
}
// 2. ワークフローの未着手タスク
const pendingWorkflow = tasks
.filter(t => t.type === 'workflow' && t.status === 'pending')
.sort((a, b) => a.id - b.id)[0];
if (pendingWorkflow) {
return {
action: 'start-next',
task: pendingWorkflow,
command: pendingWorkflow.command
};
}
// 3. ブロックされたタスク
const blockedTasks = tasks.filter(t => t.status === 'blocked');
if (blockedTasks.length > 0) {
return {
action: 'resolve-block',
tasks: blockedTasks
};
}
// 4. サブタスクが残っている
const pendingSubtasks = tasks.filter(t =>
t.type === 'subtask' && t.status !== 'completed'
);
if (pendingSubtasks.length > 0) {
// 依存関係をチェックして実行可能なタスクを探す
const executableTasks = pendingSubtasks.filter(task => {
if (!task.dependencies || task.dependencies.length === 0) {
return true;
}
return task.dependencies.every(depId => {
const depTask = tasks.find(t => t.id === depId);
return depTask && depTask.status === 'completed';
});
});
return {
action: 'continue-implementation',
executableTasks,
blockedTasks: pendingSubtasks.filter(t => !executableTasks.includes(t))
};
}
// 5. すべて完了
return {
action: 'completed'
};
}
```