teamwork

ClawSkills 作者 clawskills

Dynamically creates and manages AI agent teams for complex tasks. Invoke when user requests multi-agent collaboration, complex project execution, or when tasks require specialized roles and coordinated workflow.

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install clawskills:clawskills~chenxinbest-teamwork
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/clawskills%3Aclawskills~chenxinbest-teamwork/file -o chenxinbest-teamwork.md
# Teamwork Skill

This skill enables dynamic team creation and management for executing complex engineering tasks through coordinated AI agents with intelligent model selection, cost optimization, and continuous performance evaluation.

## When to Invoke

Invoke this skill when:
- User requests execution of complex projects requiring multiple specialized roles
- Tasks need to be broken down into coordinated steps (analysis, design, implementation, testing, review)
- User wants to leverage multiple AI models/providers for optimal cost-performance balance
- Projects require structured workflow with quality assurance and iteration

## Initialization & Configuration Management

### Automatic Initialization

**IMPORTANT**: This skill includes an autonomous initialization system. When invoked for the first time or when configuration is missing, it will automatically:

1. **Check Configuration Status**
   - Verify if `.trae/config/providers.json` exists
   - Verify if `.trae/config/team-roles.json` exists
   - Verify if `.trae/data/model_scores.json` exists

2. **Interactive Setup Process**
   If configuration files are missing or incomplete, the skill will proactively ask the user:

   **Step 1: Provider Setup**
   - Ask: "Which AI providers would you like to configure? (e.g., OpenAI, Anthropic, Google, Azure, etc.)"
   - For each provider, collect:
     - Provider name
     - API key (or environment variable name)
     - Base URL (if custom endpoint)
   
   **Step 2: Model Configuration**
   For each provider, ask:
   - "Which models from [provider] would you like to use?"
   - For each model, collect:
     - Model name/identifier
     - Pricing model type (subscription/tiered_usage/pay_per_use)
     - Pricing details based on type:
       - **Subscription**: cost, start date, end date
       - **Tiered Usage**: daily quota, monthly quota, overage rate
       - **Pay-Per-Use**: input cost per 1k tokens, output cost per 1k tokens
     - Capabilities (e.g., reasoning, coding, fast-response)
     - Maximum concurrent tasks
   
   **Step 3: Host Model Selection**
   - Ask: "Which model should serve as the primary interface (host model)?"
   - Present list of configured models
   - User selects one as the main interaction point
   
   **Step 4: Budget Configuration**
   - Ask: "What is your monthly budget limit? (optional)"
   - Set alert thresholds

3. **Configuration Persistence**
   - Save all configurations to `.trae/config/providers.json`
   - Create default role definitions in `.trae/config/team-roles.json`
   - Initialize empty scores database in `.trae/data/model_scores.json`
   - Confirm successful setup with user

### Configuration Management Commands

Users can manage their configuration at any time using these commands:

**View Configuration**
```
User: "Show me my current provider and model configuration"
```
Response: Display complete configuration from `.trae/config/providers.json`

**Add Provider**
```
User: "Add a new provider: [provider name]"
```
Action: Interactive prompts for provider details, then append to configuration

**Add Model**
```
User: "Add model [model name] to provider [provider name]"
```
Action: Interactive prompts for model details, then add to provider's model list

**Update Model Pricing**
```
User: "Update pricing for [model name]"
```
Action: Ask for new pricing details and update configuration

**Remove Model**
```
User: "Remove model [model name] from provider [provider name]"
```
Action: Confirm and remove from configuration

**Change Host Model**
```
User: "Change the host model to [model name]"
```
Action: Update host_model configuration

**View Model Scores**
```
User: "Show me the performance scores for all models"
```
Response: Display current model capability scores from `.trae/data/model_scores.json`

**Reset Configuration**
```
User: "Reset all configurations to default"
```
Action: Confirm with user, then reinitialize

### Configuration File Structure

