mcpField
A
agent-swarm-issue

agent-swarm-issue

github.com/ruvnetエージェントワークフロー80.0k1.1k 回インストール今日更新
リポジトリ

agent-swarm-issue について

agent-swarm-issue は、GitHub Issues を複数エージェントで扱うタスクに変換します。issue の分解、担当割り当て、進捗管理が必要なチーム向けで、コメントコマンドや issue 間の連携にも対応します。

主な機能

  1. 01issue をスウォームタスクに変換
  2. 02サブタスクの分解と担当割り当て
  3. 03コメントから操作を実行
  4. 04進捗を追跡して issue を更新
  5. 05エピック、依存関係、PR リンクを管理

活用シーン

  1. 01複雑な issue の分解と調整
  2. 02issue の分類、ラベル付け、割り当て
  3. 03エピックやマイルストーンの進捗管理
  4. 04コメントからスウォーム操作を開始

MCP 対応

GitHub MCP ツールで issue の読み取り、作成、更新を行い、claude-flow MCP ツールでスウォームの初期化、エージェントの起動、タスクの編成を行います。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/ruvnet/ruflo --skill agent-swarm-issue

インストール後、Claude Code で/agent-swarm-issueを入力して読み込まれたか確認します。

詳細


name: swarm-issue description: GitHub Issue を基にしたスウォーム調整エージェント。Issue をインテリジェントなマルチエージェントタスクに変換し、自動分解と進捗追跡を行います type: coordination color: "#FF6B35" tools:

  • mcp__github__get_issue
  • mcp__github__create_issue
  • mcp__github__update_issue
  • mcp__github__list_issues
  • mcp__github__create_issue_comment
  • mcp__claude-flow__swarm_init
  • mcp__claude-flow__agent_spawn
  • mcp__claude-flow__task_orchestrate
  • mcp__claude-flow__memory_usage
  • TodoWrite
  • TodoRead
  • Bash
  • Grep
  • Read
  • Write hooks: pre:
    • "GitHub Issue 管理のためのスウォーム調整システムを初期化します"
    • "Issue のコンテキストを分析し、最適なスウォームトポロジーを判断します"
    • "エージェント間で共有できるよう、Issue のメタデータをスウォームメモリに保存します" post:
    • "スウォームの進捗とエージェントの割り当てを Issue に反映します"
    • "スウォーム分析結果に基づいてフォローアップタスクを作成します"
    • "包括的なスウォーム調整レポートを生成します"

Swarm Issue - Issue ベースのスウォーム調整

概要

GitHub Issues をインテリジェントなスウォームタスクに変換し、高度なマルチエージェントオーケストレーションによるタスクの自動分解とエージェント調整を可能にします。

主な機能

1. Issue からスウォームへの変換
# Create swarm from issue using gh CLI
# Get issue details
ISSUE_DATA=$(gh issue view 456 --json title,body,labels,assignees,comments)

# Create swarm from issue
npx ruv-swarm github issue-to-swarm 456 \
  --issue-data "$ISSUE_DATA" \
  --auto-decompose \
  --assign-agents

# Batch process multiple issues
ISSUES=$(gh issue list --label "swarm-ready" --json number,title,body,labels)
npx ruv-swarm github issues-batch \
  --issues "$ISSUES" \
  --parallel

# Update issues with swarm status
echo "$ISSUES" | jq -r '.[].number' | while read -r num; do
  gh issue edit $num --add-label "swarm-processing"
done
2. Issue コメントコマンド

Issue コメントを通じてスウォーム操作を実行します。


$swarm analyze
$swarm decompose 5
$swarm assign @agent-coder
$swarm estimate
$swarm start
3. スウォーム用 Issue テンプレート

name: Swarm Task
description: Create a task for AI swarm processing
body:
  - type: dropdown
    id: topology
    attributes:
      label: Swarm Topology
      options:
        - mesh
        - hierarchical
        - ring
        - star
  - type: input
    id: agents
    attributes:
      label: Required Agents
      placeholder: "coder, tester, analyst"
  - type: textarea
    id: tasks
    attributes:
      label: Task Breakdown
      placeholder: |
        1. Task one description
        2. Task two description

Issue ラベルの自動化

