hashgraph-online/awesome-codex-plugins / plugins/beastlabai/multi-llm-plugin/skills/multi-llm
multi-llm
FlaggedOrchestrate plan reviews, task generation, implementation and code reviews across several LLM CLIs in parallel, or ask every model one free-text question about a plan. Use when the user says: review my plan, multi-llm, run a code review, generate tasks from a plan, implement this plan, ask the models about my plan.
apply_suggestions_orchestrator.py
View on GitHub#!/usr/bin/env python3
"""
Orchestrator for applying validated suggestions to a plan file.
This script reads validation results from a plan review and outputs
the list of suggestions that should be applied. The actual application
is handled by Claude Code using Task subagents sequentially.
Usage:
uv run --project "{SKILL_DIR}" -- python "{SKILL_DIR}/multi_llm.py" apply-suggestions plans/my-plan.md [options]
"""
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional
# Add parent to path for imports
sys.path.insert(0, str(Path(__file__).parent))
from utils.stream_bootstrap import bootstrap_streams
from utils.apply_orchestrator_base import build_common_arg_parser
from utils.apply_suggestion_phase import SuggestionApplyPhase
from utils.cli_common import dispatcher_prefix, refuse_unsupported_batch_size
from utils.suggestion_batcher import SuggestionBatch, format_batch_for_prompt
class ApplySuggestionsOrchestrator(SuggestionApplyPhase):
"""Thin subclass for the apply-suggestions phase."""
phase_name = "apply-suggestions"
review_subdir = "review-plan"
item_noun = "suggestion"
supports_revalidation = True
supports_skip_flag = True
guard_double_nesting = False
# One shared artifact (the plan), so batches are strictly sequential (D3h).
write_kind = "apply_suggestions"
# That artifact being the plan is also what makes `--mark-completed` re-stamp
# `plan_hash`: this phase's own edits are not a human's.
edits_the_plan = True
phase_dir_key = "apply_suggestions_dir"
summary_title = "SUGGESTIONS TO APPLY (BATCHED)"
# ----------------------------------------------------------------
# Argument parser
# ----------------------------------------------------------------
@classmethod
def parse_args(cls, argv=None):
"""Build and parse CLI arguments for apply-suggestions."""
# Printed commands, so resolved from `__file__` and never a skill-dir
# placeholder (see review_plan_orchestrator.parse_args for why).
run = dispatcher_prefix()
parser = build_common_arg_parser(
description="Prepare validated suggestions for application to a plan",
epilog=f"""
This orchestrator outputs a JSON list of suggestions to apply.
The actual application is handled by Claude Code using Task subagents.
Example:
{run} apply-suggestions plans/my-plan.md
Bulk Approval Examples:
# Auto-approve all LOW importance items
{run} apply-suggestions plans/my-plan.md --approve-all-low
# Auto-approve items with validation failures (parsing errors, timeouts)
{run} apply-suggestions plans/my-plan.md --approve-validation-failed
# Skip all items requiring human review
{run} apply-suggestions plans/my-plan.md --skip-all-human
# Re-run validation on failed items with a different model
{run} apply-suggestions plans/my-plan.md --revalidate --revalidate-model cursor-agent:opus
""",
include_revalidation=True,
include_output_format=True,
include_skip=True,
include_approve_validation_failed=True,
include_revalidate_all_human=True,
include_internal_revalidation=True,
include_mark_completed=True,
)
args = parser.parse_args(argv)
refuse_unsupported_batch_size(parser, args)
return args
# ----------------------------------------------------------------
# Phase hooks
# ----------------------------------------------------------------
def _validation_missing(
self, validation_path: Path, groups: Optional[List[Dict[str, Any]]]
) -> None:
"""No validation, no apply: says so on stderr, then stops."""
print(
f"ERROR: Validation results not found at {validation_path}",
file=sys.stderr,
)
print(
"Run --review-plan first to generate validation results.",
file=sys.stderr,
)
super()._validation_missing(validation_path, groups)
def _generate_single_batch_prompt(self, batch: SuggestionBatch) -> str:
"""The plan-specific prompt for one batch."""
return format_batch_for_prompt(batch, self.plan_path)
def main(argv=None) -> int:
"""Main entry point."""
bootstrap_streams()
args = ApplySuggestionsOrchestrator.parse_args(argv)
orchestrator = ApplySuggestionsOrchestrator(args)
return orchestrator.run()
if __name__ == "__main__":
from utils import process_control
# A process entry of its own: provider children must stay this process's.
process_control.restore_sigchld_default()
sys.exit(main(sys.argv[1:]))
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |