arXiv:2606.05720cs.SEcs.AI2026-06

用模块化技能胶囊降低代码生成的上下文开销,提升准确率和可扩展性。

Microskill Architecture: A Modular Skill-Driven Framework for AI-Native Code Generation

  • 将项目知识拆分为原子化技能胶囊,动态路由只调用相关部分。
  • 实测减少90%以上令牌消耗,首编译成功率接近翻倍,零架构违规。
  • 支持自学习新增技能,适合构建可进化、高效率的AI原生开发系统。

大语言模型与AI编程代理重塑了软件开发,但迈向完全AI原生系统仍面临结构性挑战,核心是上下文窗口管理难题。当开发者将完整项目文档和代码注入模型记忆时,模型会丢失序列中段信息,令牌成本飙升,架构出现漂移。本文提出MicroSkill架构:一种受微服务启发的模块化设计范式,应用于知识封装而非服务分解。不向代理输入整个代码库,而是将知识划分为原子化、范围明确的技能胶囊,由动态路由器仅选择语义相关的胶囊用于任务。我们形式化地将上下文分配建模为在令牌预算约束下的语义相关性优化问题。一项针对包含十五个复杂功能的企业内容管理系统案例研究显示,MicroSkill将令牌消耗降低超过90%,首编译成功率几乎翻倍,彻底消除架构违规,并通过自学习机制实现七项新技能胶囊的自主提取与注册。这些结果表明,MicroSkill架构为构建更高效、更可靠且能持续演进的AI原生开发系统提供了可扩展基础。

原文摘要 · Abstract (English)

Large language models and AI coding agents have reshaped software development, but the path to fully AI-native systems faces structural challenges. Chief among them is managing context windows without losing accuracy or efficiency. When developers inject full project documentation and code into a model's memory, the model loses mid-sequence information, token costs spiral, and architecture drifts. This paper presents MicroSkill Architecture: a modular design paradigm inspired by microservices, applied to knowledge encapsulation instead of service decomposition. Instead of feeding an agent the entire codebase, the architecture partitions knowledge into atomic, sharply scoped skill capsules, and a dynamic router selects only semantically relevant capsules for the task. We formally model context allocation as constrained optimization over semantic relevance subject to a token budget. An empirical case study an enterprise content management system with fifteen complex features shows that MicroSkill cuts token consumption by over 90%, nearly doubles first-try compilation success rates, eliminates architectural violations entirely, and enables autonomous extraction and registration of seven new skill capsules via a self-learning mechanism. These findings suggest MicroSkill Architecture offers a scalable foundation for building AI-native development systems that are more efficient, more reliable, and capable of evolving over time.

代码生成模块化智能编程上下文管理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。