SuperAPI AI Directory

parallel-workflows

Office & productivity

View repository

Updated 10-15 17:33

About this skill

Parallel Workflows Skill

A skill that optimizes parallel execution of multiple tasks. Leverage the Task tool to process independent tasks simultaneously.


Trigger phrase

This skill is automatically triggered by the following phrases:

  • "Run in parallel," "Do it at the same time"
  • "Do it all at once," "Do it in one go"
  • "Do it efficiently," "Do it fast"
  • "run in parallel", "do these together"

Related Commands

  • /work - Execute tasks in Plans.md (parallel execution supported)

Overview

Claude Code can execute multiple tasks in parallel. This skill determines which tasks can be parallelized and formulates an optimal execution plan.


Parallelization Patterns

Pattern 1: Simultaneous Analysis of Multiple Files

Use Case: Code review, understanding structure

Task tool を並列起動:
- agent1: src/components/ を分析
- agent2: src/lib/ を分析
- agent3: src/app/ を分析

Phrasing for VibeCoders:

「このプロジェクトの構造を教えて」
→ 自動的に並列分析を実行

Pattern 2: Simultaneous Execution of Tests and Builds

Use Case: CI/CD, quality checks

並列実行:
- npm run lint
- npm run type-check
- npm run test

直列実行(依存あり):
- npm run build(上記が全て成功後)

Phrasing for VibeCoders:

「チェックして」
→ lint, type-check, test を並列実行

Pattern 3: Simultaneous Implementation of Multiple Features

Use Case: Development of independent features

Plans.md:
- [ ] ヘッダーコンポーネント作成
- [ ] フッターコンポーネント作成
- [ ] サイドバーコンポーネント作成

→ 3つのTask agentを並列起動

Phrasing for VibeCoders:

「レイアウトを全部作って」
→ 独立したコンポーネントを並列実装

Decision Logic

Conditions for Parallelization

  1. No file dependencies: Do not edit the same file
  2. No data dependencies: Output does not become input for another
  3. No order dependencies: Execution order does not affect the result

Examples of Non-Parallelizable Cases

❌ 並列化不可:
1. API クライアント作成
2. API クライアントを使うコンポーネント作成
→ 2は1の出力に依存

✅ 並列化可能:
1. ログインページ作成
2. 会員登録ページ作成
→ 互いに独立

Implementation Guide

Parallel Execution Using the Task Tool

// 並列実行パターン
const tasks = [
  { name: "タスクA", prompt: "..." },
  { name: "タスクB", prompt: "..." },
  { name: "タスクC", prompt: "..." }
];

// 全てのタスクを run_in_background: true で起動
// TaskOutput で結果を収集

Generating an Integrated Report

After each task completes, generate a report in the following format:

## 📊 並列タスク実行レポート

**実行日時**: {{timestamp}}
**タスク数**: {{count}}件(並列実行)
**所要時間**: {{duration}}秒

### 完了タスク

| # | タスク | ステータス | 所要時間 | 成果物 |
|---|-------|----------|---------|-------|
{{#each tasks}}
| {{index}} | {{name}} | {{status}} | {{duration}}秒 | {{output}} |
{{/each}}

### 変更ファイル一覧

{{#each files}}
- `{{path}}` ({{action}})
{{/each}}

Execution Examples

Example 1: Project Analysis

ユーザー: 「このプロジェクトについて教えて」

Claude Code:
🔍 プロジェクトを並列分析中...

├── [Agent 1] 構造分析中...
├── [Agent 2] 依存関係チェック中...
└── [Agent 3] コード品質分析中...

完了!

📁 プロジェクト概要:
- フレームワーク: Next.js 14
- 主要ディレクトリ: 15個
- ファイル数: 87個
- 依存パッケージ: 23個
- コード品質: 良好(lint警告: 3件)

Example 2: Implementation of Multiple Features

ユーザー: 「ヘッダー、フッター、サイドバーを作って」

Claude Code:
📋 3つの独立タスクを検出 → 並列実行します

├── [Agent 1] ヘッダー作成中... ✅ 完了
├── [Agent 2] フッター作成中... ✅ 完了
└── [Agent 3] サイドバー作成中... ✅ 完了

⏱️ 所要時間: 45秒(直列なら2分15秒)

Example 3: Quality Check

ユーザー: 「全部チェックして」

Claude Code:
🔍 品質チェックを並列実行中...

├── [Lint] ✅ 問題なし
├── [Type] ✅ 型エラーなし
├── [Test] ✅ 15/15 通過
└── [Build] ✅ 成功

✅ 全チェック通過!

Performance Metrics

Scenario Serial Execution Parallel Execution Improvement Rate
3-file analysis 30 seconds 12 seconds 60%
lint+test+build 45 seconds 20 seconds 55%
Creating 3 components 3 minutes 1 minute 67%

Error handling

When Some Tasks Fail

  1. Retain the results of successful tasks
  2. Display error details of failed tasks
  3. Present a re-execution option
📊 並列実行完了(一部エラー)

├── [Task 1] A作成 ✅ (25秒)
├── [Task 2] B作成 ❌ エラー
│   └── 原因: TypeScriptエラー
└── [Task 3] C作成 ✅ (22秒)

⚠️ 1件のタスクが失敗しました。
失敗したタスクを再実行しますか? (y/n)

Usage Notes

Recommended

  • ✅ Simultaneous editing of independent files
  • ✅ Parallel execution of multiple analysis tasks
  • ✅ Simultaneous execution of non-dependent tests

Not Recommended

  • ❌ Simultaneous writing to the same file
  • ❌ Parallelizing tasks with dependencies
  • ❌ Parallel execution of database migrations

Summary for VibeCoder

What we want to do Phrasing Parallelization
Creating multiple pages "Create all the pages" ✅ Automatic
Code analysis "Analyze this project" ✅ Automatic
Quality check "Check it" ✅ Automatic
Implement in order "Do it in order" ❌ Serial

Points: Even without being particularly conscious of it, Claude Code automatically determines tasks that can be parallelized and optimizes them.