agent-swarm-issue

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

name: swarm-issue description: GitHub issue-based swarm coordination agent that transforms issues into intelligent multi-agent tasks with automatic decomposition and progress tracking 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:
    • "Initialize swarm coordination system for GitHub issue management"
    • "Analyze issue context and determine optimal swarm topology"
    • "Store issue metadata in swarm memory for cross-agent access" post:
    • "Update issue with swarm progress and agent assignments"
    • "Create follow-up tasks based on swarm analysis results"
    • "Generate comprehensive swarm coordination report"


name: swarm-issue description: GitHub issue-based swarm coordination agent that transforms issues into intelligent multi-agent tasks with automatic decomposition and progress tracking 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:
    • "Initialize swarm coordination system for GitHub issue management"
    • "Analyze issue context and determine optimal swarm topology"
    • "Store issue metadata in swarm memory for cross-agent access" post:
    • "Update issue with swarm progress and agent assignments"
    • "Create follow-up tasks based on swarm analysis results"
    • "Generate comprehensive swarm coordination report"

Swarm Issue - Issue-Based Swarm Coordination

Swarm Issue - 基于Issue的集群协调

Overview

概述

Transform GitHub Issues into intelligent swarm tasks, enabling automatic task decomposition and agent coordination with advanced multi-agent orchestration.
将GitHub Issues转换为智能集群任务,通过高级多Agent编排实现自动任务分解和Agent协调。

Core Features

核心功能

1. Issue-to-Swarm Conversion

1. Issue到Swarm的转换

bash
undefined
bash
undefined

Create swarm from issue using gh CLI

Create swarm from issue using gh CLI

Get issue details

Get issue details

ISSUE_DATA=$(gh issue view 456 --json title,body,labels,assignees,comments)
ISSUE_DATA=$(gh issue view 456 --json title,body,labels,assignees,comments)

Create swarm from issue

Create swarm from issue

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

Batch process multiple issues

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
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

Update issues with swarm status

echo "$ISSUES" | jq -r '.[].number' | while read -r num; do gh issue edit $num --add-label "swarm-processing" done
undefined
echo "$ISSUES" | jq -r '.[].number' | while read -r num; do gh issue edit $num --add-label "swarm-processing" done
undefined

2. Issue Comment Commands

2. Issue评论命令

Execute swarm operations via issue comments:
markdown
<!-- In issue comment -->
$swarm analyze
$swarm decompose 5
$swarm assign @agent-coder
$swarm estimate
$swarm start
通过Issue评论执行集群操作:
markdown
<!-- In issue comment -->
$swarm analyze
$swarm decompose 5
$swarm assign @agent-coder
$swarm estimate
$swarm start

3. Issue Templates for Swarms

3. 用于Swarm的Issue模板

markdown
<!-- .github/ISSUE_TEMPLATE$swarm-task.yml -->
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
markdown
<!-- .github/ISSUE_TEMPLATE$swarm-task.yml -->
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 Label Automation

Issue标签自动化

Auto-Label Based on Content

基于内容的自动标签

javascript
// .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"]
    }
  ]
}
javascript
// .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"]
    }
  ]
}

Dynamic Agent Assignment

动态Agent分配

bash
undefined
bash
undefined

Assign agents based on issue content

Assign agents based on issue content

npx ruv-swarm github issue-analyze 456
--suggest-agents
--estimate-complexity
--create-subtasks
undefined
npx ruv-swarm github issue-analyze 456
--suggest-agents
--estimate-complexity
--create-subtasks
undefined

Issue Swarm Commands

Issue集群命令

Initialize from Issue

从Issue初始化

bash
undefined
bash
undefined

Create swarm with full issue context using gh CLI

Create swarm with full issue context using gh CLI

Get complete issue data

Get complete issue data

ISSUE=$(gh issue view 456 --json title,body,labels,assignees,comments,projectItems)
ISSUE=$(gh issue view 456 --json title,body,labels,assignees,comments,projectItems)

Get referenced issues and PRs

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 '.')
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

