Skip to content

feat(core): 规范各风格提示词中的文件引用格式#23

Open
huangdengdui wants to merge 1 commit intoOrionStarAI:opensourcefrom
huangdengdui:feat/add-code-reference-prompt
Open

feat(core): 规范各风格提示词中的文件引用格式#23
huangdengdui wants to merge 1 commit intoOrionStarAI:opensourcefrom
huangdengdui:feat/add-code-reference-prompt

Conversation

@huangdengdui
Copy link

Summary / 摘要

规范各风格提示词中的文件引用格式,统一要求 AI 在响应中使用相对路径 + 行号格式引用文件(如 src/routes/index.ts:42),便于 VSCode 等 IDE 插件场景将文件引用渲染为可点击的跳转链接。

Standardize file reference format in agent-style prompts, requiring AI to use relative path + line number format (e.g. src/routes/index.ts:42) in responses, enabling VSCode and other IDE plugins to render file references as clickable navigation links.

Changes / 变更说明

  • packages/core/src/core/prompts.ts
    • cursor: COMMUNICATION 中追加文件引用相对路径规范
    • claude-code: Code References 补充相对路径示例
    • gemini3 (CLI & VSCode): Communication Style 新增 File References 条目
    • default (CLI): Code References 补充相对路径示例
    • vscode: Core Mandates 新增 File References 条目

Testing / 测试

在对应风格下与 AI 对话,观察 AI 在响应中引用文件时是否使用 相对路径:行号 格式(如 src/foo/bar.ts:42),在 VSCode 插件中验证该格式可被渲染为可点击的跳转链接。

统一要求 AI 在响应中使用相对路径+行号格式引用文件
(如 src/routes/index.ts:42),便于 VSCode 等 IDE
插件场景将文件引用渲染为可点击的跳转链接。

涉及:cursor、claude-code、gemini3、vscode、default 风格

Signed-off-by: huangdengdui <huangdengdui@cmcm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant