ターミナル向けAIコーディングエージェントの構築:スキャフォールディング、ハーネス、コンテキストエンジニアリング、および得られた知見
Building AI Coding Agents for the Terminal: Scaffolding, Harness, Context Engineering, and Lessons Learned
March 5, 2026
著者: Nghi D. Q. Bui
cs.AI
要旨
AIコーディング支援の状況は、複雑なIDEプラグインから多機能なターミナルネイティブエージェントへと、根本的な転換を遂げつつある。開発者がソース管理、ビルド実行、環境デプロイを直接行う場で動作するCLIベースのエージェントは、長期にわたる開発タスクに対して前例のない自律性を提供する。本論文では、この新たなパラダイムに特化して設計されたオープンソースのコマンドラインコーディングエージェント「OPENDEV」を提案する。効果的な自律支援には、コンテキストの肥大化と推論能力の低下を防ぐため、厳格な安全制御と高効率なコンテキスト管理が不可欠である。OPENDEVは、ワークロード特化型モデルルーティングを備えた複合AIシステムアーキテクチャ、計画と実行を分離したデュアルエージェントアーキテクチャ、レイジーツールディスカバリ、古い観察結果を段階的に削減する適応的コンテキスト圧縮を通じて、これらの課題を克服する。さらに、自動化されたメモリシステムを採用してセッションを跨いだプロジェクト固有の知識を蓄積し、イベント駆動型のシステムリマインダーにより指示のフェードアウトに対抗する。明示的な推論フェーズの強制とコンテキスト効率の優先化により、OPENDEVはターミナルファーストのAI支援に向けた安全で拡張性の高い基盤を提供し、堅牢な自律的ソフトウェアエンジニアリングの青写真を提示する。
English
The landscape of AI coding assistance is undergoing a fundamental shift from complex IDE plugins to versatile, terminal-native agents. Operating directly where developers manage source control, execute builds, and deploy environments, CLI-based agents offer unprecedented autonomy for long-horizon development tasks. In this paper, we present OPENDEV, an open-source, command-line coding agent engineered specifically for this new paradigm. Effective autonomous assistance requires strict safety controls and highly efficient context management to prevent context bloat and reasoning degradation. OPENDEV overcomes these challenges through a compound AI system architecture with workload-specialized model routing, a dual-agent architecture separating planning from execution, lazy tool discovery, and adaptive context compaction that progressively reduces older observations. Furthermore, it employs an automated memory system to accumulate project-specific knowledge across sessions and counteracts instruction fade-out through event-driven system reminders. By enforcing explicit reasoning phases and prioritizing context efficiency, OPENDEV provides a secure, extensible foundation for terminal-first AI assistance, offering a blueprint for robust autonomous software engineering.