**Provider Configuration** (`.trae/config/providers.json`)
```json
{
  "version": "1.0",
  "last_updated": "2026-02-12T11:00:00Z",
  "providers": [
    {
      "name": "openai",
      "api_key": "${OPENAI_API_KEY}",
      "base_url": "https://api.openai.com/v1",
      "models": [
        {
          "name": "gpt-4",
          "pricing_model": "pay_per_use",
          "input_cost_per_1k": 0.03,
          "output_cost_per_1k": 0.06,
          "context_window": 128000,
          "capabilities": ["reasoning", "coding", "analysis"],
          "max_concurrent_tasks": 3
        }
      ]
    }
  ],
  "host_model": {
    "provider": "openai",
    "model": "gpt-4"
  },
  "budget": {
    "max_monthly_cost": 100.00,
    "currency": "USD",
    "alert_threshold": 0.8
  }
}
```

**Team Roles Configuration** (`.trae/config/team-roles.json`)
```json
{
  "version": "1.0",
  "last_updated": "2026-02-12T11:00:00Z",
  "roles": {
    "project_manager": {
      "description": "Coordinates team activities and manages timeline",
      "required_capabilities": ["planning", "coordination", "communication"],
      "preferred_model_traits": {
        "reliability": "high",
        "thinking_depth": "medium",
        "response_speed": "medium"
      }
    }
  }
}
```

**Model Scores Database** (`.trae/data/model_scores.json`)
```json
{
  "version": "1.0",
  "last_updated": "2026-02-12T11:00:00Z",
  "evaluation_interval": 3600,
  "scores": {}
}
```

### Initialization Checklist

Before executing any team task, verify:

- [ ] `.trae/config/providers.json` exists and contains at least one provider
- [ ] At least one model is configured
- [ ] Host model is designated
- [ ] `.trae/config/team-roles.json` exists with role definitions
- [ ] `.trae/data/model_scores.json` exists (can be empty initially)

If any checklist item fails, trigger interactive initialization.

## Core System Components

### 1. Model Performance Evaluation System

#### Multi-Dimensional Scoring
All models are periodically evaluated by peer models across multiple dimensions:

**Evaluation Dimensions:**
- **Response Speed**: How quickly the model responds to requests
- **Response Frequency**: Rate of successful responses within time windows
- **Thinking Depth**: Quality of reasoning and problem-solving approach
- **Multi-threading Capability**: Ability to handle parallel tasks
- **Code Quality**: Quality of generated code (for coding tasks)
- **Creativity**: Novelty and innovation in solutions
- **Reliability**: Consistency in performance across sessions
- **Context Understanding**: Ability to maintain context over long conversations

**Scoring Mechanism:**
- Each model scores other models on a scale (e.g., 1-10) for each dimension
- Scores are aggregated using weighted average
- Evaluations occur after each task completion
- Historical scores are maintained with decay factor for recent performance
- Final capability score = weighted sum of all dimension scores

**Score Storage:**
```json
{
  "model_scores": {
    "gpt-4": {
      "response_speed": 8.5,
      "response_frequency": 9.0,
      "thinking_depth": 9.5,
      "multi_threading": 7.0,
      "code_quality": 9.0,
      "creativity": 8.5,
      "reliability": 9.5,
      "context_understanding": 9.0,
      "overall_score": 8.75,
      "evaluation_count": 42,
      "last_updated": "2026-02-12T10:30:00Z"
    }
  }
}
```

### 2. Cost Calculation System

#### Pricing Models

**Subscription-Based (订阅制)**
- Fixed cost for unlimited usage during subscription period
- Lowest effective cost per request when fully utilized
- Marked as expired after subscription ends → excluded from team
- Configuration:
```json
{
  "pricing_model": "subscription",
  "cost": 20.00,
  "currency": "USD",
  "valid_from": "2026-02-01",
  "valid_until": "2026-03-01",
  "status": "active"
}
```

**Tiered Usage (阶段用量制)**
- Lower cost with daily/monthly quotas
- Medium cost effectiveness
- Must monitor quota usage daily
- Configuration:
```json
{
  "pricing_model": "tiered_usage",
  "daily_quota": 1000