Initialize swarm

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

Add swarm initialization comment

Add swarm initialization comment

gh issue comment 456 --body "🐝 Swarm initialized for this issue"
undefined
gh issue comment 456 --body "🐝 Swarm initialized for this issue"
undefined

Task Decomposition

任务分解

bash
undefined
bash
undefined

Break down issue into subtasks with gh CLI

Break down issue into subtasks with gh CLI

Get issue body

Get issue body

ISSUE_BODY=$(gh issue view 456 --json body --jq '.body')
ISSUE_BODY=$(gh issue view 456 --json body --jq '.body')

Decompose into subtasks

Decompose into subtasks

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

Update issue with checklist

Update issue with checklist

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

Subtasks

Subtasks

$CHECKLIST"
gh issue edit 456 --body "$UPDATED_BODY"
$CHECKLIST"
gh issue edit 456 --body "$UPDATED_BODY"

Create linked issues for major subtasks

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
undefined
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
undefined

Progress Tracking

进度跟踪

bash
undefined
bash
undefined

Update issue with swarm progress using gh CLI

Update issue with swarm progress using gh CLI

Get current issue state

Get current issue state

CURRENT=$(gh issue view 456 --json body,labels)
CURRENT=$(gh issue view 456 --json body,labels)

Get swarm progress

Get swarm progress

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

Update checklist in issue body

Update checklist in issue body

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

Edit issue with updated body

Edit issue with updated body

gh issue edit 456 --body "$UPDATED_BODY"
gh issue edit 456 --body "$UPDATED_BODY"

Post progress summary as comment

Post progress summary as comment

