Communitygithub.com

SamuelChien/mega-skills-collection

マルチエージェントコラボレーションプラグイン。N個の並列サブエージェントをgit worktree分離環境で起動し、同じタスクで競わせます。エージェントは独立して作業し、評価はメトリクスまたはLLM判定で行い、最良のブランチをマージします。コード最適化、コンテンツバリエーション、研究探索など、並列競争が有効なタスクに使用します。前提条件: gitリポジトリ。

mega-skills-collection とは?

このスキルは、Claude CodeなどのAIエージェント上で動作するマルチエージェントコラボレーションフレームワーク「AgentHub」を提供します。ユーザーが「複数のアプローチを試す」「エージェントを競わせる」などのトリガーフレーズを使用すると、コーディネーターとなるメインセッションがN個の並列サブエージェントを生成し、それぞれが独立したgit worktree内で同じタスクに取り組みます。各エージェントは他のエージェントの作業を見ることなく、自分のworktreeで変更、テスト、反復を行い、結果をメッセージボードに投稿します。コーディネーターはメトリクス(ベンチマーク、テスト通過率など)またはLLM判定による評価を実行し、最優秀結果のブランチをメインブランチにマージします。これにより、コード最適化、リファクタリング、テスト作成、バグ修正、コンテンツ生成など様々なタスクで、複数の戦略を並行的に試行し、最も効果的な結果を得ることができます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/agenthub

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

AgentHub — マルチエージェントコラボレーション

N個の並列AIエージェントを生成し、同じタスクで競わせます。各エージェントは独立したgit worktree内で作業します。コーディネーターが結果を評価し、勝者をマージします。

スラッシュコマンド

コマンド説明
/hub:init新しいコラボレーションセッションを作成 — タスク、エージェント数、評価基準
/hub:spawn分離されたworktree内でN個の並列サブエージェントを起動
/hub:statusDAG状態、エージェント進捗、ブランチステータスを表示
/hub:evalメトリクスまたはLLM判定でエージェント結果をランク付け
/hub:merge勝者ブランチをマージし、敗者をアーカイブ
/hub:boardエージェントメッセージボードの読み書き
/hub:runワンショットライフサイクル: 初期化 → ベースライン → 生成 → 評価 → マージ

エージェントテンプレート

--template オプションで生成すると、エージェントは定義済みの反復パターンに従います:

テンプレートパターン使用例
optimizer編集 → 評価 → 保持/破棄 → 10回繰り返しパフォーマンス、レイテンシ、サイズ
refactorer再構築 → テスト → 成功するまで反復コード品質、技術的負債
test-writerテスト作成 → カバレッジ計測 → 繰り返しテストカバレッジのギャップ
bug-fixer再現 → 診断 → 修正 → 検証バグ修正アプローチ

テンプレートは references/agent-templates.md で定義されています。

このスキルがアクティブになる条件

トリガーフレーズ:

  • 「複数のアプローチを試す」
  • 「エージェントを競わせる」
  • 「並列最適化」
  • 「N個のエージェントを生成」
  • 「異なる解決策を比較」
  • 「ファンアウト」または「トーナメント」
  • 「コンテンツバリエーションを生成」
  • 「異なるドラフトを比較」
  • 「A/Bテストコピー」
  • 「複数の戦略を探索」

コーディネータープロトコル

メインのClaude Codeセッションがコーディネーターです。以下のライフサイクルに従います:

INIT → DISPATCH → MONITOR → EVALUATE → MERGE

1. 初期化

/hub:init を実行してセッションを作成します。これにより以下が生成されます:

  • .agenthub/sessions/{session-id}/config.yaml — タスク設定
  • .agenthub/sessions/{session-id}/state.json — 状態マシン
  • .agenthub/board/ — メッセージボードチャンネル

2. ディスパッチ

/hub:spawn を実行してエージェントを起動します。エージェント1~Nそれぞれについて:

  • タスク割り当てを .agenthub/board/dispatch/ に投稿
  • isolation: "worktree" を指定してAgentツールで生成
  • すべてのエージェントを1つのメッセージで同時に起動(並列)

3. モニタリング

/hub:status を実行して進捗を確認:

  • dag_analyzer.py --status --session {id} でブランチ状態を表示
  • ボード progress/ チャンネルにエージェントの更新情報

4. 評価

/hub:eval を実行して結果をランク付け:

  • メトリクスモード: 各worktreeで評価コマンドを実行し、数値結果を解析
  • 判定モード: 差分を読み取り、コーディネーターが品質でランク付け
  • ハイブリッド: まずメトリクス、同点の場合はLLM判定

5. マージ

/hub:merge を実行して完了:

  • git merge --no-ff で勝者をベースブランチにマージ
  • 敗者にタグ付け: git tag hub/archive/{session}/agent-{i}
  • worktreeをクリーンアップ
  • マージサマリーをボードに投稿

エージェントプロトコル

各サブエージェントは以下のプロンプトパターンを受け取ります:

あなたは hub セッション {session-id} のエージェント-{i} です。
タスク: {タスク説明}

指示:
1. 割り当てを .agenthub/board/dispatch/{seq}-agent-{i}.md で読み取る
2. 自分のworktreeで作業 — 変更、テスト実行、反復
3. すべての変更を説明的なメッセージ付きでコミット
4. 結果サマリーを .agenthub/board/results/agent-{i}-result.md に書き込む
5. 完了したら終了

エージェント同士はお互いの作業を見ることはできません。エージェント間の通信はなく、コーディネーターが読み取るためのボードにのみ書き込みます。

DAGモデル

ブランチ命名規則

hub/{session-id}/agent-{N}/attempt-{M}
  • セッションID: タイムスタンプベース (YYYYMMDD-HHMMSS)
  • エージェントN: 連番 (1からエージェント数まで)
  • 試行M: リトライ時に増加 (通常は1)

フロンティア検出

フロンティア = 子ブランチのないブランチの先端。AgentHubの「リーフ」クエリに相当します。

python scripts/dag_analyzer.py --frontier --session {id}

不変性

DAGは追加専用です:

  • エージェントブランチのリベースや強制プッシュは決して行わない
  • コミットは決して削除しない(アーカイブ後はブランチ参照のみ削除)
  • すべてのアプローチはgitタグで保存される

メッセージボード

場所: .agenthub/board/

チャンネル

チャンネル書き手読み手目的
dispatch/コーディネーターエージェントタスク割り当て
progress/エージェントコーディネーターステータス更新
results/エージェント + コーディネーター全員最終結果 + マージサマリー

投稿フォーマット

---
author: agent-1
timestamp: 2026-03-17T14:30:22Z
channel: results
parent: null
---

## 結果概要

- **アプローチ**: O(n²)ソートをハッシュマップに置き換え
- **変更ファイル数**: 3
- **メトリクス**: 142ms (ベースライン: 180ms, 差分: -38ms)
- **信頼度**: 高 — すべてのテストが成功

ボードルール

  • 追加専用: 投稿は編集や削除を行わない
  • ユニークファイル名: {seq:03d}-{author}-{timestamp}.md
  • すべての投稿にYAMLフロントマターが必要

評価モード

メトリクスベース

最適な用途: ベンチマーク、テスト合格率、ファイルサイズ、応答時間。

python scripts/result_ranker.py --session {id} \
  --eval-cmd "pytest bench.py --json" \
  --metric p50_ms --direction lower

ランカーは各エージェントのworktreeディレクトリで評価コマンドを実行し、標準出力からメトリクスを解析します。

LLM判定

最適な用途: コード品質、可読性、アーキテクチャの意思決定。

コーディネーターは各エージェントの差分(git diff base...agent-branch)を読み取り、以下でランク付け:

  1. 正確性(タスクを解決しているか)
  2. シンプルさ(変更行数が少ないほど良い)
  3. 品質(クリーンな実行、良い構造)

ハイブリッド

まずメトリクスを実行。上位エージェントが互いに10%以内の差であれば、LLM判定で同点を解消します。

セッションライフサイクル

初期化 → 実行中 → 評価中 → マージ済み
                          → アーカイブ済み(勝者なしの場合)

状態遷移は session_manager.py によって管理:

遷移元遷移先トリガー
initrunning/hub:spawn 完了
runningevaluating全エージェント復帰
evaluatingmerged/hub:merge 完了
evaluatingarchived勝者なし / 全失敗

プロアクティブトリガー

コーディネーターは以下の場合に行動する必要があります:

シグナルアクション
全エージェントがクラッシュ失敗サマリーを投稿し、異なる制約でのリトライを提案
ベースラインからの改善なしセッションをアーカイブし、別のアプローチを提案
孤立worktreeを検出session_manager.py --cleanup {id} を実行
セッションが running で停滞ボードの進捗を確認し、タイムアウトを検討

インストール

# Claude Codeスキルディレクトリにコピー
cp -r engineering/agenthub ~/.claude/skills/agenthub

# またはClawHubでインストール
clawhub install agenthub

スクリプト

スクリプト目的
hub_init.py.agenthub/ 構造とセッションを初期化
dag_analyzer.pyフロンティア検出、DAGグラフ、ブランチステータス
board_manager.pyメッセージボードCRUD(チャンネル、投稿、スレッド)
result_ranker.pyメトリクスまたは差分品質でエージェントをランク付け
session_manager.pyセッション状態マシンとクリーンアップ

関連スキル

  • autoresearch-agent — 単一エージェントの最適化ループ(N個のエージェントを競わせたい場合はAgentHubを使用)
  • self-improving-agent — 自己修正エージェント(外部競争が必要な場合はAgentHubを使用)
  • git-worktree-manager — Git worktreeユーティリティ(AgentHubは内部的にworktreeを使用)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

2D game development principles. Sprites, tilemaps, physics, camera.

SamuelChien/mega-skills-collection

3D game development principles. Rendering, shaders, physics, cameras.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

関連スキル