内容に基づくラベルの自動付与
// .github$swarm-labels.json
{
  "rules": [
    {
      "keywords": ["bug", "error", "broken"],
      "labels": ["bug", "swarm-debugger"],
      "agents": ["debugger", "tester"]
    },
    {
      "keywords": ["feature", "implement", "add"],
      "labels": ["enhancement", "swarm-feature"],
      "agents": ["architect", "coder", "tester"]
    },
    {
      "keywords": ["slow", "performance", "optimize"],
      "labels": ["performance", "swarm-optimizer"],
      "agents": ["analyst", "optimizer"]
    }
  ]
}
動的なエージェント割り当て
# Assign agents based on issue content
npx ruv-swarm github issue-analyze 456 \
  --suggest-agents \
  --estimate-complexity \
  --create-subtasks

Issue スウォームコマンド

Issue から初期化
# Create swarm with full issue context using gh CLI
# Get complete issue data
ISSUE=$(gh issue view 456 --json title,body,labels,assignees,comments,projectItems)

# Get referenced issues and PRs
REFERENCES=$(gh issue view 456 --json body --jq '.body' | \
  grep -oE '#[0-9]+' | while read -r ref; do
    NUM=${ref#\#}
    gh issue view $NUM --json number,title,state 2>$dev$null || \
    gh pr view $NUM --json number,title,state 2>$dev$null
  done | jq -s '.')

# Initialize swarm
npx ruv-swarm github issue-init 456 \
  --issue-data "$ISSUE" \
  --references "$REFERENCES" \
  --load-comments \
  --analyze-references \
  --auto-topology

# Add swarm initialization comment
gh issue comment 456 --body "🐝 Swarm initialized for this issue"
タスクの分解
# Break down issue into subtasks with gh CLI
# Get issue body
ISSUE_BODY=$(gh issue view 456 --json body --jq '.body')

# Decompose into subtasks
SUBTASKS=$(npx ruv-swarm github issue-decompose 456 \
  --body "$ISSUE_BODY" \
  --max-subtasks 10 \
  --assign-priorities)

# Update issue with checklist
CHECKLIST=$(echo "$SUBTASKS" | jq -r '.tasks[] | "- [ ] " + .description')
UPDATED_BODY="$ISSUE_BODY

## Subtasks
$CHECKLIST"

gh issue edit 456 --body "$UPDATED_BODY"

# Create linked issues for major subtasks
echo "$SUBTASKS" | jq -r '.tasks[] | select(.priority == "high")' | while read -r task; do
  TITLE=$(echo "$task" | jq -r '.title')
  BODY=$(echo "$task" | jq -r '.description')
  
  gh issue create \
    --title "$TITLE" \
    --body "$BODY

Parent issue: #456" \
    --label "subtask"
done
進捗の追跡
# Update issue with swarm progress using gh CLI
# Get current issue state
CURRENT=$(gh issue view 456 --json body,labels)

# Get swarm progress
PROGRESS=$(npx ruv-swarm github issue-progress 456)

# Update checklist in issue body
UPDATED_BODY=$(echo "$CURRENT" | jq -r '.body' | \
  npx ruv-swarm github update-checklist --progress "$PROGRESS")

# Edit issue with updated body
gh issue edit 456 --body "$UPDATED_BODY"

# Post progress summary as comment
SUMMARY=$(echo "$PROGRESS" | jq -r '
"## 📊 Progress Update

**Completion**: \(.completion)%
**ETA**: \(.eta)

### Completed Tasks
\(.completed | map("- ✅ " + .) | join("\n"))

### In Progress
\(.in_progress | map("- 🔄 " + .) | join("\n"))

### Remaining
\(.remaining | map("- ⏳ " + .) | join("\n"))

---
🤖 Automated update by swarm agent"')

gh issue comment 456 --body "$SUMMARY"

# Update labels based on progress
if [[ $(echo "$PROGRESS" | jq -r '.completion') -eq 100 ]]; then
  gh issue edit 456 --add-label "ready-for-review" --remove-label "in-progress"
fi

高度な機能

1. Issue の依存関係
# Handle issue dependencies
npx ruv-swarm github issue-deps 456 \
  --resolve-order \
  --parallel-safe \
  --update-blocking
2. エピック管理
# Coordinate epic-level swarms
npx ruv-swarm github epic-swarm \
  --epic 123 \
  --child-issues "456,457,458" \
  --orchestrate
3. Issue テンプレート
# Generate issue from swarm analysis
npx ruv-swarm github create-issues \
  --from-analysis \
  --template "bug-report" \
  --auto-assign

ワークフロー統合

Issue 用 GitHub Actions
# .github$workflows$issue-swarm.yml
name: Issue Swarm Handler
on:
  issues:
    types: [opened, labeled, commented]

jobs:
  swarm-process:
    runs-on: ubuntu-latest
    steps:
      - name: Process Issue
        uses: ruvnet$swarm-action@v1
        with:
          command: |
            if [[ "${{ github.event.label.name }}" == "swarm-ready" ]]; then
              npx ruv-swarm github issue-init ${{ github.event.issue.number }}
            fi
Issue ボードとの統合
# Sync with project board
npx ruv-swarm github issue-board-sync \
  --project "Development" \
  --column-mapping '{
    "To Do": "pending",
    "In Progress": "active",
    "Done": "completed"
  }'

Issue の種類と戦略

バグ報告
# Specialized bug handling
npx ruv-swarm github bug-swarm 456 \
  --reproduce \
  --isolate \
  --fix \
  --test
機能リクエスト
# Feature implementation swarm
npx ruv-swarm github feature-swarm 456 \
  --design \
  --implement \
  --document \
  --demo
技術的負債
# Refactoring swarm
npx ruv-swarm github debt-swarm 456 \
  --analyze-impact \
  --plan-migration \
  --execute \
  --validate

自動化の例

古い Issue の自動クローズ
# Process stale issues with swarm using gh CLI
# Find stale issues
STALE_DATE=$(date -d '30 days ago' --iso-8601)
STALE_ISSUES=$(gh issue list --state open --json number,title,updatedAt,labels \
  --jq ".[] | select(.updatedAt < \"$STALE_DATE\")")

# Analyze each stale issue
echo "$STALE_ISSUES" | jq -r '.number' | while read -r num; do
  # Get full issue context
  ISSUE=$(gh issue view $num --json title,body,comments,labels)
  
  # Analyze with swarm
  ACTION=$(npx ruv-swarm github analyze-stale \
    --issue "$ISSUE" \
    --suggest-action)
  
  case "$ACTION" in
    "close")
      # Add stale label and warning comment
      gh issue comment $num --body "This issue has been inactive for 30 days and will be closed in 7 days if there's no further activity."
      gh issue edit $num --add-label "stale"
      ;;
    "keep")
      # Remove stale label if present
      gh issue edit $num --remove-label "stale" 2>$dev$null || true
      ;;
    "needs-info")
      # Request more information
      gh issue comment $num --body "This issue needs more information. Please provide additional context or it may be closed as stale."
      gh issue edit $num --add-label "needs-info"
      ;;
  esac
done

# Close issues that have been stale for 37+ days
gh issue list --label stale --state open --json number,updatedAt \
  --jq ".[] | select(.updatedAt < \"$(date -d '37 days ago' --iso-8601)\") | .number" | \
  while read -r num; do
    gh issue close $num --comment "Closing due to inactivity. Feel free to reopen if this is still relevant."
  done
Issue のトリアージ
# Automated triage system
npx ruv-swarm github triage \
  --unlabeled \
  --analyze-content \
  --suggest-labels \
  --assign-priority
重複の検出
# Find duplicate issues
npx ruv-swarm github find-duplicates \
  --threshold 0.8 \
  --link-related \
  --close-duplicates

統合パターン

1. Issue と PR のリンク
# Link issues to PRs automatically
npx ruv-swarm github link-pr \
  --issue 456 \
  --pr 789 \
  --update-both
2. マイルストーンの調整
# Coordinate milestone swarms
npx ruv-swarm github milestone-swarm \
  --milestone "v2.0" \
  --parallel-issues \
  --track-progress
3. リポジトリをまたぐ Issue
# Handle issues across repositories
npx ruv-swarm github cross-repo \
  --issue "org$repo#456" \
  --related "org$other-repo#123" \
  --coordinate

指標と分析

Issue の解決時間
# Analyze swarm performance
npx ruv-swarm github issue-metrics \
  --issue 456 \
  --metrics "time-to-close,agent-efficiency,subtask-completion"
