Claude
Skills
Sign in
Back

Group Collaboration

Included with Lifetime
$97 forever

Best practices for inter-group communication, knowledge sharing, and collaborative workflows in four-tier architecture

General

What this skill does


# Group Collaboration Skill

## Overview

This skill provides guidelines, patterns, and best practices for effective collaboration between the four agent groups in the four-tier architecture. It covers communication protocols, knowledge transfer strategies, feedback mechanisms, and coordination patterns that enable autonomous learning and continuous improvement across groups.

## When to Apply This Skill

**Use this skill when:**
- Implementing inter-group communication between any two groups
- Designing handoff protocols between analysis, decision, execution, and validation phases
- Setting up feedback loops for continuous improvement
- Sharing knowledge and patterns across groups
- Coordinating multi-group workflows
- Troubleshooting collaboration issues between groups
- Optimizing group performance through better coordination

**Required for:**
- All agents in four-tier architecture (Groups 1, 2, 3, 4)
- Orchestrator coordination logic
- Cross-group pattern learning
- Workflow optimization

## Four-Tier Architecture Recap

**Group 1: Strategic Analysis & Intelligence (The "Brain")**
- **Role**: Analyze and recommend
- **Output**: Recommendations with confidence scores
- **Key Agents**: code-analyzer, security-auditor, smart-recommender

**Group 2: Decision Making & Planning (The "Council")**
- **Role**: Evaluate and decide
- **Output**: Execution plans with priorities
- **Key Agents**: strategic-planner, preference-coordinator

**Group 3: Execution & Implementation (The "Hand")**
- **Role**: Execute decisions
- **Output**: Execution results with metrics
- **Key Agents**: quality-controller, test-engineer, documentation-generator

**Group 4: Validation & Optimization (The "Guardian")**
- **Role**: Validate and optimize
- **Output**: Validation results and feedback
- **Key Agents**: post-execution-validator, performance-optimizer, continuous-improvement

## Communication Patterns

### Pattern 1: Analysis → Decision (Group 1 → Group 2)

**Purpose**: Transfer analysis findings and recommendations to decision-makers

**Structure**:
```python
from lib.group_collaboration_system import record_communication

record_communication(
    from_agent="code-analyzer",  # Group 1
    to_agent="strategic-planner",  # Group 2
    task_id=task_id,
    communication_type="recommendation",
    message="Code analysis complete with 5 recommendations",
    data={
        "quality_score": 72,
        "recommendations": [
            {
                "type": "refactoring",
                "priority": "high",
                "confidence": 0.92,  # High confidence
                "description": "Extract login method complexity",
                "rationale": "Cyclomatic complexity 15, threshold 10",
                "estimated_effort_hours": 2.5,
                "expected_impact": "high",
                "files_affected": ["src/auth.py"]
            }
        ],
        "patterns_detected": ["token_auth", "validation_duplication"],
        "metrics": {
            "complexity_avg": 8.5,
            "duplication_rate": 0.12,
            "test_coverage": 0.78
        }
    }
)
```

**Best Practices**:
- Always include confidence scores (0.0-1.0)
- Provide rationale for each recommendation
- Include estimated effort and expected impact
- Attach relevant metrics and context
- Reference detected patterns
- List affected files

**Anti-Patterns to Avoid**:
- ❌ Recommendations without confidence scores
- ❌ Missing rationale or context
- ❌ Vague impact estimates ("it will be better")
- ❌ No prioritization
- ❌ Execution commands (that's Group 3's job)

### Pattern 2: Decision → Execution (Group 2 → Group 3)

**Purpose**: Communicate execution plan with priorities and user preferences

**Structure**:
```python
record_communication(
    from_agent="strategic-planner",  # Group 2
    to_agent="quality-controller",  # Group 3
    task_id=task_id,
    communication_type="execution_plan",
    message="Execute quality improvement plan with 3 priorities",
    data={
        "decision_rationale": "High-priority refactoring based on user preferences",
        "execution_plan": {
            "quality_targets": {
                "tests": 80,
                "standards": 90,
                "documentation": 70
            },
            "priority_order": [
                "fix_failing_tests",  # Highest priority
                "apply_code_standards",
                "add_missing_docs"
            ],
            "approach": "incremental",  # or "comprehensive"
            "risk_tolerance": "low"  # User preference
        },
        "user_preferences": {
            "auto_fix_threshold": 0.9,
            "coding_style": "concise",
            "comment_level": "moderate",
            "documentation_level": "standard"
        },
        "constraints": {
            "max_iterations": 3,
            "time_budget_minutes": 15,
            "files_in_scope": ["src/auth.py", "src/utils.py"]
        },
        "decision_confidence": 0.88
    }
)
```

**Best Practices**:
- Include clear execution plan with priorities
- Apply user preferences to the plan
- Set realistic constraints (time, iterations)
- Provide decision rationale
- Specify risk tolerance
- Define success criteria

**Anti-Patterns to Avoid**:
- ❌ Plans without priorities
- ❌ Missing user preferences
- ❌ Unrealistic constraints
- ❌ No success criteria
- ❌ Ambiguous instructions

### Pattern 3: Execution → Validation (Group 3 → Group 4)

**Purpose**: Send execution results for validation and quality assessment

**Structure**:
```python
record_communication(
    from_agent="quality-controller",  # Group 3
    to_agent="post-execution-validator",  # Group 4
    task_id=task_id,
    communication_type="execution_result",
    message="Quality improvement complete: 68 → 84",
    data={
        "metrics_before": {
            "quality_score": 68,
            "tests_passing": 45,
            "standards_violations": 23,
            "doc_coverage": 0.60
        },
        "metrics_after": {
            "quality_score": 84,
            "tests_passing": 50,
            "standards_violations": 2,
            "doc_coverage": 0.75
        },
        "changes_made": {
            "tests_fixed": 5,
            "standards_violations_fixed": 21,
            "docs_generated": 10
        },
        "files_modified": ["src/auth.py", "tests/test_auth.py"],
        "auto_corrections_applied": 30,
        "manual_review_needed": [],
        "iterations_used": 2,
        "execution_time_seconds": 145,
        "component_scores": {
            "tests": 28,
            "standards": 22,
            "documentation": 16,
            "patterns": 13,
            "code_metrics": 5
        },
        "issues_encountered": []
    }
)
```

**Best Practices**:
- Show before/after metrics clearly
- List all changes made
- Include execution statistics
- Report any issues encountered
- Specify files modified
- Break down component scores

**Anti-Patterns to Avoid**:
- ❌ Only showing final metrics without before state
- ❌ Missing execution time and iterations
- ❌ No breakdown of what was changed
- ❌ Hiding issues or failures
- ❌ Incomplete component scoring

### Pattern 4: Validation → Analysis (Group 4 → Group 1)

**Purpose**: Provide feedback on recommendation effectiveness for learning

**Structure**:
```python
from lib.agent_feedback_system import add_feedback

add_feedback(
    from_agent="post-execution-validator",  # Group 4
    to_agent="code-analyzer",  # Group 1
    task_id=task_id,
    feedback_type="success",  # or "improvement", "warning", "error"
    message="Recommendations were highly effective",
    details={
        "recommendations_followed": 3,
        "recommendations_effective": 3,
        "quality_improvement": 16,  # points improved
        "execution_smooth": True,
        "user_satisfaction": "high",
        "suggestions_for_improvement": []
    },
    impact="quality_score +16, all recommendations effective"
)
```

**Best Practices**:
- Specific feedback on

Related in General