Squadがリポジトリ内で調整されたAIエージェントを実行する方法
GitHub公式ブログで紹介されたオープンソースプロジェクト「Squad」は、リポジトリ内でマルチエージェントを自動構成・協調動作させ、開発・テスト・レビューのコンテキスト喪失を防ぐ実用的なワークフローを実現する。
キーポイント
リポジトリ内マルチエージェント構成
CLIコマンド2つでリード、フロントエンド、バックエンド、テスターの専門エージェントを自動初期化し、重厚な基盤構築の手間を省略する。
コンテキスト共有と並列処理
コーディネーターが指示を解析し、専門エージェントが並列で実装・テスト・ドキュメント化を行う。エージェントはリポジトリの履歴や決定事項を共有し、コンテキスト喪失を防ぐ。
内部イテレーションと独立レビュープロトコル
テスターがコードを検証し、失敗時は別のエージェントが修正する自己レビュー防止機構により、品質担保とコンテキスト分離を実現し、開発者の手動修正負荷を軽減する。
並列実行による独立した推論コンテキスト
複数の専門エージェントを同時に実行することで、各エージェントが他の思考と競合することなく独立した推論環境を維持できる。
明示的・バージョン管理されたメモリ
チャーターと履歴をplain textで.squad/フォルダに保存し、コードと同じリポジトリ内でAIの記憶を透明かつGitで管理可能にする。
マルチエージェントワークフローのハードル低下
複雑なインフラ構築や高度なプロンプトエンジニアリング、CLI操作を排除し、低負荷で誰でもAIチームの活用を始められる設計を実現している。
影響分析・編集コメントを表示
影響分析
GitHub公式が公開したこのプロジェクトは、マルチエージェント開発のハードルを大幅に下げ、実務での採用を加速させる可能性がある。特にコンテキスト共有と独立レビュー機構は、AIコーディングツールの次の進化段階を示唆しており、開発チームのワークフロー再構築に寄与する。
編集コメント
マルチエージェント開発の実用化において「コンテキストの共有」と「独立した検証」は必須条件であり、Squadはこの課題を軽量なCLIツールで解決する示唆に富むアプローチを提供している。
タイトル: Squadがリポジトリ内で連携するAIエージェントを実行する仕組み
以前AIコーディングツールを使ったことがあれば、そのパターンをご存知でしょう。プロンプトを書き、モデルが誤解し、それを洗練させ、より良い出力を引き出します。進捗は、ソフトウェアを構築することよりも、モデルを操ることに大きく依存します。
プロジェクトが大きくなるにつれ、課題は「どうプロンプトするか?」から、「途中でコンテキストを失うことなく、設計、実装、テスト、レビューをどう調整するか?」に変わっていきます。
マルチエージェントシステムはこの停滞を打破する優れた方法ですが、通常は膨大なセットアップが必要です。人々は、単一のタスクを委任できるようになる前に、何時間もオーケストレーション層を構築し、フレームワークを連携させ、ベクトルデータベースを設定することに費やします。
GitHub Copilot上に構築されたオープンソースプロジェクトであるSquadは、事前設定済みのAIチームを直接リポジトリ内に初期化します。これは、重厚なオーケストレーションインフラや高度なプロンプトエンジニアリングの専門知識を必要とせずに、マルチエージェント開発をアクセス可能で、把握しやすく、有用なものにできるという賭けです。
2つのコマンド—npm install -g @bradygaster/squad-cliを一度グローバルに、squad initをリポジトリごとに一度—実行するだけで、Squadは特化したAIチーム(リーダー、フロントエンド開発者、バックエンド開発者、テスター)を直接リポジトリに配備します。
単一のチャットボットが役割を切り替えるのではなく、Squadは重厚な中央集権的インフラなしに、リポジトリネイティブなマルチエージェントオーケストレーションを実現します。
Squadがエージェント間で作業を調整する仕組み
あなたは自然言語で必要な作業を記述します。すると、Squad内のコーディネーターエージェントがルーティングを判断し、リポジトリのコンテキストを読み込み、タスク固有の指示を持った専門家エージェントを生成します。
例えば、「チーム、JWT認証が必要です—リフレッシュトークン、bcrypt、すべて含めて」と入力します。すると、チームが並行して動き始めるのを目にします。バックエンド専門家が実装を担当します。テスターは付随するテストスイートの作成を開始します。ドキュメンテーション専門家がプルリクエストを開きます。数分以内にファイルが書き出され、ブランチが作成されます。これらの専門家は、あなたの命名規則や、先週の火曜日にデータベース接続について下した決定を既に知っています。それはプロンプトに含めたからではなく、エージェントが共有のチーム決定事項と、リポジトリにコミットされた自身のプロジェクト履歴ファイルから読み込むからです。
出力を手動でテストし、何度も修正プロンプトを投げることを強いられる代わりに、Squadは反復を内部で処理します。バックエンド専門家が初期実装を草案すると、テスターはそれに対してテストスイートを実行します。テストが失敗すれば、テスターはコードを却下します。重要なのは、オーケストレーション層が、元のエージェント自身による作業の修正を防ぐ点です。Squadのレビュアープロトコルは、却下された作業を元の作成者が修正することを防ぎ、別のエージェントが修正に当たらなければなりません。これにより、単一のAIに自身の誤りをレビューさせるのではなく、別個のコンテキストウィンドウと新鮮な視点による真に独立したレビューが強制されます。レビュアー自動化が有効なワークフローでは、この内部ループを生き残ったプルリクエストをレビューすればよく、すべての中間的な試行をレビューする必要はありません。
これはオートパイロットではなく、最初のセッションで魔法が働くわけでもありません。エージェントは明確化の質問をし、時には合理的だが誤った仮定をすることもあります。あなたは依然として全てのプルリクエストをレビューし、マージします。これは自律的な実行ではなく、協調的なオーケストレーションです。
リポジトリネイティブオーケストレーションの背景にあるアーキテクチャパターン
Squadを使うにせよ、独自のマルチエージェントワークフローを構築するにせよ、リポジトリネイティブオーケストレーションを構築する中で私たちが学んだアーキテクチャパターンがいくつかあります。これらのパターンは、アーキテクチャを「ブラックボックス」的な動作から、リポジトリレベルで検査可能で予測可能なものへと移行させます。
1. 共有メモリのための「ドロップボックス」パターン
ほとんどのAIオーケストレーションは、エージェントを同期させるために、リアルタイムチャットや複雑なベクトルデータベース検索に依存しています。これは往々にして脆弱すぎることが分かりました。ライブエージェント間で状態を同期させるのは無駄な努力です。
代わりにSquadは「ドロップボックス」パターンを使います。特定のライブラリの選択や命名規則の決定といったあらゆるアーキテクチャ上の選択は、構造化されたブロックとして、リポジトリ内のバージョン管理された decisions.md ファイルに追記されます。これは、リポジトリ内での非同期の知識共有が、リアルタイム同期よりもスケールするという賭けです。マークダウンファイルをチームの共有脳として扱うことで、永続性、可読性、そしてチームが下した全ての決定の完全な監査証跡が得られます。このメモリはライブセッションではなくプロジェクトファイルに存在するため、チームは切断や再起動後もコンテキストを回復し、中断した場所から作業を再開できます。
2. コンテキスト分割ではなくコンテキスト複製
AI開発における最大のハードルの一つは、コンテキストウィンドウの制限です。単一のエージェントが全てを行おうとすると、「作業記憶」がメタ管理で圧迫され、ハルシネーション(誤生成)を引き起こします。
Squadは、コーディネーターエージェントを薄いルーターに留めることでこれを解決します。それは作業を行わず、専門家を生成するだけです。各専門家はそれぞれ独自の大きなコンテキストウィンドウ(例:対応モデルでは最大20万トークン)を持つ別個の推論呼び出しとして実行されるため、一つのコンテキストを四つのエージェントで分割するのではなく、リポジトリのコンテキストをそれらに複製していることになります。
複数の専門家を並行して実行することで、複数の独立した推論コンテキストが同時に動作します。これにより、各エージェントは他のエージェントの思考と領域を競合させることなく、リポジトリの関連部分を「見る」ことができます。
3. プロンプト内の明示的メモリ vs. 重み内の暗黙的メモリ
私たちは、AIチームのメモリは可読的でバージョン管理されるべきだと考えています。エージェントがあなたのプロジェクトについて何を「知っている」か推測する必要はありません。
Squadでは、エージェントのアイデンティティは、主に二つのリポジトリファイル—チャーター(彼らが誰か)と履歴(彼らが何をしたか)—と共有のチーム決定事項に基づいて構築されます。これらはプレーンテキストです。これらは .squad/ フォルダ内に存在するため、AIのメモリはコードと一緒にバージョン管理されます。リポジトリをクローンする時、あなたが得るのはコードだけではありません。彼らのメモリがコードと共に直接リポジトリ内にあるため、既に「オンボーディング」済みのAIチームを得ているのです。
マルチエージェントワークフローへの障壁を下げる
Squadにおける私たちの最大の成果は、誰もが低負荷、低儀礼的な方法でエージェント開発を始めやすくすることです。AIチームにコード作成を手伝わせるために、何時間もインフラストラクチャと格闘したり、複雑なプロンプトエンジニアリングを学んだり、複雑なCLI操作を管理したりする必要はありません。
リポジトリネイティブオーケストレーションがどのようなものか体感するには、Squadリポジトリをチェックし、課題に対して squad を投げて、ワークフローがどのように展開するか見てください。
*この投稿「How Squad runs coordinated AI agents inside your repository」は The GitHub Blog で最初に公開されました。*
原文を表示
If you’ve used AI coding tools before, you know the pattern. You write a prompt, the model misunderstands, you refine it, and you coax better output. Progress depends more on steering the model than on building the software.
As projects grow, the challenge stops being “how do I prompt?” and starts becoming “how do I coordinate design, implementation, testing, and review without losing context along the way.”
Multi-agent systems are a great way to move past this plateau, but usually require a massive amount of setup. People spend hours building orchestration layers, wiring up frameworks, and configuring vector databases before they can delegate a single task.
Squad, an open source project built on GitHub Copilot, initializes a preconfigured AI team directly inside your repository. It is a bet that multi-agent development can be accessible, legible, and useful without requiring heavy orchestration infrastructure or deep prompt engineering expertise.
Two commands—npm install -g @bradygaster/squad-cli once globally, squad init once per repo—and Squad drops a specialized AI team: a lead, frontend developer, backend developer, and tester directly against your repository.
Instead of a single chatbot switching roles, Squad demonstrates repository native multi-agent orchestration without heavy centralized infrastructure.
How Squad coordinates work across agents
You describe the work you need done in natural language. From there, a coordinator agent inside Squad figures out the routing, loads repository context, and spawns specialists with task-specific instructions.
For example, you type: “Team, I need JWT auth—refresh tokens, bcrypt, the works.” Then you watch the team spin up in parallel. The backend specialist takes the implementation. The tester starts writing the accompanying test suite. A documentation specialist opens a pull request. Within minutes, files are written and branches are created. These specialists already know your naming conventions and what you decided about database connections last Tuesday—not because you put it in the prompt, but because agents load from shared team decisions and their own project history files committed to the repository.
Instead of forcing you to manually test the output and prompt the model through multiple rounds of fixes, Squad handles iteration internally. Once the backend specialist drafts the initial implementation, the tester runs their test suite against it. If those tests fail, the tester rejects the code. Crucially, the orchestration layer prevents the original agent from revising its own work. Squad’s reviewer protocol can prevent the original author from revising rejected work, and a different agent must step in to fix it. This forces genuine independent review with a separate context window and a fresh perspective, rather than asking a single AI to review its own mistakes. In workflows where reviewer automation is enabled, you review the pull request that survives this internal loop rather than every intermediate attempt.
It’s not autopilot, and it’s not magic on session one. Agents will ask clarifying questions and sometimes make reasonable but wrong assumptions. You still review and merge every pull request. It is collaborative orchestration, not autonomous execution.
Architectural patterns behind repository-native orchestration
Whether you use Squad or build your own multi-agent workflows, there are a few architectural patterns we’ve learned from building repository-native orchestration. These patterns move the architecture away from “black box” behavior toward something inspectable and predictable at the repository level.
- The “Drop-box” pattern for shared memory
Most AI orchestration relies on real-time chat or complex vector database lookups to keep agents in sync. We’ve found that this is often too fragile; synchronizing state across live agents is a fool’s errand.
Instead, Squad uses a “drop-box” pattern. Every architectural choice, like choosing a specific library or a naming convention, is appended as a structured block to a versioned decisions.md file in the repository. This is a bet that asynchronous knowledge sharing inside the repository scales better than real-time synchronization. By treating a markdown file as the team’s shared brain, you get persistence, legibility, and a perfect audit trail of every decision the team has made. Because this memory lives in project files rather than a live session, the team can also recover context after disconnects or restarts and continue from where it left off.
- Context replication over context splitting
One of the biggest hurdles in AI development is the context window limit. When a single agent tries to do everything, the “working memory” gets crowded with meta-management, leading to hallucinations.
Squad solves this by ensuring the coordinator agent remains a thin router. It doesn’t do the work; it spawns specialists. Because each specialist runs as a separate inference call with its own large context window (e.g., up to 200K tokens on supported models), you aren’t splitting one context among four agents, you’re replicating repository context across them.
Running multiple specialists in parallel gives you multiple independent reasoning contexts operating simultaneously. This allows each agent to “see” the relevant parts of the repository without competing for space with the other agents’ thoughts.
- Explicit memory in the prompt vs. implicit memory in the weights
We believe an AI team’s memory should be legible and versioned. You shouldn’t have to wonder what an agent “knows” about your project.
In Squad, an agent’s identity is built primarily on two repository files: a charter (who they are) and a history (what they’ve done), alongside shared team decisions. These are plain text. Because these live in your . squad/ folder, the AI’s memory is versioned right alongside your code. When you clone a repo, you aren’t just getting the code; you are getting an already “onoboarded” AI team because their memory lives alongside the code directly in the repository.
Lowering the barrier to multi-agent workflows
Our biggest win with Squad is that it makes it easy for anyone to get started with agentic development in a low-touch, low-ceremony way. You shouldn’t have to spend hours wrestling with infrastructure, learning complex prompt engineering, or managing convoluted CLI interactions just to get an AI team to help you write code.
To see what repository-native orchestration feels like, check out the Squad repository and throw a squad at a problem to see how the workflow evolves.
The post How Squad runs coordinated AI agents inside your repository appeared first on The GitHub Blog.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み