スウォームの有効性
# Generate effectiveness report
npx ruv-swarm github effectiveness \
  --issues "closed:>2024-01-01" \
  --compare "with-swarm,without-swarm"

ベストプラクティス

1. Issue テンプレート
  • スウォームの設定オプションを含めます
  • タスクの分解構造を提示します
  • 明確な受け入れ基準を設定します
  • 複雑さの見積もりを含めます
2. ラベル戦略
  • スウォーム関連のラベルを一貫して使用します
  • ラベルをエージェントの種類に対応付けます
  • スウォームの優先度を示す指標を設定します
  • ステータス追跡用ラベルを使用します
3. コメントのエチケット
  • 明確なコマンド構文を使用します
  • スレッドで進捗を更新します
  • 決定事項をコメントで要約します
  • 関連する PR へのリンクを含めます

セキュリティと権限

  1. コマンドの認可:コマンド実行前にユーザー権限を検証します
  2. レート制限:Issue コマンドのスパムや不正利用を防ぎます
  3. 監査ログ:Issue に対するすべてのスウォーム操作を追跡します
  4. データプライバシー:プライベートリポジトリの設定を尊重します

例

複雑なバグ調査
# Issue #789: Memory leak in production
npx ruv-swarm github issue-init 789 \
  --topology hierarchical \
  --agents "debugger,analyst,tester,monitor" \
  --priority critical \
  --reproduce-steps
機能の実装
# Issue #234: Add OAuth integration
npx ruv-swarm github issue-init 234 \
  --topology mesh \
  --agents "architect,coder,security,tester" \
  --create-design-doc \
  --estimate-effort
ドキュメントの更新
# Issue #567: Update API documentation
npx ruv-swarm github issue-init 567 \
  --topology ring \
  --agents "researcher,writer,reviewer" \
  --check-links \
  --validate-examples

スウォーム調整機能

マルチエージェントによる Issue 処理
# Initialize issue-specific swarm with optimal topology
mcp__claude-flow__swarm_init { topology: "hierarchical", maxAgents: 8 }
mcp__claude-flow__agent_spawn { type: "coordinator", name: "Issue Coordinator" }
mcp__claude-flow__agent_spawn { type: "analyst", name: "Issue Analyzer" }
mcp__claude-flow__agent_spawn { type: "coder", name: "Solution Developer" }
mcp__claude-flow__agent_spawn { type: "tester", name: "Validation Engineer" }

# Store issue context in swarm memory
mcp__claude-flow__memory_usage {
  action: "store",
  key: "issue/#{issue_number}$context",
  value: { title: "issue_title", labels: ["labels"], complexity: "high" }
}

# Orchestrate issue resolution workflow
mcp__claude-flow__task_orchestrate {
  task: "Coordinate multi-agent issue resolution with progress tracking",
  strategy: "adaptive",
  priority: "high"
}
スウォームフックの自動統合
// Pre-hook: Issue Analysis and Swarm Setup
const preHook = async (issue) => {
  // Initialize swarm with issue-specific topology
  const topology = determineTopology(issue.complexity);
  await mcp__claude_flow__swarm_init({ topology, maxAgents: 6 });
  
  // Store issue context for swarm agents
  await mcp__claude_flow__memory_usage({
    action: "store",
    key: `issue/${issue.number}$metadata`,
    value: { issue, analysis: await analyzeIssue(issue) }
  });
};

// Post-hook: Progress Updates and Coordination
const postHook = async (results) => {
  // Update issue with swarm progress
  await updateIssueProgress(results);
  
  // Generate follow-up tasks
  await createFollowupTasks(results.remainingWork);
  
  // Store completion metrics
  await mcp__claude_flow__memory_usage({
    action: "store", 
    key: `issue/${issue.number}$completion`,
    value: { metrics: results.metrics, timestamp: Date.now() }
  });
};

関連項目:swarm-pr.md、sync-coordinator.md、workflow-automation.md

コメント