跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
浏览器与自动化

enhance-orchestrator

Use when coordinating multiple enhancers for /enhance command. Runs analyzers in parallel and produces unified report.

agent-sh · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add agent-sh/agentsys --skill enhance-orchestrator

技能说明


name: enhance-orchestrator description: "Use when coordinating multiple enhancers for /enhance command. Runs analyzers in parallel and produces unified report." version: 5.1.0 argument-hint: "[path] [--apply] [--focus=TYPE]"

enhance-orchestrator

Coordinate all enhancement analyzers in parallel and produce a unified report.

Critical Rules

  1. MUST run enhancers in parallel - Use Promise.all for efficiency
  2. MUST only run enhancers for existing content - Skip if no files found
  3. MUST report HIGH certainty first - Priority order: HIGH → MEDIUM → LOW
  4. NEVER auto-fix without --apply flag - Explicit consent required
  5. NEVER auto-fix MEDIUM or LOW issues - Only HIGH certainty

Workflow

Phase 1: Parse Arguments

const args = '$ARGUMENTS'.split(' ').filter(Boolean);
const targetPath = args.find(a => !a.startsWith('--')) || '.';

const flags = {
  apply: args.includes('--apply'),
  focus: args.find(a => a.startsWith('--focus='))?.split('=')[1],
  verbose: args.includes('--verbose'),
  showSuppressed: args.includes('--show-suppressed'),
  resetLearned: args.includes('--reset-learned'),
  noLearn: args.includes('--no-learn'),
  exportLearned: args.includes('--export-learned')
};

// Validate focus type
const VALID_FOCUS = ['plugin', 'agent', 'claudemd', 'claude-memory', 'docs', 'prompt', 'hooks', 'skills', 'cross-file'];
if (flags.focus && !VALID_FOCUS.includes(flags.focus)) {
  console.error(`Invalid --focus: "${flags.focus}". Valid: ${VALID_FOCUS.join(', ')}`);
  return;
}

Phase 2: Discovery

Detect what exists in target path:

const discovery = {
  plugins: await Glob({ pattern: 'plugins/*/.claude-plugin/plugin.json', path: targetPath }),
  agents: await Glob({ pattern: '**/agents/*.md', path: targetPath }),
  claudemd: await Glob({ pattern: '**/CLAUDE.md', path: targetPath }) ||
            await Glob({ pattern: '**/AGENTS.md', path: targetPath }),
  docs: await Glob({ pattern: 'docs/**/*.md', path: targetPath }),
  prompts: await Glob({ pattern: '**/prompts/**/*.md', path: targetPath }) ||
           await Glob({ pattern: '**/commands/**/*.md', path: targetPath }),
  hooks: await Glob({ pattern: '**/hooks/**/*.md', path: targetPath }),
  skills: await Glob({ pattern: '**/skills/**/SKILL.md', path: targetPath }),
  // Cross-file runs if agents OR skills exist (analyzes relationships)
  'cross-file': discovery.agents?.length || discovery.skills?.length ? ['enabled'] : []
};

Phase 3: Load Suppressions

// Use relative path from skill directory to plugin lib
// Path: skills/enhance-orchestrator/ -> ../../lib/
const { getSuppressionPath } = require('../../lib/cross-platform');
const { loadAutoSuppressions, getProjectId, clearAutoSuppressions } = require('../../lib/enhance/auto-suppression');

const suppressionPath = getSuppressionPath();
const projectId = getProjectId(targetPath);

if (flags.resetLearned) {
  clearAutoSuppressions(suppressionPath, projectId);
  console.log(`Cleared suppressions for project: ${projectId}`);
}

const autoLearned = loadAutoSuppressions(suppressionPath, projectId);

Phase 4: Launch Enhancers in Parallel

CRITICAL: MUST spawn these EXACT agents using Task(). Do NOT use Explore or other agents.

Focus TypeAgent to SpawnModelJS Analyzer
pluginplugin-enhancersonnetlib/enhance/plugin-analyzer.js
agentagent-enhanceropuslib/enhance/agent-analyzer.js
claudemdclaudemd-enhanceropuslib/enhance/projectmemory-analyzer.js
docsdocs-enhanceropuslib/enhance/docs-analyzer.js
promptprompt-enhanceropuslib/enhance/prompt-analyzer.js
hookshooks-enhanceropuslib/enhance/hook-analyzer.js
skillsskills-enhanceropuslib/enhance/skill-analyzer.js
cross-filecross-file-enhancersonnetlib/enhance/cross-file-analyzer.js

Each agent has Bash(node:*) to run its JS analyzer. Do NOT substitute with Explore agents.

// EXACT agent mapping - do not change
const ENHANCER_AGENTS = {
  plugin: 'plugin-enhancer',
  agent: 'agent-enhancer',
  claudemd: 'claudemd-enhancer',
  docs: 'docs-enhancer',
  prompt: 'prompt-enhancer',
  hooks: 'hooks-enhancer',
  skills: 'skills-enhancer',
  'cross-file': 'cross-file-enhancer'
};

const promises = [];

for (const [type, agentType] of Object.entries(ENHANCER_AGENTS)) {
  if (focus && focus !== type) continue;
  if (!discovery[type]?.length) continue;

  // MUST use exact subagent_type - these agents have Bash(node:*) to run JS analyzers
  promises.push(Task({
    subagent_type: agentType,
    prompt: `Analyze ${type} in ${targetPath}.
MUST use Skill tool to invoke your enhance-* skill.
The skill runs the JavaScript analyzer and returns structured findings.
verbose: ${flags.verbose}
Return JSON: { "enhancerType": "${type}", "findings": [...], "summary": { high, medium, low } }`
  }));
}

// MUST use Promise.all for parallel execution
const results = await Promise.all(promises);

Phase 5: Aggregate Results

function aggregateResults(enhancerResults) {
  const findings = [];
  const byEnhancer = {};

  for (const result of enhancerResults) {
    if (!result?.findings) continue;
    for (const finding of result.findings) {
      findings.push({ ...finding, source: result.enhancerType });
    }
    byEnhancer[result.enhancerType] = result.summary;
  }

  return {
    findings,
    byEnhancer,
    totals: {
      high: findings.filter(f => f.certainty === 'HIGH').length,
      medium: findings.filter(f => f.certainty === 'MEDIUM').length,
      low: findings.filter(f => f.certainty === 'LOW').length
    }
  };
}

Phase 6: Generate Report

Generate report directly from aggregated findings:

const { generateReport } = require('../../lib/enhance/reporter');

const report = generateReport(agg
阅读完整来源 ↗