<!-- AUTO-GENERATED by scripts/gen-adapters.js - DO NOT EDIT -->
---
name: enhance-orchestrator
description: "Use when coordinating multiple enhancers for /enhance command. Runs analyzers in parallel and produces unified report."
version: 4.2.2
argument-hint: "[path] [--apply] [--focus=TYPE]"
---

> **OpenCode Note**: Invoke agents using `@agent-name` syntax.
> Available agents: task-discoverer, exploration-agent, planning-agent,
> implementation-agent, deslop-agent, delivery-validator, sync-docs-agent, consult-agent
> Example: `@exploration-agent analyze the codebase`


# 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

*(JavaScript reference - not executable in OpenCode)*

### Phase 2: Discovery

Detect what exists in target path:

*(JavaScript reference - not executable in OpenCode)*

### Phase 3: Load Suppressions

*(JavaScript reference - not executable in OpenCode)*

### Phase 4: Launch Enhancers in Parallel

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

| Focus Type | Agent to Spawn | Model | JS Analyzer |
|------------|----------------|-------|-------------|
| `plugin` | `plugin-enhancer` | sonnet | `lib/enhance/plugin-analyzer.js` |
| `agent` | `agent-enhancer` | opus | `lib/enhance/agent-analyzer.js` |
| `claudemd` | `claudemd-enhancer` | opus | `lib/enhance/projectmemory-analyzer.js` |
| `docs` | `docs-enhancer` | opus | `lib/enhance/docs-analyzer.js` |
| `prompt` | `prompt-enhancer` | opus | `lib/enhance/prompt-analyzer.js` |
| `hooks` | `hooks-enhancer` | opus | `lib/enhance/hook-analyzer.js` |
| `skills` | `skills-enhancer` | opus | `lib/enhance/skill-analyzer.js` |
| `cross-file` | `cross-file-enhancer` | sonnet | `lib/enhance/cross-file-analyzer.js` |

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

*(JavaScript reference - not executable in OpenCode)*

### Phase 5: Aggregate Results

*(JavaScript reference - not executable in OpenCode)*

### Phase 6: Generate Report

Generate report directly from aggregated findings:

*(JavaScript reference - not executable in OpenCode)*

### Phase 7: Auto-Learning

*(JavaScript reference - not executable in OpenCode)*

### Phase 8: Apply Fixes

*(JavaScript reference - not executable in OpenCode)*

## Output Format

```markdown
# Enhancement Analysis Report

**Target**: {targetPath}
**Date**: {timestamp}
**Enhancers Run**: {list}

## Executive Summary

| Enhancer | HIGH | MEDIUM | LOW | Auto-Fixable |
|----------|------|--------|-----|--------------|
| plugin   | 2    | 3      | 1   | 1            |
| agent    | 1    | 2      | 0   | 1            |
| **Total**| **3**| **5**  | **1**| **2**       |

## HIGH Certainty Issues
[Grouped by enhancer, then file]

## MEDIUM Certainty Issues
[...]

## Auto-Fix Summary
{n} issues can be fixed with `--apply` flag.
```

## Constraints

- MUST run enhancers in parallel (Promise.all)
- MUST skip enhancers for missing content types
- MUST report HIGH certainty issues first
- MUST deduplicate findings across enhancers
- NEVER auto-fix without explicit --apply flag
- NEVER auto-fix MEDIUM or LOW certainty issues