SUMMARY=$(echo "$PROGRESS" | jq -r ' "## 📊 Progress Update
Completion: (.completion)% ETA: (.eta)
SUMMARY=$(echo "$PROGRESS" | jq -r ' "## 📊 Progress Update
Completion: (.completion)% ETA: (.eta)

Completed Tasks

Completed Tasks

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

In Progress

In Progress

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

Remaining

Remaining

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

🤖 Automated update by swarm agent"')
gh issue comment 456 --body "$SUMMARY"
(.remaining | map("- ⏳ " + .) | join("\n"))

🤖 Automated update by swarm agent"')
gh issue comment 456 --body "$SUMMARY"

Update labels based on progress

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
undefined
if [[ $(echo "$PROGRESS" | jq -r '.completion') -eq 100 ]]; then gh issue edit 456 --add-label "ready-for-review" --remove-label "in-progress" fi
undefined

Advanced Features

高级功能

1. Issue Dependencies

1. Issue依赖关系

bash
undefined
bash
undefined

Handle issue dependencies

Handle issue dependencies

npx ruv-swarm github issue-deps 456
--resolve-order
--parallel-safe
--update-blocking
undefined
npx ruv-swarm github issue-deps 456
--resolve-order
--parallel-safe
--update-blocking
undefined

2. Epic Management

2. Epic管理

bash
undefined
bash
undefined

Coordinate epic-level swarms

Coordinate epic-level swarms

npx ruv-swarm github epic-swarm
--epic 123
--child-issues "456,457,458"
--orchestrate
undefined
npx ruv-swarm github epic-swarm
--epic 123
--child-issues "456,457,458"
--orchestrate
undefined

3. Issue Templates

3. Issue模板

bash
undefined
bash
undefined

Generate issue from swarm analysis

Generate issue from swarm analysis

npx ruv-swarm github create-issues
--from-analysis
--template "bug-report"
--auto-assign
undefined
npx ruv-swarm github create-issues
--from-analysis
--template "bug-report"
--auto-assign
undefined

Workflow Integration

工作流集成

GitHub Actions for Issues

用于Issues的GitHub Actions

yaml
undefined
yaml
undefined

.github$workflows$issue-swarm.yml

.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
undefined
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
undefined

Issue Board Integration

Issue看板集成

bash
undefined
bash
undefined

Sync with project board

Sync with project board

npx ruv-swarm github issue-board-sync
--project "Development"
--column-mapping '{ "To Do": "pending", "In Progress": "active", "Done": "completed" }'
undefined
npx ruv-swarm github issue-board-sync
--project "Development"
--column-mapping '{ "To Do": "pending", "In Progress": "active", "Done": "completed" }'
undefined

Issue Types & Strategies

Issue类型与策略

Bug Reports

Bug报告

bash
undefined
bash
undefined

Specialized bug handling

Specialized bug handling

npx ruv-swarm github bug-swarm 456
--reproduce
--isolate
--fix
--test
undefined
npx ruv-swarm github bug-swarm 456
--reproduce
--isolate
--fix
--test
undefined

Feature Requests

功能请求

bash
undefined
bash
undefined

Feature implementation swarm

Feature implementation swarm

npx ruv-swarm github feature-swarm 456
--design
--implement
--document
--demo
undefined
npx ruv-swarm github feature-swarm 456
--design
--implement
--document
--demo
undefined

Technical Debt

技术债务

bash
undefined
bash
undefined

Refactoring swarm

Refactoring swarm

npx ruv-swarm github debt-swarm 456
--analyze-impact
--plan-migration
--execute
--validate
undefined
npx ruv-swarm github debt-swarm 456
--analyze-impact
--plan-migration
--execute
--validate
undefined

Automation Examples

自动化示例

Auto-Close Stale Issues

自动关闭陈旧Issue

bash
undefined
bash
undefined

Process stale issues with swarm using gh CLI

Process stale issues with swarm using gh CLI

Find stale issues

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")")
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

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
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

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
undefined
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
undefined

Issue Triage

Issue分类

bash
undefined
bash
undefined

Automated triage system

Automated triage system

npx ruv-swarm github triage
--unlabeled
--analyze-content
--suggest-labels
--assign-priority
undefined
npx ruv-swarm github triage
--unlabeled
--analyze-content
--suggest-labels
--assign-priority
undefined

Duplicate Detection

重复检测

bash
undefined
bash
undefined

Find duplicate issues

Find duplicate issues

npx ruv-swarm github find-duplicates
--threshold 0.8
--link-related
--close-duplicates
undefined
npx ruv-swarm github find-duplicates
--threshold 0.8
--link-related
--close-duplicates
undefined

Integration Patterns

集成模式

1. Issue-PR Linking

1. Issue与PR关联

bash
undefined
bash
undefined

Link issues to PRs automatically

Link issues to PRs automatically

npx ruv-swarm github link-pr
--issue 456
--pr 789
--update-both
undefined
npx ruv-swarm github link-pr
--issue 456
--pr 789
--update-both
undefined

2. Milestone Coordination

2. 里程碑协调

bash
undefined
bash
undefined

Coordinate milestone swarms

Coordinate milestone swarms

npx ruv-swarm github milestone-swarm
--milestone "v2.0"
--parallel-issues
--track-progress
undefined
npx ruv-swarm github milestone-swarm
--milestone "v2.0"
--parallel-issues
--track-progress
undefined

3. Cross-Repo Issues

3. 跨仓库Issues

bash
undefined
bash
undefined

Handle issues across repositories

Handle issues across repositories

npx ruv-swarm github cross-repo
--issue "org$repo#456"
--related "org$other-repo#123"
--coordinate
undefined
npx ruv-swarm github cross-repo
--issue "org$repo#456"
--related "org$other-repo#123"
--coordinate
undefined

Metrics & Analytics

指标与分析

Issue Resolution Time

Issue解决时间

bash
undefined
bash
undefined

Analyze swarm performance

Analyze swarm performance

npx ruv-swarm github issue-metrics
--issue 456
--metrics "time-to-close,agent-efficiency,subtask-completion"
undefined
npx ruv-swarm github issue-metrics
--issue 456
--metrics "time-to-close,agent-efficiency,subtask-completion"
undefined

Swarm Effectiveness

Swarm有效性

bash
undefined
bash
undefined

Generate effectiveness report

Generate effectiveness report

npx ruv-swarm github effectiveness
--issues "closed:>2024-01-01"
--compare "with-swarm,without-swarm"
undefined
npx ruv-swarm github effectiveness
--issues "closed:>2024-01-01"
--compare "with-swarm,without-swarm"
undefined

Best Practices

最佳实践

1. Issue Templates

1. Issue模板

  • Include swarm configuration options
  • Provide task breakdown structure
  • Set clear acceptance criteria
  • Include complexity estimates
  • 包含Swarm配置选项
  • 提供任务分解结构
  • 设置明确的验收标准
  • 包含复杂度估算

2. Label Strategy

2. 标签策略

  • Use consistent swarm-related labels
  • Map labels to agent types
  • Priority indicators for swarm
  • Status tracking labels
  • 使用一致的Swarm相关标签
  • 将标签映射到Agent类型
  • Swarm的优先级指示器
  • 状态跟踪标签

3. Comment Etiquette

3. 评论规范

  • Clear command syntax
  • Progress updates in threads
  • Summary comments for decisions
  • Link to relevant PRs
  • 清晰的命令语法
  • 线程中的进度更新
  • 决策的总结评论
  • 关联到相关PR

Security & Permissions

安全与权限

  1. Command Authorization: Validate user permissions before executing commands
  2. Rate Limiting: Prevent spam and abuse of issue commands
  3. Audit Logging: Track all swarm operations on issues
  4. Data Privacy: Respect private repository settings
  1. 命令授权:执行命令前验证用户权限
  2. 速率限制:防止Issue命令被滥用和垃圾信息
  3. 审计日志:跟踪所有针对Issues的Swarm操作
  4. 数据隐私:尊重私有仓库设置

Examples

示例

Complex Bug Investigation

复杂Bug调查

bash
undefined
bash
undefined

Issue #789: Memory leak in production

Issue #789: Memory leak in production

npx ruv-swarm github issue-init 789
--topology hierarchical
--agents "debugger,analyst,tester,monitor"
--priority critical
--reproduce-steps
undefined
npx ruv-swarm github issue-init 789
--topology hierarchical
--agents "debugger,analyst,tester,monitor"
--priority critical
--reproduce-steps
undefined

Feature Implementation

功能实现

bash
undefined
bash
undefined

Issue #234: Add OAuth integration

Issue #234: Add OAuth integration

npx ruv-swarm github issue-init 234
--topology mesh
--agents "architect,coder,security,tester"
--create-design-doc
--estimate-effort
undefined
npx ruv-swarm github issue-init 234
--topology mesh
--agents "architect,coder,security,tester"
--create-design-doc
--estimate-effort
undefined

Documentation Update

文档更新

bash
undefined
bash
undefined

Issue #567: Update API documentation

Issue #567: Update API documentation

npx ruv-swarm github issue-init 567
--topology ring
--agents "researcher,writer,reviewer"
--check-links
--validate-examples
undefined
npx ruv-swarm github issue-init 567
--topology ring
--agents "researcher,writer,reviewer"
--check-links
--validate-examples
undefined

Swarm Coordination Features

Swarm协调功能

Multi-Agent Issue Processing

多Agent Issue处理

bash
undefined
bash
undefined

Initialize issue-specific swarm with optimal topology

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" }
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

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" } }
mcp__claude-flow__memory_usage { action: "store", key: "issue/#{issue_number}$context", value: { title: "issue_title", labels: ["labels"], complexity: "high" } }

Orchestrate issue resolution workflow

Orchestrate issue resolution workflow

mcp__claude-flow__task_orchestrate { task: "Coordinate multi-agent issue resolution with progress tracking", strategy: "adaptive", priority: "high" }
undefined
mcp__claude-flow__task_orchestrate { task: "Coordinate multi-agent issue resolution with progress tracking", strategy: "adaptive", priority: "high" }
undefined

Automated Swarm Hooks Integration

自动化Swarm钩子集成

javascript
// 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() }
  });
};
See also: swarm-pr.md, sync-coordinator.md, workflow-automation.md
javascript
// 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