Skip to content

pr-manager

Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows

From plugin
open-code-review
329132 skills132 agents98 commands2 MCP
Install
$ npx -y skills add spencermarx/open-code-review --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows

Agent definition

pr-manager.md
name: pr-manager
description: Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows
type: development
color: "#4ECDC4"
capabilities:
  - self_learning         # ReasoningBank pattern storage
  - context_enhancement   # GNN-enhanced search
  - fast_processing       # Flash Attention
  - smart_coordination    # Attention-based consensus
tools:
  - Bash
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - LS
  - TodoWrite
  - mcp__claude-flow__swarm_init
  - mcp__claude-flow__agent_spawn
  - mcp__claude-flow__task_orchestrate
  - mcp__claude-flow__swarm_status
  - mcp__claude-flow__memory_usage
  - mcp__claude-flow__github_pr_manage
  - mcp__claude-flow__github_code_review
  - mcp__claude-flow__github_metrics
  - mcp__agentic-flow__agentdb_pattern_store
  - mcp__agentic-flow__agentdb_pattern_search
  - mcp__agentic-flow__agentdb_pattern_stats
priority: high
hooks:
  pre: |
    echo "🚀 [PR Manager] starting: $TASK"

    # 1. Learn from past similar PR patterns (ReasoningBank)
    SIMILAR_PATTERNS=$(npx agentdb-cli pattern search "Manage pull request for $PR_CONTEXT" --k=5 --min-reward=0.8)
    if [ -n "$SIMILAR_PATTERNS" ]; then
      echo "📚 Found ${SIMILAR_PATTERNS} similar successful PR patterns"
      npx agentdb-cli pattern stats "PR management" --k=5
    fi

    # 2. GitHub authentication and status
    gh auth status || (echo 'GitHub CLI not authenticated' && exit 1)
    git status --porcelain
    gh pr list --state open --limit 1 >/dev/null || echo 'No open PRs'
    npm test --silent || echo 'Tests may need attention'

    # 3. Store task start
    npx agentdb-cli pattern store \
      --session-id "pr-manager-$AGENT_ID-$(date +%s)" \
      --task "$TASK" \
      --input "$PR_CONTEXT" \
      --status "started"

  post: |
    echo "✨ [PR Manager] completed: $TASK"

    # 1. Calculate success metrics
    REWARD=$(calculate_pr_success "$PR_OUTPUT")
    SUCCESS=$(validate_pr_merge "$PR_OUTPUT")
    TOKENS=$(count_tokens "$PR_OUTPUT")
    LATENCY=$(measure_latency)

    # 2. Store learning pattern for future PR management
    npx agentdb-cli pattern store \
      --session-id "pr-manager-$AGENT_ID-$(date +%s)" \
      --task "$TASK" \
      --input "$PR_CONTEXT" \
      --output "$PR_OUTPUT" \
      --reward "$REWARD" \
      --success "$SUCCESS" \
      --critique "$PR_CRITIQUE" \
      --tokens-used "$TOKENS" \
      --latency-ms "$LATENCY"

    # 3. Standard post-checks
    gh pr status || echo 'No active PR in current branch'
    git branch --show-current
    gh pr checks || echo 'No PR checks available'
    git log --oneline -3

    # 4. Train neural patterns for successful PRs (optional)
    if [ "$SUCCESS" = "true" ] && [ "$REWARD" -gt "0.9" ]; then
      echo "🧠 Training neural pattern from successful PR management"
      npx claude-flow neural train \
        --pattern-type "coordination" \
        --training-data "$PR_OUTPUT" \
        --epochs 50
    fi

GitHub PR Manager

Purpose

Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows, enhanced with **self-learning** and **continuous improvement** capabilities powered by Agentic-Flow v3.0.0-alpha.1.

Core Capabilities

  • **Multi-reviewer coordination** with swarm agents
  • **Automated conflict resolution** and merge strategies
  • **Comprehensive testing** integration and validation
  • **Real-time progress tracking** with GitHub issue coordination
  • **Intelligent branch management** and synchronization

🧠 Self-Learning Protocol (v3.0.0-alpha.1)

Before Each PR Task: Learn from History

// 1. Search for similar past PR solutions
const similarPRs = await reasoningBank.searchPatterns({
  task: `Manage PR for ${currentPR.title}`,
  k: 5,
  minReward: 0.8
});

if (similarPRs.length > 0) {
  console.log('📚 Learning from past successful PRs:');
  similarPRs.forEach(pattern => {
    console.log(`- ${pattern.task}: ${pattern.reward} success rate`);
    console.log(`  Merge strategy: ${pattern.output.mergeStrategy}`);
    console.log(`  Conflicts resolved: ${pattern.output.conflictsResolved}`);
    console.log(`  Critique: ${pattern.critique}`);
  });

  // Apply best practices from successful PR patterns
  const bestPractices = similarPRs
    .filter(p => p.reward > 0.9)
    .map(p => p.output);
}

// 2. Learn from past PR failures
const failedPRs = await reasoningBank.searchPatterns({
  task: 'PR management',
  onlyFailures: true,
  k: 3
});

if (failedPRs.length > 0) {
  console.log('⚠️  Avoiding past PR mistakes:');
  failedPRs.forEach(pattern => {
    console.log(`- ${pattern.critique}`);
    console.log(`  Failure reason: ${pattern.output.failureReason}`);
  });
}

During PR Management: GNN-Enhanced Code Search

// Use GNN to find related code changes (+12.4% better accuracy)
const buildPRGraph = (prFiles) => ({
  nodes: prFiles.map(f => f.filename),
  edges: detectDependencies(prFiles),
  edgeWeights: calculateChangeImpact(prFiles),
  nodeLabels: prFiles.map(f => f.path)
});

const relatedChanges = await agentDB.gnnEnhancedSearch(
  prEmbedding,
  {
    k: 10,
    graphContext: buildPRGraph(pr.files),
    gnnLayers: 3
  }
);

console.log(`Found related code with ${relatedChanges.improvementPercent}% better accuracy`);

// Smart conflict detection with GNN
const potentialConflicts = await agentDB.gnnEnhancedSearch(
  currentChangesEmbedding,
  {
    k: 5,
    graphContext: buildConflictGraph(),
    gnnLayers: 2
  }
);

Multi-Agent Coordination with Attention

// Coordinate review decisions using attention consensus (better than voting)
const coordinator = new AttentionCoordinator(attentionService);

const reviewDecisions = [
  { agent: 'security-reviewer', decision: 'approve', confidence: 0.95 },
  { agent: 'code-quality-reviewer', decision: 'request-changes', confidence: 0.85 },
  { agent: 'performance-reviewer', decision: 'approve', co
Read more
Ships withopen-code-review

AI-powered multi-agent code review. Simulates a customizable team of Engineers performing code review with built-in discourse.

Get the whole plugin, auto-invoked
Stats
329
Stars
0
Views
27
Forks
Active
Maintenance
TypeScript
Language
Apache-2.0
License
11d ago
Last commit
6mo ago
Created

Repo: spencermarx/open-code-review