-
Notifications
You must be signed in to change notification settings - Fork 36
feat: Add source references requirement to code-explorer prompt #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Update the code-explorer persona prompt to instruct the AI agent to always include a "References" section at the end of responses with source code locations (file paths, line numbers, and symbol names). This makes it easier for users to navigate to the relevant code sections that were discussed in the response. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Overview: Add Source References Requirement to Code-Explorer PromptSummaryThis PR enhances the Files ChangedModified Files:
Total Changes: 2 files modified, +57 additions, -167 deletions The PR primarily refactors prompt definitions by removing duplicate inline Architecture & Impact AssessmentWhat This PR Accomplishes
Key Technical ChangesNew Prompt Section Added to Refactoring:
Affected System Componentsgraph TD
A[ProbeAgent] --> B[predefinedPrompts from shared/prompts.js]
B --> C[code-explorer persona]
C --> D[getClaudeNativeSystemPrompt]
C --> E[getCodexNativeSystemPrompt]
C --> F[getSystemMessage]
D --> G[Claude Native Engines]
E --> H[Codex CLI]
F --> I[XML Tool Format]
style C fill:#90EE90
style B fill:#87CEEB
style D fill:#FFE4B5
style E fill:#FFE4B5
style F fill:#FFE4B5
Impact Flow:
Component Relationshipsgraph LR
A[User Query] --> B[ProbeAgent]
B --> C{Prompt Type?}
C -->|code-explorer| D[Enhanced Prompt with References]
C -->|other| E[Standard Prompt]
D --> F[AI Response + References Section]
E --> G[AI Response]
style D fill:#90EE90
style F fill:#87CEEB
style B fill:#FFE4B5
Scope Discovery & Context ExpansionImmediate ImpactDirectly Affected:
Integration Points:
Architecture Improvements✅ Resolved Code Duplication Issue: Previously, the
This PR successfully eliminates this duplication by:
This resolves the maintenance burden where changes had to be synchronized manually. Related Files (Not Modified)
Testing RecommendationsManual Testing:
Automated Testing (Future):
Potential Expansion PointsConsider for Future Updates:
Review NotesThis is a low-risk, high-value change:
Labels:
Metadata
Powered by Visor from Probelabs Last updated: 2026-01-19T09:21:11.304Z | Triggered by: pr_updated | Commit: e3d6331 💡 TIP: You can chat with Visor using |
✅ Security Check PassedNo security issues found – changes LGTM. Architecture Issues (4)
✅ Performance Check PassedNo performance issues found – changes LGTM. Quality Issues (5)
Powered by Visor from Probelabs Last updated: 2026-01-19T09:21:14.457Z | Triggered by: pr_updated | Commit: e3d6331 💡 TIP: You can chat with Visor using |
Update the shared prompts file to match the local prompts in getSystemMessage(). Both locations now include the "References" section requirement. Note: There is prompt duplication between ProbeAgent.js:getSystemMessage() and shared/prompts.js that should be addressed in a future refactor. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove local predefinedPrompts definition that was shadowing the imported one - Update shared/prompts.js to be the single source of truth for all prompts - Add missing code-review-template prompt to shared/prompts.js Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
code-explorerpersona prompt to require source code references in responsesfile_path:line_numberorfile_path#symbol_nameChanges
1. Added References Section to code-explorer prompt
2. Prompt Architecture Refactoring
predefinedPromptsdefinition fromProbeAgent.jsthat was shadowing the imported oneshared/prompts.jsto be the single source of truth for all promptscode-review-templateprompt toshared/prompts.jsBenefits
Test plan
🤖 Generated with Claude Code