Claude
Skills
Sign in
Back

orchestrator-subsystems

Included with Lifetime
$97 forever

Orchestrator subsystem details including automatic learning integration, performance recording, validation, interactive suggestions, gitignore management, and workspace health monitoring.

General

What this skill does


# Orchestrator Subsystems Reference

This skill documents the orchestrator's subsystems that handle specialized tasks:
- Automatic learning integration
- Performance recording
- Validation integration
- Interactive suggestions
- .gitignore management
- Workspace health monitoring

## Automatic Learning Integration

**CRITICAL**: After every task completion, **automatically and silently** trigger the learning engine and performance recording:

```javascript
// This happens AUTOMATICALLY after every task - no user confirmation needed
async function complete_task(task_data) {
  const start_time = Date.now()

  // 1. Execute main task
  const result = await execute_task(task_data)

  // 2. Run quality assessment
  const quality = await assess_quality(result)
  const end_time = Date.now()

  // 3. AUTOMATIC PERFORMANCE RECORDING (Silent Background)
  const performance_data = {
    task_type: task_data.type || classify_task(task_data.description),
    description: task_data.description,
    complexity: assess_complexity(task_data),
    duration: Math.round((end_time - start_time) / 1000), // seconds
    success: quality.overall_score >= 70,
    skills_used: this.loaded_skills || [],
    agents_delegated: this.delegated_agents || [],
    files_modified: task_data.files_modified || 0,
    lines_changed: task_data.lines_changed || 0,
    quality_improvement: quality.improvement || 0,
    issues_found: quality.issues_found || [],
    recommendations: quality.recommendations || [],
    best_practices_followed: quality.best_practices_met || true,
    documentation_updated: task_data.documentation_updated || false,
    timestamp: new Date().toISOString()
  }

  // Record performance metrics (compatible with dashboard)
  await record_task_performance(performance_data, detect_current_model())

  // 4. AUTOMATIC GIT ACTIVITY MONITORING (Silent Background)
  // Capture any git-based activities that might have been missed
  await run_automatic_activity_recording()

  // 5. AUTOMATIC LEARNING (Silent Background)
  await delegate_to_learning_engine({
    task: task_data,
    result: result,
    quality: quality,
    performance: performance_data,
    skills_used: this.loaded_skills,
    agents_delegated: this.delegated_agents,
    duration: performance_data.duration
  })
  // Learning engine runs silently - no output to user

  // 5. Return results to user
  return result
}
```

**Learning & Performance Recording Happen Every Time**:
- ✓ After successful tasks → Learn what worked + record performance
- ✓ After failed tasks → Learn what to avoid + record failure patterns
- ✓ After quality checks → Learn quality patterns + record quality metrics
- ✓ After delegations → Learn agent effectiveness + record delegation performance
- ✓ After skill usage → Learn skill effectiveness + record skill performance
- ✓ After ANY task → Automatic performance recording for dashboard display
- ✓ Git commits → Automatic capture of code changes and version updates
- ✓ All file modifications → Comprehensive activity tracking

**User Never Sees Learning or Recording**:
- Learning and recording are background processes
- No "learning..." or "recording..." messages to user
- No interruption of workflow
- Just silent continuous improvement
- Results show in better performance over time
- Dashboard automatically updates with new performance data

**Performance Recording Benefits**:
- Dashboard shows all task types, not just assessments
- Real-time performance tracking without manual commands
- Historical performance data for trend analysis
- Model-specific performance metrics
- Task-type specific performance insights
- Automatic quality improvement tracking

## Automatic Performance Recording Integration (v2.1+)

**CRITICAL**: Every task automatically records performance metrics for dashboard display and trend analysis.

### Performance Data Capture

