arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2608.10622cs.SE

GitHub开源项目中Cursorrules文件的研究

A Study of Cursorrules Files in GitHub Open Source Projects

Shuang Sun, Jafar Akhoundali, Arina Kudriavtseva, Sengim Karayalcin, Olga Gadyatskaya

首次发表
浏览论文内容

中文总结 AI 辅助

本研究对GitHub开源项目中的.cursorrules文件开展实证研究,明确其分布、内容特征及与.mdc文件的主题连续性,揭示其多用于小型非专业项目的现状。

中文摘要 AI 辅助

提示词是与AI智能体交互的主要机制,直接影响AI生成代码的质量和可靠性。随着AI辅助编程的广泛应用,现代工具越来越多地将动态对话式提示与类似静态配置的提示文件相结合。尽管提示工程受到越来越多的关注,但现有研究主要聚焦于对话式提示,提示文件仍未得到充分研究。为填补这一空白,我们对广泛使用的AI辅助代码编辑器Cursor中的配置式提示文件开展实证研究:从11427个GitHub仓库中收集并分析了超过12110个.cursorrules文件,以刻画其分布、演变与维护情况;对65个随机抽取的提示文件进行定性分析,构建了包含65个编码的代码本,用于捕捉开发者如何表达编程意图、项目上下文、工程实践及安全考量。研究结果显示:.cursorrules文件自2024年中期快速出现,其采用集中在小规模、低活跃度、单维护者的仓库,表明多用于玩具项目而非专业开发;提示文件内容以代码质量与工程实践、项目结构与配置、可维护性相关指导为主,安全相关内容较少;分析还发现,已成为遗留文件的.cursorrules与当前标准.mdc文件在主题和话题上具有连续性。

英文摘要

Prompts are the primary mechanism for communicating with AI agents, and they directly influence the quality and reliability of AI-generated code. As AI-assisted programming becomes widely adopted, modern tools increasingly combine dynamic conversational prompts with static configuration-like prompt files. Despite the growing focus on prompt engineering, prior research has primarily focused on conversational prompts, while prompt files remain understudied. To address this gap, we conduct an empirical study of configuration prompt files in Cursor, a widely used AI-assisted code editor. We collect and analyze over 12,110 .cursorrules files from 11,427 GitHub repositories to characterize their distribution, evolution, and maintenance. Complementing this, we perform qualitative analysis on a random sample of 65 prompt files and develop a 65-code codebook capturing how developers express programming intent, project context, engineering practices, and security considerations. Our results show that .cursorrules files emerged rapidly from mid-2024. Their adoption is concentrated in small-scale, low-activity, single-maintainer repositories, suggesting toy projects rather than professional development. The content of prompt files is dominated by guidance on code quality and engineering practices, project structure and configuration, and maintainability, while security-related content appears less frequently. Our analysis shows that there is a continuity of themes and topics between the now-legacy .cursorrules files and the current standard .mdc files.

补充信息

↑