arXiv:2512.18925cs.SEcs.AI2025-12被引 10

研究开发者如何用规则定义项目上下文,提升AI编程助手的准确性。

Beyond the Prompt: An Empirical Study of Cursor Rules

  • 分析401个开源仓库的代码规则,提炼出五大上下文类型。
  • 发现不同项目类型和语言的规则差异显著,影响AI响应质量。
  • 为下一代智能开发工具提供可落地的上下文设计参考。

尽管大语言模型(LLMs)展现出卓越能力,研究表明其效果不仅取决于显式提示,还依赖于更广泛的上下文信息。这一需求在软件工程领域尤为突出,因为项目目标、架构及协作规范对响应质量至关重要。为此,许多AI编程助手引入了开发者可编写、机器可读的持久性指令,以编码项目的独特约束。尽管该实践日益普及,但这些指令的具体内容仍缺乏研究。本文通过大规模实证研究,刻画这一新兴的开发者提供上下文形式。基于对401个包含cursor rules的开源仓库的定性分析,我们构建了一个涵盖五大主题的完整项目上下文分类体系:Conventions(惯例)、Guidelines(指南)、Project Information(项目信息)、LLM Directives(LLM指令)和Examples(示例)。研究还探讨了此类上下文在不同项目类型与编程语言间的差异,为下一代上下文感知型AI开发工具提供启示。

原文摘要 · Abstract (English)

While Large Language Models (LLMs) have demonstrated remarkable capabilities, research shows that their effectiveness depends not only on explicit prompts but also on the broader context provided. This requirement is especially pronounced in software engineering, where the goals, architecture, and collaborative conventions of an existing project play critical roles in response quality. To support this, many AI coding assistants have introduced ways for developers to author persistent, machine-readable directives that encode a project's unique constraints. Although this practice is growing, the content of these directives remains unstudied. This paper presents a large-scale empirical study to characterize this emerging form of developer-provided context. Through a qualitative analysis of 401 open-source repositories containing cursor rules, we developed a comprehensive taxonomy of project context that developers consider essential, organized into five high-level themes: Conventions, Guidelines, Project Information, LLM Directives, and Examples. Our study also explores how this context varies across different project types and programming languages, offering implications for the next generation of context-aware AI developer tools.

AI编程上下文理解代码规则大模型应用

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