**Task Metrics Collected**:
```javascript
const performance_metrics = {
  // Task Classification
  task_type: classify_task(task_data.description),  // refactoring, coding, documentation, etc.
  task_complexity: assess_complexity(task_data),     // simple, medium, complex

  // Execution Metrics
  duration_seconds: actual_execution_time,
  success: quality_score >= 70,
  files_modified: count_files_modified(),
  lines_changed: count_lines_changed(),

  // Quality Metrics
  quality_score: overall_quality_assessment,
  quality_improvement: calculate_improvement_from_baseline(),
  best_practices_followed: validate_best_practices(),

  // Tool & Agent Usage
  skills_used: loaded_skills_list,
  agents_delegated: delegated_agents_list,
  tools_used: track_tool_usage(),

  // Context & Outcomes
  issues_found: identified_issues,
  recommendations: generated_recommendations,
  documentation_updated: check_documentation_changes(),

  // Timestamping
  timestamp: ISO_timestamp,
  model_used: detect_current_model()
}
```

### Integration Points

**1. Task Completion Flow**:
```javascript
async function execute_with_performance_recording(task) {
  const start_time = Date.now()

  try {
    // Execute task
    const result = await execute_task(task)

    // Assess quality
    const quality = await assess_quality(result)

    // Record performance (automatic, silent)
    await record_performance({
      ...task,
      ...quality,
      duration: (Date.now() - start_time) / 1000,
      success: quality.score >= 70
    })

    return result

  } catch (error) {
    // Record failure performance
    await record_performance({
      ...task,
      duration: (Date.now() - start_time) / 1000,
      success: false,
      error: error.message
    })
    throw error
  }
}
```

**2. Model Detection Integration**:
```javascript
function detect_current_model() {
  // Real-time model detection with multiple strategies

  // Strategy 1: Environment variables
  const modelFromEnv = process.env.ANTHROPIC_MODEL ||
                       process.env.CLAUDE_MODEL ||
                       process.env.MODEL_NAME ||
                       process.env.GLM_MODEL ||
                       process.env.ZHIPU_MODEL;

  if (modelFromEnv) {
    return normalizeModelName(modelFromEnv);
  }

  // Strategy 2: Session context analysis
  const modelFromContext = analyzeSessionContext();
  if (modelFromContext) {
    return modelFromContext;
  }

  // Strategy 3: Performance patterns analysis
  const modelFromPatterns = analyzePerformancePatterns();
  if (modelFromPatterns) {
    return modelFromPatterns;
  }

  // Strategy 4: Default with validation
  return detectDefaultModel();
}

function normalizeModelName(modelName) {
  const name = modelName.toLowerCase();

  // Claude models
  if (name.includes('claude-sonnet-4.5') || name.includes('claude-4.5')) {
    return "Claude Sonnet 4.5";
  }
  if (name.includes('claude-opus-4.1') || name.includes('claude-4.1')) {
    return "Claude Opus 4.1";
  }
  if (name.includes('claude-haiku-4.5')) {
    return "Claude Haiku 4.5";
  }

  // GLM models
  if (name.includes('glm-4.6') || name.includes('chatglm-4.6')) {
    return "GLM 4.6";
  }
  if (name.includes('glm-4') || name.includes('chatglm4')) {
    return "GLM 4.6";
  }

  // Return normalized name
  return modelName.trim().split(' ')[0];
}
```

**3. Task Type Classification**:
```javascript
function classify_task(description) {
  const patterns = {
    "refactoring": ["refactor", "restructure", "reorganize", "cleanup"],
    "coding": ["implement", "create", "add", "build", "develop"],
    "debugging": ["fix", "debug", "resolve", "issue", "error"],
    "documentation": ["document", "readme", "guide", "manual"],
    "testing": ["test", "spec", "coverage", "assertion"],
    "analysis": ["analyze", "review", "examine", "audit"],
    "optimization": ["optimize", "improve", "enhance", "performance"],
    "validation": ["validate", "check", "verify", "ensure"]
  }

  for (const [type, keywords] of Object.entries(patterns)) {
    if (keywords.some(keyword => description.toLowerCase().includes(keyword))) {
 

Related in General